Update benchmark test suite
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Jan 2016 03:54:36 +0000 (03:54 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Jan 2016 03:54:36 +0000 (03:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152679

Reviewed by Simon Fraser.

Fix tests for other browsers.

* Animometer/resources/extensions.js:
(Point.elementClientSize): Some browsers return 0 for SVG clientWidth and clientHeight.
Use getBoundingClientRect() instead.
* Animometer/tests/misc/resources/canvas-electrons.js:
(CanvasElectron.prototype._draw): Some browsers don't support ellipse.

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

PerformanceTests/Animometer/resources/extensions.js
PerformanceTests/Animometer/tests/misc/resources/canvas-electrons.js
PerformanceTests/ChangeLog

index f39bcaf..f31b80e 100644 (file)
@@ -66,7 +66,8 @@ Point.pointOnEllipse = function(angle, radiuses)
 
 Point.elementClientSize = function(element)
 {
-    return new Point(element.clientWidth, element.clientHeight);
+    var rect = element.getBoundingClientRect();
+    return new Point(rect.width, rect.height);
 }
 
 Point.prototype =
index f7b0a65..ed84fa0 100644 (file)
@@ -34,9 +34,11 @@ CanvasElectron.prototype = {
             this._context.fillStyle = this._color;
 
             // Draw the orbit of the object.
-            this._context.beginPath();
-            this._context.ellipse(this._stageSize.center.x, this._stageSize.center.y, this._orbitRadiuses.x, this._orbitRadiuses.y, 0, 0, 2 * Math.PI);
-            this._context.stroke();
+            if (this._context.ellipse) {
+                this._context.beginPath();
+                this._context.ellipse(this._stageSize.center.x, this._stageSize.center.y, this._orbitRadiuses.x, this._orbitRadiuses.y, 0, 0, 2 * Math.PI);
+                this._context.stroke();
+            }
 
             // Draw the object.
             this._context.beginPath();
index c1cca5f..512ca1f 100644 (file)
@@ -1,5 +1,20 @@
 2016-01-07  Jon Lee  <jonlee@apple.com>
 
+        Update benchmark test suite
+        https://bugs.webkit.org/show_bug.cgi?id=152679
+
+        Reviewed by Simon Fraser.
+
+        Fix tests for other browsers.
+
+        * Animometer/resources/extensions.js:
+        (Point.elementClientSize): Some browsers return 0 for SVG clientWidth and clientHeight.
+        Use getBoundingClientRect() instead.
+        * Animometer/tests/misc/resources/canvas-electrons.js:
+        (CanvasElectron.prototype._draw): Some browsers don't support ellipse.
+
+2016-01-07  Jon Lee  <jonlee@apple.com>
+
         Add a waitUntilReady() step
         https://bugs.webkit.org/show_bug.cgi?id=152862