Changeset 92631 in webkit
- Timestamp:
- Aug 8, 2011 1:49:33 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r92630 r92631 1 2011-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 1 21 2011-08-08 Cris Neckar <cdn@chromium.org> 2 22 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r92628 r92631 3227 3227 void RenderBox::addShadowOverflow() 3228 3228 { 3229 int shadowLeft;3230 int shadowRight;3231 int shadowTop;3232 int shadowBottom;3229 LayoutUnit shadowLeft; 3230 LayoutUnit shadowRight; 3231 LayoutUnit shadowTop; 3232 LayoutUnit shadowBottom; 3233 3233 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)); 3240 3240 } 3241 3241 -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r91955 r92631 722 722 } 723 723 724 void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const724 void RenderStyle::applyTransform(TransformationMatrix& transform, const LayoutSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const 725 725 { 726 726 // transform-origin brackets the transform with translate operations. … … 794 794 } 795 795 796 static RoundedRect::Radii calcRadiiFor(const BorderData& border, int width, int height)796 static RoundedRect::Radii calcRadiiFor(const BorderData& border, LayoutSize size) 797 797 { 798 798 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()))); 807 807 } 808 808 … … 839 839 } 840 840 841 RoundedRect RenderStyle::getRoundedBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const841 RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const 842 842 { 843 843 RoundedRect roundedRect(borderRect); 844 844 if (hasBorderRadius()) { 845 RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect. width(), borderRect.height());845 RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.size()); 846 846 radii.scale(calcConstraintScaleFor(borderRect, radii)); 847 847 roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge); … … 850 850 } 851 851 852 RoundedRect RenderStyle::getRoundedInnerBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const852 RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const 853 853 { 854 854 bool horizontal = isHorizontalWritingMode(); 855 855 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; 860 860 861 861 return getRoundedInnerBorderFor(borderRect, topWidth, bottomWidth, leftWidth, rightWidth, includeLogicalLeftEdge, includeLogicalRightEdge); 862 862 } 863 863 864 RoundedRect RenderStyle::getRoundedInnerBorderFor(const IntRect& borderRect,865 int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const866 { 867 IntRect innerRect(borderRect.x() + leftWidth,868 borderRect.y() + topWidth,869 borderRect.width() - leftWidth - rightWidth,870 borderRect.height() - topWidth - bottomWidth);864 RoundedRect 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); 871 871 872 872 RoundedRect roundedRect(innerRect); -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r92164 r92631 743 743 744 744 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }; 745 void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;745 void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const; 746 746 void setPageScaleTransform(float); 747 747 … … 882 882 } 883 883 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; 889 889 890 890 void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border.m_left.m_width, v) } -
trunk/Source/WebCore/rendering/style/ShadowData.cpp
r90869 r92631 71 71 void ShadowData::adjustRectForShadow(IntRect& rect, int additionalOutlineSize) const 72 72 { 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; 77 77 calculateShadowExtent(this, additionalOutlineSize, shadowLeft, shadowRight, shadowTop, shadowBottom); 78 78
Note: See TracChangeset
for help on using the changeset viewer.