Changeset 155626 in webkit


Ignore:
Timestamp:
Sep 12, 2013 9:49:39 AM (11 years ago)
Author:
zoltan@webkit.org
Message:

[CSS Shapes] Turn shape's logicalwidth/height into a LayoutSize
https://bugs.webkit.org/show_bug.cgi?id=121187

Reviewed by David Hyatt.

No new tests, no behavior change.

  • rendering/shapes/ShapeInfo.cpp:

(WebCore::::computedShape):

  • rendering/shapes/ShapeInfo.h:

(WebCore::ShapeInfo::setShapeSize):
(WebCore::ShapeInfo::shapeContainingBlockHeight):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r155625 r155626  
     12013-09-12  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS Shapes] Turn shape's logicalwidth/height into a LayoutSize
     4        https://bugs.webkit.org/show_bug.cgi?id=121187
     5
     6        Reviewed by David Hyatt.
     7
     8        No new tests, no behavior change.
     9
     10        * rendering/shapes/ShapeInfo.cpp:
     11        (WebCore::::computedShape):
     12        * rendering/shapes/ShapeInfo.h:
     13        (WebCore::ShapeInfo::setShapeSize):
     14        (WebCore::ShapeInfo::shapeContainingBlockHeight):
     15
    1162013-09-12  Darin Adler  <darin@apple.com>
    217
  • trunk/Source/WebCore/rendering/shapes/ShapeInfo.cpp

    r154081 r155626  
    4646        return shape;
    4747
    48     const LayoutSize logicalBoxSize(m_shapeLogicalWidth, m_shapeLogicalHeight);
    4948    WritingMode writingMode = m_renderer->style()->writingMode();
    5049    Length margin = m_renderer->style()->shapeMargin();
     
    5655    case ShapeValue::Shape:
    5756        ASSERT(shapeValue->shape());
    58         m_shape = Shape::createShape(shapeValue->shape(), logicalBoxSize, writingMode, margin, padding);
     57        m_shape = Shape::createShape(shapeValue->shape(), m_shapeLogicalSize, writingMode, margin, padding);
    5958        break;
    6059    case ShapeValue::Image:
    6160        ASSERT(shapeValue->image());
    62         m_shape = Shape::createShape(shapeValue->image(), 0, logicalBoxSize, writingMode, margin, padding);
     61        m_shape = Shape::createShape(shapeValue->image(), 0, m_shapeLogicalSize, writingMode, margin, padding);
    6362        break;
    6463    default:
  • trunk/Source/WebCore/rendering/shapes/ShapeInfo.h

    r152925 r155626  
    7373    void setShapeSize(LayoutUnit logicalWidth, LayoutUnit logicalHeight)
    7474    {
    75         if (m_renderer->style()->boxSizing() == CONTENT_BOX) {
    76             logicalWidth -= m_renderer->borderAndPaddingLogicalWidth();
    77             logicalHeight -= m_renderer->borderAndPaddingLogicalHeight();
    78         }
     75        LayoutSize newLogicalSize(logicalWidth, logicalHeight);
    7976
    80         if (m_shapeLogicalWidth == logicalWidth && m_shapeLogicalHeight == logicalHeight)
     77        if (m_renderer->style()->boxSizing() == CONTENT_BOX)
     78            newLogicalSize -= LayoutSize(m_renderer->borderAndPaddingLogicalWidth(), m_renderer->borderAndPaddingLogicalHeight());
     79
     80        if (m_shapeLogicalSize == newLogicalSize)
    8181            return;
    8282        dirtyShapeSize();
    83         m_shapeLogicalWidth = logicalWidth;
    84         m_shapeLogicalHeight = logicalHeight;
     83        m_shapeLogicalSize = newLogicalSize;
    8584    }
    8685
     
    9897    LayoutUnit logicalLineBottom() const { return m_shapeLineTop + m_lineHeight + logicalTopOffset(); }
    9998
    100     LayoutUnit shapeContainingBlockHeight() const { return (m_renderer->style()->boxSizing() == CONTENT_BOX) ? (m_shapeLogicalHeight + m_renderer->borderAndPaddingLogicalHeight()) : m_shapeLogicalHeight; }
     99    LayoutUnit shapeContainingBlockHeight() const { return (m_renderer->style()->boxSizing() == CONTENT_BOX) ? (m_shapeLogicalSize.height() + m_renderer->borderAndPaddingLogicalHeight()) : m_shapeLogicalSize.height(); }
    101100
    102101    bool lineOverlapsShapeBounds() const { return logicalLineTop() < shapeLogicalBottom() && shapeLogicalTop() <= logicalLineBottom(); }
     
    123122private:
    124123    mutable OwnPtr<Shape> m_shape;
    125 
    126     LayoutUnit m_shapeLogicalWidth;
    127     LayoutUnit m_shapeLogicalHeight;
     124    LayoutSize m_shapeLogicalSize;
    128125};
    129126}
Note: See TracChangeset for help on using the changeset viewer.