Changeset 92631 in webkit


Ignore:
Timestamp:
Aug 8, 2011 1:49:33 PM (13 years ago)
Author:
eae@chromium.org
Message:

Switch RenderStyle to to new layout types
https://bugs.webkit.org/show_bug.cgi?id=65208

Reviewed by Eric Seidel.

No new tests, no new functionality.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::addShadowOverflow):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::applyTransform):
(WebCore::calcRadiiFor):
(WebCore::RenderStyle::getRoundedBorderFor):
(WebCore::RenderStyle::getRoundedInnerBorderFor):

  • rendering/style/RenderStyle.h:
  • rendering/style/ShadowData.cpp:

(WebCore::ShadowData::adjustRectForShadow):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r92630 r92631  
     12011-08-08  Emil A Eklund  <eae@chromium.org>
     2
     3        Switch RenderStyle to to new layout types
     4        https://bugs.webkit.org/show_bug.cgi?id=65208
     5
     6        Reviewed by Eric Seidel.
     7
     8        No new tests, no new functionality.
     9
     10        * rendering/RenderBox.cpp:
     11        (WebCore::RenderBox::addShadowOverflow):
     12        * rendering/style/RenderStyle.cpp:
     13        (WebCore::RenderStyle::applyTransform):
     14        (WebCore::calcRadiiFor):
     15        (WebCore::RenderStyle::getRoundedBorderFor):
     16        (WebCore::RenderStyle::getRoundedInnerBorderFor):
     17        * rendering/style/RenderStyle.h:
     18        * rendering/style/ShadowData.cpp:
     19        (WebCore::ShadowData::adjustRectForShadow):
     20
    1212011-08-08  Cris Neckar  <cdn@chromium.org>
    222
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r92628 r92631  
    32273227void RenderBox::addShadowOverflow()
    32283228{
    3229     int shadowLeft;
    3230     int shadowRight;
    3231     int shadowTop;
    3232     int shadowBottom;
     3229    LayoutUnit shadowLeft;
     3230    LayoutUnit shadowRight;
     3231    LayoutUnit shadowTop;
     3232    LayoutUnit shadowBottom;
    32333233    style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft);
    3234     IntRect borderBox = borderBoxRect();
    3235     int overflowLeft = borderBox.x() + shadowLeft;
    3236     int overflowRight = borderBox.maxX() + shadowRight;
    3237     int overflowTop = borderBox.y() + shadowTop;
    3238     int overflowBottom = borderBox.maxY() + shadowBottom;
    3239     addVisualOverflow(IntRect(overflowLeft, overflowTop, overflowRight - overflowLeft, overflowBottom - overflowTop));
     3234    LayoutRect borderBox = borderBoxRect();
     3235    LayoutUnit overflowLeft = borderBox.x() + shadowLeft;
     3236    LayoutUnit overflowRight = borderBox.maxX() + shadowRight;
     3237    LayoutUnit overflowTop = borderBox.y() + shadowTop;
     3238    LayoutUnit overflowBottom = borderBox.maxY() + shadowBottom;
     3239    addVisualOverflow(LayoutRect(overflowLeft, overflowTop, overflowRight - overflowLeft, overflowBottom - overflowTop));
    32403240}
    32413241
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r91955 r92631  
    722722}
    723723
    724 void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const
     724void RenderStyle::applyTransform(TransformationMatrix& transform, const LayoutSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const
    725725{
    726726    // transform-origin brackets the transform with translate operations.
     
    794794}
    795795
    796 static RoundedRect::Radii calcRadiiFor(const BorderData& border, int width, int height)
     796static RoundedRect::Radii calcRadiiFor(const BorderData& border, LayoutSize size)
    797797{
    798798    return RoundedRect::Radii(
    799         LayoutSize(border.topLeft().width().calcValue(width),
    800                    border.topLeft().height().calcValue(height)),
    801         LayoutSize(border.topRight().width().calcValue(width),
    802                    border.topRight().height().calcValue(height)),
    803         LayoutSize(border.bottomLeft().width().calcValue(width),
    804                    border.bottomLeft().height().calcValue(height)),
    805         LayoutSize(border.bottomRight().width().calcValue(width),
    806                    border.bottomRight().height().calcValue(height)));
     799        LayoutSize(border.topLeft().width().calcValue(size.width()),
     800                   border.topLeft().height().calcValue(size.height())),
     801        LayoutSize(border.topRight().width().calcValue(size.width()),
     802                   border.topRight().height().calcValue(size.height())),
     803        LayoutSize(border.bottomLeft().width().calcValue(size.width()),
     804                   border.bottomLeft().height().calcValue(size.height())),
     805        LayoutSize(border.bottomRight().width().calcValue(size.width()),
     806                   border.bottomRight().height().calcValue(size.height())));
    807807}
    808808
     
    839839}
    840840
    841 RoundedRect RenderStyle::getRoundedBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
     841RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
    842842{
    843843    RoundedRect roundedRect(borderRect);
    844844    if (hasBorderRadius()) {
    845         RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.width(), borderRect.height());
     845        RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.size());
    846846        radii.scale(calcConstraintScaleFor(borderRect, radii));
    847847        roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge);
     
    850850}
    851851
    852 RoundedRect RenderStyle::getRoundedInnerBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
     852RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
    853853{
    854854    bool horizontal = isHorizontalWritingMode();
    855855
    856     int leftWidth = (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0;
    857     int rightWidth = (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0;
    858     int topWidth = (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0;
    859     int bottomWidth = (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0;
     856    LayoutUnit leftWidth = (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0;
     857    LayoutUnit rightWidth = (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0;
     858    LayoutUnit topWidth = (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0;
     859    LayoutUnit bottomWidth = (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0;
    860860
    861861    return getRoundedInnerBorderFor(borderRect, topWidth, bottomWidth, leftWidth, rightWidth, includeLogicalLeftEdge, includeLogicalRightEdge);
    862862}
    863863
    864 RoundedRect RenderStyle::getRoundedInnerBorderFor(const IntRect& borderRect,
    865     int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
    866 {
    867     IntRect innerRect(borderRect.x() + leftWidth,
    868             borderRect.y() + topWidth,
    869             borderRect.width() - leftWidth - rightWidth,
    870             borderRect.height() - topWidth - bottomWidth);
     864RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect,
     865    LayoutUnit topWidth, LayoutUnit bottomWidth, LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
     866{
     867    LayoutRect innerRect(borderRect.x() + leftWidth,
     868               borderRect.y() + topWidth,
     869               borderRect.width() - leftWidth - rightWidth,
     870               borderRect.height() - topWidth - bottomWidth);
    871871
    872872    RoundedRect roundedRect(innerRect);
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r92164 r92631  
    743743
    744744    enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
    745     void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
     745    void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
    746746    void setPageScaleTransform(float);
    747747
     
    882882    }
    883883   
    884     RoundedRect getRoundedBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
    885     RoundedRect getRoundedInnerBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
    886 
    887     RoundedRect getRoundedInnerBorderFor(const IntRect& borderRect,
    888         int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
     884    RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
     885    RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
     886
     887    RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect,
     888        LayoutUnit topWidth, LayoutUnit bottomWidth, LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
    889889
    890890    void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border.m_left.m_width, v) }
  • trunk/Source/WebCore/rendering/style/ShadowData.cpp

    r90869 r92631  
    7171void ShadowData::adjustRectForShadow(IntRect& rect, int additionalOutlineSize) const
    7272{
    73     int shadowLeft = 0;
    74     int shadowRight = 0;
    75     int shadowTop = 0;
    76     int shadowBottom = 0;
     73    LayoutUnit shadowLeft = 0;
     74    LayoutUnit shadowRight = 0;
     75    LayoutUnit shadowTop = 0;
     76    LayoutUnit shadowBottom = 0;
    7777    calculateShadowExtent(this, additionalOutlineSize, shadowLeft, shadowRight, shadowTop, shadowBottom);
    7878
Note: See TracChangeset for help on using the changeset viewer.