-
commit-queue@webkit.org authored
https://bugs.webkit.org/show_bug.cgi?id=100763 Patch by Hans Muller <hmuller@adobe.com> on 2012-11-06 Reviewed by Darin Adler. Source/WebCore: The ExclusionPolygon's internal logic, notably getVertexIntersectionVertices(), assumes that ExclusionPolygonEdge vertices are stored in clockwise order. If this is not true, then we construct the polygon's edges in reverse. To determine if the vertices are in clockwise order, we compare the slope of the line between the top,left vertex and its previous vertex, with the the slope of the line of vertices before and after the top,left vertex. If the slope of the latter is greater, then top,left vertex is located to its left, and the vertices are clockwise. Test: fast/exclusions/shape-inside/shape-inside-counterclockwise-polygon.html * rendering/ExclusionPolygon.cpp: (WebCore::determinant): Used to decide if the min vertex is on the left side of the line that passes through its adjacent vertices. (WebCore::ExclusionPolygon::ExclusionPolygon): If the polygon's vertices are specified in counterclockwise order, construct the edges in reverse. (WebCore::appendIntervalX): Made this an inline since it was only defined as a function for the sake of clarity. LayoutTests: Verify that a shape-inside polygon whose vertices are specified in counterclockwise order is handled correctly. * fast/exclusions/shape-inside/shape-inside-counterclockwise-polygon-expected.html: Added. * fast/exclusions/shape-inside/shape-inside-counterclockwise-polygon.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
6a17d333