Diff
Modified: trunk/PerformanceTests/ChangeLog (164077 => 164078)
--- trunk/PerformanceTests/ChangeLog 2014-02-14 01:06:53 UTC (rev 164077)
+++ trunk/PerformanceTests/ChangeLog 2014-02-14 01:17:14 UTC (rev 164078)
@@ -1,5 +1,24 @@
2014-02-13 Zoltan Horvath <zol...@webkit.org>
+ [CSS Shapes] Add performance test for complex polygon with shape-margin
+ https://bugs.webkit.org/show_bug.cgi?id=128769
+
+ Reviewed by Ryosuke Niwa.
+
+ This patch modifies the logic of createShapeOutsideTest to accept multiple
+ CSS properties from the test. The patch adds performance test for complex
+ polygon shape (self intersecting at multiple places) case, moreover we
+ apply shape-margin on the polygon also.
+
+ * Layout/Shapes/ShapeOutsideContentBox.html:
+ * Layout/Shapes/ShapeOutsideInset.html:
+ * Layout/Shapes/ShapeOutsidePolygonWithMargin.html: Added.
+ * Layout/Shapes/ShapeOutsideRaster.html:
+ * Layout/Shapes/ShapeOutsideSimplePolygon.html:
+ * Layout/Shapes/resources/shapes.js:
+
+2014-02-13 Zoltan Horvath <zol...@webkit.org>
+
[CSS Shapes] Add performance test for raster shape
https://bugs.webkit.org/show_bug.cgi?id=128746
Modified: trunk/PerformanceTests/Layout/Shapes/ShapeOutsideContentBox.html (164077 => 164078)
--- trunk/PerformanceTests/Layout/Shapes/ShapeOutsideContentBox.html 2014-02-14 01:06:53 UTC (rev 164077)
+++ trunk/PerformanceTests/Layout/Shapes/ShapeOutsideContentBox.html 2014-02-14 01:17:14 UTC (rev 164078)
@@ -8,8 +8,12 @@
<body>
<pre id="log"></pre>
<script>
- var shape = "content-box";
- PerfTestRunner.measureTime(createShapeOutsideTest("200px", "200px", shape, 1000));
+ var properties = {
+ width: "200px",
+ height: "200px",
+ webkitShapeOutside: "content-box"
+ };
+ PerfTestRunner.measureTime(createShapeOutsideTest(properties, 1000));
</script>
</body>
</html>
Modified: trunk/PerformanceTests/Layout/Shapes/ShapeOutsideInset.html (164077 => 164078)
--- trunk/PerformanceTests/Layout/Shapes/ShapeOutsideInset.html 2014-02-14 01:06:53 UTC (rev 164077)
+++ trunk/PerformanceTests/Layout/Shapes/ShapeOutsideInset.html 2014-02-14 01:17:14 UTC (rev 164078)
@@ -8,8 +8,12 @@
<body>
<pre id="log"></pre>
<script>
- var shape = "inset(10px)";
- PerfTestRunner.measureTime(createShapeOutsideTest("200px", "200px", shape, 1000));
+ var properties = {
+ width: "200px",
+ height: "200px",
+ webkitShapeOutside: "inset(10px)"
+ };
+ PerfTestRunner.measureTime(createShapeOutsideTest(properties, 1000));
</script>
</body>
</html>
Added: trunk/PerformanceTests/Layout/Shapes/ShapeOutsidePolygonWithMargin.html (0 => 164078)
--- trunk/PerformanceTests/Layout/Shapes/ShapeOutsidePolygonWithMargin.html (rev 0)
+++ trunk/PerformanceTests/Layout/Shapes/ShapeOutsidePolygonWithMargin.html 2014-02-14 01:17:14 UTC (rev 164078)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <link rel="stylesheet" href="" type="text/css"></link>
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <pre id="log"></pre>
+ <script>
+ var properties = {
+ width: "200px",
+ height: "200px",
+ webkitShapeOutside: "polygon(0 0, 200px 40px, 0px 40px, 200px 80px, 0px 80px, 200px 120px, 0px 120px, 200px 160px, 0px 160px, 200px 200px)",
+ webkitShapeMargin: "5px"
+ };
+ PerfTestRunner.measureTime(createShapeOutsideTest(properties, 1000));
+ </script>
+ </body>
+</html>
Modified: trunk/PerformanceTests/Layout/Shapes/ShapeOutsideRaster.html (164077 => 164078)
--- trunk/PerformanceTests/Layout/Shapes/ShapeOutsideRaster.html 2014-02-14 01:06:53 UTC (rev 164077)
+++ trunk/PerformanceTests/Layout/Shapes/ShapeOutsideRaster.html 2014-02-14 01:17:14 UTC (rev 164078)
@@ -8,8 +8,12 @@
<body>
<pre id="log"></pre>
<script>
- var shape = "url(resources/shape.gif)";
- PerfTestRunner.measureTime(createShapeOutsideTest("200px", "200px", shape, 1000));
+ var properties = {
+ width: "200px",
+ height: "200px",
+ webkitShapeOutside: "url(resources/shape.gif)"
+ };
+ PerfTestRunner.measureTime(createShapeOutsideTest(properties, 1000));
</script>
</body>
</html>
Modified: trunk/PerformanceTests/Layout/Shapes/ShapeOutsideSimplePolygon.html (164077 => 164078)
--- trunk/PerformanceTests/Layout/Shapes/ShapeOutsideSimplePolygon.html 2014-02-14 01:06:53 UTC (rev 164077)
+++ trunk/PerformanceTests/Layout/Shapes/ShapeOutsideSimplePolygon.html 2014-02-14 01:17:14 UTC (rev 164078)
@@ -8,8 +8,12 @@
<body>
<pre id="log"></pre>
<script>
- var shape = "polygon(0 0, 200px 100px, 0px 200px)";
- PerfTestRunner.measureTime(createShapeOutsideTest("200px", "200px", shape, 1000));
+ var properties = {
+ width: "200px",
+ height: "200px",
+ webkitShapeOutside: "polygon(0 0, 200px 100px, 0px 200px)"
+ };
+ PerfTestRunner.measureTime(createShapeOutsideTest(properties, 1000));
</script>
</body>
</html>
Modified: trunk/PerformanceTests/Layout/Shapes/resources/shapes.js (164077 => 164078)
--- trunk/PerformanceTests/Layout/Shapes/resources/shapes.js 2014-02-14 01:06:53 UTC (rev 164077)
+++ trunk/PerformanceTests/Layout/Shapes/resources/shapes.js 2014-02-14 01:17:14 UTC (rev 164078)
@@ -22,16 +22,16 @@
return paragraph;
}
- function createFloatingNode(width, height, shape) {
+ function createFloatingNode(properties) {
if (!templateFloatingNode) {
templateFloatingNode = document.createElement("div");
templateFloatingNode.className = "floatingObject";
}
var float = templateFloatingNode.cloneNode(false);
- float.style.width = width;
- float.style.height = height;
- float.style.webkitShapeOutside = shape;
+ for (prop in properties) {
+ float.style[prop] = properties[prop];
+ }
return float;
}
@@ -41,10 +41,10 @@
}
}
- function createFloatingObjects(width, height, shape, floatingObjectCount) {
+ function createFloatingObjects(properties, floatingObjectCount) {
var testBox = document.createElement("div");
for (var i = 0; i < floatingObjectCount; ++i) {
- testBox.appendChild(createFloatingNode(width, height, shape));
+ testBox.appendChild(createFloatingNode(properties));
testBox.appendChild(createParagraphNode())
}
testBox.className = "testBox";
@@ -58,13 +58,13 @@
}
}
- function createShapeOutsideTest(width, height, shape, shapeObjectCount) {
+ function createShapeOutsideTest(properties, shapeObjectCount) {
shapeObjectCount = shapeObjectCount || DEFAULT_SHAPE_OBJECT_COUNT;
- var floatingObjects = createFloatingObjects(width, height, shape, shapeObjectCount);
+ var floatingObjects = createFloatingObjects(properties, shapeObjectCount);
document.body.appendChild(floatingObjects);
return {
- description: "Testing shapes with " + shape +" using " + shapeObjectCount + " shapes.",
+ description: "Testing shapes with " + properties['webkitShapeOutside'] +" using " + shapeObjectCount + " shapes.",
run: function() {
applyFloating();
document.body.offsetTop;