Refactor ShapeOutsideInfo so it isn't mutated for each line
authorbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Aug 2014 19:05:21 +0000 (19:05 +0000)
committerbjonesbe@adobe.com <bjonesbe@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Aug 2014 19:05:21 +0000 (19:05 +0000)
commit48dc1825519570242a10843eb144fad3206c3cd6
tree6c8a58d396506e5ac1a5606e35ae8d4e27293fd1
parent7df0de02ec603a9700d975a807d382deb872baad
Refactor ShapeOutsideInfo so it isn't mutated for each line
https://bugs.webkit.org/show_bug.cgi?id=135781

Reviewed by Zoltan Horvath.

Encapsulate the per line state into a ShapeOutsideDeltas object.
updateDeltasForContainingBlockLine has been renamed to
computeDeltasForContainingBlockLine, and it returns an instance of the
ShapeOutsideDeltas object for that line. This object is cached, but
none of the functionality of ShapeOutsideInfo is dependant on any line
specific data anymore.

No new tests, no behavior change.

* rendering/FloatingObjects.cpp:
(WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
    Update to take a FloatingObject reference because the FloatingObject cannot be null.
(WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
    Ditto.
(WebCore::ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNeeded): Pass FloatingObject to
    updateOffsetIfNeeded as a reference, since it cannot be null.
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
    Use ShapeOutsideDeltas object to calculate the offset and take the FloatingObject as a
    reference.
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
    Ditto.
(WebCore::shapeInfoForFloat): Deleted.
* rendering/line/LineWidth.cpp:
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded): Update to use ShapeOutsideDeltas object.
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine): Return a ShaoeOutsideDeltas object
    instead of storing line specific data in instance variables.
(WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine): Deleted.
* rendering/shapes/ShapeOutsideInfo.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172529 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/FloatingObjects.cpp
Source/WebCore/rendering/line/LineWidth.cpp
Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
Source/WebCore/rendering/shapes/ShapeOutsideInfo.h