Title: [92631] trunk/Source/WebCore
Revision
92631
Author
[email protected]
Date
2011-08-08 13:49:33 -0700 (Mon, 08 Aug 2011)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (92630 => 92631)


--- trunk/Source/WebCore/ChangeLog	2011-08-08 20:39:23 UTC (rev 92630)
+++ trunk/Source/WebCore/ChangeLog	2011-08-08 20:49:33 UTC (rev 92631)
@@ -1,3 +1,23 @@
+2011-08-08  Emil A Eklund  <[email protected]>
+
+        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):
+
 2011-08-08  Cris Neckar  <[email protected]>
 
         Remove counter nodes from the tree and fix-up children when they are removed from the counter map.

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (92630 => 92631)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2011-08-08 20:39:23 UTC (rev 92630)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2011-08-08 20:49:33 UTC (rev 92631)
@@ -3226,17 +3226,17 @@
 
 void RenderBox::addShadowOverflow()
 {
-    int shadowLeft;
-    int shadowRight;
-    int shadowTop;
-    int shadowBottom;
+    LayoutUnit shadowLeft;
+    LayoutUnit shadowRight;
+    LayoutUnit shadowTop;
+    LayoutUnit shadowBottom;
     style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft);
-    IntRect borderBox = borderBoxRect();
-    int overflowLeft = borderBox.x() + shadowLeft;
-    int overflowRight = borderBox.maxX() + shadowRight;
-    int overflowTop = borderBox.y() + shadowTop;
-    int overflowBottom = borderBox.maxY() + shadowBottom;
-    addVisualOverflow(IntRect(overflowLeft, overflowTop, overflowRight - overflowLeft, overflowBottom - overflowTop));
+    LayoutRect borderBox = borderBoxRect();
+    LayoutUnit overflowLeft = borderBox.x() + shadowLeft;
+    LayoutUnit overflowRight = borderBox.maxX() + shadowRight;
+    LayoutUnit overflowTop = borderBox.y() + shadowTop;
+    LayoutUnit overflowBottom = borderBox.maxY() + shadowBottom;
+    addVisualOverflow(LayoutRect(overflowLeft, overflowTop, overflowRight - overflowLeft, overflowBottom - overflowTop));
 }
 
 void RenderBox::addOverflowFromChild(RenderBox* child, const LayoutSize& delta)

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (92630 => 92631)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2011-08-08 20:39:23 UTC (rev 92630)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2011-08-08 20:49:33 UTC (rev 92631)
@@ -721,7 +721,7 @@
     rareNonInheritedData.access()->m_content = ContentData::create(quote);
 }
 
-void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const
+void RenderStyle::applyTransform(TransformationMatrix& transform, const LayoutSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const
 {
     // transform-origin brackets the transform with translate operations.
     // Optimize for the case where the only transform is a translation, since the transform-origin is irrelevant
@@ -793,17 +793,17 @@
     rareData->m_boxShadow = shadowData;
 }
 
-static RoundedRect::Radii calcRadiiFor(const BorderData& border, int width, int height)
+static RoundedRect::Radii calcRadiiFor(const BorderData& border, LayoutSize size)
 {
     return RoundedRect::Radii(
-        LayoutSize(border.topLeft().width().calcValue(width), 
-                   border.topLeft().height().calcValue(height)),
-        LayoutSize(border.topRight().width().calcValue(width),
-                   border.topRight().height().calcValue(height)),
-        LayoutSize(border.bottomLeft().width().calcValue(width), 
-                   border.bottomLeft().height().calcValue(height)),
-        LayoutSize(border.bottomRight().width().calcValue(width), 
-                   border.bottomRight().height().calcValue(height)));
+        LayoutSize(border.topLeft().width().calcValue(size.width()), 
+                   border.topLeft().height().calcValue(size.height())),
+        LayoutSize(border.topRight().width().calcValue(size.width()),
+                   border.topRight().height().calcValue(size.height())),
+        LayoutSize(border.bottomLeft().width().calcValue(size.width()), 
+                   border.bottomLeft().height().calcValue(size.height())),
+        LayoutSize(border.bottomRight().width().calcValue(size.width()), 
+                   border.bottomRight().height().calcValue(size.height())));
 }
 
 static float calcConstraintScaleFor(const IntRect& rect, const RoundedRect::Radii& radii)
@@ -838,36 +838,36 @@
     return factor;
 }
 
-RoundedRect RenderStyle::getRoundedBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
+RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
 {
     RoundedRect roundedRect(borderRect);
     if (hasBorderRadius()) {
-        RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.width(), borderRect.height());
+        RoundedRect::Radii radii = calcRadiiFor(surround->border, borderRect.size());
         radii.scale(calcConstraintScaleFor(borderRect, radii));
         roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), includeLogicalLeftEdge, includeLogicalRightEdge);
     }
     return roundedRect;
 }
 
-RoundedRect RenderStyle::getRoundedInnerBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
+RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
 {
     bool horizontal = isHorizontalWritingMode();
 
-    int leftWidth = (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0;
-    int rightWidth = (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0;
-    int topWidth = (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0;
-    int bottomWidth = (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0;
+    LayoutUnit leftWidth = (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0;
+    LayoutUnit rightWidth = (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0;
+    LayoutUnit topWidth = (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0;
+    LayoutUnit bottomWidth = (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0;
 
     return getRoundedInnerBorderFor(borderRect, topWidth, bottomWidth, leftWidth, rightWidth, includeLogicalLeftEdge, includeLogicalRightEdge);
 }
 
-RoundedRect RenderStyle::getRoundedInnerBorderFor(const IntRect& borderRect,
-    int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
+RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect,
+    LayoutUnit topWidth, LayoutUnit bottomWidth, LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
 {
-    IntRect innerRect(borderRect.x() + leftWidth, 
-            borderRect.y() + topWidth, 
-            borderRect.width() - leftWidth - rightWidth, 
-            borderRect.height() - topWidth - bottomWidth);
+    LayoutRect innerRect(borderRect.x() + leftWidth, 
+               borderRect.y() + topWidth, 
+               borderRect.width() - leftWidth - rightWidth, 
+               borderRect.height() - topWidth - bottomWidth);
 
     RoundedRect roundedRect(innerRect);
 

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (92630 => 92631)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2011-08-08 20:39:23 UTC (rev 92630)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2011-08-08 20:49:33 UTC (rev 92631)
@@ -742,7 +742,7 @@
     bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
 
     enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
-    void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
+    void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
     void setPageScaleTransform(float);
 
     bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
@@ -881,11 +881,11 @@
         setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed)));
     }
     
-    RoundedRect getRoundedBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
-    RoundedRect getRoundedInnerBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
+    RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
+    RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
 
-    RoundedRect getRoundedInnerBorderFor(const IntRect& borderRect,
-        int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
+    RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect,
+        LayoutUnit topWidth, LayoutUnit bottomWidth, LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
 
     void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border.m_left.m_width, v) }
     void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v) }

Modified: trunk/Source/WebCore/rendering/style/ShadowData.cpp (92630 => 92631)


--- trunk/Source/WebCore/rendering/style/ShadowData.cpp	2011-08-08 20:39:23 UTC (rev 92630)
+++ trunk/Source/WebCore/rendering/style/ShadowData.cpp	2011-08-08 20:49:33 UTC (rev 92631)
@@ -70,10 +70,10 @@
 
 void ShadowData::adjustRectForShadow(IntRect& rect, int additionalOutlineSize) const
 {
-    int shadowLeft = 0;
-    int shadowRight = 0;
-    int shadowTop = 0;
-    int shadowBottom = 0;
+    LayoutUnit shadowLeft = 0;
+    LayoutUnit shadowRight = 0;
+    LayoutUnit shadowTop = 0;
+    LayoutUnit shadowBottom = 0;
     calculateShadowExtent(this, additionalOutlineSize, shadowLeft, shadowRight, shadowTop, shadowBottom);
 
     rect.move(shadowLeft, shadowTop);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to