Diff
Modified: trunk/LayoutTests/ChangeLog (131609 => 131610)
--- trunk/LayoutTests/ChangeLog 2012-10-17 16:09:10 UTC (rev 131609)
+++ trunk/LayoutTests/ChangeLog 2012-10-17 16:27:06 UTC (rev 131610)
@@ -1,3 +1,37 @@
+2012-10-17 Hans Muller <[email protected]>
+
+ [CSS Exclusions] Additional simple polygon tests
+ https://bugs.webkit.org/show_bug.cgi?id=98548
+
+ Reviewed by Dirk Schulze.
+
+ Added a pair of CSS Exclusions shape-inside ref-tests for regular polygons
+ with 8 and 16 sides. Also made some small revisions to the supporting code,
+ simple-polyon.js, and the existing simple polygon tests, and to localize and
+ correct the conversion from float to layout coordinates. All of the tests
+ now round/truncate the left edge of line segment intervals depending on whether
+ subpixel layout is enabled.
+
+ * fast/exclusions/resources/simple-polygon.js:
+ (createRegularPolygonVertices):
+ (polygonXIntercepts):
+ (simulatePolygonShape):
+ (generateSimulatedPolygonShapeInsideElement):
+ (createPolygonShapeInsideTestCase):
+ (createPolygonShapeInsideTestCaseExpected):
+ * fast/exclusions/shape-inside/shape-inside-regular-polygon16-expected.html: Added.
+ * fast/exclusions/shape-inside/shape-inside-regular-polygon16.html: Added.
+ * fast/exclusions/shape-inside/shape-inside-regular-polygon8-expected.html: Added.
+ * fast/exclusions/shape-inside/shape-inside-regular-polygon8.html: Added.
+ * fast/exclusions/shape-inside/shape-inside-simple-polygon-001-expected.html:
+ * fast/exclusions/shape-inside/shape-inside-simple-polygon-001.html:
+ * fast/exclusions/shape-inside/shape-inside-simple-polygon-002-expected.html:
+ * fast/exclusions/shape-inside/shape-inside-simple-polygon-002.html:
+ * fast/exclusions/shape-inside/shape-inside-simple-polygon-003-expected.html:
+ * fast/exclusions/shape-inside/shape-inside-simple-polygon-003.html:
+ * fast/exclusions/shape-inside/shape-inside-simple-polygon-004-expected.html:
+ * fast/exclusions/shape-inside/shape-inside-simple-polygon-004.html:
+
2012-10-17 Vsevolod Vlasov <[email protected]>
Web Inspector: [Regression] Undoing script changes does not restore breakpoints.
Modified: trunk/LayoutTests/fast/exclusions/resources/simple-polygon.js (131609 => 131610)
--- trunk/LayoutTests/fast/exclusions/resources/simple-polygon.js 2012-10-17 16:09:10 UTC (rev 131609)
+++ trunk/LayoutTests/fast/exclusions/resources/simple-polygon.js 2012-10-17 16:27:06 UTC (rev 131610)
@@ -13,6 +13,30 @@
};
}
+function createRegularPolygonVertices(size, nSides)
+{
+ var radius = size / (2 * Math.cos(Math.PI / nSides));
+ var inset = size / 2 + 20;
+ var vertices = [];
+
+ for (var i = 0; i < nSides/2; i++) {
+ var a = (1 + 2*i) * (Math.PI / nSides);
+ vertices[i] = {x: Math.floor(radius * Math.cos(a)), y: Math.floor(radius * Math.sin(a))};
+ vertices[nSides - i - 1] = {x: vertices[i].x, y: -vertices[i].y} // Y axis symmetry
+ }
+
+ for (var i = 0; i < nSides; i++) {
+ vertices[i].x += inset;
+ vertices[i].y += inset;
+ }
+
+ return vertices;
+}
+
+function subpixelRound(f) {
+ return Math.floor(!hasSubpixelSupport ? f : (Math.floor(f * 64) + 32) / 64); // see FractionLayoutUnit::round()
+}
+
// Return two X intercepts of the horizontal line at y. We're assuming that the polygon
// 0 or 2 intercepts for all y.Of course this isn't true for polygons in general,
// just the ones used by the test cases supported by this file.
@@ -53,7 +77,10 @@
}
}
- return (xIntercepts.length == 2) ? [Math.min.apply(null, xIntercepts), Math.max.apply(null, xIntercepts)] : [];
+ if (xIntercepts.length != 2)
+ return [];
+
+ return [subpixelRound(Math.min.apply(null, xIntercepts)), Math.floor(Math.max.apply(null, xIntercepts))];
}
function polygonLineIntercepts(polygon, y, lineHeight) {
@@ -109,7 +136,11 @@
var svgPolygon = document.createElementNS(svgNS, "polygon");
svgPolygon.setAttribute("points", polygon.vertices.map( function(p) { return p.x + "," + p.y; } ).join(" "));
svgPolygon.setAttribute("fill", "#636363");
- document.getElementById(elementId).appendChild(svgPolygon);
+
+ var svgElement = document.getElementById(elementId);
+ svgElement.style.width = polygon.maxX + "px";
+ svgElement.style.height = polygon.maxY + "px";
+ svgElement.appendChild(svgPolygon);
}
function simulatePolygonShape(elementId, stylesheet, polygon, lineHeight) {
@@ -131,8 +162,8 @@
for (var y = polygon.minY; y < polygon.maxY; y += lineHeight) {
var xIntercepts = polygonLineIntercepts(polygon, y, lineHeight);
- var left = Math.ceil(xIntercepts[0 ]);
- var right = Math.floor(xIntercepts[1]);
+ var left = xIntercepts[0];
+ var right = xIntercepts[1];
var paddingLeft = document.createElement("div");
paddingLeft.setAttribute("class", "float left");
@@ -166,8 +197,8 @@
for (var y = polygon.minY; y < polygon.maxY; y += lineHeight) {
var xIntercepts = polygonLineIntercepts(polygon, y, lineHeight);
- var left = Math.ceil(xIntercepts[0 ]);
- var right = Math.floor(xIntercepts[1]);
+ var left = xIntercepts[0];
+ var right = xIntercepts[1];
var paddingLeft = document.createElement("div");
paddingLeft.setAttribute("class", "float left");
@@ -188,15 +219,12 @@
element.appendChild(p);
}
-
-
-
function positionInformativeText(elementId, stylesheet, polygon, lineHeight)
{
stylesheet.insertRule("#" + elementId + " { position: absolute; top: " + (polygon.maxY + lineHeight) + "px;}");
}
-function createPolygonShapeInsideTestCase(vertices) {
+function createPolygonShapeInsideTestCase() {
var stylesheet = document.getElementById("stylesheet").sheet;
var polygon = createPolygon(vertices);
generatePolygonShapeInsideElement("polygon-shape-inside", stylesheet, polygon, lineHeight);
@@ -204,11 +232,10 @@
positionInformativeText("informative-text", stylesheet, polygon, lineHeight)
}
-function createPolygonShapeInsideTestCaseExpected(vertices) {
+function createPolygonShapeInsideTestCaseExpected() {
var stylesheet = document.getElementById("stylesheet").sheet;
var polygon = createPolygon(vertices);
generateSimulatedPolygonShapeInsideElement("polygon-shape-inside", stylesheet, polygon, lineHeight);
generatePolygonSVGElements("polygon-svg-shape", stylesheet, polygon, lineHeight);
positionInformativeText("informative-text", stylesheet, polygon, lineHeight)
}
-
Added: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon16-expected.html (0 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon16-expected.html (rev 0)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon16-expected.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+ if (window.internals)
+ window.internals.settings.setCSSExclusionsEnabled(true);
+
+ var vertices = createRegularPolygonVertices(400, 16); // 400x400 16 sided regular polygon
+ var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCaseExpected();
+ }
+</script>
+
+<style id="stylesheet">
+ #polygon-shape-inside, #polygon-svg-shape {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ }
+</style>
+</head>
+
+<body _onload_="init()">
+ <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
+ <div id="polygon-shape-inside"></div>
+ <p id="informative-text">
+ This test requires the Ahem font. It creates a polygonal shape-inside and a matching
+ filled SVG polygon. The content should just fill the shape with alternating black and
+ empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
+</body>
+
+</html>
Added: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon16.html (0 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon16.html (rev 0)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon16.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+ if (window.internals)
+ window.internals.settings.setCSSExclusionsEnabled(true);
+
+ var vertices = createRegularPolygonVertices(400, 16); // 400x400 16 sided regular polygon
+ var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCase();
+ }
+</script>
+
+<style id="stylesheet">
+ #polygon-shape-inside, #polygon-svg-shape {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ }
+</style>
+</head>
+
+<body _onload_="init()">
+ <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
+ <div id="polygon-shape-inside"></div>
+ <p id="informative-text">
+ This test requires the Ahem font. It creates a polygonal shape-inside and a matching
+ filled SVG polygon. The content should just fill the shape with alternating black and
+ empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
+</body>
+
+</html>
Added: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon8-expected.html (0 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon8-expected.html (rev 0)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon8-expected.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+ if (window.internals)
+ window.internals.settings.setCSSExclusionsEnabled(true);
+
+ var vertices = createRegularPolygonVertices(400, 8); // 400x400 8 sided regular polygon
+ var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCaseExpected();
+ }
+</script>
+
+<style id="stylesheet">
+ #polygon-shape-inside, #polygon-svg-shape {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ }
+</style>
+</head>
+
+<body _onload_="init()">
+ <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
+ <div id="polygon-shape-inside"></div>
+ <p id="informative-text">
+ This test requires the Ahem font. It creates a polygonal shape-inside and a matching
+ filled SVG polygon. The content should just fill the shape with alternating black and
+ empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
+</body>
+
+</html>
Added: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon8.html (0 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon8.html (rev 0)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-regular-polygon8.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+ if (window.internals)
+ window.internals.settings.setCSSExclusionsEnabled(true);
+
+ var vertices = createRegularPolygonVertices(400, 8); // 400x400 regular octahedron
+ var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCase();
+ }
+</script>
+
+<style id="stylesheet">
+ #polygon-shape-inside, #polygon-svg-shape {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ }
+</style>
+</head>
+
+<body _onload_="init()">
+ <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
+ <div id="polygon-shape-inside"></div>
+ <p id="informative-text">
+ This test requires the Ahem font. It creates a polygonal shape-inside and a matching
+ filled SVG polygon. The content should just fill the shape with alternating black and
+ empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
+</body>
+
+</html>
Modified: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-001-expected.html (131609 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-001-expected.html 2012-10-17 16:09:10 UTC (rev 131609)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-001-expected.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -9,6 +9,13 @@
// Concave assymetric simple polygon with horizontal top and bottom edges. Roughly an hourglass shape.
var vertices = [{x:40, y:40}, {x:440, y:40}, {x:320, y:160}, {x:480, y:320}, {x:80, y:320}, {x:200, y:200}];
var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCaseExpected();
+ }
</script>
<style id="stylesheet">
@@ -20,13 +27,14 @@
</style>
</head>
-<body _onload_="createPolygonShapeInsideTestCaseExpected(vertices)">
- <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
- <div id="polygon-shape-inside"></div>
- <p id="informative-text">
- This test requires the Ahem font. It creates a polygonal shape-inside and a matching
- filled SVG polygon. The content should just fill the shape with alternating black and
- empty rectangles on each line.</p>
+<body _onload_="init()">
+ <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
+ <div id="polygon-shape-inside"></div>
+ <p id="informative-text">
+ This test requires the Ahem font. It creates a polygonal shape-inside and a matching
+ filled SVG polygon. The content should just fill the shape with alternating black and
+ empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
</body>
</html>
Modified: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-001.html (131609 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-001.html 2012-10-17 16:09:10 UTC (rev 131609)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-001.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -9,6 +9,13 @@
// Concave assymetric simple polygon with horizontal top and bottom edges. Roughly an hourglass shape.
var vertices = [{x:40, y:40}, {x:440, y:40}, {x:320, y:160}, {x:480, y:320}, {x:80, y:320}, {x:200, y:200}];
var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCase();
+ }
</script>
<style id="stylesheet">
@@ -20,15 +27,14 @@
</style>
</head>
-<body _onload_="createPolygonShapeInsideTestCase(vertices)">
- <div id="root">
- <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
- <div id="polygon-shape-inside"></div>
- <p id="informative-text">
- This test requires the Ahem font. It creates a polygonal shape-inside and a matching
- filled SVG polygon. The content should just fill the shape with alternating black and
- empty rectangles on each line.</p>
- </div>
+<body _onload_="init()">
+ <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
+ <div id="polygon-shape-inside"></div>
+ <p id="informative-text">
+ This test requires the Ahem font. It creates a polygonal shape-inside and a matching
+ filled SVG polygon. The content should just fill the shape with alternating black and
+ empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
</body>
</html>
Modified: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-002-expected.html (131609 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-002-expected.html 2012-10-17 16:09:10 UTC (rev 131609)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-002-expected.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -10,6 +10,13 @@
// but with a right right edge.
var vertices = [{x:40, y:40}, {x:440, y:40}, {x:480, y:320}, {x:80, y:320}, {x:200, y:200}];
var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCaseExpected();
+ }
</script>
<style id="stylesheet">
@@ -21,13 +28,14 @@
</style>
</head>
-<body _onload_="createPolygonShapeInsideTestCaseExpected(vertices)">
- <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
- <div id="polygon-shape-inside"></div>
- <p id="informative-text">
- This test requires the Ahem font. It creates a polygonal shape-inside and a matching
- filled SVG polygon. The content should just fill the shape with alternating black and
- empty rectangles on each line.</p>
+<body _onload_="init()">
+ <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
+ <div id="polygon-shape-inside"></div>
+ <p id="informative-text">
+ This test requires the Ahem font. It creates a polygonal shape-inside and a matching
+ filled SVG polygon. The content should just fill the shape with alternating black and
+ empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
</body>
</html>
Modified: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-002.html (131609 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-002.html 2012-10-17 16:09:10 UTC (rev 131609)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-002.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -10,6 +10,13 @@
// but with a single right edge.
var vertices = [{x:40, y:40}, {x:440, y:40}, {x:480, y:320}, {x:80, y:320}, {x:200, y:200}];
var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCase();
+ }
</script>
<style id="stylesheet">
@@ -21,15 +28,14 @@
</style>
</head>
-<body _onload_="createPolygonShapeInsideTestCase(vertices)">
- <div id="root">
- <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
- <div id="polygon-shape-inside"></div>
- <p id="informative-text">
- This test requires the Ahem font. It creates a polygonal shape-inside and a matching
- filled SVG polygon. The content should just fill the shape with alternating black and
- empty rectangles on each line.</p>
- </div>
+<body _onload_="init()">
+ <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
+ <div id="polygon-shape-inside"></div>
+ <p id="informative-text">
+ This test requires the Ahem font. It creates a polygonal shape-inside and a matching
+ filled SVG polygon. The content should just fill the shape with alternating black and
+ empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
</body>
</html>
Modified: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-003-expected.html (131609 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-003-expected.html 2012-10-17 16:09:10 UTC (rev 131609)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-003-expected.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -10,6 +10,13 @@
// with a vertical left edge.
var vertices = [{x:40, y:40}, {x:440, y:40}, {x:320, y:160}, {x:480, y:320}, {x:40, y:320}];
var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCaseExpected();
+ }
</script>
<style id="stylesheet">
@@ -21,13 +28,14 @@
</style>
</head>
-<body _onload_="createPolygonShapeInsideTestCaseExpected(vertices)">
+<body _onload_="init()">
<svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
<div id="polygon-shape-inside"></div>
<p id="informative-text">
This test requires the Ahem font. It creates a polygonal shape-inside and a matching
filled SVG polygon. The content should just fill the shape with alternating black and
empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
</body>
</html>
Modified: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-003.html (131609 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-003.html 2012-10-17 16:09:10 UTC (rev 131609)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-003.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -10,6 +10,13 @@
// with a vertical left edge.
var vertices = [{x:40, y:40}, {x:440, y:40}, {x:320, y:160}, {x:480, y:320}, {x:40, y:320}];
var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCase();
+ }
</script>
<style id="stylesheet">
@@ -21,15 +28,14 @@
</style>
</head>
-<body _onload_="createPolygonShapeInsideTestCase(vertices)">
- <div id="root">
- <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
- <div id="polygon-shape-inside"></div>
- <p id="informative-text">
- This test requires the Ahem font. It creates a polygonal shape-inside and a matching
- filled SVG polygon. The content should just fill the shape with alternating black and
- empty rectangles on each line.</p>
- </div>
+<body _onload_="init()">
+ <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
+ <div id="polygon-shape-inside"></div>
+ <p id="informative-text">
+ This test requires the Ahem font. It creates a polygonal shape-inside and a matching
+ filled SVG polygon. The content should just fill the shape with alternating black and
+ empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
</body>
</html>
Modified: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-004-expected.html (131609 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-004-expected.html 2012-10-17 16:09:10 UTC (rev 131609)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-004-expected.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -10,6 +10,13 @@
// hourglass shape with vertical edges in the center.
var vertices = [{x:40, y:40}, {x:440, y:40}, {x:320, y:160}, {x:320, y:240}, {x:480, y:400}, {x:80, y:400}, {x:200, y:280}, {x:200, y:200}]};
var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCaseExpected();
+ }
</script>
<style id="stylesheet">
@@ -21,13 +28,14 @@
</style>
</head>
-<body _onload_="createPolygonShapeInsideTestCaseExpected(vertices)">
+<body _onload_="init()">
<svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
<div id="polygon-shape-inside"></div>
<p id="informative-text">
This test requires the Ahem font. It creates a polygonal shape-inside and a matching
filled SVG polygon. The content should just fill the shape with alternating black and
empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
</body>
</html>
Modified: trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-004.html (131609 => 131610)
--- trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-004.html 2012-10-17 16:09:10 UTC (rev 131609)
+++ trunk/LayoutTests/fast/exclusions/shape-inside/shape-inside-simple-polygon-004.html 2012-10-17 16:27:06 UTC (rev 131610)
@@ -10,6 +10,13 @@
// hourglass shape with vertical edges in the center.
var vertices = [{x:40, y:40}, {x:440, y:40}, {x:320, y:160}, {x:320, y:240}, {x:480, y:400}, {x:80, y:400}, {x:200, y:280}, {x:200, y:200}]};
var lineHeight = 40;
+ var hasSubpixelSupport;
+
+ function init() {
+ var rect = document.getElementById("subpixel-test").getBoundingClientRect();
+ hasSubpixelSupport = rect.width != Math.floor(rect.width);
+ createPolygonShapeInsideTestCase();
+ }
</script>
<style id="stylesheet">
@@ -21,15 +28,14 @@
</style>
</head>
-<body _onload_="createPolygonShapeInsideTestCase(vertices)">
- <div id="root">
- <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
- <div id="polygon-shape-inside"></div>
- <p id="informative-text">
- This test requires the Ahem font. It creates a polygonal shape-inside and a matching
- filled SVG polygon. The content should just fill the shape with alternating black and
- empty rectangles on each line.</p>
- </div>
+<body _onload_="init()">
+ <svg id="polygon-svg-shape" xmlns="http://www.w3.org/2000/svg"></svg>
+ <div id="polygon-shape-inside"></div>
+ <p id="informative-text">
+ This test requires the Ahem font. It creates a polygonal shape-inside and a matching
+ filled SVG polygon. The content should just fill the shape with alternating black and
+ empty rectangles on each line.</p>
+ <div id="subpixel-test" style="width: 4.5px; height: 5px;"></div>
</body>
</html>