-
commit-queue@webkit.org authored
https://bugs.webkit.org/show_bug.cgi?id=99343 Patch by Hans Muller <hmuller@adobe.com> on 2012-11-05 Reviewed by Dirk Schulze. Source/WebCore: ExclusionPolygonEdges now span coincident and collinear vertices. Currently pairs of vertices are only considered coincident if their coordinates are exactly equal. Similarly, a vertex is only considered collinear with an edge if the area of the triangle defined by the three vertices is exactly zero. In the future it may be useful to relax the comparison with zero. Tests: fast/exclusions/shape-inside/shape-inside-coincident-vertices.html fast/exclusions/shape-inside/shape-inside-collinear-vertices.html * rendering/ExclusionPolygon.cpp: (WebCore::determinant): Used to measure collinearity. (WebCore): (WebCore::areCollinearPoints): True if three FloatPoint arguments are collinear per the test outlined above. (WebCore::areCoincidentPoints): True if the two FloatPoint arguments are equal. (WebCore::nextVertexIndex): The next vertex index in clockwise or counterclockwise order. (WebCore::ExclusionPolygon::findNextEdgeVertexIndex): Return the index of the next non-coincident, non-collinear vertex. (WebCore::ExclusionPolygon::ExclusionPolygon): Skip coincident and collinear vertices when building the list of edges. * rendering/ExclusionPolygon.h: Added private findNextEdgeVertexIndex() declaration. LayoutTests: Verify that exclusion polygonal shape-inside layout is unaffected by coincident or collinear vertices. * fast/exclusions/shape-inside/shape-inside-coincident-vertices-expected.html: Added. * fast/exclusions/shape-inside/shape-inside-coincident-vertices.html: Added. * fast/exclusions/shape-inside/shape-inside-collinear-vertices-expected.html: Added. * fast/exclusions/shape-inside/shape-inside-collinear-vertices.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
0bac6043