Add text tests
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Mar 2016 01:37:35 +0000 (01:37 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Mar 2016 01:37:35 +0000 (01:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155257

Reviewed by Simon Fraser.

* Animometer/resources/extensions.js:
(UnitBezier.Utilities.createClass): Add a class that computes Bezier points
assuming that two of the control points are at (0,0) and (1,1). Taken from
WebCore/platform/graphics/UnitBezier.h
* Animometer/resources/runner/tests.js: Add a test for English text and one
for international text.
* Animometer/tests/master/international.html: Added.
* Animometer/tests/master/resources/text.js: Added. The test assumes there is
#template div which it will copy. The copies are placed behind the template, and
are set with different colors each frame. They are moved around with CSS transform.
* Animometer/tests/master/text.html: Added.

Remove the other text tests, since these ones cover the same techniques.
* Animometer/tests/text/layering-text.html: Removed.
* Animometer/tests/text/resources/layering-text.js: Removed.
* Animometer/tests/text/resources/text-boxes.js: Removed.
* Animometer/tests/text/text-boxes.html: Removed.
* Animometer/resources/debug-runner/tests.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197908 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/Animometer/resources/debug-runner/tests.js
PerformanceTests/Animometer/resources/extensions.js
PerformanceTests/Animometer/resources/runner/tests.js
PerformanceTests/Animometer/tests/master/international.html [new file with mode: 0644]
PerformanceTests/Animometer/tests/master/resources/text.js [new file with mode: 0644]
PerformanceTests/Animometer/tests/master/text.html [new file with mode: 0644]
PerformanceTests/Animometer/tests/text/layering-text.html [deleted file]
PerformanceTests/Animometer/tests/text/resources/layering-text.js [deleted file]
PerformanceTests/Animometer/tests/text/resources/text-boxes.js [deleted file]
PerformanceTests/Animometer/tests/text/text-boxes.html [deleted file]
PerformanceTests/ChangeLog

index 5848eac..2ef5bb4 100644 (file)
@@ -160,15 +160,7 @@ Suites.push(new Suite("HTML suite",
         {
             url: "bouncing-particles/bouncing-css-images.html?particleWidth=80&particleHeight=80&imageSrc=../resources/yin-yang.svg",
             name: "CSS bouncing SVG images"
-        },
-        {
-            url: "text/layering-text.html",
-            name: "CSS layering text"
-        },
-        {
-            url: "text/text-boxes.html?particleWidth=280&particleHeight=180",
-            name: "CSS text boxes"
-        },
+        }
     ]
 ));
 
index 6f653fe..d26d3b6 100644 (file)
@@ -314,6 +314,76 @@ Insets.elementPadding = function(element)
         parseFloat(styles.paddingTop));
 }
 
+UnitBezier = Utilities.createClass(
+    function(point1, point2)
+    {
+        // First and last points in the Bézier curve are assumed to be (0,0) and (!,1)
+        this._c = point1.multiply(3);
+        this._b = point2.subtract(point1).multiply(3).subtract(this._c);
+        this._a = new Point(1, 1).subtract(this._c).subtract(this._b);
+    }, {
+
+    epsilon: 1e-5,
+    derivativeEpsilon: 1e-6,
+
+    solve: function(x)
+    {
+        return this.sampleY(this.solveForT(x));
+    },
+
+    sampleX: function(t)
+    {
+        return ((this._a.x * t + this._b.x) * t + this._c.x) * t;
+    },
+
+    sampleY: function(t)
+    {
+        return ((this._a.y * t + this._b.y) * t + this._c.y) * t;kkkj
+    },
+
+    sampleDerivativeX: function(t)
+    {
+        return(3 * this._a.x * t + 2 * this._b.x) * t + this._c.x;
+    },
+
+    solveForT: function(x)
+    {
+        var t0, t1, t2, x2, d2, i;
+
+        for (t2 = x, i = 0; i < 8; ++i) {
+            x2 = this.sampleX(t2) - x;
+            if (Math.abs(x2) < this.epsilon)
+                return t2;
+            d2 = this.sampleDerivativeX(t2);
+            if (Math.abs(d2) < this.derivativeEpsilon)
+                break;
+            t2 = t2 - x2 / d2;
+        }
+
+        t0 = 0;
+        t1 = 1;
+        t2 = x;
+
+        if (t2 < t0)
+            return t0;
+        if (t2 > t1)
+            return t1;
+
+        while (t0 < t1) {
+            x2 = this.sampleX(t2);
+            if (Math.abs(x2 - x) < this.epsilon)
+                return t2;
+            if (x > x2)
+                t0 = t2;
+            else
+                t1 = t2;
+            t2 = (t1 - t0) * .5 + t0;
+        }
+
+        return t2;
+    }
+});
+
 SimplePromise = Utilities.createClass(
     function()
     {
index af324fb..0881e32 100644 (file)
@@ -33,6 +33,10 @@ Suites.push(new Suite("Animometer",
             name: "Canvas line segments"
         },
         {
+            url: "master/text.html",
+            name: "A to Z"
+        },
+        {
             url: "master/focus.html",
             name: "Focus"
         },
@@ -41,6 +45,10 @@ Suites.push(new Suite("Animometer",
             name: "Images"
         },
         {
+            url: "master/international.html",
+            name: "Design"
+        },
+        {
             url: "master/particles.html",
             name: "DOM particles, SVG masks"
         },
diff --git a/PerformanceTests/Animometer/tests/master/international.html b/PerformanceTests/Animometer/tests/master/international.html
new file mode 100644 (file)
index 0000000..c15da93
--- /dev/null
@@ -0,0 +1,40 @@
+<!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: 48px;
+        }
+        #stage div {
+            width: 60%;
+            position: absolute;
+            text-align: center;
+        }
+        #template {
+            color: #111;
+        }
+    </style>
+</head>
+<body>
+    <div id="stage">
+        <div id="template">
+            <p>设计</p>
+            <p class="rtl">تصميم</p>
+            <p>дизайн</p>
+            <p>デザイン</p>
+            <p class="rtl">עיצוב</p>
+            <p>디자인</p>
+        </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>
diff --git a/PerformanceTests/Animometer/tests/master/resources/text.js b/PerformanceTests/Animometer/tests/master/resources/text.js
new file mode 100644 (file)
index 0000000..d70b7aa
--- /dev/null
@@ -0,0 +1,104 @@
+(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.4,
+    shimmerMax: 0.5,
+    millisecondsPerRotation: 1000 / (.26 * Math.PI * 2),
+    particleDistance: 1,
+    lightnessMin: 13,
+    lightnessMax: 94,
+
+    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 x = 0;
+        var y = 0;
+        var progress = 0;
+        var stepX = Math.sin(angle) * this.particleDistance;
+        var stepY = Math.cos(angle) * this.particleDistance;
+        for (var i = 0; i < this._offsetIndex; ++i) {
+            x += stepX;
+            y += stepY;
+
+            var element = this.testElements[i];
+
+            var colorProgress = this.shadowFalloff.solve(progress);
+            var shimmer = Math.sin(Stage.dateCounterValue(100) - colorProgress);
+            colorProgress += Utilities.lerp(shimmer, this.shimmerAverage, this.shimmerMax);
+            var interpolatedLightness = Math.round(Utilities.lerp(Math.max(Math.min(colorProgress, 1), 0), this.lightnessMin, this.lightnessMax));
+
+            element.style.color = "hsl(0,0%," + interpolatedLightness + "%)";
+            element.style.transform = "translateX(" + Math.floor(y) + "px) translateY(" + Math.floor(x) + "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;
+
+}());
diff --git a/PerformanceTests/Animometer/tests/master/text.html b/PerformanceTests/Animometer/tests/master/text.html
new file mode 100644 (file)
index 0000000..bc32834
--- /dev/null
@@ -0,0 +1,34 @@
+<!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: 48px;
+        }
+        #stage div {
+            width: 21em;
+            position: absolute;
+        }
+        #template {
+            color: #111;
+        }
+    </style>
+</head>
+<body>
+    <div id="stage">
+        <div id="template">
+            Whenever the black fox jumped the squirrel gazed suspiciously. Amazingly few discotheques provide jukeboxes.
+        </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>
diff --git a/PerformanceTests/Animometer/tests/text/layering-text.html b/PerformanceTests/Animometer/tests/text/layering-text.html
deleted file mode 100644 (file)
index d7abc53..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <link rel="stylesheet" type="text/css" href="../resources/stage.css">
-    <style>
-        .text-layer {
-            position: absolute;
-            left: 0px;
-            top: 0px;
-            padding: 0.72em;
-            background-color: transparent;
-            line-height: 1.1;
-            font-size: 0.72em;
-        }
-        @media screen and (min-device-width: 1800px) {
-            .text-layer {
-                line-height: 1.2;
-                font-size: 0.96em;
-            }
-        }
-    </style>
-</head>
-<body>
-    <div id="stage"></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/layering-text.js"></script>
-</body>
-</html>
diff --git a/PerformanceTests/Animometer/tests/text/resources/layering-text.js b/PerformanceTests/Animometer/tests/text/resources/layering-text.js
deleted file mode 100644 (file)
index 0da93cb..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-(function() {
-
-LayeringTextStage = Utilities.createSubclass(Stage,
-    function()
-    {
-        Stage.call(this);
-    }, {
-
-    initialize: function(benchmark, options)
-    {
-        Stage.prototype.initialize.call(this, benchmark, options);
-        this._textElementParent = this.element;
-        this._textElements = [];
-        this._textItemIndex = 0;
-        this._colorIndex = 0;
-        this._animateCounts = 0;
-    },
-
-    _nextTextItem: function(textItemFlags)
-    {
-        var textItem = LayeringTextStage.textItems[this._textItemIndex];
-        Utilities.extendObject(textItemFlags, LayeringTextStage.textItemsFlags[this._textItemIndex]);
-        this._textItemIndex = (this._textItemIndex + 1) % LayeringTextStage.textItems.length;
-        return textItem;
-    },
-
-    _previousTextItem: function(textItemFlags)
-    {
-        this._textItemIndex = (this._textItemIndex + LayeringTextStage.textItems.length - 1) % LayeringTextStage.textItems.length;
-        Utilities.extendObject(textItemFlags, LayeringTextStage.textItemsFlags[this._textItemIndex]);
-        return LayeringTextStage.textItems[this._textItemIndex];
-    },
-
-    _pushTextElement: function()
-    {
-        var textItemFlags = {};
-        var textItem = this._nextTextItem(textItemFlags);
-        for ( ; textItemFlags.isClosing; textItem = this._nextTextItem(textItemFlags))
-            this._textElementParent = this._textElementParent.parentNode;
-
-        var parseResult = LayeringTextStage.parseTextItem(textItem);
-        textItem = textItem.substring(parseResult.tagStart.length, textItem.length - parseResult.tagEnd.length);
-
-        var textElement = document.createElement(parseResult.nodeName);
-
-        for (var attrname in parseResult.args)
-            textElement.setAttribute(attrname, parseResult.args[attrname]);
-
-        this._textElementParent.appendChild(textElement);
-
-        if (!parseResult.tagEnd.length)
-            this._textElementParent = textElement;
-
-        textElement.innerHTML = textItem;
-
-        this._textElements.push(textElement);
-        return this._textElements.length;
-    },
-
-    _popTextElement: function()
-    {
-        var textItemFlags = {};
-        var textItem = this._previousTextItem(textItemFlags);
-        for ( ; textItemFlags.isClosing; textItem = this._previousTextItem(textItemFlags))
-            this._textElementParent = this._textElementParent.lastChild;
-
-        if (textItemFlags.isOpening)
-            this._textElementParent = this._textElementParent.parentNode;
-
-        this._textElements[this._textElements.length - 1].remove();
-
-        this._textElements.pop();
-        return this._textElements.length;
-    },
-
-    _colorTextItem: function(color)
-    {
-        var textElementIndex = LayeringTextStage.colorIndexToTextElementIndex(this._colorIndex);
-        for ( ; textElementIndex < this._textElements.length; textElementIndex += LayeringTextStage.insertableTextItems)
-            this._textElements[textElementIndex].style.backgroundColor = color;
-    },
-
-    animate: function(timeDelta)
-    {
-        this._colorTextItem("transparent");
-        this._colorIndex = (this._colorIndex + 1) % LayeringTextStage.colorableTextItems;
-        this._colorTextItem("YellowGreen");
-
-        var blackTextElements = Math.min(this._textElements.length, LayeringTextStage.insertableTextItems);
-        var i = 0;
-        for ( ; i < this._textElements.length - blackTextElements; ++i)
-            this._textElements[i].style.color = (this._animateCounts & 1) ? "LightYellow" : "white";
-
-        for ( ; i < this._textElements.length; ++i)
-            this._textElements[i].style.color = "black";
-
-        ++this._animateCounts;
-    },
-
-    tune: function(count)
-    {
-        if (count == 0)
-            return;
-
-        if (count > 0) {
-            for (var i = 0; i < count; ++i)
-                this._pushTextElement();
-            return;
-        }
-
-        count = Math.min(-count, this._textElements.length);
-        for (var i = 0; i < count; ++i)
-            this._popTextElement();
-    },
-
-    complexity: function()
-    {
-        return this._textElements.length;
-    }
-});
-
-Utilities.extendObject(LayeringTextStage, {
-    textItems: [
-        "<div class='text-layer'>",
-            "<h2>Types of benchmarks</h2>",
-            "<ol>",
-                "<li>Real program",
-                    "<ul>",
-                        "<li>word processing software</li>",
-                        "<li>tool software of CAD</li>",
-                        "<li>user's application software (i.e.: MIS)</li>",
-                    "</ul>",
-                "</li>",
-                "<li>Kernel",
-                    "<ul>",
-                        "<li>contains key codes</li>",
-                        "<li>normally abstracted from actual program</li>",
-                        "<li>popular kernel: Livermore loop</li>",
-                        "<li>linpack benchmark (contains basic linear algebra subroutine written in FORTRAN language)</li>",
-                        "<li>results are represented in MFLOPS</li>",
-                    "</ul>",
-                "</li>",
-                "<li>Synthetic Benchmark",
-                    "<ul>",
-                        "<li>Procedure for programming synthetic benchmark:",
-                            "<ul>",
-                                "<li>take statistics of all types of operations from many application programs</li>",
-                                "<li>get proportion of each operation</li>",
-                                "<li>write program based on the proportion above</li>",
-                            "</ul>",
-                        "</li>",
-                        "<li>Types of Synthetic Benchmark are:",
-                            "<ul>",
-                                "<li>Whetstone</li>",
-                                "<li>Dhrystone</li>",
-                            "</ul>",
-                        "</li>",
-                        "<li>These were the first general purpose industry standard computer benchmarks. They do not necessarily obtain high scores on modern pipelined computers.</li>",
-                    "</ul>",
-                "</li>",
-                "<li>I/O benchmarks</li>",
-                "<li>Database benchmarks: to measure the throughput and response times of database management systems (DBMS')</li>",
-                "<li>Parallel benchmarks: used on machines with multiple cores, processors or systems consisting of multiple machines</li>",
-            "</ol>",
-            "<h2>Common benchmarks</h2>",
-            "<ul>",
-                "<li>Business Applications Performance Corporation (BAPCo)</li>",
-                "<li>Embedded Microprocessor Benchmark Consortium (EEMBC)</li>",
-                "<li>Standard Performance Evaluation Corporation (SPEC), in particular their SPECint and SPECfp</li>",
-                "<li>Transaction Processing Performance Council (TPC)</li>",
-                "<li>Coremark: Embedded computing benchmark</li>",
-            "</ul>",
-            "<h3>Open source benchmarks</h3>",
-            "<ul>",
-                "<li>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.</li>",
-                "<li>Bonnie++: filesystem and hard drive benchmark</li>",
-                "<li>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.</li>",
-            "</ul>",
-        "</div>"
-    ],
-
-    parseTextItem: function(textItem)
-    {
-        var parseResult = {};
-        parseResult.tagStart = textItem.match(/<(.*?)>/g)[0];
-        var spaceIndex = parseResult.tagStart.indexOf(" ");
-        parseResult.nodeName = parseResult.tagStart.substring(1, spaceIndex != -1 ? spaceIndex : parseResult.tagStart.length - 1);
-        parseResult.args = spaceIndex != -1 ? Utilities.parseArguments(parseResult.tagStart.substring(spaceIndex + 1, parseResult.tagStart.length - 1)) : {};
-        var tagEnd = "</" + parseResult.nodeName + ">";
-        parseResult.tagEnd = textItem.endsWith(tagEnd) ? tagEnd : "";
-        return parseResult;
-    },
-
-    isOpeningTextItem: function(textItem)
-    {
-        return !LayeringTextStage.parseTextItem(textItem).tagEnd.length;
-    },
-
-    isClosingTextItem: function(textItem)
-    {
-        return textItem.indexOf("/") == +1;
-    },
-
-    isColorableTextItem: function(textItemFlags)
-    {
-        return !(textItemFlags.isOpening || textItemFlags.isClosing);
-    },
-
-    isInsertableTextItem: function(textItemFlags)
-    {
-        return !textItemFlags.isClosing;
-    },
-
-    colorIndexToTextElementIndex: function(colorIndex)
-    {
-        var textElementIndex = 0;
-        var index = 0;
-
-        for (var textItemIndex = 0; textItemIndex < LayeringTextStage.textItemsFlags.length; ++textItemIndex) {
-            if (LayeringTextStage.isColorableTextItem(LayeringTextStage.textItemsFlags[textItemIndex])) {
-                if (++index > colorIndex)
-                    break;
-            }
-            if (LayeringTextStage.isInsertableTextItem(LayeringTextStage.textItemsFlags[textItemIndex]))
-                ++textElementIndex;
-        }
-
-        return textElementIndex;
-    }
-});
-
-Utilities.extendObject(LayeringTextStage, {
-    textItemsFlags: LayeringTextStage.textItems.map(function(textItem)
-    {
-       var textItemFlags = {};
-       textItemFlags.isOpening = LayeringTextStage.isOpeningTextItem(textItem);
-       textItemFlags.isClosing = LayeringTextStage.isClosingTextItem(textItem);
-       return textItemFlags;
-    })
-});
-
-Utilities.extendObject(LayeringTextStage, {
-    colorableTextItems: LayeringTextStage.textItemsFlags.filter(function(textItemFlags)
-    {
-        return LayeringTextStage.isColorableTextItem(textItemFlags);
-    }).length,
-
-    insertableTextItems: LayeringTextStage.textItemsFlags.filter(function(textItemFlags)
-    {
-        return LayeringTextStage.isInsertableTextItem(textItemFlags);
-    }).length
-});
-
-LayeringTextBenchmark = Utilities.createSubclass(Benchmark,
-    function(options)
-    {
-        Benchmark.call(this, new LayeringTextStage(), options);
-    }
-);
-
-window.benchmarkClass = LayeringTextBenchmark;
-
-})();
-
diff --git a/PerformanceTests/Animometer/tests/text/resources/text-boxes.js b/PerformanceTests/Animometer/tests/text/resources/text-boxes.js
deleted file mode 100644 (file)
index 6a3523e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-(function() {
-
-BouncingTextBox = Utilities.createSubclass(BouncingParticle,
-    function(stage, sampleText)
-    {
-        BouncingParticle.call(this, stage);
-
-        this.element = document.createElement("div");
-        this.element.classList.add('particle');
-        this.element.style.width = this.size.x + "px";
-        this.element.style.height = this.size.y + "px";
-        this.element.textContent = sampleText;
-
-        stage.element.appendChild(this.element);
-        this._move();
-    }, {
-
-    _move: function()
-    {
-        this.element.style.left = this.position.x + "px";
-        this.element.style.top = this.position.y + "px";
-    },
-
-    animate: function(timeDelta)
-    {
-        BouncingParticle.prototype.animate.call(this, timeDelta);
-        this._move();
-    }
-});
-
-BouncingTextBoxStage = Utilities.createSubclass(BouncingParticlesStage,
-    function()
-    {
-        BouncingParticlesStage.call(this);
-        this._sampleText = document.getElementById('sample-text').textContent;
-    }, {
-
-    createParticle: function()
-    {
-        return new BouncingTextBox(this, this._sampleText);
-    },
-
-    particleWillBeRemoved: function(particle)
-    {
-        particle.element.remove();
-    }
-});
-
-BouncingTextBoxBenchmark = Utilities.createSubclass(Benchmark,
-    function(options)
-    {
-        Benchmark.call(this, new BouncingTextBoxStage(), options);
-    }
-);
-
-window.benchmarkClass = BouncingTextBoxBenchmark;
-
-})();
diff --git a/PerformanceTests/Animometer/tests/text/text-boxes.html b/PerformanceTests/Animometer/tests/text/text-boxes.html
deleted file mode 100644 (file)
index 6c489c3..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <style>
-        .text-layer {
-            position: absolute;
-            left: 0px;
-            top: 0px;
-            padding: 0.72em;
-            background-color: transparent;
-            line-height: 1.1;
-            font-size: 0.72em;
-        }
-        @media screen and (min-device-width: 1800px) {
-            .text-layer {
-                line-height: 1.2;
-                font-size: 0.96em;
-            }
-        }
-
-        .particle {
-            position: absolute;
-            width: 280px;
-            font-size: 12px;
-            font-family: sans-serif;
-            padding: 3px;
-        }
-
-        #sample-text {
-            display: none;
-        }
-    </style>
-    <link rel="stylesheet" type="text/css" href="../resources/stage.css">
-</head>
-<body>
-    <div id="sample-text" class="particle">I can eat glass and it doesn't hurt me.
-        Vitrum edere possum; mihi non nocet.
-        Je peux manger du verre, ça ne me fait pas mal.
-        काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम
-        אני יכול לאכול זכוכית וזה לא מזיק לי.
-        ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει.
-        أنا قادر على أكل الزجاج و هذا لا يؤلمني.
-        ฉันกินกระจกได้ แต่มันไม่ทำให้ฉันเจ็บ
-        मैं काँच खा सकता हूँ और मुझे उससे कोई चोट नहीं पहुंचती.
-        我能吞下玻璃而不伤身体。
-        私はガラスを食べられます。それは私を傷つけません。
-        나는 유리를 먹을 수 있어요. 그래도 아프지 않아요
-        Я можу їсти скло, і воно мені не зашкодить.
-        ನನಗೆ ಹಾನಿ ಆಗದೆ, ನಾನು ಗಜನ್ನು ತಿನಬಹುದು
-    </div>
-    <div id="stage"></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="../bouncing-particles/resources/bouncing-particles.js"></script>
-    <script charset="utf-8" src="resources/text-boxes.js"></script>
-</body>
-</html>
index 5be89f3..5862394 100644 (file)
@@ -1,5 +1,31 @@
 2016-03-09  Jon Lee  <jonlee@apple.com>
 
+        Add text tests
+        https://bugs.webkit.org/show_bug.cgi?id=155257
+
+        Reviewed by Simon Fraser.
+
+        * Animometer/resources/extensions.js:
+        (UnitBezier.Utilities.createClass): Add a class that computes Bezier points
+        assuming that two of the control points are at (0,0) and (1,1). Taken from
+        WebCore/platform/graphics/UnitBezier.h
+        * Animometer/resources/runner/tests.js: Add a test for English text and one
+        for international text.
+        * Animometer/tests/master/international.html: Added.
+        * Animometer/tests/master/resources/text.js: Added. The test assumes there is
+        #template div which it will copy. The copies are placed behind the template, and
+        are set with different colors each frame. They are moved around with CSS transform.
+        * Animometer/tests/master/text.html: Added.
+
+        Remove the other text tests, since these ones cover the same techniques.
+        * Animometer/tests/text/layering-text.html: Removed.
+        * Animometer/tests/text/resources/layering-text.js: Removed.
+        * Animometer/tests/text/resources/text-boxes.js: Removed.
+        * Animometer/tests/text/text-boxes.html: Removed.
+        * Animometer/resources/debug-runner/tests.js:
+
+2016-03-09  Jon Lee  <jonlee@apple.com>
+
         Add a new image test
         https://bugs.webkit.org/show_bug.cgi?id=155232