[CSS Shapes] Empty polygons with non-zero shape-padding cause an ASSERT crash
authorhmuller@adobe.com <hmuller@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Nov 2013 18:21:29 +0000 (18:21 +0000)
committerhmuller@adobe.com <hmuller@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Nov 2013 18:21:29 +0000 (18:21 +0000)
commit91419d4727b588f704bbb3f978f22a10aa483405
treec61e920d0f19612dd57b5a4da77c181a26803ba8
parent86a33b7a1c3f0d8c6031825072b86de3f5d05e3b
[CSS Shapes] Empty polygons with non-zero shape-padding cause an ASSERT crash
https://bugs.webkit.org/show_bug.cgi?id=124324

Reviewed by Andreas Kling.

Source/WebCore:

PolygonShape::shapePaddingBounds() and PolygonShape::shapeMarginBounds() no
longer attempt to compute a new FloatPolygon when the original is empty, i.e.
when it has less than three vertices.

Tests: fast/shapes/shape-inside/shape-inside-empty-polygon-crash.html
       fast/shapes/shape-outside-floats/shape-outside-floats-empty-polygon-crash.html

* rendering/shapes/PolygonShape.cpp:
(WebCore::PolygonShape::shapePaddingBounds): Don't compute a padding FloatPolygon if the original polygon is empty.
(WebCore::PolygonShape::shapeMarginBounds): Don't compute a margin FloatPolygon if the original polygon is empty.

LayoutTests:

* fast/shapes/shape-inside/shape-inside-empty-polygon-crash-expected.txt: Added.
* fast/shapes/shape-inside/shape-inside-empty-polygon-crash.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-empty-polygon-crash-expected.txt: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-empty-polygon-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/shapes/shape-inside/shape-inside-empty-polygon-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/shapes/shape-inside/shape-inside-empty-polygon-crash.html [new file with mode: 0644]
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-empty-polygon-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-empty-polygon-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/shapes/PolygonShape.cpp