<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[56740] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/56740">56740</a></dd>
<dt>Author</dt> <dd>kenneth@webkit.org</dd>
<dt>Date</dt> <dd>2010-03-29 14:44:44 -0700 (Mon, 29 Mar 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>JavaScriptCore: Add an enable flag for the Widgets (http://www.w3.org/TR/widgets-reqs/)
and turn it on for Qt only.

Reviewed by Simon Fraser.

* wtf/Platform.h:

WebCore: When enabling Web Widgets, add support for the view-mode media
feature (http://www.w3.org/TR/widgets-vmmf/).

Reviewed by Simon Fraser.

Test: fast/media/media-feature-wgt-view-mode.html

* css/CSSValueKeywords.in:
* css/MediaFeatureNames.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::view_modeMediaFeatureEval):
* page/ChromeClient.h:
(WebCore::ChromeClient::isDocked):
(WebCore::ChromeClient::isFloating):
(WebCore::ChromeClient::isApplication):
(WebCore::ChromeClient::isFullscreen):

WebKit/qt: Add an internal Qt API for changing the view mode media feature
(http://www.w3.org/TR/widgets-vmmf/).

Reviewed by Simon Fraser.

* Api/qwebpage.cpp:
(qt_wrt_setViewMode):
(QWebPagePrivate::priv):
* Api/qwebpage_p.h:
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::isDocked):
(WebCore::ChromeClientQt::isFloating):
(WebCore::ChromeClientQt::isApplication):
(WebCore::ChromeClientQt::isFullscreen):
* WebCoreSupport/ChromeClientQt.h:

WebKitTools: Add hooks to the Qt DRT for testing the view mode media feature.

Reviewed by Simon Fraser.

* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::setViewModeMediaFeature):
* DumpRenderTree/qt/LayoutTestControllerQt.h:

LayoutTests: Add a test and an expected result for the Widgets 1.0: View Mode
Media Feature (http://www.w3.org/TR/widgets-vmmf/).

Reviewed by Simon Fraser.

Skip on all other platforms than Qt, that has Skipped files.

* fast/media/media-feature-wgt-view-mode.html: Added.
* fast/media/media-feature-wgt-view-mode-expected.txt: Added.
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/win/Skipped:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJavaScriptCoreChangeLog">trunk/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkJavaScriptCorewtfPlatformh">trunk/JavaScriptCore/wtf/Platform.h</a></li>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkSkipped">trunk/LayoutTests/platform/gtk/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformmacSkipped">trunk/LayoutTests/platform/mac/Skipped</a></li>
<li><a href="#trunkLayoutTestsplatformwinSkipped">trunk/LayoutTests/platform/win/Skipped</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorecssCSSValueKeywordsin">trunk/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#trunkWebCorecssMediaFeatureNamesh">trunk/WebCore/css/MediaFeatureNames.h</a></li>
<li><a href="#trunkWebCorecssMediaQueryEvaluatorcpp">trunk/WebCore/css/MediaQueryEvaluator.cpp</a></li>
<li><a href="#trunkWebCorepageChromeClienth">trunk/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkWebKitqtApiqwebpagecpp">trunk/WebKit/qt/Api/qwebpage.cpp</a></li>
<li><a href="#trunkWebKitqtApiqwebpage_ph">trunk/WebKit/qt/Api/qwebpage_p.h</a></li>
<li><a href="#trunkWebKitqtChangeLog">trunk/WebKit/qt/ChangeLog</a></li>
<li><a href="#trunkWebKitqtWebCoreSupportChromeClientQtcpp">trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp</a></li>
<li><a href="#trunkWebKitqtWebCoreSupportChromeClientQth">trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h</a></li>
<li><a href="#trunkWebKitToolsChangeLog">trunk/WebKitTools/ChangeLog</a></li>
<li><a href="#trunkWebKitToolsDumpRenderTreeqtLayoutTestControllerQtcpp">trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp</a></li>
<li><a href="#trunkWebKitToolsDumpRenderTreeqtLayoutTestControllerQth">trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastmediamediafeaturewgtviewmodeexpectedtxt">trunk/LayoutTests/fast/media/media-feature-wgt-view-mode-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamediafeaturewgtviewmodehtml">trunk/LayoutTests/fast/media/media-feature-wgt-view-mode.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/ChangeLog (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/ChangeLog        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/JavaScriptCore/ChangeLog        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2010-02-26  Kenneth Rohde Christiansen  &lt;kenneth@webkit.org&gt;
+
+        Reviewed by Simon Fraser.
+
+        Add support for Widgets 1.0: View Mode Media Feature
+        https://bugs.webkit.org/show_bug.cgi?id=35446
+
+        Add an enable flag for the Widgets (http://www.w3.org/TR/widgets-reqs/)
+        and turn it on for Qt only.
+
+        * wtf/Platform.h:
+
</ins><span class="cx"> 2010-03-29  Patrick Gansterer  &lt;paroga@paroga.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkJavaScriptCorewtfPlatformh"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/wtf/Platform.h (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/wtf/Platform.h        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/JavaScriptCore/wtf/Platform.h        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -558,6 +558,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(QT)
</span><span class="cx"> #define WTF_USE_QT4_UNICODE 1
</span><ins>+#if !defined(ENABLE_WIDGETS_10_SUPPORT)
+#define ENABLE_WIDGETS_10_SUPPORT 1
+#endif
</ins><span class="cx"> #elif OS(WINCE)
</span><span class="cx"> #define WTF_USE_WINCE_UNICODE 1
</span><span class="cx"> #elif PLATFORM(GTK)
</span><span class="lines">@@ -808,6 +811,10 @@
</span><span class="cx"> #define ENABLE_DASHBOARD_SUPPORT 0
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !defined(ENABLE_WIDGETS_10_SUPPORT)
+#define ENABLE_WIDGETS_10_SUPPORT 0
+#endif
+
</ins><span class="cx"> #if !defined(ENABLE_INSPECTOR)
</span><span class="cx"> #define ENABLE_INSPECTOR 1
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/LayoutTests/ChangeLog        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2010-02-26  Kenneth Rohde Christiansen  &lt;kenneth@webkit.org&gt;
+
+        Reviewed by Simon Fraser.
+
+        Add support for Widgets 1.0: View Mode Media Feature
+        https://bugs.webkit.org/show_bug.cgi?id=35446
+
+        Add a test and an expected result for the Widgets 1.0: View Mode
+        Media Feature (http://www.w3.org/TR/widgets-vmmf/).
+
+        Skip on all other platforms than Qt, that has Skipped files.
+
+        * fast/media/media-feature-wgt-view-mode.html: Added.
+        * fast/media/media-feature-wgt-view-mode-expected.txt: Added.
+        * platform/gtk/Skipped:
+        * platform/mac/Skipped:
+        * platform/win/Skipped:
+
</ins><span class="cx"> 2010-03-29  David Levin  &lt;levin@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Rubber-stamped by Dmitry Titov.
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediamediafeaturewgtviewmodeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/media-feature-wgt-view-mode-expected.txt (0 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/media-feature-wgt-view-mode-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/media/media-feature-wgt-view-mode-expected.txt        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584 [bgcolor=#0000FF]
+      RenderBlock {DIV} at (0,0) size 200x200 [bgcolor=#008000]
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamediafeaturewgtviewmodehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/media-feature-wgt-view-mode.html (0 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/media-feature-wgt-view-mode.html                                (rev 0)
+++ trunk/LayoutTests/fast/media/media-feature-wgt-view-mode.html        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;head&gt;
+    &lt;title&gt;Testing Widgets 1.0 View Mode Media Feature&lt;/title&gt;
+    &lt;style type=&quot;text/css&quot;&gt;
+        div {
+            background-color: red;
+        }
+        @media (-webkit-view-mode: mini) {
+            body {
+                background-color: blue;
+            }
+        }
+        @media (-webkit-view-mode: all) {
+            div {
+                background-color: green;
+            }
+        }
+    &lt;/style&gt;
+    &lt;script&gt;
+        if (window.layoutTestController)
+            layoutTestController.setViewModeMediaFeature(&quot;mini&quot;);
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div style=&quot;width: 200; height: 200;&quot;\&gt;
+&lt;/body&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/Skipped (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/Skipped        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/LayoutTests/platform/gtk/Skipped        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -5882,3 +5882,6 @@
</span><span class="cx"> http/tests/loading/onload-vs-immediate-refresh.pl
</span><span class="cx"> http/tests/loading/redirect-with-no-location-crash.html
</span><span class="cx"> http/tests/loading/state-object-security-exception.html
</span><ins>+
+# No Widgets 1.0 support
+fast/media/media-feature-wgt-view-mode.html
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/Skipped (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/Skipped        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/LayoutTests/platform/mac/Skipped        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -142,3 +142,6 @@
</span><span class="cx"> 
</span><span class="cx"> # Misses setMediaType() and implementation
</span><span class="cx"> fast/media/print-restores-previous-mediatype.html
</span><ins>+
+# No Widgets 1.0 support
+fast/media/media-feature-wgt-view-mode.html
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwinSkipped"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/Skipped (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/Skipped        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/LayoutTests/platform/win/Skipped        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -812,3 +812,6 @@
</span><span class="cx"> # renderTheme is not ready to draw progress element
</span><span class="cx"> fast/dom/HTMLProgressElement/progress-element.html
</span><span class="cx"> fast/dom/HTMLProgressElement/set-progress-properties.html
</span><ins>+
+# No Widgets 1.0 support
+fast/media/media-feature-wgt-view-mode.html
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebCore/ChangeLog        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2010-03-22  Kenneth Rohde Christiansen  &lt;kenneth@webkit.org&gt;
+
+        Reviewed by Simon Fraser.
+
+        Add support for Widgets 1.0: View Mode Media Feature
+        https://bugs.webkit.org/show_bug.cgi?id=35446
+
+        When enabling Web Widgets, add support for the view-mode media
+        feature (http://www.w3.org/TR/widgets-vmmf/).
+
+        Test: fast/media/media-feature-wgt-view-mode.html
+
+        * css/CSSValueKeywords.in:
+        * css/MediaFeatureNames.h:
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::view_modeMediaFeatureEval):
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::isDocked):
+        (WebCore::ChromeClient::isFloating):
+        (WebCore::ChromeClient::isApplication):
+        (WebCore::ChromeClient::isFullscreen):
+
</ins><span class="cx"> 2010-03-29  Kenneth Russell  &lt;kbr@google.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Fisher.
</span></span></pre></div>
<a id="trunkWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/CSSValueKeywords.in (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/CSSValueKeywords.in        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebCore/css/CSSValueKeywords.in        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -709,3 +709,10 @@
</span><span class="cx"> # -webkit-color-correction
</span><span class="cx"> #default
</span><span class="cx"> sRGB
</span><ins>+
+# (-webkit-view-mode:) media feature:
+mini
+floating
+application
+fullscreen
+#all
</ins></span></pre></div>
<a id="trunkWebCorecssMediaFeatureNamesh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/MediaFeatureNames.h (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/MediaFeatureNames.h        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebCore/css/MediaFeatureNames.h        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -25,6 +25,13 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     namespace MediaFeatureNames {
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIDGETS_10_SUPPORT)
+#define CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro) \
+    macro(view_mode, &quot;-webkit-view-mode&quot;)
+#else
+#define CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro)
+#endif
+
</ins><span class="cx"> #define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \
</span><span class="cx">     macro(color, &quot;color&quot;) \
</span><span class="cx">     macro(grid, &quot;grid&quot;) \
</span><span class="lines">@@ -59,6 +66,8 @@
</span><span class="cx">     macro(transform_3d, &quot;-webkit-transform-3d&quot;) \
</span><span class="cx">     macro(transition, &quot;-webkit-transition&quot;) \
</span><span class="cx">     macro(animation, &quot;-webkit-animation&quot;) \
</span><ins>+    CSS_MEDIAQUERY_NAMES_FOR_WIDGETS_10_MEDIAFEATURE(macro)
+
</ins><span class="cx"> // end of macro
</span><span class="cx"> 
</span><span class="cx"> #ifndef CSS_MEDIAQUERY_NAMES_HIDE_GLOBALS
</span></span></pre></div>
<a id="trunkWebCorecssMediaQueryEvaluatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/css/MediaQueryEvaluator.cpp (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/css/MediaQueryEvaluator.cpp        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebCore/css/MediaQueryEvaluator.cpp        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;MediaQueryEvaluator.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><ins>+#include &quot;ChromeClient.h&quot;
</ins><span class="cx"> #include &quot;CSSPrimitiveValue.h&quot;
</span><span class="cx"> #include &quot;CSSStyleSelector.h&quot;
</span><span class="cx"> #include &quot;CSSValueList.h&quot;
</span><span class="lines">@@ -494,6 +495,29 @@
</span><span class="cx">     return returnValueIfNoParameter;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIDGETS_10_SUPPORT)
+static bool view_modeMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
+{
+    if (value) {
+        String mode = static_cast&lt;CSSPrimitiveValue*&gt;(value)-&gt;getStringValue();
+        if (ChromeClient* client = frame-&gt;page()-&gt;chrome()-&gt;client()) {
+            if (mode == &quot;all&quot;)
+                return true;
+            if (mode == &quot;mini&quot; &amp;&amp; client-&gt;isDocked())
+                return true;
+            if (mode == &quot;floating&quot; &amp;&amp; client-&gt;isFloating())
+                return true;
+            if (mode == &quot;application&quot; &amp;&amp; client-&gt;isApplication())
+                return true;
+            if (mode == &quot;fullscreen&quot; &amp;&amp; client-&gt;isFullscreen())
+                return true;
+            return false;
+        }
+    }
+    return false;
+}
+#endif
+
</ins><span class="cx"> static void createFunctionMap()
</span><span class="cx"> {
</span><span class="cx">     // Create the table.
</span></span></pre></div>
<a id="trunkWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/ChromeClient.h (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/ChromeClient.h        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebCore/page/ChromeClient.h        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -230,6 +230,13 @@
</span><span class="cx">         virtual void needTouchEvents(bool) = 0;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIDGETS_10_SUPPORT)
+        virtual bool isDocked() { return false; }
+        virtual bool isFloating() { return false; }
+        virtual bool isApplication() { return false; }
+        virtual bool isFullscreen() { return false; }
+#endif
+
</ins><span class="cx">     protected:
</span><span class="cx">         virtual ~ChromeClient() { }
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkWebKitqtApiqwebpagecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/Api/qwebpage.cpp (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/Api/qwebpage.cpp        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebKit/qt/Api/qwebpage.cpp        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -119,6 +119,15 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><ins>+void QWEBKIT_EXPORT qt_wrt_setViewMode(QWebPage* page, const QString&amp; mode)
+{
+    QWebPagePrivate::priv(page)-&gt;viewMode = mode;
+    WebCore::Frame* frame = QWebFramePrivate::core(page-&gt;mainFrame());
+    WebCore::FrameView* view = frame-&gt;view();
+    frame-&gt;document()-&gt;updateStyleSelector();
+    view-&gt;forceLayout();
+}
+
</ins><span class="cx"> void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories()
</span><span class="cx"> {
</span><span class="cx">     PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false);
</span><span class="lines">@@ -499,6 +508,11 @@
</span><span class="cx">     return page-&gt;d-&gt;page;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+QWebPagePrivate* QWebPagePrivate::priv(QWebPage* page)
+{
+    return page-&gt;d;
+}
+
</ins><span class="cx"> bool QWebPagePrivate::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &amp;request, QWebPage::NavigationType type)
</span><span class="cx"> {
</span><span class="cx">     if (insideOpenCall
</span></span></pre></div>
<a id="trunkWebKitqtApiqwebpage_ph"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/Api/qwebpage_p.h (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/Api/qwebpage_p.h        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebKit/qt/Api/qwebpage_p.h        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx">     ~QWebPagePrivate();
</span><span class="cx"> 
</span><span class="cx">     static WebCore::Page* core(QWebPage*);
</span><ins>+    static QWebPagePrivate* priv(QWebPage*);
</ins><span class="cx"> 
</span><span class="cx">     void createMainFrame();
</span><span class="cx"> #ifndef QT_NO_CONTEXTMENU
</span><span class="lines">@@ -185,6 +186,8 @@
</span><span class="cx">     bool inspectorIsInternalOnly; // True if created through the Inspect context menu action
</span><span class="cx">     Qt::DropAction m_lastDropAction;
</span><span class="cx"> 
</span><ins>+    QString viewMode;
+
</ins><span class="cx">     static bool drtRun;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitqtChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/ChangeLog (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/ChangeLog        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebKit/qt/ChangeLog        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2010-03-22  Kenneth Rohde Christiansen  &lt;kenneth@webkit.org&gt;
+
+        Reviewed by Simon Fraser.
+
+        Add support for Widgets 1.0: View Mode Media Feature
+        https://bugs.webkit.org/show_bug.cgi?id=35446
+
+        Add an internal Qt API for changing the view mode media feature
+        (http://www.w3.org/TR/widgets-vmmf/).
+
+        * Api/qwebpage.cpp:
+        (qt_wrt_setViewMode):
+        (QWebPagePrivate::priv):
+        * Api/qwebpage_p.h:
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::isDocked):
+        (WebCore::ChromeClientQt::isFloating):
+        (WebCore::ChromeClientQt::isApplication):
+        (WebCore::ChromeClientQt::isFullscreen):
+        * WebCoreSupport/ChromeClientQt.h:
+
</ins><span class="cx"> 2010-03-29  Kenneth Rohde Christiansen  &lt;kenneth@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Antti Koivisto.
</span></span></pre></div>
<a id="trunkWebKitqtWebCoreSupportChromeClientQtcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -545,4 +545,26 @@
</span><span class="cx">     return new QtFallbackWebPopup;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIDGETS_10_SUPPORT)
+bool ChromeClientQt::isDocked()
+{
+    return m_webPage-&gt;d-&gt;viewMode == &quot;mini&quot;;
</ins><span class="cx"> }
</span><ins>+
+bool ChromeClientQt::isFloating()
+{
+    return m_webPage-&gt;d-&gt;viewMode == &quot;floating&quot;;
+}
+
+bool ChromeClientQt::isApplication()
+{
+    return m_webPage-&gt;d-&gt;viewMode == &quot;application&quot;;
+}
+
+bool ChromeClientQt::isFullscreen()
+{
+    return m_webPage-&gt;d-&gt;viewMode == &quot;fullscreen&quot;;
+}
+#endif
+
+}
</ins></span></pre></div>
<a id="trunkWebKitqtWebCoreSupportChromeClientQth"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebKit/qt/WebCoreSupport/ChromeClientQt.h        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -154,6 +154,13 @@
</span><span class="cx">         virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
</span><span class="cx">         virtual void cancelGeolocationPermissionRequestForFrame(Frame*) { }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIDGETS_10_SUPPORT)
+        virtual bool isDocked();
+        virtual bool isFloating();
+        virtual bool isApplication();
+        virtual bool isFullscreen();
+#endif
+
</ins><span class="cx">         QtAbstractWebPopup* createSelectPopup();
</span><span class="cx"> 
</span><span class="cx">         QWebPage* m_webPage;
</span></span></pre></div>
<a id="trunkWebKitToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/ChangeLog (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/ChangeLog        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebKitTools/ChangeLog        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2010-02-26  Kenneth Rohde Christiansen  &lt;kenneth@webkit.org&gt;
+
+        Reviewed by Simon Fraser.
+
+        Add support for Widgets 1.0: View Mode Media Feature
+        https://bugs.webkit.org/show_bug.cgi?id=35446
+
+        Add hooks to the Qt DRT for testing the view mode media feature.
+
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::setViewModeMediaFeature):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
</ins><span class="cx"> 2010-03-29  Adam Barth  &lt;abarth@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed.  Update expected results for unit tests.
</span></span></pre></div>
<a id="trunkWebKitToolsDumpRenderTreeqtLayoutTestControllerQtcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &lt;QLocale&gt;
</span><span class="cx"> #include &lt;qwebsettings.h&gt;
</span><span class="cx"> 
</span><ins>+extern void qt_wrt_setViewMode(QWebPage*, const QString&amp; mode);
</ins><span class="cx"> extern void qt_dump_editing_callbacks(bool b);
</span><span class="cx"> extern void qt_dump_frame_loader(bool b);
</span><span class="cx"> extern void qt_dump_resource_load_callbacks(bool b);
</span><span class="lines">@@ -146,6 +147,11 @@
</span><span class="cx">     return qt_drt_counterValueForElementById(m_drt-&gt;webPage()-&gt;mainFrame(), id);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void LayoutTestController::setViewModeMediaFeature(const QString&amp; mode)
+{
+    qt_wrt_setViewMode(m_drt-&gt;webPage(), mode);
+}
+
</ins><span class="cx"> int LayoutTestController::webHistoryItemCount()
</span><span class="cx"> {
</span><span class="cx">     if (!m_webHistory)
</span></span></pre></div>
<a id="trunkWebKitToolsDumpRenderTreeqtLayoutTestControllerQth"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h (56739 => 56740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h        2010-03-29 20:51:44 UTC (rev 56739)
+++ trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h        2010-03-29 21:44:44 UTC (rev 56740)
</span><span class="lines">@@ -139,6 +139,7 @@
</span><span class="cx">     void setMainFrameIsFirstResponder(bool isFirst);
</span><span class="cx">     void setXSSAuditorEnabled(bool enable);
</span><span class="cx">     void setCaretBrowsingEnabled(bool enable);
</span><ins>+    void setViewModeMediaFeature(const QString&amp; mode);
</ins><span class="cx"> 
</span><span class="cx">     bool pauseAnimationAtTimeOnElementWithId(const QString&amp; animationName, double time, const QString&amp; elementId);
</span><span class="cx">     bool pauseTransitionAtTimeOnElementWithId(const QString&amp; propertyName, double time, const QString&amp; elementId);
</span></span></pre>
</div>
</div>

</body>
</html>