Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: Source/core/rendering/shapes/PolygonShape.cpp

Issue 264453009: [CSS Shapes] shape-outside polygon can fail when line-top intersects a vertex (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove -webkit-font-smoothing Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/shapes/PolygonShape.cpp
diff --git a/Source/core/rendering/shapes/PolygonShape.cpp b/Source/core/rendering/shapes/PolygonShape.cpp
index 15fd9bd451b0b58abc4f7dfb467e7225cb9827b2..0160f85b93a2a68304321a31e7120017db12b89b 100644
--- a/Source/core/rendering/shapes/PolygonShape.cpp
+++ b/Source/core/rendering/shapes/PolygonShape.cpp
@@ -69,7 +69,7 @@ float OffsetPolygonEdge::xIntercept(float y) const
FloatShapeInterval OffsetPolygonEdge::clippedEdgeXRange(float y1, float y2) const
{
- if (!overlapsYRange(y1, y2))
+ if (!overlapsYRange(y1, y2) || (y1 == maxY() && vertex2().y() < vertex1().y()))
return FloatShapeInterval();
if (isWithinYRange(y1, y2))
@@ -135,6 +135,8 @@ void PolygonShape::getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logica
FloatShapeInterval excludedInterval;
for (unsigned i = 0; i < overlappingEdges.size(); i++) {
const FloatPolygonEdge& edge = *(overlappingEdges[i]);
+ if (edge.maxY() == edge.minY())
+ continue;
if (!shapeMargin()) {
excludedInterval.unite(OffsetPolygonEdge(edge, FloatSize()).clippedEdgeXRange(y1, y2));
} else {

Powered by Google App Engine
This is Rietveld 408576698