-
commit-queue@webkit.org authored
https://bugs.webkit.org/show_bug.cgi?id=100039 Patch by Hans Muller <hmuller@adobe.com> on 2012-10-30 Reviewed by Dirk Schulze. Source/WebCore: Corrected the algorithm for computing included polygon intervals for rectilinear polygons, and polygons with horizontal edges in general. Tests: fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-001.html fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-002.html * rendering/ExclusionPolygon.cpp: Removed some internal dead code related to the no-longer-used sortedEdgesMinY Vector. (WebCore::ExclusionPolygon::ExclusionPolygon): Initialize new ExclusionPolygonEdge edgeIndex field. (WebCore::getVertexIntersectionVertices): Return the previous, next, and target vertex indices for a vertex intersection. (WebCore::ExclusionPolygon::computeXIntersections): Refactored the core of this method to improve handling of horizontal edges. (WebCore::ExclusionPolygon::computeEdgeIntersections): Ignore zero-width edges. * rendering/ExclusionPolygon.h: Removed the rightVertexY() method, since it's no longer used. (WebCore::ExclusionPolygon::edgeAt): New method. (WebCore::ExclusionPolygon::numberOfEdges): New method. (ExclusionPolygon): Added support for retrieving edges. (WebCore::ExclusionPolygonEdge::vertex1): Use vertex1Index. (WebCore::ExclusionPolygonEdge::vertex2): Use vertex2Index. (ExclusionPolygonEdge): Renamed index1, index2 fields to vertex1Index, vertex2Index. (WebCore::ExclusionPolygonEdge::previousEdge): New method. (WebCore::ExclusionPolygonEdge::nextEdge): New method. LayoutTests: Added tests for CSS Exclusion shape-inside polygons with horizontal edges. Corrected the simple-polygon.js code for computing a polygon's included intervals. * fast/exclusions/resources/simple-polygon.js: * fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-001-expected.html: Added. * fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-001.html: Added. * fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-002-expected.html: Added. * fast/exclusions/shape-inside/shape-inside-rectilinear-polygon-002.html: Added. * fast/exclusions/shape-inside/shape-inside-simple-polygon-004-expected.html: * fast/exclusions/shape-inside/shape-inside-simple-polygon-004.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
635973c7