Title: [100042] branches/subpixellayout/Source/WebCore

Diff

Modified: branches/subpixellayout/Source/WebCore/dom/Element.cpp (100041 => 100042)


--- branches/subpixellayout/Source/WebCore/dom/Element.cpp	2011-11-11 23:54:14 UTC (rev 100041)
+++ branches/subpixellayout/Source/WebCore/dom/Element.cpp	2011-11-11 23:54:58 UTC (rev 100042)
@@ -344,20 +344,16 @@
 int Element::offsetWidth()
 {
     document()->updateLayoutIgnorePendingStylesheets();
-    if (RenderBoxModelObject* rend = renderBoxModelObject()) {
-        LayoutUnit adjustForIntRounding = rend->offsetLeft() - rend->offsetLeft().floor();
-        return roundf(adjustForAbsoluteZoom(rend->offsetWidth() + adjustForIntRounding, rend));
-    }
+    if (RenderBoxModelObject* rend = renderBoxModelObject())
+        return adjustForAbsoluteZoom(rend->offsetWidth(), rend);
     return 0;
 }
 
 int Element::offsetHeight()
 {
     document()->updateLayoutIgnorePendingStylesheets();
-    if (RenderBoxModelObject* rend = renderBoxModelObject()) {
-        LayoutUnit adjustForIntRounding = rend->offsetTop() - rend->offsetTop().floor();
-        return roundf(adjustForAbsoluteZoom(rend->offsetHeight() + adjustForIntRounding, rend));
-    }
+    if (RenderBoxModelObject* rend = renderBoxModelObject())
+        return adjustForAbsoluteZoom(rend->offsetHeight(), rend);
     return 0;
 }
 
@@ -375,7 +371,7 @@
     document()->updateLayoutIgnorePendingStylesheets();
 
     if (RenderBox* rend = renderBox())
-        return roundf(adjustForAbsoluteZoom(rend->clientLeft(), rend));
+        return adjustForAbsoluteZoom(rend->clientLeft(), rend);
     return 0;
 }
 
@@ -384,7 +380,7 @@
     document()->updateLayoutIgnorePendingStylesheets();
 
     if (RenderBox* rend = renderBox())
-        return roundf(adjustForAbsoluteZoom(rend->clientTop(), rend));
+        return adjustForAbsoluteZoom(rend->clientTop(), rend);
     return 0;
 }
 
@@ -399,14 +395,12 @@
         (inQuirksMode && isHTMLElement() && document()->body() == this)) {
         if (FrameView* view = document()->view()) {
             if (RenderView* renderView = document()->renderView())
-                return roundf(adjustForAbsoluteZoom(view->layoutWidth(), renderView));
+                return adjustForAbsoluteZoom(view->layoutWidth(), renderView);
         }
     }
     
-    if (RenderBox* rend = renderBox()) {
-        LayoutUnit adjustForIntRounding = rend->clientLeft() - rend->clientLeft().floor();
-        return roundf(adjustForAbsoluteZoom(rend->clientWidth() + adjustForIntRounding, rend));
-    }
+    if (RenderBox* rend = renderBox())
+        return adjustForAbsoluteZoom(rend->clientWidth(), rend);
     return 0;
 }
 
@@ -422,14 +416,12 @@
         (inQuirksMode && isHTMLElement() && document()->body() == this)) {
         if (FrameView* view = document()->view()) {
             if (RenderView* renderView = document()->renderView())
-                return roundf(adjustForAbsoluteZoom(view->layoutHeight(), renderView));
+                return adjustForAbsoluteZoom(view->layoutHeight(), renderView);
         }
     }
     
-    if (RenderBox* rend = renderBox()) {
-        LayoutUnit adjustForIntRounding = rend->clientTop() - rend->clientTop().floor();
-        return roundf(adjustForAbsoluteZoom(rend->clientHeight() + adjustForIntRounding, rend));
-    }
+    if (RenderBox* rend = renderBox())
+        return adjustForAbsoluteZoom(rend->clientHeight(), rend);
     return 0;
 }
 
@@ -445,7 +437,7 @@
 {
     document()->updateLayoutIgnorePendingStylesheets();
     if (RenderBox* rend = renderBox())
-        return roundf(adjustForAbsoluteZoom(rend->scrollTop(), rend));
+        return adjustForAbsoluteZoom(rend->scrollTop(), rend);
     return 0;
 }
 
@@ -467,7 +459,7 @@
 {
     document()->updateLayoutIgnorePendingStylesheets();
     if (RenderBox* rend = renderBox()) {
-        return roundf(adjustForAbsoluteZoom(rend->scrollWidth(), rend));
+        return adjustForAbsoluteZoom(rend->scrollWidth(), rend);
     }
     return 0;
 }
@@ -476,7 +468,7 @@
 {
     document()->updateLayoutIgnorePendingStylesheets();
     if (RenderBox* rend = renderBox()) {
-        return roundf(adjustForAbsoluteZoom(rend->scrollHeight(), rend));
+        return adjustForAbsoluteZoom(rend->scrollHeight(), rend);
     }
     return 0;
 }

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBox.cpp (100041 => 100042)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBox.cpp	2011-11-11 23:54:14 UTC (rev 100041)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBox.cpp	2011-11-11 23:54:58 UTC (rev 100042)
@@ -465,14 +465,14 @@
 
 // More IE extensions.  clientWidth and clientHeight represent the interior of an object
 // excluding border and scrollbar.
-LayoutUnit RenderBox::clientWidth() const
+int RenderBox::clientWidth() const
 {
-    return width() - borderLeft() - borderRight() - verticalScrollbarWidth();
+    return (width() - borderLeft() - borderRight() - verticalScrollbarWidth()).round();
 }
 
-LayoutUnit RenderBox::clientHeight() const
+int RenderBox::clientHeight() const
 {
-    return height() - borderTop() - borderBottom() - horizontalScrollbarHeight();
+    return (height() - borderTop() - borderBottom() - horizontalScrollbarHeight()).round();
 }
 
 int RenderBox::scrollWidth() const
@@ -482,8 +482,8 @@
     // For objects with visible overflow, this matches IE.
     // FIXME: Need to work right with writing modes.
     if (style()->isLeftToRightDirection())
-        return max(clientWidth(), maxXLayoutOverflow() - borderLeft());
-    return clientWidth() - min<int>(0, minXLayoutOverflow() - borderLeft());
+        return max(clientWidth(), (maxXLayoutOverflow() - borderLeft()).round());
+    return clientWidth() - min(0, (minXLayoutOverflow() - borderLeft()).round());
 }
 
 int RenderBox::scrollHeight() const

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBox.h (100041 => 100042)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBox.h	2011-11-11 23:54:14 UTC (rev 100041)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBox.h	2011-11-11 23:54:58 UTC (rev 100042)
@@ -180,19 +180,19 @@
 
     // IE extensions. Used to calculate offsetWidth/Height.  Overridden by inlines (RenderFlow)
     // to return the remaining width on a given line (and the height of a single line).
-    virtual LayoutUnit offsetWidth() const { return width(); }
-    virtual LayoutUnit offsetHeight() const { return height(); }
+    virtual int offsetWidth() const { return width(); }
+    virtual int offsetHeight() const { return height(); }
 
     // More IE extensions.  clientWidth and clientHeight represent the interior of an object
     // excluding border and scrollbar.  clientLeft/Top are just the borderLeftWidth and borderTopWidth.
-    LayoutUnit clientLeft() const { return borderLeft(); }
-    LayoutUnit clientTop() const { return borderTop(); }
-    LayoutUnit clientWidth() const;
-    LayoutUnit clientHeight() const;
-    LayoutUnit clientLogicalWidth() const { return style()->isHorizontalWritingMode() ? clientWidth() : clientHeight(); }
-    LayoutUnit clientLogicalHeight() const { return style()->isHorizontalWritingMode() ? clientHeight() : clientWidth(); }
-    LayoutUnit clientLogicalBottom() const { return borderBefore() + clientLogicalHeight(); }
-    LayoutRect clientBoxRect() const { return LayoutRect(clientLeft(), clientTop(), clientWidth(), clientHeight()); }
+    int clientLeft() const { return borderLeft().round(); }
+    int clientTop() const { return borderTop().round(); }
+    int clientWidth() const;
+    int clientHeight() const;
+    int clientLogicalWidth() const { return style()->isHorizontalWritingMode() ? clientWidth() : clientHeight(); }
+    int clientLogicalHeight() const { return style()->isHorizontalWritingMode() ? clientHeight() : clientWidth(); }
+    int clientLogicalBottom() const { return borderBefore() + clientLogicalHeight(); }
+    IntRect clientBoxRect() const { return IntRect(clientLeft(), clientTop(), clientWidth(), clientHeight()); }
 
     // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the
     // object has overflow:hidden/scroll/auto specified and also has overflow.

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.cpp (100041 => 100042)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.cpp	2011-11-11 23:54:14 UTC (rev 100041)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.cpp	2011-11-11 23:54:58 UTC (rev 100042)
@@ -431,7 +431,7 @@
     return 0;
 }
 
-LayoutUnit RenderBoxModelObject::offsetLeft() const
+int RenderBoxModelObject::offsetLeft() const
 {
     // If the element is the HTML body element or does not have an associated box
     // return 0 and stop this algorithm.
@@ -462,10 +462,10 @@
         }
     }
 
-    return xPos;
+    return xPos.round();
 }
 
-LayoutUnit RenderBoxModelObject::offsetTop() const
+int RenderBoxModelObject::offsetTop() const
 {
     // If the element is the HTML body element or does not have an associated box
     // return 0 and stop this algorithm.
@@ -495,7 +495,7 @@
                 yPos += toRenderBox(offsetPar)->top();
         }
     }
-    return yPos;
+    return yPos.round();
 }
 
 LayoutUnit RenderBoxModelObject::paddingTop(bool) const

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.h (100041 => 100042)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.h	2011-11-11 23:54:14 UTC (rev 100041)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.h	2011-11-11 23:54:58 UTC (rev 100042)
@@ -55,10 +55,10 @@
 
     // IE extensions. Used to calculate offsetWidth/Height.  Overridden by inlines (RenderFlow)
     // to return the remaining width on a given line (and the height of a single line).
-    virtual LayoutUnit offsetLeft() const;
-    virtual LayoutUnit offsetTop() const;
-    virtual LayoutUnit offsetWidth() const = 0;
-    virtual LayoutUnit offsetHeight() const = 0;
+    virtual int offsetLeft() const;
+    virtual int offsetTop() const;
+    virtual int offsetWidth() const = 0;
+    virtual int offsetHeight() const = 0;
 
     virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderInline.cpp (100041 => 100042)


--- branches/subpixellayout/Source/WebCore/rendering/RenderInline.cpp	2011-11-11 23:54:14 UTC (rev 100041)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderInline.cpp	2011-11-11 23:54:58 UTC (rev 100042)
@@ -637,17 +637,17 @@
     }
 }
 
-LayoutUnit RenderInline::offsetLeft() const
+int RenderInline::offsetLeft() const
 {
-    LayoutUnit x = RenderBoxModelObject::offsetLeft();
+    int x = RenderBoxModelObject::offsetLeft();
     if (InlineBox* firstBox = firstLineBoxIncludingCulling())
         x += firstBox->x();
     return x;
 }
 
-LayoutUnit RenderInline::offsetTop() const
+int RenderInline::offsetTop() const
 {
-    LayoutUnit y = RenderBoxModelObject::offsetTop();
+    int y = RenderBoxModelObject::offsetTop();
     if (InlineBox* firstBox = firstLineBoxIncludingCulling())
         y += firstBox->y();
     return y;

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderInline.h (100041 => 100042)


--- branches/subpixellayout/Source/WebCore/rendering/RenderInline.h	2011-11-11 23:54:14 UTC (rev 100041)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderInline.h	2011-11-11 23:54:58 UTC (rev 100042)
@@ -121,10 +121,10 @@
 
     virtual bool requiresLayer() const { return isRelPositioned() || isTransparent() || hasMask(); }
 
-    virtual LayoutUnit offsetLeft() const;
-    virtual LayoutUnit offsetTop() const;
-    virtual LayoutUnit offsetWidth() const { return linesBoundingBox().width(); }
-    virtual LayoutUnit offsetHeight() const { return linesBoundingBox().height(); }
+    virtual int offsetLeft() const;
+    virtual int offsetTop() const;
+    virtual int offsetWidth() const { return linesBoundingBox().width(); }
+    virtual int offsetHeight() const { return linesBoundingBox().height(); }
 
     virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const;
     virtual LayoutRect rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, LayoutUnit outlineWidth) const;

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderListBox.cpp (100041 => 100042)


--- branches/subpixellayout/Source/WebCore/rendering/RenderListBox.cpp	2011-11-11 23:54:14 UTC (rev 100041)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderListBox.cpp	2011-11-11 23:54:58 UTC (rev 100042)
@@ -650,7 +650,7 @@
 
 int RenderListBox::scrollHeight() const
 {
-    return max(clientHeight(), listHeight());
+    return max(clientHeight(), listHeight().round());
 }
 
 int RenderListBox::scrollLeft() const

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderVideo.cpp (100041 => 100042)


--- branches/subpixellayout/Source/WebCore/rendering/RenderVideo.cpp	2011-11-11 23:54:14 UTC (rev 100041)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderVideo.cpp	2011-11-11 23:54:58 UTC (rev 100042)
@@ -300,28 +300,28 @@
     return fullScreen->placeholder();
 }
 
-LayoutUnit RenderVideo::offsetLeft() const
+int RenderVideo::offsetLeft() const
 {
     if (const RenderBlock* block = rendererPlaceholder(this))
         return block->offsetLeft();
     return RenderMedia::offsetLeft();
 }
 
-LayoutUnit RenderVideo::offsetTop() const
+int RenderVideo::offsetTop() const
 {
     if (const RenderBlock* block = rendererPlaceholder(this))
         return block->offsetTop();
     return RenderMedia::offsetTop();
 }
 
-LayoutUnit RenderVideo::offsetWidth() const
+int RenderVideo::offsetWidth() const
 {
     if (const RenderBlock* block = rendererPlaceholder(this))
         return block->offsetWidth();
     return RenderMedia::offsetWidth();
 }
 
-LayoutUnit RenderVideo::offsetHeight() const
+int RenderVideo::offsetHeight() const
 {
     if (const RenderBlock* block = rendererPlaceholder(this))
         return block->offsetHeight();

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderVideo.h (100041 => 100042)


--- branches/subpixellayout/Source/WebCore/rendering/RenderVideo.h	2011-11-11 23:54:14 UTC (rev 100041)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderVideo.h	2011-11-11 23:54:58 UTC (rev 100042)
@@ -75,10 +75,10 @@
     virtual int minimumReplacedHeight() const;
 
 #if ENABLE(FULLSCREEN_API)
-    virtual LayoutUnit offsetLeft() const;
-    virtual LayoutUnit offsetTop() const;
-    virtual LayoutUnit offsetWidth() const;
-    virtual LayoutUnit offsetHeight() const;
+    virtual int offsetLeft() const;
+    virtual int offsetTop() const;
+    virtual int offsetWidth() const;
+    virtual int offsetHeight() const;
 #endif
 
     void updatePlayer();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to