<!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>[198610] trunk/PerformanceTests</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/198610">198610</a></dd>
<dt>Author</dt> <dd>jonlee@apple.com</dd>
<dt>Date</dt> <dd>2016-03-23 19:08:13 -0700 (Wed, 23 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Make the benchmark require device to be in landscape orientation
https://bugs.webkit.org/show_bug.cgi?id=155822
rdar://problem/25258650
Reviewed by Ryosuke Niwa.
Check that the device is in landscape orientation. If not, disable the button to start it,
and show a warning message.
* Animometer/developer.html: Add a message about how the browser should be set up. Include a
warning message that appears if the orientation is incorrect on mobile devices.
* Animometer/index.html: Ditto.
* Animometer/resources/debug-runner/animometer.css: Migrate the .hidden rule into the release
stylesheet. Update the style to accommodate the new UI.
* Animometer/resources/runner/animometer.css:
* Animometer/resources/runner/animometer.js:
(window.benchmarkController.initialize): Add the orientation listener is needed.
(window.benchmarkController.addOrientationListenerIfNecessary): Only mobile devices need this. Check
to see for support of window.orientation.
(window.benchmarkController._orientationChanged): Toggle the warning based on whether we match the
landscape query. Set a state variable, which is needed for the debug harness. Call updateStartButtonState.
(window.benchmarkController.updateStartButtonState):
* Animometer/resources/debug-runner/animometer.js: Change _updateStartButtonState to return
a boolean about whether at least one test is selected. That will be used in
benchmarkController.updateStartButtonState(). Move the load event listener to the release version.
(window.benchmarkController.updateStartButtonState): Override the release version, and also check
that at least one test is selected.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkPerformanceTestsAnimometerdeveloperhtml">trunk/PerformanceTests/Animometer/developer.html</a></li>
<li><a href="#trunkPerformanceTestsAnimometerindexhtml">trunk/PerformanceTests/Animometer/index.html</a></li>
<li><a href="#trunkPerformanceTestsAnimometerresourcesdebugrunneranimometercss">trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.css</a></li>
<li><a href="#trunkPerformanceTestsAnimometerresourcesdebugrunneranimometerjs">trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometerresourcesrunneranimometercss">trunk/PerformanceTests/Animometer/resources/runner/animometer.css</a></li>
<li><a href="#trunkPerformanceTestsAnimometerresourcesrunneranimometerjs">trunk/PerformanceTests/Animometer/resources/runner/animometer.js</a></li>
<li><a href="#trunkPerformanceTestsChangeLog">trunk/PerformanceTests/ChangeLog</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkPerformanceTestsAnimometerdeveloperhtml"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/developer.html (198609 => 198610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/developer.html        2016-03-24 00:43:39 UTC (rev 198609)
+++ trunk/PerformanceTests/Animometer/developer.html        2016-03-24 02:08:13 UTC (rev 198610)
</span><span class="lines">@@ -75,7 +75,11 @@
</span><span class="cx"> </form>
</span><span class="cx"> </div>
</span><span class="cx"> </div>
</span><del>- <button onclick="benchmarkController.startBenchmark()">Start Test</button>
</del><ins>+ <p>For accurate results, please take the browser window full screen, or rotate the device to landscape orientation.</p>
+ <div class="orientation-check">
+ <p class="hidden">Please rotate the device to orientation before starting.</p>
+ <button id="run-benchmark" onclick="benchmarkController.startBenchmark()">Run benchmark</button>
+ </div>
</ins><span class="cx"> </section>
</span><span class="cx"> <section id="test-container">
</span><span class="cx"> <div id="running-test" class="frame-container"></div>
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerindexhtml"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/index.html (198609 => 198610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/index.html        2016-03-24 00:43:39 UTC (rev 198609)
+++ trunk/PerformanceTests/Animometer/index.html        2016-03-24 02:08:13 UTC (rev 198610)
</span><span class="lines">@@ -20,7 +20,11 @@
</span><span class="cx"> <section id="intro" class="selected">
</span><span class="cx"> <h1>Animometer</h1>
</span><span class="cx"> <p>Animometer is a graphics benchmark that measures a browser’s capability to animate complex scenes at a target frame rate.</p>
</span><del>- <button onclick="benchmarkController.startBenchmark()">Run benchmark</button>
</del><ins>+ <p>For accurate results, please take the browser window full screen, or rotate the device to landscape orientation.</p>
+ <div class="orientation-check">
+ <p class="hidden">Please rotate the device to orientation before starting.</p>
+ <button id="run-benchmark" onclick="benchmarkController.startBenchmark()">Run benchmark</button>
+ </div>
</ins><span class="cx"> </section>
</span><span class="cx"> <section id="test-container" class="frame-container">
</span><span class="cx"> </section>
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerresourcesdebugrunneranimometercss"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.css (198609 => 198610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.css        2016-03-24 00:43:39 UTC (rev 198609)
+++ trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.css        2016-03-24 02:08:13 UTC (rev 198610)
</span><span class="lines">@@ -3,10 +3,6 @@
</span><span class="cx"> color: rgb(235, 235, 235);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.hidden {
- display: none;
-}
-
</del><span class="cx"> h1 {
</span><span class="cx"> margin: 5vh 0;
</span><span class="cx"> }
</span><span class="lines">@@ -140,9 +136,9 @@
</span><span class="cx"> font-size: 1.2em;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#intro > div {
</del><ins>+#intro > div:first-of-type {
</ins><span class="cx"> width: 100%;
</span><del>- margin: 2em 0;
</del><ins>+ margin: 2em 0 0;
</ins><span class="cx"> flex-direction: row;
</span><span class="cx"> display: flex;
</span><span class="cx"> align-content: flex-start;
</span><span class="lines">@@ -179,7 +175,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #suites > div {
</span><del>- margin-top: 3em;
</del><ins>+ margin: 3em 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #drop-target {
</span><span class="lines">@@ -220,6 +216,20 @@
</span><span class="cx"> padding: .1em 0;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#intro > p {
+ padding: 0 5px 1em;
+ font-size: 1em;
+}
+
+#intro .orientation-check {
+ padding: 0 0 10vh;
+ margin-top: 0;
+}
+
+#intro .orientation-check p {
+ color: hsl(11, 100%, 66%);
+}
+
</ins><span class="cx"> @media screen and (min-device-width: 1800px) {
</span><span class="cx"> #intro {
</span><span class="cx"> min-height: 800px;
</span><span class="lines">@@ -231,7 +241,7 @@
</span><span class="cx"> min-height: 100%;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- #intro > div {
</del><ins>+ #intro > div:first-of-type {
</ins><span class="cx"> flex-direction: column;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerresourcesdebugrunneranimometerjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js (198609 => 198610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js        2016-03-24 00:43:39 UTC (rev 198609)
+++ trunk/PerformanceTests/Animometer/resources/debug-runner/animometer.js        2016-03-24 02:08:13 UTC (rev 198610)
</span><span class="lines">@@ -242,22 +242,19 @@
</span><span class="cx"> suiteCheckbox.indeterminate = numberEnabledTests > 0 && numberEnabledTests < suiteCheckbox.testsElements.length;
</span><span class="cx"> },
</span><span class="cx">
</span><del>- _updateStartButtonState: function()
</del><ins>+ isAtLeastOneTestSelected: function()
</ins><span class="cx"> {
</span><span class="cx"> var suitesElements = this._suitesElements();
</span><del>- var startButton = document.querySelector("#intro button");
</del><span class="cx">
</span><span class="cx"> for (var i = 0; i < suitesElements.length; ++i) {
</span><span class="cx"> var suiteElement = suitesElements[i];
</span><span class="cx"> var suiteCheckbox = this._checkboxElement(suiteElement);
</span><span class="cx">
</span><del>- if (suiteCheckbox.checked) {
- startButton.disabled = false;
- return;
- }
</del><ins>+ if (suiteCheckbox.checked)
+ return true;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- startButton.disabled = true;
</del><ins>+ return false;
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> _onChangeSuiteCheckbox: function(event)
</span><span class="lines">@@ -267,13 +264,13 @@
</span><span class="cx"> var testCheckbox = this._checkboxElement(testElement);
</span><span class="cx"> testCheckbox.checked = selected;
</span><span class="cx"> }, this);
</span><del>- this._updateStartButtonState();
</del><ins>+ benchmarkController.updateStartButtonState();
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> _onChangeTestCheckbox: function(suiteCheckbox)
</span><span class="cx"> {
</span><span class="cx"> this._updateSuiteCheckboxState(suiteCheckbox);
</span><del>- this._updateStartButtonState();
</del><ins>+ benchmarkController.updateStartButtonState();
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> _createSuiteElement: function(treeElement, suite, id)
</span><span class="lines">@@ -392,7 +389,7 @@
</span><span class="cx"> this._updateSuiteCheckboxState(suiteCheckbox);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- this._updateStartButtonState();
</del><ins>+ benchmarkController.updateStartButtonState();
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> updateLocalStorageFromUI: function()
</span><span class="lines">@@ -489,6 +486,7 @@
</span><span class="cx"> if (benchmarkController.startBenchmarkImmediatelyIfEncoded())
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+ benchmarkController.addOrientationListenerIfNecessary();
</ins><span class="cx"> suitesManager.createElements();
</span><span class="cx"> suitesManager.updateUIFromLocalStorage();
</span><span class="cx"> suitesManager.updateEditsElementsState();
</span><span class="lines">@@ -523,6 +521,16 @@
</span><span class="cx"> }, false);
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ updateStartButtonState: function()
+ {
+ var startButton = document.getElementById("run-benchmark");
+ if ("isInLandscapeOrientation" in this && !this.isInLandscapeOrientation) {
+ startButton.disabled = true;
+ return;
+ }
+ startButton.disabled = !suitesManager.isAtLeastOneTestSelected();
+ },
+
</ins><span class="cx"> onBenchmarkOptionsChanged: function(event)
</span><span class="cx"> {
</span><span class="cx"> if (event.target.name == "controller") {
</span><span class="lines">@@ -593,5 +601,3 @@
</span><span class="cx"> this.updateGraphData(testResult, testData, benchmarkRunnerClient.results.options);
</span><span class="cx"> }
</span><span class="cx"> });
</span><del>-
-window.addEventListener("load", benchmarkController.initialize);
</del></span></pre></div>
<a id="trunkPerformanceTestsAnimometerresourcesrunneranimometercss"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/resources/runner/animometer.css (198609 => 198610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/resources/runner/animometer.css        2016-03-24 00:43:39 UTC (rev 198609)
+++ trunk/PerformanceTests/Animometer/resources/runner/animometer.css        2016-03-24 02:08:13 UTC (rev 198610)
</span><span class="lines">@@ -46,6 +46,10 @@
</span><span class="cx"> flex: 0 1 1em;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.hidden {
+ display: none;
+}
+
</ins><span class="cx"> button {
</span><span class="cx"> flex: 0 0 auto;
</span><span class="cx"> display: block;
</span><span class="lines">@@ -68,6 +72,10 @@
</span><span class="cx"> background-color: rgba(0, 0, 0, .2);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+button:disabled {
+ border-color: rgba(96, 96, 96, .5);
+ color: rgba(96, 96, 96, .5);
+}
</ins><span class="cx">
</span><span class="cx"> @media screen and (min-device-width: 768px) {
</span><span class="cx"> section {
</span><span class="lines">@@ -105,12 +113,29 @@
</span><span class="cx"> flex: 1 0 auto;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#intro p {
- flex: 1 1 auto;
- padding: 0 0 10vh 0;
</del><ins>+#intro > p {
+ flex: 0 1 auto;
+ padding: .5em 0;
+ margin: 0;
</ins><span class="cx"> font-size: 2em;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#intro .orientation-check {
+ padding: 10vh 0;
+ text-align: center;
+}
+
+#intro .orientation-check p {
+ font-size: 1em;
+ color: hsl(11, 72%, 50%);
+ margin-bottom: 1em;
+ -apple-trailing-word: -apple-partially-balanced;
+}
+
+#intro .orientation-check button {
+ margin: 0 auto;
+}
+
</ins><span class="cx"> @media screen and (min-device-width: 768px) {
</span><span class="cx"> #intro p {
</span><span class="cx"> max-width: 800px;
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerresourcesrunneranimometerjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/resources/runner/animometer.js (198609 => 198610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/resources/runner/animometer.js        2016-03-24 00:43:39 UTC (rev 198609)
+++ trunk/PerformanceTests/Animometer/resources/runner/animometer.js        2016-03-24 02:08:13 UTC (rev 198610)
</span><span class="lines">@@ -355,6 +355,35 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> window.benchmarkController = {
</span><ins>+ initialize: function()
+ {
+ benchmarkController.addOrientationListenerIfNecessary();
+ },
+
+ addOrientationListenerIfNecessary: function() {
+ if (!("orientation" in window))
+ return;
+
+ this.orientationQuery = window.matchMedia("(orientation: landscape)");
+ this._orientationChanged(this.orientationQuery);
+ this.orientationQuery.addListener(this._orientationChanged);
+ },
+
+ _orientationChanged: function(match)
+ {
+ benchmarkController.isInLandscapeOrientation = match.matches;
+ if (match.matches)
+ document.querySelector(".orientation-check p").classList.add("hidden");
+ else
+ document.querySelector(".orientation-check p").classList.remove("hidden");
+ benchmarkController.updateStartButtonState();
+ },
+
+ updateStartButtonState: function()
+ {
+ document.getElementById("run-benchmark").disabled = !this.isInLandscapeOrientation;
+ },
+
</ins><span class="cx"> _startBenchmark: function(suites, options, frameContainerID)
</span><span class="cx"> {
</span><span class="cx"> benchmarkRunnerClient.initialize(suites, options);
</span><span class="lines">@@ -479,3 +508,5 @@
</span><span class="cx"> selection.addRange(range);
</span><span class="cx"> }
</span><span class="cx"> };
</span><ins>+
+window.addEventListener("load", function() { benchmarkController.initialize(); });
</ins></span></pre></div>
<a id="trunkPerformanceTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/ChangeLog (198609 => 198610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/ChangeLog        2016-03-24 00:43:39 UTC (rev 198609)
+++ trunk/PerformanceTests/ChangeLog        2016-03-24 02:08:13 UTC (rev 198610)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2016-03-23 Jon Lee <jonlee@apple.com>
+
+ Make the benchmark require device to be in landscape orientation
+ https://bugs.webkit.org/show_bug.cgi?id=155822
+ rdar://problem/25258650
+
+ Reviewed by Ryosuke Niwa.
+
+ Check that the device is in landscape orientation. If not, disable the button to start it,
+ and show a warning message.
+
+ * Animometer/developer.html: Add a message about how the browser should be set up. Include a
+ warning message that appears if the orientation is incorrect on mobile devices.
+ * Animometer/index.html: Ditto.
+
+ * Animometer/resources/debug-runner/animometer.css: Migrate the .hidden rule into the release
+ stylesheet. Update the style to accommodate the new UI.
+ * Animometer/resources/runner/animometer.css:
+
+ * Animometer/resources/runner/animometer.js:
+ (window.benchmarkController.initialize): Add the orientation listener is needed.
+ (window.benchmarkController.addOrientationListenerIfNecessary): Only mobile devices need this. Check
+ to see for support of window.orientation.
+ (window.benchmarkController._orientationChanged): Toggle the warning based on whether we match the
+ landscape query. Set a state variable, which is needed for the debug harness. Call updateStartButtonState.
+ (window.benchmarkController.updateStartButtonState):
+ * Animometer/resources/debug-runner/animometer.js: Change _updateStartButtonState to return
+ a boolean about whether at least one test is selected. That will be used in
+ benchmarkController.updateStartButtonState(). Move the load event listener to the release version.
+ (window.benchmarkController.updateStartButtonState): Override the release version, and also check
+ that at least one test is selected.
+
</ins><span class="cx"> 2016-03-22 Geoffrey Garen <ggaren@apple.com>
</span><span class="cx">
</span><span class="cx"> MallocBench: consolidate regression testing for aligned allocation
</span></span></pre>
</div>
</div>
</body>
</html>