Changeset 133968 in webkit
- Timestamp:
- Nov 8, 2012 4:09:57 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r133966 r133968 1 2012-11-08 Hans Muller <hmuller@adobe.com> 2 3 [CSS Exclusions] Polygon with horizontal bottom edges returns incorrect segments 4 https://bugs.webkit.org/show_bug.cgi?id=100874 5 6 Reviewed by Dirk Schulze. 7 8 Added two additional tests for rectilinear polygons, where the tops and bottoms 9 of lines intersect the polygons' horizontal edges. More tests of this kind will 10 be needed when exclusion layout supports polygons that break horizontal lines up 11 into more than one segment. 12 13 * fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-003-expected.html: Added. 14 * fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-003.html: Added. 15 * fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-004-expected.html: Added. 16 * fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-004.html: Added. 17 1 18 2012-11-08 Christophe Dumez <christophe.dumez@intel.com> 2 19 -
trunk/Source/WebCore/ChangeLog
r133964 r133968 1 2012-11-08 Hans Muller <hmuller@adobe.com> 2 3 [CSS Exclusions] Polygon with horizontal bottom edges returns incorrect segments 4 https://bugs.webkit.org/show_bug.cgi?id=100874 5 6 Reviewed by Dirk Schulze. 7 8 Revised the way that computeXIntersections() handles intersections with horizotal polygon edges. 9 Deciding if a vertex intersection corresponds to a polygon "edge crossing", i.e. a change from inside 10 to outside or outside to inside, now depends on which side of the horizontal line the function's 11 y parameter corresponds to. If the y corresponds to the top of the line, then isaMinY the parameter 12 is true, and an intersection with a horizontal edge is only considered to be an edge crossing if 13 if the inside of the polygon is just below the horizontal edge. When isMinY is false then the inside 14 of the polygon must be just above the horizontal edge. 15 16 Tests: fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-003.html 17 fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-004.html 18 19 * rendering/ExclusionPolygon.cpp: 20 (WebCore::getVertexIntersectionVertices): Corrected two cases where the next/previous vertex was determined incorrectly. 21 (WebCore::ExclusionPolygon::computeXIntersections): Added a bool isMinY parameter which specifies if the y parameter corresponds to the top or bottom a horizontal line. 22 (WebCore::ExclusionPolygon::getExcludedIntervals): Added the new computeXIntersections() parameter. 23 (WebCore::ExclusionPolygon::getIncludedIntervals): Ditto. 24 * rendering/ExclusionPolygon.h: 25 (WebCore::ExclusionPolygonEdge::previousEdge): Corrected the previousEdge() function. 26 1 27 2012-11-08 Otto Derek Cheung <otcheung@rim.com> 2 28 -
trunk/Source/WebCore/rendering/ExclusionPolygon.cpp
r133682 r133968 191 191 if ((intersection.type == VertexMinY && (thisEdge.vertex1().y() < thisEdge.vertex2().y())) 192 192 || (intersection.type == VertexMaxY && (thisEdge.vertex1().y() > thisEdge.vertex2().y()))) { 193 prevVertex = polygon.vertexAt(thisEdge.previousEdge().vertexIndex 2);193 prevVertex = polygon.vertexAt(thisEdge.previousEdge().vertexIndex1); 194 194 thisVertex = polygon.vertexAt(thisEdge.vertexIndex1); 195 195 nextVertex = polygon.vertexAt(thisEdge.vertexIndex2); … … 197 197 prevVertex = polygon.vertexAt(thisEdge.vertexIndex1); 198 198 thisVertex = polygon.vertexAt(thisEdge.vertexIndex2); 199 nextVertex = polygon.vertexAt(thisEdge.nextEdge().vertexIndex 1);199 nextVertex = polygon.vertexAt(thisEdge.nextEdge().vertexIndex2); 200 200 } 201 201 … … 220 220 } 221 221 222 void ExclusionPolygon::computeXIntersections(float y, Vector<ExclusionInterval>& result) const222 void ExclusionPolygon::computeXIntersections(float y, bool isMinY, Vector<ExclusionInterval>& result) const 223 223 { 224 224 Vector<ExclusionPolygon::EdgeInterval> overlappingEdges; … … 266 266 267 267 if (evenOddCrossing) { 268 bool edgeCrossing = false; 269 if (thisIntersection.type == Normal || !inside || index == intersections.size() - 1) 270 edgeCrossing = true; 271 else { 268 bool edgeCrossing = thisIntersection.type == Normal; 269 if (!edgeCrossing) { 272 270 FloatPoint prevVertex; 273 271 FloatPoint thisVertex; … … 275 273 276 274 if (getVertexIntersectionVertices(thisIntersection, prevVertex, thisVertex, nextVertex)) { 277 if (prevVertex.y() == y) 278 edgeCrossing = (thisVertex.x() > prevVertex.x()) ? nextVertex.y() > y : nextVertex.y() < y; 275 if (nextVertex.y() == y) 276 edgeCrossing = (isMinY) ? prevVertex.y() > y : prevVertex.y() < y; 277 else if (prevVertex.y() == y) 278 edgeCrossing = (isMinY) ? nextVertex.y() > y : nextVertex.y() < y; 279 279 else 280 edgeCrossing = (nextVertex.y() != y);280 edgeCrossing = true; 281 281 } 282 282 } … … 332 332 333 333 Vector<ExclusionInterval> y1XIntervals, y2XIntervals; 334 computeXIntersections(y1, y1XIntervals);335 computeXIntersections(y2, y2XIntervals);334 computeXIntersections(y1, true, y1XIntervals); 335 computeXIntersections(y2, false, y2XIntervals); 336 336 337 337 Vector<ExclusionInterval> mergedIntervals; … … 359 359 360 360 Vector<ExclusionInterval> y1XIntervals, y2XIntervals; 361 computeXIntersections(y1, y1XIntervals);362 computeXIntersections(y2, y2XIntervals);361 computeXIntersections(y1, true, y1XIntervals); 362 computeXIntersections(y2, false, y2XIntervals); 363 363 364 364 Vector<ExclusionInterval> commonIntervals; -
trunk/Source/WebCore/rendering/ExclusionPolygon.h
r133490 r133968 69 69 70 70 private: 71 void computeXIntersections(float y, Vector<ExclusionInterval>&) const;71 void computeXIntersections(float y, bool isMinY, Vector<ExclusionInterval>&) const; 72 72 void computeEdgeIntersections(float minY, float maxY, Vector<ExclusionInterval>&) const; 73 73 unsigned findNextEdgeVertexIndex(unsigned vertexIndex1, bool clockwise) const; … … 103 103 { 104 104 ASSERT(polygon && polygon->numberOfEdges() > 1); 105 return polygon->edgeAt((edgeIndex + polygon->numberOfEdges() - 2) % polygon->numberOfEdges());105 return polygon->edgeAt((edgeIndex + polygon->numberOfEdges() - 1) % polygon->numberOfEdges()); 106 106 } 107 107
Note: See TracChangeset
for help on using the changeset viewer.