OLD | NEW |
1 // The functions in this file are intended to be used to test non-complex polygo
ns | 1 // The functions in this file are intended to be used to test non-complex polygo
ns |
2 // where horizontal lines that overlap the polygon only cross the polygon twice. | 2 // where horizontal lines that overlap the polygon only cross the polygon twice. |
3 if (window.internals) | |
4 window.internals.settings.setCSSExclusionsEnabled(true); | |
5 | |
6 function createPolygon(vertices) { | 3 function createPolygon(vertices) { |
7 var xCoordinates = vertices.map( function(p) { return p.x; } ); | 4 var xCoordinates = vertices.map( function(p) { return p.x; } ); |
8 var yCoordinates = vertices.map( function(p) { return p.y; } ); | 5 var yCoordinates = vertices.map( function(p) { return p.y; } ); |
9 return { | 6 return { |
10 vertices: vertices, | 7 vertices: vertices, |
11 minX: Math.min.apply(null, xCoordinates), | 8 minX: Math.min.apply(null, xCoordinates), |
12 maxX: Math.max.apply(null, xCoordinates), | 9 maxX: Math.max.apply(null, xCoordinates), |
13 minY: Math.min.apply(null, yCoordinates), | 10 minY: Math.min.apply(null, yCoordinates), |
14 maxY: Math.max.apply(null, yCoordinates) | 11 maxY: Math.max.apply(null, yCoordinates) |
15 }; | 12 }; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 positionInformativeText("informative-text", stylesheet, polygon, lineHeight) | 238 positionInformativeText("informative-text", stylesheet, polygon, lineHeight) |
242 } | 239 } |
243 | 240 |
244 function createPolygonShapeInsideTestCaseExpected() { | 241 function createPolygonShapeInsideTestCaseExpected() { |
245 var stylesheet = document.getElementById("stylesheet").sheet; | 242 var stylesheet = document.getElementById("stylesheet").sheet; |
246 var polygon = createPolygon(vertices); | 243 var polygon = createPolygon(vertices); |
247 generateSimulatedPolygonShapeInsideElement("polygon-shape-inside", styleshee
t, polygon, lineHeight); | 244 generateSimulatedPolygonShapeInsideElement("polygon-shape-inside", styleshee
t, polygon, lineHeight); |
248 generatePolygonSVGElements("polygon-svg-shape", stylesheet, polygon, lineHei
ght); | 245 generatePolygonSVGElements("polygon-svg-shape", stylesheet, polygon, lineHei
ght); |
249 positionInformativeText("informative-text", stylesheet, polygon, lineHeight) | 246 positionInformativeText("informative-text", stylesheet, polygon, lineHeight) |
250 } | 247 } |
OLD | NEW |