Modified: trunk/PerformanceTests/Animometer/resources/debug-runner/tests.js (194410 => 194411)
--- trunk/PerformanceTests/Animometer/resources/debug-runner/tests.js 2015-12-24 03:43:23 UTC (rev 194410)
+++ trunk/PerformanceTests/Animometer/resources/debug-runner/tests.js 2015-12-24 04:26:36 UTC (rev 194411)
@@ -97,6 +97,10 @@
url: "text/layering-text.html",
name: "CSS layering text"
},
+ {
+ url: "text/text-boxes.html?particleWidth=280&particleHeight=180",
+ name: "CSS text boxes"
+ },
]
));
Added: trunk/PerformanceTests/Animometer/tests/text/resources/text-boxes.js (0 => 194411)
--- trunk/PerformanceTests/Animometer/tests/text/resources/text-boxes.js (rev 0)
+++ trunk/PerformanceTests/Animometer/tests/text/resources/text-boxes.js 2015-12-24 04:26:36 UTC (rev 194411)
@@ -0,0 +1,65 @@
+function BouncingTextBox(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();
+}
+
+BouncingTextBox.prototype = Object.create(BouncingParticle.prototype);
+BouncingTextBox.prototype.constructor = BouncingTextBox;
+
+BouncingTextBox.prototype._move = function()
+{
+ this.element.style.left = this._position.x + "px";
+ this.element.style.top = this._position.y + "px";
+}
+
+BouncingTextBox.prototype.animate = function(timeDelta)
+{
+ BouncingParticle.prototype.animate.call(this, timeDelta);
+ this._move();
+}
+
+function BouncingTextBoxStage(element, options)
+{
+ BouncingParticlesStage.call(this, element, options);
+ this._sampleText = document.getElementById('sample-text').textContent;
+}
+
+BouncingTextBoxStage.prototype = Object.create(BouncingParticlesStage.prototype);
+BouncingTextBoxStage.prototype.constructor = BouncingTextBoxStage;
+
+BouncingTextBoxStage.prototype.createParticle = function()
+{
+ return new BouncingTextBox(this, this._sampleText);
+}
+
+BouncingTextBoxStage.prototype.particleWillBeRemoved = function(particle)
+{
+ particle.element.remove();
+}
+
+function BouncingTextBoxsBenchmark(suite, test, options, recordTable, progressBar)
+{
+ BouncingParticlesBenchmark.call(this, suite, test, options, recordTable, progressBar);
+}
+
+BouncingTextBoxsBenchmark.prototype = Object.create(BouncingParticlesBenchmark.prototype);
+BouncingTextBoxsBenchmark.prototype.constructor = BouncingTextBoxsBenchmark;
+
+BouncingTextBoxsBenchmark.prototype.createStage = function(element)
+{
+ return new BouncingTextBoxStage(element, this._options);
+}
+
+window.benchmarkClient.create = function(suite, test, options, recordTable, progressBar)
+{
+ return new BouncingTextBoxsBenchmark(suite, test, options, recordTable, progressBar);
+}
Added: trunk/PerformanceTests/Animometer/tests/text/text-boxes.html (0 => 194411)
--- trunk/PerformanceTests/Animometer/tests/text/text-boxes.html (rev 0)
+++ trunk/PerformanceTests/Animometer/tests/text/text-boxes.html 2015-12-24 04:26:36 UTC (rev 194411)
@@ -0,0 +1,64 @@
+<!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=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script src=""
+ <script charset="utf-8" src=""
+</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>
+</body>
+</html>
Modified: trunk/PerformanceTests/ChangeLog (194410 => 194411)
--- trunk/PerformanceTests/ChangeLog 2015-12-24 03:43:23 UTC (rev 194410)
+++ trunk/PerformanceTests/ChangeLog 2015-12-24 04:26:36 UTC (rev 194411)
@@ -1,3 +1,26 @@
+2015-12-23 Simon Fraser <[email protected]>
+
+ Add an Animometer developer test which animates text-rich boxes
+ https://bugs.webkit.org/show_bug.cgi?id=152544
+
+ Reviewed by Zalan Bujtas.
+
+ Add a test that draws lots of international text. This is a particle test,
+ moving the boxes around with absolution positioning.
+
+ * Animometer/resources/debug-runner/tests.js:
+ * Animometer/tests/text/resources/text-boxes.js: Added.
+ (BouncingTextBox):
+ (BouncingTextBox.prototype._move):
+ (BouncingTextBox.prototype.animate):
+ (BouncingTextBoxStage):
+ (BouncingTextBoxStage.prototype.createParticle):
+ (BouncingTextBoxStage.prototype.particleWillBeRemoved):
+ (BouncingTextBoxsBenchmark):
+ (BouncingTextBoxsBenchmark.prototype.createStage):
+ (window.benchmarkClient.create):
+ * Animometer/tests/text/text-boxes.html: Added.
+
2015-12-23 Jon Lee <[email protected]>
Split benchmark into two different pages