Title: [164006] trunk/Source/WebCore
Revision
164006
Author
[email protected]
Date
2014-02-12 19:02:53 -0800 (Wed, 12 Feb 2014)

Log Message

[CSS Shapes] Rename shapeSize and others to make ShapeInfo and friends easier to understand
https://bugs.webkit.org/show_bug.cgi?id=128685

Reviewed by Alexandru Chiculita.

The ShapeInfo hierarchy has grown organically as the spec has changed,
and the naming has become very stale and confusing. The spec is now in
Last Call, so it seems like a good time to take a stab towards better
naming that matches the spec terminology and is also more consistent
in general.

No new tests, no behavior change.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::imageChanged): Use new names.
(WebCore::RenderBlock::updateShapeInsideInfoAfterStyleChange): Ditto.
(WebCore::shapeInfoRequiresRelayout): Ditto.
(WebCore::RenderBlock::computeShapeSize): Ditto.
(WebCore::RenderBlock::updateShapesAfterBlockLayout): Ditto.
* rendering/RenderBlock.h:
(WebCore::RenderBlock::logicalSizeForChild): This method makes it much
    cleaner to set the reference box size.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionNewFloats): Use new names.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange): Ditto.
(WebCore::RenderBox::imageChanged): Ditto.
* rendering/shapes/ShapeInfo.cpp:
(WebCore::getShapeImageMarginRect): Rename variables.
(WebCore::ShapeInfo<RenderType>::computedShape): More renames.
* rendering/shapes/ShapeInfo.h:
(WebCore::ShapeInfo::setReferenceBoxLogicalSize): Renamed from
    setShapeSize.
(WebCore::ShapeInfo::logicalLineTop): Use new names.
(WebCore::ShapeInfo::logicalLineBottom): Ditto.
(WebCore::ShapeInfo::shapeContainingBlockLogicalHeight): Ditto.
(WebCore::ShapeInfo::markShapeAsDirty): Renamed from dirtyShapeSize.
(WebCore::ShapeInfo::isShapeDirty): Renamed from shapeSizeDirty.
(WebCore::ShapeInfo::referenceBoxLogicalSize): Renamed from shapeSize.
(WebCore::ShapeInfo::logicalTopOffset): Use new names.
(WebCore::ShapeInfo::logicalLeftOffset): Ditto.
* rendering/shapes/ShapeInsideInfo.cpp:
(WebCore::ShapeInsideInfo::updateSegmentsForLine): Ditto.
(WebCore::ShapeInsideInfo::adjustLogicalLineTop): Ditto.
(WebCore::ShapeInsideInfo::computeFirstFitPositionForFloat): Ditto.
* rendering/shapes/ShapeInsideInfo.h:
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine): Ditto.
* rendering/shapes/ShapeOutsideInfo.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (164005 => 164006)


--- trunk/Source/WebCore/ChangeLog	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/ChangeLog	2014-02-13 03:02:53 UTC (rev 164006)
@@ -1,3 +1,55 @@
+2014-02-12  Bem Jones-Bey  <[email protected]>
+
+        [CSS Shapes] Rename shapeSize and others to make ShapeInfo and friends easier to understand
+        https://bugs.webkit.org/show_bug.cgi?id=128685
+
+        Reviewed by Alexandru Chiculita.
+
+        The ShapeInfo hierarchy has grown organically as the spec has changed,
+        and the naming has become very stale and confusing. The spec is now in
+        Last Call, so it seems like a good time to take a stab towards better
+        naming that matches the spec terminology and is also more consistent
+        in general.
+
+        No new tests, no behavior change.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::imageChanged): Use new names.
+        (WebCore::RenderBlock::updateShapeInsideInfoAfterStyleChange): Ditto.
+        (WebCore::shapeInfoRequiresRelayout): Ditto.
+        (WebCore::RenderBlock::computeShapeSize): Ditto.
+        (WebCore::RenderBlock::updateShapesAfterBlockLayout): Ditto.
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock::logicalSizeForChild): This method makes it much
+            cleaner to set the reference box size.
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::positionNewFloats): Use new names.
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange): Ditto.
+        (WebCore::RenderBox::imageChanged): Ditto.
+        * rendering/shapes/ShapeInfo.cpp:
+        (WebCore::getShapeImageMarginRect): Rename variables.
+        (WebCore::ShapeInfo<RenderType>::computedShape): More renames.
+        * rendering/shapes/ShapeInfo.h:
+        (WebCore::ShapeInfo::setReferenceBoxLogicalSize): Renamed from
+            setShapeSize.
+        (WebCore::ShapeInfo::logicalLineTop): Use new names.
+        (WebCore::ShapeInfo::logicalLineBottom): Ditto.
+        (WebCore::ShapeInfo::shapeContainingBlockLogicalHeight): Ditto.
+        (WebCore::ShapeInfo::markShapeAsDirty): Renamed from dirtyShapeSize.
+        (WebCore::ShapeInfo::isShapeDirty): Renamed from shapeSizeDirty.
+        (WebCore::ShapeInfo::referenceBoxLogicalSize): Renamed from shapeSize.
+        (WebCore::ShapeInfo::logicalTopOffset): Use new names.
+        (WebCore::ShapeInfo::logicalLeftOffset): Ditto.
+        * rendering/shapes/ShapeInsideInfo.cpp:
+        (WebCore::ShapeInsideInfo::updateSegmentsForLine): Ditto.
+        (WebCore::ShapeInsideInfo::adjustLogicalLineTop): Ditto.
+        (WebCore::ShapeInsideInfo::computeFirstFitPositionForFloat): Ditto.
+        * rendering/shapes/ShapeInsideInfo.h:
+        * rendering/shapes/ShapeOutsideInfo.cpp:
+        (WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine): Ditto.
+        * rendering/shapes/ShapeOutsideInfo.h:
+
 2014-02-12  Brent Fulgham  <[email protected]>
 
         REGRESSION: Crashing/Broken Tests Due To Unexpected 8-bit Character Data

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (164005 => 164006)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2014-02-13 03:02:53 UTC (rev 164006)
@@ -1321,7 +1321,7 @@
     ShapeValue* shapeValue = style().shapeInside();
     if (shapeValue && shapeValue->image() && shapeValue->image()->data() == image) {
         ShapeInsideInfo& shapeInsideInfo = ensureShapeInsideInfo();
-        shapeInsideInfo.dirtyShapeSize();
+        shapeInsideInfo.markShapeAsDirty();
         markShapeInsideDescendantsForLayout();
     }
 #endif
@@ -1381,7 +1381,7 @@
 
     if (shapeInside) {
         ShapeInsideInfo& shapeInsideInfo = ensureShapeInsideInfo();
-        shapeInsideInfo.dirtyShapeSize();
+        shapeInsideInfo.markShapeAsDirty();
     } else
         setShapeInsideInfo(nullptr);
     markShapeInsideDescendantsForLayout();
@@ -1446,7 +1446,7 @@
 {
     ShapeInsideInfo* info = block->shapeInsideInfo();
     if (info)
-        info->setNeedsLayout(info->shapeSizeDirty());
+        info->setNeedsLayout(info->isShapeDirty());
     else
         info = block->layoutShapeInsideInfo();
     return info && info->needsLayout();
@@ -1461,10 +1461,10 @@
     if (isRenderNamedFlowFragment()) {
         ShapeInsideInfo* parentShapeInsideInfo = toRenderBlock(parent())->shapeInsideInfo();
         ASSERT(parentShapeInsideInfo);
-        shapeInsideInfo->setShapeSize(parentShapeInsideInfo->shapeSize().width(), parentShapeInsideInfo->shapeSize().height());
+        shapeInsideInfo->setReferenceBoxLogicalSize(parentShapeInsideInfo->referenceBoxLogicalSize());
     } else {
         bool percentageLogicalHeightResolvable = percentageLogicalHeightIsResolvableFromBlock(this, false);
-        shapeInsideInfo->setShapeSize(logicalWidth(), percentageLogicalHeightResolvable ? logicalHeight() : LayoutUnit());
+        shapeInsideInfo->setReferenceBoxLogicalSize(LayoutSize(logicalWidth(), percentageLogicalHeightResolvable ? logicalHeight() : LayoutUnit()));
     }
 }
 #endif
@@ -1500,7 +1500,7 @@
     // A previous sibling has changed dimension, so we need to relayout the shape with the content
     ShapeInsideInfo* shapeInsideInfo = layoutShapeInsideInfo();
     if (heightChanged && shapeInsideInfo)
-        shapeInsideInfo->dirtyShapeSize();
+        shapeInsideInfo->markShapeAsDirty();
 #else
     UNUSED_PARAM(heightChanged);
 #endif

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (164005 => 164006)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2014-02-13 03:02:53 UTC (rev 164006)
@@ -278,6 +278,7 @@
     enum ApplyLayoutDeltaMode { ApplyLayoutDelta, DoNotApplyLayoutDelta };
     LayoutUnit logicalWidthForChild(const RenderBox& child) const { return isHorizontalWritingMode() ? child.width() : child.height(); }
     LayoutUnit logicalHeightForChild(const RenderBox& child) const { return isHorizontalWritingMode() ? child.height() : child.width(); }
+    LayoutSize logicalSizeForChild(const RenderBox& child) const { return isHorizontalWritingMode() ? child.size() : child.size().transposedSize(); }
     LayoutUnit logicalTopForChild(const RenderBox& child) const { return isHorizontalWritingMode() ? child.y() : child.x(); }
     void setLogicalLeftForChild(RenderBox& child, LayoutUnit logicalLeft, ApplyLayoutDeltaMode = DoNotApplyLayoutDelta);
     void setLogicalTopForChild(RenderBox& child, LayoutUnit logicalTop, ApplyLayoutDeltaMode = DoNotApplyLayoutDelta);

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (164005 => 164006)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2014-02-13 03:02:53 UTC (rev 164006)
@@ -2342,7 +2342,7 @@
 
 #if ENABLE(CSS_SHAPES)
         if (ShapeOutsideInfo* shapeOutside = childBox.shapeOutsideInfo())
-            shapeOutside->setShapeSize(logicalWidthForChild(childBox), logicalHeightForChild(childBox));
+            shapeOutside->setReferenceBoxLogicalSize(logicalSizeForChild(childBox));
 #endif
         // If the child moved, we have to repaint it.
         if (childBox.checkForRepaintDuringLayout())

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (164005 => 164006)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2014-02-13 03:02:53 UTC (rev 164006)
@@ -404,7 +404,7 @@
     if (!shapeOutside)
         ShapeOutsideInfo::removeInfo(*this);
     else
-        ShapeOutsideInfo::ensureInfo(*this).dirtyShapeSize();
+        ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty();
 
     if (shapeOutside || shapeOutside != oldShapeOutside)
         markShapeOutsideDependentsForLayout();
@@ -1542,7 +1542,7 @@
 #if ENABLE(CSS_SHAPES)
     ShapeValue* shapeOutsideValue = style().shapeOutside();
     if (!view().frameView().isInLayout() && isFloating() && shapeOutsideValue && shapeOutsideValue->image() && shapeOutsideValue->image()->data() == image) {
-        ShapeOutsideInfo::ensureInfo(*this).dirtyShapeSize();
+        ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty();
         markShapeOutsideDependentsForLayout();
     }
 #endif

Modified: trunk/Source/WebCore/rendering/shapes/ShapeInfo.cpp (164005 => 164006)


--- trunk/Source/WebCore/rendering/shapes/ShapeInfo.cpp	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/rendering/shapes/ShapeInfo.cpp	2014-02-13 03:02:53 UTC (rev 164006)
@@ -42,7 +42,6 @@
 
 namespace WebCore {
 
-
 bool checkShapeImageOrigin(Document& document, CachedImage& cachedImage)
 {
     if (cachedImage.isOriginClean(document.securityOrigin()))
@@ -67,11 +66,11 @@
     return LayoutRect(LayoutPoint(), styleImage.cachedImage()->image()->size());
 }
 
-static LayoutRect getShapeImageMarginRect(const RenderBox& renderBox, const LayoutSize& shapeSize)
+static LayoutRect getShapeImageMarginRect(const RenderBox& renderBox, const LayoutSize& referenceBoxLogicalSize)
 {
     LayoutPoint marginBoxOrigin(-renderBox.marginLogicalLeft() - renderBox.borderAndPaddingLogicalLeft(), -renderBox.marginBefore() - renderBox.borderBefore() - renderBox.paddingBefore());
     LayoutSize marginBoxSizeDelta(renderBox.marginLogicalWidth() + renderBox.borderAndPaddingLogicalWidth(), renderBox.marginLogicalHeight() + renderBox.borderAndPaddingLogicalHeight());
-    return LayoutRect(marginBoxOrigin, shapeSize + marginBoxSizeDelta);
+    return LayoutRect(marginBoxOrigin, referenceBoxLogicalSize + marginBoxSizeDelta);
 }
 
 template<class RenderType>
@@ -90,20 +89,20 @@
     switch (shapeValue->type()) {
     case ShapeValue::Shape:
         ASSERT(shapeValue->shape());
-        m_shape = Shape::createShape(shapeValue->shape(), m_shapeLogicalSize, writingMode, margin, padding);
+        m_shape = Shape::createShape(shapeValue->shape(), m_referenceBoxLogicalSize, writingMode, margin, padding);
         break;
     case ShapeValue::Image: {
         ASSERT(shapeValue->image());
         const StyleImage& styleImage = *(shapeValue->image());
         const LayoutRect& imageRect = getShapeImageReplacedRect(m_renderer, styleImage);
-        const LayoutRect& marginRect = getShapeImageMarginRect(m_renderer, m_shapeLogicalSize);
+        const LayoutRect& marginRect = getShapeImageMarginRect(m_renderer, m_referenceBoxLogicalSize);
         m_shape = Shape::createRasterShape(styleImage, shapeImageThreshold, imageRect, marginRect, writingMode, margin, padding);
         break;
     }
     case ShapeValue::Box: {
         // FIXME This does not properly compute the rounded corners as specified in all conditions.
         // https://bugs.webkit.org/show_bug.cgi?id=127982
-        const RoundedRect& shapeRect = m_renderer.style().getRoundedBorderFor(LayoutRect(LayoutPoint(), m_shapeLogicalSize), &(m_renderer.view()));
+        const RoundedRect& shapeRect = m_renderer.style().getRoundedBorderFor(LayoutRect(LayoutPoint(), m_referenceBoxLogicalSize), &(m_renderer.view()));
         m_shape = Shape::createLayoutBoxShape(shapeRect, writingMode, margin, padding);
         break;
     }

Modified: trunk/Source/WebCore/rendering/shapes/ShapeInfo.h (164005 => 164006)


--- trunk/Source/WebCore/rendering/shapes/ShapeInfo.h	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/rendering/shapes/ShapeInfo.h	2014-02-13 03:02:53 UTC (rev 164006)
@@ -71,23 +71,20 @@
 public:
     virtual ~ShapeInfo() { }
 
-    void setShapeSize(LayoutUnit logicalWidth, LayoutUnit logicalHeight)
+    void setReferenceBoxLogicalSize(LayoutSize newReferenceBoxLogicalSize)
     {
-        LayoutBox box = resolvedLayoutBox();
+        LayoutBox box = referenceBox();
         switch (box) {
         case MarginBox:
-            logicalHeight += m_renderer.marginLogicalHeight();
-            logicalWidth += m_renderer.marginLogicalWidth();
+            newReferenceBoxLogicalSize.expand(m_renderer.marginLogicalWidth(), m_renderer.marginLogicalHeight());
             break;
         case BorderBox:
             break;
         case PaddingBox:
-            logicalHeight -= m_renderer.borderLogicalHeight();
-            logicalWidth -= m_renderer.borderLogicalWidth();
+            newReferenceBoxLogicalSize.shrink(m_renderer.borderLogicalWidth(), m_renderer.borderLogicalHeight());
             break;
         case ContentBox:
-            logicalHeight -= m_renderer.borderAndPaddingLogicalHeight();
-            logicalWidth -= m_renderer.borderAndPaddingLogicalWidth();
+            newReferenceBoxLogicalSize.shrink(m_renderer.borderAndPaddingLogicalWidth(), m_renderer.borderAndPaddingLogicalHeight());
             break;
         case Fill:
         case Stroke:
@@ -97,11 +94,10 @@
             break;
         }
 
-        LayoutSize newLogicalSize(logicalWidth, logicalHeight);
-        if (m_shapeLogicalSize == newLogicalSize)
+        if (m_referenceBoxLogicalSize == newReferenceBoxLogicalSize)
             return;
-        dirtyShapeSize();
-        m_shapeLogicalSize = newLogicalSize;
+        markShapeAsDirty();
+        m_referenceBoxLogicalSize = newReferenceBoxLogicalSize;
     }
 
     SegmentList computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineHeight) const;
@@ -113,18 +109,18 @@
     LayoutUnit shapeLogicalWidth() const { return computedShapeLogicalBoundingBox().width(); }
     LayoutUnit shapeLogicalHeight() const { return computedShapeLogicalBoundingBox().height(); }
 
-    LayoutUnit logicalLineTop() const { return m_shapeLineTop + logicalTopOffset(); }
-    LayoutUnit logicalLineBottom() const { return m_shapeLineTop + m_lineHeight + logicalTopOffset(); }
-    LayoutUnit logicalLineBottom(LayoutUnit lineHeight) const { return m_shapeLineTop + lineHeight + logicalTopOffset(); }
+    LayoutUnit logicalLineTop() const { return m_referenceBoxLineTop + logicalTopOffset(); }
+    LayoutUnit logicalLineBottom() const { return m_referenceBoxLineTop + m_lineHeight + logicalTopOffset(); }
+    LayoutUnit logicalLineBottom(LayoutUnit lineHeight) const { return m_referenceBoxLineTop + lineHeight + logicalTopOffset(); }
 
-    LayoutUnit shapeContainingBlockLogicalHeight() const { return (m_renderer.style().boxSizing() == CONTENT_BOX) ? (m_shapeLogicalSize.height() + m_renderer.borderAndPaddingLogicalHeight()) : m_shapeLogicalSize.height(); }
+    LayoutUnit shapeContainingBlockLogicalHeight() const { return (m_renderer.style().boxSizing() == CONTENT_BOX) ? (m_referenceBoxLogicalSize.height() + m_renderer.borderAndPaddingLogicalHeight()) : m_referenceBoxLogicalSize.height(); }
 
     virtual bool lineOverlapsShapeBounds() const = 0;
 
-    void dirtyShapeSize() { m_shape.clear(); }
-    bool shapeSizeDirty() { return !m_shape.get(); }
+    void markShapeAsDirty() { m_shape.clear(); }
+    bool isShapeDirty() { return !m_shape.get(); }
     const RenderType& owner() const { return m_renderer; }
-    LayoutSize shapeSize() const { return m_shapeLogicalSize; }
+    LayoutSize referenceBoxLogicalSize() const { return m_referenceBoxLogicalSize; }
 
     LayoutRect computedShapePhysicalBoundingBox() const
     {
@@ -163,7 +159,7 @@
     {
     }
 
-    virtual LayoutBox resolvedLayoutBox() const = 0;
+    virtual LayoutBox referenceBox() const = 0;
     virtual LayoutRect computedShapeLogicalBoundingBox() const = 0;
     virtual ShapeValue* shapeValue() const = 0;
     virtual void getIntervals(LayoutUnit, LayoutUnit, SegmentList&) const = 0;
@@ -172,7 +168,7 @@
 
     LayoutUnit logicalTopOffset() const
     {
-        LayoutBox box = resolvedLayoutBox();
+        LayoutBox box = referenceBox();
         switch (box) {
         case MarginBox: return -m_renderer.marginBefore();
         case BorderBox: return LayoutUnit();
@@ -191,7 +187,7 @@
     {
         if (m_renderer.isRenderRegion())
             return LayoutUnit();
-        LayoutBox box = resolvedLayoutBox();
+        LayoutBox box = referenceBox();
         switch (box) {
         case MarginBox: return -m_renderer.marginStart();
         case BorderBox: return LayoutUnit();
@@ -206,14 +202,14 @@
         return LayoutUnit();
     }
 
-    LayoutUnit m_shapeLineTop;
+    LayoutUnit m_referenceBoxLineTop;
     LayoutUnit m_lineHeight;
 
     const RenderType& m_renderer;
 
 private:
     mutable OwnPtr<Shape> m_shape;
-    LayoutSize m_shapeLogicalSize;
+    LayoutSize m_referenceBoxLogicalSize;
 };
 
 bool checkShapeImageOrigin(Document&, CachedImage&);

Modified: trunk/Source/WebCore/rendering/shapes/ShapeInsideInfo.cpp (164005 => 164006)


--- trunk/Source/WebCore/rendering/shapes/ShapeInsideInfo.cpp	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/rendering/shapes/ShapeInsideInfo.cpp	2014-02-13 03:02:53 UTC (rev 164006)
@@ -78,7 +78,7 @@
 bool ShapeInsideInfo::updateSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineHeight)
 {
     ASSERT(lineHeight >= 0);
-    m_shapeLineTop = lineTop - logicalTopOffset();
+    m_referenceBoxLineTop = lineTop - logicalTopOffset();
     m_lineHeight = lineHeight;
     m_segments.clear();
     m_segmentRanges.clear();
@@ -96,9 +96,9 @@
         return false;
 
     LayoutUnit newLineTop;
-    if (shape.firstIncludedIntervalLogicalTop(m_shapeLineTop, FloatSize(minSegmentWidth, m_lineHeight), newLineTop)) {
-        if (newLineTop > m_shapeLineTop) {
-            m_shapeLineTop = newLineTop;
+    if (shape.firstIncludedIntervalLogicalTop(m_referenceBoxLineTop, FloatSize(minSegmentWidth, m_lineHeight), newLineTop)) {
+        if (newLineTop > m_referenceBoxLineTop) {
+            m_referenceBoxLineTop = newLineTop;
             return true;
         }
     }
@@ -117,7 +117,7 @@
         return 0;
 
     LayoutUnit firstFitPosition = 0;
-    if (computedShape().firstIncludedIntervalLogicalTop(m_shapeLineTop, floatSize, firstFitPosition) && (m_shapeLineTop <= firstFitPosition))
+    if (computedShape().firstIncludedIntervalLogicalTop(m_referenceBoxLineTop, floatSize, firstFitPosition) && (m_referenceBoxLineTop <= firstFitPosition))
         return firstFitPosition;
 
     return 0;

Modified: trunk/Source/WebCore/rendering/shapes/ShapeInsideInfo.h (164005 => 164006)


--- trunk/Source/WebCore/rendering/shapes/ShapeInsideInfo.h	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/rendering/shapes/ShapeInsideInfo.h	2014-02-13 03:02:53 UTC (rev 164006)
@@ -103,11 +103,11 @@
 
     virtual bool lineOverlapsShapeBounds() const override
     {
-        return computedShape().lineOverlapsShapePaddingBounds(m_shapeLineTop, m_lineHeight);
+        return computedShape().lineOverlapsShapePaddingBounds(m_referenceBoxLineTop, m_lineHeight);
     }
 
 protected:
-    virtual LayoutBox resolvedLayoutBox() const override
+    virtual LayoutBox referenceBox() const override
     {
         if (shapeValue()->layoutBox() == BoxMissing)
             return ContentBox;

Modified: trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp (164005 => 164006)


--- trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp	2014-02-13 03:02:53 UTC (rev 164006)
@@ -61,18 +61,18 @@
 
 void ShapeOutsideInfo::updateDeltasForContainingBlockLine(const RenderBlockFlow& containingBlock, const FloatingObject& floatingObject, LayoutUnit lineTop, LayoutUnit lineHeight)
 {
-    LayoutUnit shapeTop = containingBlock.logicalTopForFloat(&floatingObject) + std::max(LayoutUnit(), containingBlock.marginBeforeForChild(m_renderer));
-    LayoutUnit floatRelativeLineTop = lineTop - shapeTop;
+    LayoutUnit borderBoxTop = containingBlock.logicalTopForFloat(&floatingObject) + std::max(LayoutUnit(), containingBlock.marginBeforeForChild(m_renderer));
+    LayoutUnit borderBoxLineTop = lineTop - borderBoxTop;
 
-    if (shapeSizeDirty() || m_lineTop != floatRelativeLineTop || m_lineHeight != lineHeight) {
-        m_lineTop = floatRelativeLineTop;
-        m_shapeLineTop = floatRelativeLineTop - logicalTopOffset();
+    if (isShapeDirty() || m_borderBoxLineTop != borderBoxLineTop || m_lineHeight != lineHeight) {
+        m_borderBoxLineTop = borderBoxLineTop;
+        m_referenceBoxLineTop = borderBoxLineTop - logicalTopOffset();
         m_lineHeight = lineHeight;
 
         LayoutUnit floatMarginBoxWidth = containingBlock.logicalWidthForFloat(&floatingObject);
 
         if (lineOverlapsShapeBounds()) {
-            SegmentList segments = computeSegmentsForLine(floatRelativeLineTop, lineHeight);
+            SegmentList segments = computeSegmentsForLine(borderBoxLineTop, lineHeight);
             if (segments.size()) {
                 LayoutUnit rawLeftMarginBoxDelta = segments.first().logicalLeft + containingBlock.marginStartForChild(m_renderer);
                 m_leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMarginBoxDelta, LayoutUnit(), floatMarginBoxWidth);

Modified: trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.h (164005 => 164006)


--- trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.h	2014-02-13 02:03:49 UTC (rev 164005)
+++ trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.h	2014-02-13 03:02:53 UTC (rev 164006)
@@ -59,11 +59,11 @@
 
     virtual bool lineOverlapsShapeBounds() const override
     {
-        return computedShape().lineOverlapsShapeMarginBounds(m_shapeLineTop, m_lineHeight);
+        return computedShape().lineOverlapsShapeMarginBounds(m_referenceBoxLineTop, m_lineHeight);
     }
 
 protected:
-    virtual LayoutBox resolvedLayoutBox() const override
+    virtual LayoutBox referenceBox() const override
     {
         if (shapeValue()->layoutBox() == BoxMissing) {
             if (shapeValue()->type() == ShapeValue::Image)
@@ -85,7 +85,7 @@
 
     LayoutUnit m_leftMarginBoxDelta;
     LayoutUnit m_rightMarginBoxDelta;
-    LayoutUnit m_lineTop;
+    LayoutUnit m_borderBoxLineTop;
     bool m_lineOverlapsShape;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to