Title: [112170] trunk/Source/WebCore
Revision
112170
Author
[email protected]
Date
2012-03-26 16:35:04 -0700 (Mon, 26 Mar 2012)

Log Message

Update LayoutUnit usage in ContainerNode, Element, and ElementRareData
https://bugs.webkit.org/show_bug.cgi?id=82219

Reviewed by Eric Seidel.

No new tests. No change in behavior.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getLowerRightCorner): linesBoundingBox returns the enclosing IntRect
of the contained lines. Inline's aren't bounded in LayoutUnits nor pixel snapped.
* dom/Element.cpp:
(WebCore::Element::boundsInRootViewSpace): Coordinates in root view space are akin to absolute
coordinates, which are always expressed in integers.
* dom/Element.h:
(Element):
* dom/ElementRareData.h:
(WebCore::defaultMinimumSizeForResizing): Using numeric_limits<LayoutUnit>::max instead of
INT_MAX to avoid overflowing when LayoutUnits are sub-pixel.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112169 => 112170)


--- trunk/Source/WebCore/ChangeLog	2012-03-26 23:33:58 UTC (rev 112169)
+++ trunk/Source/WebCore/ChangeLog	2012-03-26 23:35:04 UTC (rev 112170)
@@ -1,3 +1,24 @@
+2012-03-26  Levi Weintraub  <[email protected]>
+
+        Update LayoutUnit usage in ContainerNode, Element, and ElementRareData
+        https://bugs.webkit.org/show_bug.cgi?id=82219
+
+        Reviewed by Eric Seidel.
+
+        No new tests. No change in behavior.
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::getLowerRightCorner): linesBoundingBox returns the enclosing IntRect
+        of the contained lines. Inline's aren't bounded in LayoutUnits nor pixel snapped.
+        * dom/Element.cpp:
+        (WebCore::Element::boundsInRootViewSpace): Coordinates in root view space are akin to absolute
+        coordinates, which are always expressed in integers.
+        * dom/Element.h:
+        (Element):
+        * dom/ElementRareData.h:
+        (WebCore::defaultMinimumSizeForResizing): Using numeric_limits<LayoutUnit>::max instead of
+        INT_MAX to avoid overflowing when LayoutUnits are sub-pixel.
+
 2012-03-26  Adam Klein  <[email protected]>
 
         Update binding test output for V8 after r112163.

Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (112169 => 112170)


--- trunk/Source/WebCore/dom/ContainerNode.cpp	2012-03-26 23:33:58 UTC (rev 112169)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp	2012-03-26 23:35:04 UTC (rev 112170)
@@ -932,7 +932,7 @@
             point = FloatPoint();
             if (o->isText()) {
                 RenderText* text = toRenderText(o);
-                LayoutRect linesBox = text->linesBoundingBox();
+                IntRect linesBox = text->linesBoundingBox();
                 if (!linesBox.maxX() && !linesBox.maxY())
                     continue;
                 point.moveBy(linesBox.maxXMaxYCorner());

Modified: trunk/Source/WebCore/dom/Element.cpp (112169 => 112170)


--- trunk/Source/WebCore/dom/Element.cpp	2012-03-26 23:33:58 UTC (rev 112169)
+++ trunk/Source/WebCore/dom/Element.cpp	2012-03-26 23:35:04 UTC (rev 112170)
@@ -475,13 +475,13 @@
     return 0;
 }
 
-LayoutRect Element::boundsInRootViewSpace()
+IntRect Element::boundsInRootViewSpace()
 {
     document()->updateLayoutIgnorePendingStylesheets();
 
     FrameView* view = document()->view();
     if (!view)
-        return LayoutRect();
+        return IntRect();
 
     Vector<FloatQuad> quads;
 #if ENABLE(SVG)
@@ -500,9 +500,9 @@
     }
 
     if (quads.isEmpty())
-        return LayoutRect();
+        return IntRect();
 
-    LayoutRect result = quads[0].enclosingBoundingBox();
+    IntRect result = quads[0].enclosingBoundingBox();
     for (size_t i = 1; i < quads.size(); ++i)
         result.unite(quads[i].enclosingBoundingBox());
 

Modified: trunk/Source/WebCore/dom/Element.h (112169 => 112170)


--- trunk/Source/WebCore/dom/Element.h	2012-03-26 23:33:58 UTC (rev 112169)
+++ trunk/Source/WebCore/dom/Element.h	2012-03-26 23:35:04 UTC (rev 112170)
@@ -186,7 +186,7 @@
     virtual int scrollWidth();
     virtual int scrollHeight();
 
-    LayoutRect boundsInRootViewSpace();
+    IntRect boundsInRootViewSpace();
 
     PassRefPtr<ClientRectList> getClientRects();
     PassRefPtr<ClientRect> getBoundingClientRect();

Modified: trunk/Source/WebCore/dom/ElementRareData.h (112169 => 112170)


--- trunk/Source/WebCore/dom/ElementRareData.h	2012-03-26 23:33:58 UTC (rev 112169)
+++ trunk/Source/WebCore/dom/ElementRareData.h	2012-03-26 23:35:04 UTC (rev 112170)
@@ -81,7 +81,7 @@
 
 inline IntSize defaultMinimumSizeForResizing()
 {
-    return IntSize(INT_MAX, INT_MAX);
+    return IntSize(std::numeric_limits<LayoutUnit>::max(), std::numeric_limits<LayoutUnit>::max());
 }
 
 inline ElementRareData::ElementRareData()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to