<!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>[201904] 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/201904">201904</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2016-06-09 20:31:00 -0700 (Thu, 09 Jun 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add testing support for 3x device scale factor.
https://bugs.webkit.org/show_bug.cgi?id=158597
Reviewed by Simon Fraser.
Set 3x device scale factor on the test canvas when the test url is prefixed with hidpi-3x-.
Tools:
* DumpRenderTree/mac/DumpRenderTree.mm:
(changeWindowScaleIfNeeded):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::updateWindowScaleForTest):
* WebKitTestRunner/TestOptions.cpp:
(WTR::deviceScaleFactorForTest):
(WTR::TestOptions::TestOptions):
(WTR::isHiDPITestPath): Deleted.
* WebKitTestRunner/TestOptions.h:
LayoutTests:
* fast/hidpi/hidpi-3x-device-pixel-ratio-expected.txt: Added.
* fast/hidpi/hidpi-3x-device-pixel-ratio.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreemacDumpRenderTreemm">trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestOptionscpp">trunk/Tools/WebKitTestRunner/TestOptions.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestOptionsh">trunk/Tools/WebKitTestRunner/TestOptions.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasthidpihidpi3xdevicepixelratioexpectedtxt">trunk/LayoutTests/fast/hidpi/hidpi-3x-device-pixel-ratio-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasthidpihidpi3xdevicepixelratiohtml">trunk/LayoutTests/fast/hidpi/hidpi-3x-device-pixel-ratio.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201903 => 201904)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-10 03:20:01 UTC (rev 201903)
+++ trunk/LayoutTests/ChangeLog        2016-06-10 03:31:00 UTC (rev 201904)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-06-09 Zalan Bujtas <zalan@apple.com>
+
+ Add testing support for 3x device scale factor.
+ https://bugs.webkit.org/show_bug.cgi?id=158597
+
+ Reviewed by Simon Fraser.
+
+ Set 3x device scale factor on the test canvas when the test url is prefixed with hidpi-3x-.
+
+ * fast/hidpi/hidpi-3x-device-pixel-ratio-expected.txt: Added.
+ * fast/hidpi/hidpi-3x-device-pixel-ratio.html: Added.
+
</ins><span class="cx"> 2016-06-09 Ryosuke Niwa <rniwa@webkit.org>
</span><span class="cx">
</span><span class="cx"> REGRESSION(r201823) editing/selection/selection-in-iframe-removed-crash.html is flaky
</span></span></pre></div>
<a id="trunkLayoutTestsfasthidpihidpi3xdevicepixelratioexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/hidpi/hidpi-3x-device-pixel-ratio-expected.txt (0 => 201904)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/hidpi/hidpi-3x-device-pixel-ratio-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/hidpi/hidpi-3x-device-pixel-ratio-expected.txt        2016-06-10 03:31:00 UTC (rev 201904)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+The user interface scale factor is 3.
</ins></span></pre></div>
<a id="trunkLayoutTestsfasthidpihidpi3xdevicepixelratiohtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/hidpi/hidpi-3x-device-pixel-ratio.html (0 => 201904)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/hidpi/hidpi-3x-device-pixel-ratio.html         (rev 0)
+++ trunk/LayoutTests/fast/hidpi/hidpi-3x-device-pixel-ratio.html        2016-06-10 03:31:00 UTC (rev 201904)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that 3x device scale ratio is enabled.</title>
+</head>
+<body>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+ document.write("The user interface scale factor is " + window.devicePixelRatio + ".");
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (201903 => 201904)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-06-10 03:20:01 UTC (rev 201903)
+++ trunk/Tools/ChangeLog        2016-06-10 03:31:00 UTC (rev 201904)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-06-09 Zalan Bujtas <zalan@apple.com>
+
+ Add testing support for 3x device scale factor.
+ https://bugs.webkit.org/show_bug.cgi?id=158597
+
+ Reviewed by Simon Fraser.
+
+ Set 3x device scale factor on the test canvas when the test url is prefixed with hidpi-3x-.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (changeWindowScaleIfNeeded):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::updateWindowScaleForTest):
+ * WebKitTestRunner/TestOptions.cpp:
+ (WTR::deviceScaleFactorForTest):
+ (WTR::TestOptions::TestOptions):
+ (WTR::isHiDPITestPath): Deleted.
+ * WebKitTestRunner/TestOptions.h:
+
</ins><span class="cx"> 2016-06-09 Michael Catanzaro <mcatanzaro@igalia.com>
</span><span class="cx">
</span><span class="cx"> Add comments to clarify feature enablement
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (201903 => 201904)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2016-06-10 03:20:01 UTC (rev 201903)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2016-06-10 03:31:00 UTC (rev 201904)
</span><span class="lines">@@ -1621,16 +1621,18 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> static void changeWindowScaleIfNeeded(const char* testPathOrUR)
</span><span class="cx"> {
</span><del>- bool hasHighDPIWindow = [[[mainFrame webView] window] backingScaleFactor] != 1;
</del><span class="cx"> WTF::String localPathOrUrl = String(testPathOrUR);
</span><del>- bool needsHighDPIWindow = localPathOrUrl.findIgnoringCase("/hidpi-") != notFound;
- if (hasHighDPIWindow == needsHighDPIWindow)
</del><ins>+ float currentScaleFactor = [[[mainFrame webView] window] backingScaleFactor];
+ float requiredScaleFactor = 1;
+ if (localPathOrUrl.findIgnoringCase("/hidpi-3x-") != notFound)
+ requiredScaleFactor = 3;
+ else if (localPathOrUrl.findIgnoringCase("/hidpi-") != notFound)
+ requiredScaleFactor = 2;
+ if (currentScaleFactor == requiredScaleFactor)
</ins><span class="cx"> return;
</span><del>-
- CGFloat newScaleFactor = needsHighDPIWindow ? 2 : 1;
</del><span class="cx"> // When the new scale factor is set on the window first, WebView doesn't see it as a new scale and stops propagating the behavior change to WebCore::Page.
</span><del>- gTestRunner->setBackingScaleFactor(newScaleFactor);
- [[[mainFrame webView] window] _setWindowResolution:newScaleFactor displayIfChanged:YES];
</del><ins>+ gTestRunner->setBackingScaleFactor(requiredScaleFactor);
+ [[[mainFrame webView] window] _setWindowResolution:requiredScaleFactor displayIfChanged:YES];
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (201903 => 201904)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2016-06-10 03:20:01 UTC (rev 201903)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2016-06-10 03:31:00 UTC (rev 201904)
</span><span class="lines">@@ -990,7 +990,7 @@
</span><span class="cx">
</span><span class="cx"> void TestController::updateWindowScaleForTest(PlatformWebView* view, const TestInvocation& test)
</span><span class="cx"> {
</span><del>- view->changeWindowScaleIfNeeded(test.options().isHiDPITest ? 2 : 1);
</del><ins>+ view->changeWindowScaleIfNeeded(test.options().deviceScaleFactor);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TestController::configureViewForTest(const TestInvocation& test)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestOptionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestOptions.cpp (201903 => 201904)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestOptions.cpp        2016-06-10 03:20:01 UTC (rev 201903)
+++ trunk/Tools/WebKitTestRunner/TestOptions.cpp        2016-06-10 03:31:00 UTC (rev 201904)
</span><span class="lines">@@ -56,16 +56,20 @@
</span><span class="cx"> return pathContains(pathOrURL, "svg/W3C-SVG-1.1") || pathContains(pathOrURL, "svg\\W3C-SVG-1.1");
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool isHiDPITestPath(const std::string& pathOrURL)
</del><ins>+static float deviceScaleFactorForTest(const std::string& pathOrURL)
</ins><span class="cx"> {
</span><del>- return pathContains(pathOrURL, "/hidpi-");
</del><ins>+ if (pathContains(pathOrURL, "/hidpi-3x-"))
+ return 3;
+ if (pathContains(pathOrURL, "/hidpi-"))
+ return 2;
+ return 1;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TestOptions::TestOptions(const std::string& pathOrURL)
</span><span class="cx"> : useFlexibleViewport(shouldMakeViewportFlexible(pathOrURL))
</span><span class="cx"> , useFixedLayout(shouldUseFixedLayout(pathOrURL))
</span><span class="cx"> , isSVGTest(isSVGTestPath(pathOrURL))
</span><del>- , isHiDPITest(isHiDPITestPath(pathOrURL))
</del><ins>+ , deviceScaleFactor(deviceScaleFactorForTest(pathOrURL))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestOptions.h (201903 => 201904)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestOptions.h        2016-06-10 03:20:01 UTC (rev 201903)
+++ trunk/Tools/WebKitTestRunner/TestOptions.h        2016-06-10 03:31:00 UTC (rev 201904)
</span><span class="lines">@@ -38,11 +38,11 @@
</span><span class="cx"> bool useFlexibleViewport { false };
</span><span class="cx"> bool useFixedLayout { false };
</span><span class="cx"> bool isSVGTest { false };
</span><del>- bool isHiDPITest { false };
</del><span class="cx"> bool useDataDetection { false };
</span><span class="cx"> bool useMockScrollbars { true };
</span><span class="cx"> bool needsSiteSpecificQuirks { false };
</span><span class="cx">
</span><ins>+ float deviceScaleFactor { 1 };
</ins><span class="cx"> Vector<String> overrideLanguages;
</span><span class="cx">
</span><span class="cx"> TestOptions(const std::string& pathOrURL);
</span></span></pre>
</div>
</div>
</body>
</html>