[CSS Exclusions] Handle special case "empty" shapes
https://bugs.webkit.org/show_bug.cgi?id=99342

Patch by Hans Muller <hmuller@adobe.com> on 2012-10-18
Reviewed by Dirk Schulze.

Source/WebCore:

Provide expclit coverage of the simple "empty" shape-inside shapes.
Shapes will be considered "empty" in the sense that ExclusionShape::getIncludedIntervals()
and ExclusionShape::getExcludedIntervals() will always return empty lists of intervals.
This patch covers rectangles of zero width or height, circles with 0 radius, ellipses
with 0 radiusX or radiusY, polygons with less than 3 vertices.

Test: fast/exclusions/shape-inside/shape-inside-empty.html

* rendering/ExclusionPolygon.cpp:
(WebCore::ExclusionPolygon::ExclusionPolygon): Initialize the m_empty flag.
(WebCore::ExclusionPolygon::getExcludedIntervals): Added short-circuit return when the polygon is empty.
(WebCore::ExclusionPolygon::getIncludedIntervals): Added short-circuit return when the polygon is empty.
* rendering/ExclusionPolygon.h: Added the isEmpty() method.
* rendering/ExclusionRectangle.cpp:
(WebCore::ExclusionRectangle::getExcludedIntervals): Added short-circuit return when the rectangle is empty.
(WebCore::ExclusionRectangle::getIncludedIntervals): Added short-circuit return when the rectangle is empty.
* rendering/ExclusionRectangle.h: Added the isEmpty() method.
* rendering/ExclusionShape.h: Added a virtual isEmpty() ExclusionShape method.
(ExclusionShape):

LayoutTests:

Verify that "empty" shape-inside shapes do not constrain the text their element contains.

* fast/exclusions/shape-inside/shape-inside-empty-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-empty.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Exclusions] Add ExclusionShape::shapeBoundingBox() method
https://bugs.webkit.org/show_bug.cgi?id=99216

Patch by Hans Muller <hmuller@adobe.com> on 2012-10-18
Reviewed by Dirk Schulze.

Added a FloatRect::extend() method which simplifies writing loops that
accumulate the bounding box for a sequence of FloatPoints. The new method
is used by ExclusionPolygon to initialize the shape's logical and physical
bounding boxes. This a clean-up, not a change in functionality. It's already
covered by the existing fast/exclusions LayoutTests.

* platform/graphics/FloatRect.cpp:
(WebCore::FloatRect::extend): Extend the FloatRect's bounds to include a FloatPoint.
(WebCore):
* platform/graphics/FloatRect.h:
(FloatRect): Added extend() method.
* rendering/ExclusionPolygon.cpp:
(WebCore::ExclusionPolygon::ExclusionPolygon): Use FloatRect::extend() to compute the polygon's internal bounding box.
* rendering/ExclusionShape.cpp:
(WebCore::ExclusionShape::createExclusionShape): Use FloatRect::extend() to compute the polygon's physical bounding box.
* rendering/ExclusionShape.h:
(WebCore::ExclusionShape::shapeBoundingBox): Return the shape's bounding box in physical coordinates.
(ExclusionShape):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rebaseline a slider test on Mac.
I think I grabbed the baseline at the wrong time or from the wrong bot yesterday.

* platform/mac/media/video-playing-and-pause-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed testExpectation change for Chromium.

* platform/chromium/TestExpectations: Marked svg/hixie/perf/007.xml as [ Pass Slow ]


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131772 268f45cc-cd09-0410-ab3c-d52691b4dbfc