<!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>[224742] 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/224742">224742</a></dd>
<dt>Author</dt> <dd>jonlee@apple.com</dd>
<dt>Date</dt> <dd>2017-11-12 22:54:44 -0800 (Sun, 12 Nov 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add isolated text tests for MotionMark
https://bugs.webkit.org/show_bug.cgi?id=179226

Reviewed by Darin Adler.

Add a private suite that simplifies the design test.

* MotionMark/resources/debug-runner/tests.js:
* MotionMark/resources/runner/tests.js:
* MotionMark/tests/master/design.html: Copied from PerformanceTests/MotionMark/tests/master/text.html.
Rename the html file to the title of the test.
* MotionMark/tests/master/resources/design.js: Renamed from PerformanceTests/MotionMark/tests/master/resources/text.js.
* MotionMark/tests/text/design-6.html: Copied from PerformanceTests/MotionMark/tests/master/text.html.
Six active cells
* MotionMark/tests/text/design-6.js: Added.
* MotionMark/tests/text/design.html: Renamed from PerformanceTests/MotionMark/tests/master/text.html.
Replace the text with empty table cells that are populated with desired text.
* MotionMark/tests/text/design.js: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkPerformanceTestsChangeLog">trunk/PerformanceTests/ChangeLog</a></li>
<li><a href="#trunkPerformanceTestsMotionMarkresourcesdebugrunnertestsjs">trunk/PerformanceTests/MotionMark/resources/debug-runner/tests.js</a></li>
<li><a href="#trunkPerformanceTestsMotionMarkresourcesrunnertestsjs">trunk/PerformanceTests/MotionMark/resources/runner/tests.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkPerformanceTestsMotionMarktestsmasterdesignhtml">trunk/PerformanceTests/MotionMark/tests/master/design.html</a></li>
<li><a href="#trunkPerformanceTestsMotionMarktestsmasterresourcesdesignjs">trunk/PerformanceTests/MotionMark/tests/master/resources/design.js</a></li>
<li>trunk/PerformanceTests/MotionMark/tests/text/</li>
<li><a href="#trunkPerformanceTestsMotionMarkteststextdesign6html">trunk/PerformanceTests/MotionMark/tests/text/design-6.html</a></li>
<li><a href="#trunkPerformanceTestsMotionMarkteststextdesign6js">trunk/PerformanceTests/MotionMark/tests/text/design-6.js</a></li>
<li><a href="#trunkPerformanceTestsMotionMarkteststextdesignhtml">trunk/PerformanceTests/MotionMark/tests/text/design.html</a></li>
<li><a href="#trunkPerformanceTestsMotionMarkteststextdesignjs">trunk/PerformanceTests/MotionMark/tests/text/design.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkPerformanceTestsMotionMarktestsmasterresourcestextjs">trunk/PerformanceTests/MotionMark/tests/master/resources/text.js</a></li>
<li><a href="#trunkPerformanceTestsMotionMarktestsmastertexthtml">trunk/PerformanceTests/MotionMark/tests/master/text.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkPerformanceTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/ChangeLog (224741 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/ChangeLog 2017-11-13 06:39:14 UTC (rev 224741)
+++ trunk/PerformanceTests/ChangeLog    2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2017-11-12  Jon Lee  <jonlee@apple.com>
+
+        Add isolated text tests for MotionMark
+        https://bugs.webkit.org/show_bug.cgi?id=179226
+
+        Reviewed by Darin Adler.
+
+        Add a private suite that simplifies the design test.
+
+        * MotionMark/resources/debug-runner/tests.js:
+        * MotionMark/resources/runner/tests.js:
+        * MotionMark/tests/master/design.html: Copied from PerformanceTests/MotionMark/tests/master/text.html.
+        Rename the html file to the title of the test.
+        * MotionMark/tests/master/resources/design.js: Renamed from PerformanceTests/MotionMark/tests/master/resources/text.js.
+        * MotionMark/tests/text/design-6.html: Copied from PerformanceTests/MotionMark/tests/master/text.html.
+        Six active cells
+        * MotionMark/tests/text/design-6.js: Added.
+        * MotionMark/tests/text/design.html: Renamed from PerformanceTests/MotionMark/tests/master/text.html.
+        Replace the text with empty table cells that are populated with desired text.
+        * MotionMark/tests/text/design.js: Added.
+
</ins><span class="cx"> 2017-11-06  Robin Morisset  <rmorisset@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Add a third benchmark to TailBench
</span></span></pre></div>
<a id="trunkPerformanceTestsMotionMarkresourcesdebugrunnertestsjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MotionMark/resources/debug-runner/tests.js (224741 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MotionMark/resources/debug-runner/tests.js        2017-11-13 06:39:14 UTC (rev 224741)
+++ trunk/PerformanceTests/MotionMark/resources/debug-runner/tests.js   2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -266,6 +266,35 @@
</span><span class="cx">     ]
</span><span class="cx"> ));
</span><span class="cx"> 
</span><ins>+Suites.push(new Suite("Text suite",
+    [
+        {
+            url: "text/design.html?corpus=latin",
+            name: "Design: Latin only (12 items)"
+        },
+        {
+            url: "text/design.html?corpus=cjk",
+            name: "Design: CJK only (12 items)"
+        },
+        {
+            url: "text/design.html?corpus=arabic",
+            name: "Design: RTL and complex scripts only (12 items)"
+        },
+        {
+            url: "text/design-6.html?corpus=latin",
+            name: "Design: Latin only (6 items)"
+        },
+        {
+            url: "text/design-6.html?corpus=cjk",
+            name: "Design: CJK only (6 items)"
+        },
+        {
+            url: "text/design-6.html?corpus=arabic",
+            name: "Design: RTL and complex scripts only (6 items)"
+        },
+    ]
+));
+
</ins><span class="cx"> Suites.push(new Suite("3D Graphics",
</span><span class="cx">     [
</span><span class="cx">         {
</span></span></pre></div>
<a id="trunkPerformanceTestsMotionMarkresourcesrunnertestsjs"></a>
<div class="modfile"><h4>Modified: trunk/PerformanceTests/MotionMark/resources/runner/tests.js (224741 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MotionMark/resources/runner/tests.js      2017-11-13 06:39:14 UTC (rev 224741)
+++ trunk/PerformanceTests/MotionMark/resources/runner/tests.js 2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">             name: "Images"
</span><span class="cx">         },
</span><span class="cx">         {
</span><del>-            url: "master/text.html",
</del><ins>+            url: "master/design.html",
</ins><span class="cx">             name: "Design"
</span><span class="cx">         },
</span><span class="cx">         {
</span></span></pre></div>
<a id="trunkPerformanceTestsMotionMarktestsmasterdesignhtmlfromrev224741trunkPerformanceTestsMotionMarktestsmastertexthtml"></a>
<div class="copfile"><h4>Copied: trunk/PerformanceTests/MotionMark/tests/master/design.html (from rev 224741, trunk/PerformanceTests/MotionMark/tests/master/text.html) (0 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MotionMark/tests/master/design.html                               (rev 0)
+++ trunk/PerformanceTests/MotionMark/tests/master/design.html  2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -0,0 +1,106 @@
</span><ins>+<!--
+  Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+  THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <link rel="stylesheet" type="text/css" href="../resources/stage.css">
+    <style type="text/css">
+
+        #stage {
+            font-family: Helvetica;
+            font-size: 52px;
+            background-color: #313534;
+        }
+        @media (max-width: 900px) {
+            #stage {
+                font-size: 40px;
+            }
+        }
+        @media (max-width: 568px) {
+            #stage {
+                font-size: 28px;
+            }
+        }
+
+        #stage div {
+            width: 80%;
+            height: 90%;
+            position: absolute;
+            text-align: center;
+        }
+        #template {
+            color: #FCFCFC;
+        }
+        table {
+            position: relative;
+            width: 100%;
+            height: 100%;
+        }
+        td {
+            width: 33%;
+        }
+        tr {
+            height: 20%;
+        }
+    </style>
+</head>
+<body>
+    <div id="stage">
+        <div id="template">
+            <table>
+                <tbody>
+                    <tr>
+                        <td>σχέδιο</td>
+                        <td>设计</td>
+                        <td>suunnittelu</td>
+                    </tr>
+                    <tr>
+                        <td>design</td>
+                        <td>дизайн</td>
+                        <td class="rtl">تصميم</td>
+                    </tr>
+                    <tr>
+                        <td>디자인</td>
+                        <td>conception</td>
+                        <td>デザイン</td>
+                    </tr>
+                    <tr>
+                        <td>konstruktion</td>
+                        <td class="rtl">עיצוב</td>
+                        <td>diseño</td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+    </div>
+    <script src="../../resources/strings.js"></script>
+    <script src="../../resources/extensions.js"></script>
+    <script src="../../resources/statistics.js"></script>
+    <script src="../resources/math.js"></script>
+    <script src="../resources/main.js"></script>
+    <script src="resources/design.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkPerformanceTestsMotionMarktestsmasterresourcesdesignjsfromrev224741trunkPerformanceTestsMotionMarktestsmasterresourcestextjs"></a>
<div class="copfile"><h4>Copied: trunk/PerformanceTests/MotionMark/tests/master/resources/design.js (from rev 224741, trunk/PerformanceTests/MotionMark/tests/master/resources/text.js) (0 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MotionMark/tests/master/resources/design.js                               (rev 0)
+++ trunk/PerformanceTests/MotionMark/tests/master/resources/design.js  2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -0,0 +1,140 @@
</span><ins>+/*
+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+(function() {
+
+var TextStage = Utilities.createSubclass(Stage,
+    function()
+    {
+        Stage.call(this);
+
+        this.testElements = [];
+        this._offsetIndex = 0;
+    }, {
+
+    shadowFalloff: new UnitBezier(new Point(0.015, 0.750), new Point(0.755, 0.235)),
+    shimmerAverage: 0,
+    shimmerMax: 0.5,
+    millisecondsPerRotation: 1000 / (.26 * Math.PI * 2),
+    particleDistanceX: 1.5,
+    particleDistanceY: .5,
+    lightnessMin: 13,
+    lightnessMax: 94,
+    gradients: [
+        [10, 176, 176, 209, 148, 140],
+        [171, 120, 154, 245, 196, 154],
+        [224, 99, 99, 71, 134, 148],
+        [101, 100, 117, 80, 230, 175],
+        [232, 165, 30, 69, 186, 172]
+    ],
+
+    initialize: function(benchmark)
+    {
+        Stage.prototype.initialize.call(this, benchmark);
+
+        this._template = document.getElementById("template");
+        this._offset = this.size.subtract(Point.elementClientSize(this._template)).multiply(.5);
+        this._template.style.left = this._offset.width + "px";
+        this._template.style.top = this._offset.height + "px";
+
+        this._stepProgress = 0;
+    },
+
+    tune: function(count)
+    {
+        if (count == 0)
+            return;
+
+        if (count < 0) {
+            this._offsetIndex = Math.max(this._offsetIndex + count, 0);
+            for (var i = this._offsetIndex; i < this.testElements.length; ++i)
+                this.testElements[i].style.visibility = "hidden";
+
+            this._stepProgress = 1 / this._offsetIndex;
+            return;
+        }
+
+        this._offsetIndex = this._offsetIndex + count;
+        this._stepProgress = 1 / this._offsetIndex;
+
+        var index = Math.min(this._offsetIndex, this.testElements.length);
+        for (var i = 0; i < index; ++i)
+            this.testElements[i].style.visibility = "visible";
+
+        if (this._offsetIndex <= this.testElements.length)
+            return;
+
+        for (var i = this.testElements.length; i < this._offsetIndex; ++i) {
+            var clone = this._template.cloneNode(true);
+            this.testElements.push(clone);
+            this.element.insertBefore(clone, this.element.firstChild);
+        }
+    },
+
+    animate: function(timeDelta) {
+        var angle = Stage.dateCounterValue(this.millisecondsPerRotation);
+
+        var progress = 0;
+        var stepX = Math.sin(angle) * this.particleDistanceX;
+        var stepY = Math.cos(angle) * this.particleDistanceY;
+        var x = -stepX * 3;
+        var y = -stepY * 3;
+        var gradient = this.gradients[Math.floor(angle/(Math.PI * 2)) % this.gradients.length];
+        var offset = Stage.dateCounterValue(200);
+        this._template.style.transform = "translate(" + Math.floor(x) + "px," + Math.floor(y) + "px)";
+        for (var i = 0; i < this._offsetIndex; ++i) {
+            var element = this.testElements[i];
+
+            var colorProgress = this.shadowFalloff.solve(progress);
+            var shimmer = Math.sin(offset - colorProgress);
+            colorProgress = Math.max(Math.min(colorProgress + Utilities.lerp(shimmer, this.shimmerAverage, this.shimmerMax), 1), 0);
+            var r = Math.round(Utilities.lerp(colorProgress, gradient[0], gradient[3]));
+            var g = Math.round(Utilities.lerp(colorProgress, gradient[1], gradient[4]));
+            var b = Math.round(Utilities.lerp(colorProgress, gradient[2], gradient[5]));
+            element.style.color = "rgb(" + r + "," + g + "," + b + ")";
+
+            x += stepX;
+            y += stepY;
+            element.style.transform = "translate(" + Math.floor(x) + "px," + Math.floor(y) + "px)";
+
+            progress += this._stepProgress;
+        }
+    },
+
+    complexity: function()
+    {
+        return 1 + this._offsetIndex;
+    }
+});
+
+var TextBenchmark = Utilities.createSubclass(Benchmark,
+    function(options)
+    {
+        Benchmark.call(this, new TextStage(), options);
+    }
+);
+
+window.benchmarkClass = TextBenchmark;
+
+}());
</ins></span></pre></div>
<a id="trunkPerformanceTestsMotionMarktestsmasterresourcestextjs"></a>
<div class="delfile"><h4>Deleted: trunk/PerformanceTests/MotionMark/tests/master/resources/text.js (224741 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MotionMark/tests/master/resources/text.js 2017-11-13 06:39:14 UTC (rev 224741)
+++ trunk/PerformanceTests/MotionMark/tests/master/resources/text.js    2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -1,140 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-(function() {
-
-var TextStage = Utilities.createSubclass(Stage,
-    function()
-    {
-        Stage.call(this);
-
-        this.testElements = [];
-        this._offsetIndex = 0;
-    }, {
-
-    shadowFalloff: new UnitBezier(new Point(0.015, 0.750), new Point(0.755, 0.235)),
-    shimmerAverage: 0,
-    shimmerMax: 0.5,
-    millisecondsPerRotation: 1000 / (.26 * Math.PI * 2),
-    particleDistanceX: 1.5,
-    particleDistanceY: .5,
-    lightnessMin: 13,
-    lightnessMax: 94,
-    gradients: [
-        [10, 176, 176, 209, 148, 140],
-        [171, 120, 154, 245, 196, 154],
-        [224, 99, 99, 71, 134, 148],
-        [101, 100, 117, 80, 230, 175],
-        [232, 165, 30, 69, 186, 172]
-    ],
-
-    initialize: function(benchmark)
-    {
-        Stage.prototype.initialize.call(this, benchmark);
-
-        this._template = document.getElementById("template");
-        this._offset = this.size.subtract(Point.elementClientSize(this._template)).multiply(.5);
-        this._template.style.left = this._offset.width + "px";
-        this._template.style.top = this._offset.height + "px";
-
-        this._stepProgress = 0;
-    },
-
-    tune: function(count)
-    {
-        if (count == 0)
-            return;
-
-        if (count < 0) {
-            this._offsetIndex = Math.max(this._offsetIndex + count, 0);
-            for (var i = this._offsetIndex; i < this.testElements.length; ++i)
-                this.testElements[i].style.visibility = "hidden";
-
-            this._stepProgress = 1 / this._offsetIndex;
-            return;
-        }
-
-        this._offsetIndex = this._offsetIndex + count;
-        this._stepProgress = 1 / this._offsetIndex;
-
-        var index = Math.min(this._offsetIndex, this.testElements.length);
-        for (var i = 0; i < index; ++i)
-            this.testElements[i].style.visibility = "visible";
-
-        if (this._offsetIndex <= this.testElements.length)
-            return;
-
-        for (var i = this.testElements.length; i < this._offsetIndex; ++i) {
-            var clone = this._template.cloneNode(true);
-            this.testElements.push(clone);
-            this.element.insertBefore(clone, this.element.firstChild);
-        }
-    },
-
-    animate: function(timeDelta) {
-        var angle = Stage.dateCounterValue(this.millisecondsPerRotation);
-
-        var progress = 0;
-        var stepX = Math.sin(angle) * this.particleDistanceX;
-        var stepY = Math.cos(angle) * this.particleDistanceY;
-        var x = -stepX * 3;
-        var y = -stepY * 3;
-        var gradient = this.gradients[Math.floor(angle/(Math.PI * 2)) % this.gradients.length];
-        var offset = Stage.dateCounterValue(200);
-        this._template.style.transform = "translate(" + Math.floor(x) + "px," + Math.floor(y) + "px)";
-        for (var i = 0; i < this._offsetIndex; ++i) {
-            var element = this.testElements[i];
-
-            var colorProgress = this.shadowFalloff.solve(progress);
-            var shimmer = Math.sin(offset - colorProgress);
-            colorProgress = Math.max(Math.min(colorProgress + Utilities.lerp(shimmer, this.shimmerAverage, this.shimmerMax), 1), 0);
-            var r = Math.round(Utilities.lerp(colorProgress, gradient[0], gradient[3]));
-            var g = Math.round(Utilities.lerp(colorProgress, gradient[1], gradient[4]));
-            var b = Math.round(Utilities.lerp(colorProgress, gradient[2], gradient[5]));
-            element.style.color = "rgb(" + r + "," + g + "," + b + ")";
-
-            x += stepX;
-            y += stepY;
-            element.style.transform = "translate(" + Math.floor(x) + "px," + Math.floor(y) + "px)";
-
-            progress += this._stepProgress;
-        }
-    },
-
-    complexity: function()
-    {
-        return 1 + this._offsetIndex;
-    }
-});
-
-var TextBenchmark = Utilities.createSubclass(Benchmark,
-    function(options)
-    {
-        Benchmark.call(this, new TextStage(), options);
-    }
-);
-
-window.benchmarkClass = TextBenchmark;
-
-}());
</del></span></pre></div>
<a id="trunkPerformanceTestsMotionMarktestsmastertexthtml"></a>
<div class="delfile"><h4>Deleted: trunk/PerformanceTests/MotionMark/tests/master/text.html (224741 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MotionMark/tests/master/text.html 2017-11-13 06:39:14 UTC (rev 224741)
+++ trunk/PerformanceTests/MotionMark/tests/master/text.html    2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -1,106 +0,0 @@
</span><del>-<!--
-  Copyright (C) 2015-2017 Apple Inc. All rights reserved.
-
-  Redistribution and use in source and binary forms, with or without
-  modification, are permitted provided that the following conditions
-  are met:
-  1. Redistributions of source code must retain the above copyright
-     notice, this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in the
-     documentation and/or other materials provided with the distribution.
-
-  THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-  THE POSSIBILITY OF SUCH DAMAGE.
--->
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <link rel="stylesheet" type="text/css" href="../resources/stage.css">
-    <style type="text/css">
-
-        #stage {
-            font-family: Helvetica;
-            font-size: 52px;
-            background-color: #313534;
-        }
-        @media (max-width: 900px) {
-            #stage {
-                font-size: 40px;
-            }
-        }
-        @media (max-width: 568px) {
-            #stage {
-                font-size: 28px;
-            }
-        }
-
-        #stage div {
-            width: 80%;
-            height: 90%;
-            position: absolute;
-            text-align: center;
-        }
-        #template {
-            color: #FCFCFC;
-        }
-        table {
-            position: relative;
-            width: 100%;
-            height: 100%;
-        }
-        td {
-            width: 33%;
-        }
-        tr {
-            height: 20%;
-        }
-    </style>
-</head>
-<body>
-    <div id="stage">
-        <div id="template">
-            <table>
-                <tbody>
-                    <tr>
-                        <td>σχέδιο</td>
-                        <td>设计</td>
-                        <td>suunnittelu</td>
-                    </tr>
-                    <tr>
-                        <td>design</td>
-                        <td>дизайн</td>
-                        <td class="rtl">تصميم</td>
-                    </tr>
-                    <tr>
-                        <td>디자인</td>
-                        <td>conception</td>
-                        <td>デザイン</td>
-                    </tr>
-                    <tr>
-                        <td>konstruktion</td>
-                        <td class="rtl">עיצוב</td>
-                        <td>diseño</td>
-                    </tr>
-                </tbody>
-            </table>
-        </div>
-    </div>
-    <script src="../../resources/strings.js"></script>
-    <script src="../../resources/extensions.js"></script>
-    <script src="../../resources/statistics.js"></script>
-    <script src="../resources/math.js"></script>
-    <script src="../resources/main.js"></script>
-    <script src="resources/text.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkPerformanceTestsMotionMarkteststextdesign6htmlfromrev224741trunkPerformanceTestsMotionMarktestsmastertexthtml"></a>
<div class="copfile"><h4>Copied: trunk/PerformanceTests/MotionMark/tests/text/design-6.html (from rev 224741, trunk/PerformanceTests/MotionMark/tests/master/text.html) (0 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MotionMark/tests/text/design-6.html                               (rev 0)
+++ trunk/PerformanceTests/MotionMark/tests/text/design-6.html  2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -0,0 +1,117 @@
</span><ins>+<!--
+  Copyright (C) 2017 Apple Inc. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+  THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <link rel="stylesheet" type="text/css" href="../resources/stage.css">
+    <style type="text/css">
+
+        #stage {
+            font-family: Helvetica;
+            font-size: 52px;
+            background-color: #422E2C;
+        }
+        @media (max-width: 900px) {
+            #stage {
+                font-size: 40px;
+            }
+        }
+        @media (max-width: 568px) {
+            #stage {
+                font-size: 28px;
+            }
+        }
+
+        #stage div {
+            width: 80%;
+            height: 90%;
+            position: absolute;
+            text-align: center;
+        }
+        #template {
+            color: #FCFCFC;
+        }
+        table {
+            position: relative;
+            width: 100%;
+            height: 100%;
+        }
+        td {
+            width: 25%;
+        }
+        tr {
+            height: 20%;
+        }
+    </style>
+</head>
+<body>
+    <div id="stage">
+        <div id="template">
+            <table>
+                <tbody>
+                    <tr>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td></td>
+                        <td id="cell0"></td>
+                        <td id="cell1"></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td></td>
+                        <td id="cell2"></td>
+                        <td id="cell3"></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td></td>
+                        <td id="cell4"></td>
+                        <td id="cell5"></td>
+                        <td></td>
+                    </tr>
+                    <tr>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                        <td></td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+    </div>
+    <script src="../../resources/strings.js"></script>
+    <script src="../../resources/extensions.js"></script>
+    <script src="../../resources/statistics.js"></script>
+    <script src="../resources/math.js"></script>
+    <script src="../resources/main.js"></script>
+    <script src="../master/resources/design.js"></script>
+    <script src="design-6.js" charset="utf-8"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkPerformanceTestsMotionMarkteststextdesign6js"></a>
<div class="addfile"><h4>Added: trunk/PerformanceTests/MotionMark/tests/text/design-6.js (0 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MotionMark/tests/text/design-6.js                         (rev 0)
+++ trunk/PerformanceTests/MotionMark/tests/text/design-6.js    2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+(function() {
+
+// The MotionMark-based TextBenchmark should already be set to |window.benchmarkClass|
+var TextBenchmark = window.benchmarkClass;
+var TextTemplateBenchmark = Utilities.createSubclass(TextBenchmark,
+    function(options)
+    {
+        var dataset;
+        switch (options["corpus"]) {
+        case "latin":
+            dataset = [
+                "σχέδιο",
+                "umění",
+                "design",
+                "искусство",
+                "conception",
+                "diseño"
+            ];
+            break;
+        case "cjk":
+            dataset = [
+                "设计",
+                "디자인",
+                "デザイン",
+                "예술",
+                "使吃惊",
+                "がいねん",
+            ];
+            break;
+        case "arabic":
+            dataset = [
+                {text: "تصميم", direction: "rtl"},
+                "வடிவமைப்பு",
+                "योजना",
+                {text: "לְעַצֵב", direction: "rtl"},
+                {text: "خلاق", direction: "rtl"},
+                "ศิลปะ",
+            ];
+            break;
+        }
+
+        dataset.forEach(function(entry, i) {
+            var td = document.getElementById("cell" + i);
+            if (typeof entry === 'string') {
+                td.innerText = entry;
+            } else {
+                td.innerText = entry.text;
+                td.classList.add("rtl");
+            }
+        })
+
+        TextBenchmark.call(this, options);
+    }
+);
+
+window.benchmarkClass = TextTemplateBenchmark;
+
+})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkPerformanceTestsMotionMarkteststextdesignhtmlfromrev224741trunkPerformanceTestsMotionMarktestsmastertexthtml"></a>
<div class="copfile"><h4>Copied: trunk/PerformanceTests/MotionMark/tests/text/design.html (from rev 224741, trunk/PerformanceTests/MotionMark/tests/master/text.html) (0 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MotionMark/tests/text/design.html                         (rev 0)
+++ trunk/PerformanceTests/MotionMark/tests/text/design.html    2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -0,0 +1,107 @@
</span><ins>+<!--
+  Copyright (C) 2017 Apple Inc. All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+  THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+  THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <link rel="stylesheet" type="text/css" href="../resources/stage.css">
+    <style type="text/css">
+
+        #stage {
+            font-family: Helvetica;
+            font-size: 52px;
+            background-color: #422E2C;
+        }
+        @media (max-width: 900px) {
+            #stage {
+                font-size: 40px;
+            }
+        }
+        @media (max-width: 568px) {
+            #stage {
+                font-size: 28px;
+            }
+        }
+
+        #stage div {
+            width: 80%;
+            height: 90%;
+            position: absolute;
+            text-align: center;
+        }
+        #template {
+            color: #FCFCFC;
+        }
+        table {
+            position: relative;
+            width: 100%;
+            height: 100%;
+        }
+        td {
+            width: 33%;
+        }
+        tr {
+            height: 20%;
+        }
+    </style>
+</head>
+<body>
+    <div id="stage">
+        <div id="template">
+            <table>
+                <tbody>
+                    <tr>
+                        <td id="cell0"></td>
+                        <td id="cell1"></td>
+                        <td id="cell2"></td>
+                    </tr>
+                    <tr>
+                        <td id="cell3"></td>
+                        <td id="cell4"></td>
+                        <td id="cell5"></td>
+                    </tr>
+                    <tr>
+                        <td id="cell6"></td>
+                        <td id="cell7"></td>
+                        <td id="cell8"></td>
+                    </tr>
+                    <tr>
+                        <td id="cell9"></td>
+                        <td id="cell10"></td>
+                        <td id="cell11"></td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+    </div>
+    <script src="../../resources/strings.js"></script>
+    <script src="../../resources/extensions.js"></script>
+    <script src="../../resources/statistics.js"></script>
+    <script src="../resources/math.js"></script>
+    <script src="../resources/main.js"></script>
+    <script src="../master/resources/design.js"></script>
+    <script src="design.js" charset="utf-8"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkPerformanceTestsMotionMarkteststextdesignjs"></a>
<div class="addfile"><h4>Added: trunk/PerformanceTests/MotionMark/tests/text/design.js (0 => 224742)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/PerformanceTests/MotionMark/tests/text/design.js                           (rev 0)
+++ trunk/PerformanceTests/MotionMark/tests/text/design.js      2017-11-13 06:54:44 UTC (rev 224742)
</span><span class="lines">@@ -0,0 +1,100 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+(function() {
+
+// The MotionMark-based TextBenchmark should already be set to |window.benchmarkClass|
+var TextBenchmark = window.benchmarkClass;
+var TextTemplateBenchmark = Utilities.createSubclass(TextBenchmark,
+    function(options)
+    {
+        var dataset;
+        switch (options["corpus"]) {
+        case "latin":
+            dataset = [
+                "σχέδιο",
+                "umění",
+                "suunnittelu",
+                "design",
+                "deseń",
+                "искусство",
+                "дизайн",
+                "conception",
+                "kunst",
+                "konstruktion",
+                "τέχνη",
+                "diseño"
+            ];
+            break;
+        case "cjk":
+            dataset = [
+                "设计",
+                "디자인",
+                "デザイン",
+                "がいねん",
+                "藝術",
+                "养殖",
+                "예술",
+                "展開する",
+                "발달",
+                "技術",
+                "驚き",
+                "使吃惊",
+            ];
+            break;
+        case "arabic":
+            dataset = [
+                {text: "تصميم", direction: "rtl"},
+                "வடிவமைப்பு",
+                "योजना",
+                {text: "לְעַצֵב", direction: "rtl"},
+                {text: "خلاق", direction: "rtl"},
+                "ศิลปะ",
+                "कौशल",
+                {text: "אָמָנוּת", direction: "rtl"},
+                "கலை",
+                "ดีไซน์",
+                "পরিকল্পনা",
+                {text: "ډیزاین", direction: "rtl"},
+            ];
+            break;
+        }
+
+        dataset.forEach(function(entry, i) {
+            var td = document.getElementById("cell" + i);
+            if (typeof entry === 'string') {
+                td.innerText = entry;
+            } else {
+                td.innerText = entry.text;
+                td.classList.add("rtl");
+            }
+        })
+
+        TextBenchmark.call(this, options);
+    }
+);
+
+window.benchmarkClass = TextTemplateBenchmark;
+
+})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>