<!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>[192549] 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/192549">192549</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-11-17 16:08:38 -0800 (Tue, 17 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use the media queries to dynamically set the stage for the graphics benchmark
https://bugs.webkit.org/show_bug.cgi?id=151327

Patch by Said Abou-Hallawa &lt;sabouhallawa@apple.com&gt; on 2015-11-17
Reviewed by Simon Fraser.

Clean setting the benchmark css rules by using the media queries. Accessing
document.stylesheets.cssRules seems to be unreliable. Fix the test harness
load event listener invocation. And also remove the options for normalizing
the stage resolution for retina display.

* Animometer/resources/extensions.js:
(window.DocumentExtension.insertCssRuleAfter): Deleted.
* Animometer/runner/animometer.html:
* Animometer/runner/resources/animometer.css:
(@media screen and (min-device-width: 1800px)):
* Animometer/runner/resources/animometer.js:
(window.sectionsManager.setupRunningSectionStyle):
(window.benchmarkController.initialize):
(window.sectionsManager.setupSectionStyle): Deleted.
* Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
(BouncingParticlesStage):
* Animometer/tests/text/layering-text.html:
* Animometer/tests/text/resources/layering-text.js:
(LayeringTextStage):
(LayeringTextStage.prototype._setFontSize): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkPerformanceTestsAnimometerresourcesextensionsjs">trunk/PerformanceTests/Animometer/resources/extensions.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometerrunneranimometerhtml">trunk/PerformanceTests/Animometer/runner/animometer.html</a></li>
<li><a href="#trunkPerformanceTestsAnimometerrunnerresourcesanimometercss">trunk/PerformanceTests/Animometer/runner/resources/animometer.css</a></li>
<li><a href="#trunkPerformanceTestsAnimometerrunnerresourcesanimometerjs">trunk/PerformanceTests/Animometer/runner/resources/animometer.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometertestsbouncingparticlesresourcesbouncingparticlesjs">trunk/PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-particles.js</a></li>
<li><a href="#trunkPerformanceTestsAnimometerteststextlayeringtexthtml">trunk/PerformanceTests/Animometer/tests/text/layering-text.html</a></li>
<li><a href="#trunkPerformanceTestsAnimometerteststextresourceslayeringtextjs">trunk/PerformanceTests/Animometer/tests/text/resources/layering-text.js</a></li>
<li><a href="#trunkPerformanceTestsChangeLog">trunk/PerformanceTests/ChangeLog</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkPerformanceTestsAnimometerresourcesextensionsjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/resources/extensions.js (192548 => 192549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/resources/extensions.js        2015-11-18 00:07:34 UTC (rev 192548)
+++ trunk/PerformanceTests/Animometer/resources/extensions.js        2015-11-18 00:08:38 UTC (rev 192549)
</span><span class="lines">@@ -160,22 +160,6 @@
</span><span class="cx">             
</span><span class="cx">         parentElement.appendChild(element);
</span><span class="cx">         return element;
</span><del>-    },
-    
-    insertCssRuleAfter: function(newRule, referenceRule)
-    {
-        var styleSheets = document.styleSheets;
-
-        for (var i = 0; i &lt; styleSheets.length; ++i) {       
-            for (var j = 0; j &lt; styleSheets[i].cssRules.length; ++j) {
-                if (styleSheets[i].cssRules[j].selectorText == referenceRule) {
-                    styleSheets[i].insertRule(newRule, j + 1);
-                    return true;
-                }
-            }
-        }
-        
-        return false;
</del><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerrunneranimometerhtml"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/runner/animometer.html (192548 => 192549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/runner/animometer.html        2015-11-18 00:07:34 UTC (rev 192548)
+++ trunk/PerformanceTests/Animometer/runner/animometer.html        2015-11-18 00:08:38 UTC (rev 192549)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx">                 &lt;label&gt;&lt;input id=&quot;estimated-frame-rate&quot; type=&quot;checkbox&quot; checked&gt; Estimated Frame Rate&lt;/label&gt;&lt;br&gt;
</span><span class="cx">                 &lt;label&gt;&lt;input id=&quot;fix-test-complexity&quot; type=&quot;checkbox&quot;&gt; Fix test complexity after warmup&lt;/label&gt;&lt;br&gt;
</span><span class="cx">                 &lt;label&gt;&lt;input id=&quot;show-running-results&quot; type=&quot;checkbox&quot;&gt; Show running results&lt;/label&gt;&lt;br&gt;
</span><del>-                &lt;label&gt;&lt;input id=&quot;normalize-for-device-scale-factor&quot; type=&quot;checkbox&quot;&gt; Normalize for device scale factor&lt;/label&gt;&lt;br&gt;
</del><span class="cx">                 &lt;label&gt;&lt;input id=&quot;adaptive-test&quot; type=&quot;checkbox&quot; checked onchange=&quot;benchmarkController.onChangeAdaptiveTestCheckbox()&quot;&gt; Adaptive test&lt;/label&gt;
</span><span class="cx">             &lt;/options&gt;
</span><span class="cx">             &lt;footer&gt;
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerrunnerresourcesanimometercss"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/runner/resources/animometer.css (192548 => 192549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/runner/resources/animometer.css        2015-11-18 00:07:34 UTC (rev 192548)
+++ trunk/PerformanceTests/Animometer/runner/resources/animometer.css        2015-11-18 00:08:38 UTC (rev 192549)
</span><span class="lines">@@ -240,6 +240,13 @@
</span><span class="cx">     justify-content: center;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+@media screen and (min-device-width: 1800px) {
+    section {
+        width: 1600px;
+        height: 800px;
+    }
+}
+
</ins><span class="cx"> /* -------------------------------------------------------------------------- */
</span><span class="cx"> /*                                 Home Section                               */
</span><span class="cx"> /* -------------------------------------------------------------------------- */
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerrunnerresourcesanimometerjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/runner/resources/animometer.js (192548 => 192549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/runner/resources/animometer.js        2015-11-18 00:07:34 UTC (rev 192548)
+++ trunk/PerformanceTests/Animometer/runner/resources/animometer.js        2015-11-18 00:08:38 UTC (rev 192549)
</span><span class="lines">@@ -109,30 +109,10 @@
</span><span class="cx">             history.pushState({section: sectionIdentifier}, document.title);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    setupSectionStyle: function()
-    {
-        if (screen.width &gt;= 1800 &amp;&amp; screen.height &gt;= 1000)
-            DocumentExtension.insertCssRuleAfter(&quot; section { width: 1600px; height: 800px; }&quot;, &quot;section&quot;);
-        else
-            DocumentExtension.insertCssRuleAfter(&quot; section { width: 800px; height: 600px; }&quot;, &quot;section&quot;);
-    },
-    
</del><span class="cx">     setupRunningSectionStyle: function(options)
</span><span class="cx">     {
</span><span class="cx">         if (!options[&quot;show-running-results&quot;])
</span><span class="cx">             document.getElementById(&quot;record&quot;).style.display = &quot;none&quot;;
</span><del>-
-        if (options[&quot;normalize-for-device-scale-factor&quot;] &amp;&amp; window.devicePixelRatio != 1) {
-            var percentage = window.devicePixelRatio * 100;
-            var rule = &quot;section#running &gt; #running-test &gt; iframe&quot;;
-            var newRule = rule;
-            newRule += &quot; { &quot;;
-            newRule += &quot;width: &quot; + percentage + &quot;%; &quot;;
-            newRule += &quot;height: &quot; + percentage + &quot;%; &quot;;
-            newRule += &quot;transform: scale(&quot; + 100 / percentage + &quot;) translate(&quot; + (100 - percentage) / 2 + &quot;%,&quot; + (100 - percentage) / 2 + &quot;%);&quot;;
-            newRule += &quot; }&quot;;
-            DocumentExtension.insertCssRuleAfter(newRule, rule);
-        }
</del><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -407,7 +387,6 @@
</span><span class="cx"> {
</span><span class="cx">     initialize: function()
</span><span class="cx">     {
</span><del>-        sectionsManager.setupSectionStyle();
</del><span class="cx">         optionsManager.updateUIFromLocalStorage();
</span><span class="cx">         suitesManager.createElements();
</span><span class="cx">         suitesManager.updateUIFromLocalStorage();
</span><span class="lines">@@ -463,4 +442,4 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-document.addEventListener(&quot;DOMContentLoaded&quot;, benchmarkController.initialize());
</del><ins>+window.addEventListener(&quot;load&quot;, benchmarkController.initialize);
</ins></span></pre></div>
<a id="trunkPerformanceTestsAnimometertestsbouncingparticlesresourcesbouncingparticlesjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-particles.js (192548 => 192549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-particles.js        2015-11-18 00:07:34 UTC (rev 192548)
+++ trunk/PerformanceTests/Animometer/tests/bouncing-particles/resources/bouncing-particles.js        2015-11-18 00:08:38 UTC (rev 192549)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> 
</span><span class="cx"> function BouncingParticlesStage(element, options)
</span><span class="cx"> {
</span><del>-    Stage.call(this, element);
</del><ins>+    Stage.call(this, element, options);
</ins><span class="cx">     
</span><span class="cx">     this.particleSize = new Point(parseInt(options[&quot;particleWidth&quot;]) || 10, parseInt(options[&quot;particleHeight&quot;]) || 10);
</span><span class="cx">     this._particles = [];
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerteststextlayeringtexthtml"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/tests/text/layering-text.html (192548 => 192549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/tests/text/layering-text.html        2015-11-18 00:07:34 UTC (rev 192548)
+++ trunk/PerformanceTests/Animometer/tests/text/layering-text.html        2015-11-18 00:08:38 UTC (rev 192549)
</span><span class="lines">@@ -6,10 +6,17 @@
</span><span class="cx">             position: absolute;
</span><span class="cx">             left: 0px;
</span><span class="cx">             top: 0px;
</span><del>-            padding: 3px;
</del><ins>+            padding: 0.72em;
</ins><span class="cx">             background-color: transparent;
</span><del>-            line-height: 1.2;
</del><ins>+            line-height: 1.1;
+            font-size: 0.72em;
</ins><span class="cx">         }
</span><ins>+        @media screen and (min-device-width: 1800px) {
+            .text-layer {
+                line-height: 1.2;
+                font-size: 0.96em;
+            }
+        }
</ins><span class="cx">     &lt;/style&gt;  
</span><span class="cx">     &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../resources/stage.css&quot;&gt;
</span><span class="cx">     &lt;script src=&quot;../../resources/algorithm.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkPerformanceTestsAnimometerteststextresourceslayeringtextjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/Animometer/tests/text/resources/layering-text.js (192548 => 192549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/Animometer/tests/text/resources/layering-text.js        2015-11-18 00:07:34 UTC (rev 192548)
+++ trunk/PerformanceTests/Animometer/tests/text/resources/layering-text.js        2015-11-18 00:08:38 UTC (rev 192549)
</span><span class="lines">@@ -6,7 +6,6 @@
</span><span class="cx">     this._textItemIndex = 0;
</span><span class="cx">     this._colorIndex = 0;
</span><span class="cx">     this._animateCounts = 0;
</span><del>-    this._setFontSize();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayeringTextStage.textItems = [
</span><span class="lines">@@ -61,7 +60,7 @@
</span><span class="cx">         &quot;&lt;/ul&gt;&quot;,
</span><span class="cx">         &quot;&lt;h3&gt;Open source benchmarks&lt;/h3&gt;&quot;,
</span><span class="cx">         &quot;&lt;ul&gt;&quot;,
</span><del>-            &quot;&lt;li&gt;AIM Multiuser Benchmark: composed of a list of tests that could be mixed to create a ‘load mix’ that would simulate a specific computer function on any UNIX-type OS.&lt;/li&gt;&quot;,
</del><ins>+            &quot;&lt;li&gt;AIM Multiuser Benchmark: composed of a list of tests that could be mixed to create a 'load mix' that would simulate a specific computer function on any UNIX-type OS.&lt;/li&gt;&quot;,
</ins><span class="cx">             &quot;&lt;li&gt;Bonnie++: filesystem and hard drive benchmark&lt;/li&gt;&quot;,
</span><span class="cx">             &quot;&lt;li&gt;BRL-CAD: cross-platform architecture-agnostic benchmark suite based on multithreaded ray tracing performance; baselined against a VAX-11/780; and used since 1984 for evaluating relative CPU performance, compiler differences, optimization levels, coherency, architecture differences, and operating system differences.&lt;/li&gt;&quot;,
</span><span class="cx">         &quot;&lt;/ul&gt;&quot;,
</span><span class="lines">@@ -138,14 +137,6 @@
</span><span class="cx"> LayeringTextStage.prototype = Object.create(Stage.prototype);
</span><span class="cx"> LayeringTextStage.prototype.constructor = LayeringTextStage;
</span><span class="cx"> 
</span><del>-LayeringTextStage.prototype._setFontSize = function()
-{
-    var lineHeight = this.size.height / LayeringTextStage.colorableTextItems;
-    var fontHeight = lineHeight / 1.5;
-    var fontSize = fontHeight * 72.0 / 96.0;
-    DocumentExtension.insertCssRuleAfter(&quot;.text-layer&quot;, &quot;.text-layer { font-size: &quot; + fontSize.toFixed(2) + &quot;px; }&quot;);
-}
-
</del><span class="cx"> LayeringTextStage.prototype._nextTextItem = function(textItemFlags)
</span><span class="cx"> {
</span><span class="cx">     var textItem = LayeringTextStage.textItems[this._textItemIndex];
</span></span></pre></div>
<a id="trunkPerformanceTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/ChangeLog (192548 => 192549)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/ChangeLog        2015-11-18 00:07:34 UTC (rev 192548)
+++ trunk/PerformanceTests/ChangeLog        2015-11-18 00:08:38 UTC (rev 192549)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2015-11-17  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        Use the media queries to dynamically set the stage for the graphics benchmark
+        https://bugs.webkit.org/show_bug.cgi?id=151327
+
+        Reviewed by Simon Fraser.
+
+        Clean setting the benchmark css rules by using the media queries. Accessing
+        document.stylesheets.cssRules seems to be unreliable. Fix the test harness
+        load event listener invocation. And also remove the options for normalizing
+        the stage resolution for retina display.
+
+        * Animometer/resources/extensions.js:
+        (window.DocumentExtension.insertCssRuleAfter): Deleted.
+        * Animometer/runner/animometer.html:
+        * Animometer/runner/resources/animometer.css:
+        (@media screen and (min-device-width: 1800px)):
+        * Animometer/runner/resources/animometer.js:
+        (window.sectionsManager.setupRunningSectionStyle):
+        (window.benchmarkController.initialize):
+        (window.sectionsManager.setupSectionStyle): Deleted.
+        * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
+        (BouncingParticlesStage):
+        * Animometer/tests/text/layering-text.html:
+        * Animometer/tests/text/resources/layering-text.js:
+        (LayeringTextStage):
+        (LayeringTextStage.prototype._setFontSize): Deleted.
+
</ins><span class="cx"> 2015-11-16  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove the option for animating using setInterval from the graphics benchmark
</span></span></pre>
</div>
</div>

</body>
</html>