Add pixelSnappedX/Y/Width/Height methods
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 03:56:27 +0000 (03:56 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 03:56:27 +0000 (03:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78040

Reviewed by Eric Seidel.

Add pixel snapped versions of x/y/width/height methods. These return the
same value as the x/w/width/height methods for now but once we move over
to sub pixel layout they will snap the subpixel value to a device pixel
and return an integer value.

When snapping the left and top edge is simply rounded to the nearest
device pixel.
The right and bottom edges are computed by subtracting the rounded left/
top edge from the precise location and size. This ensures that the edges
all line up with device pixels and that the total size of an object,
including borders, is at most one pixel off.

In summary, the values are computed as follows:
        x: round(x)
        y: round(y)
        maxX: round(x + width)
        maxY: round(y + height)
        width: round(x + width) - round(x)
        height: round(y + height) - round(y)

We use the term pixel snapped to indicate that the numbers are not merely
rounded. This also matches the naming used by the line box tree.

No new tests, no functionality changes.

* page/PrintContext.cpp:
(WebCore::PrintContext::pageNumberForElement):
* rendering/RenderBlock.cpp:
(WebCore::::collectIfNeeded):
* rendering/RenderBlock.h:
(RenderBlock):
(WebCore::RenderBlock::pixelSnappedLogicalRightOffsetForLine):
(WebCore::RenderBlock::pixelSnappedLogicalLeftOffsetForLine):
(WebCore::RenderBlock::FloatingObject::pixelSnappedX):
(WebCore::RenderBlock::FloatingObject::pixelSnappedMaxX):
(WebCore::RenderBlock::FloatingObject::pixelSnappedY):
(WebCore::RenderBlock::FloatingObject::pixelSnappedMaxY):
(WebCore::RenderBlock::FloatingObject::pixelSnappedWidth):
(WebCore::RenderBlock::FloatingObject::pixelSnappedHeight):
(FloatingObject):
(WebCore::RenderBlock::pixelSnappedLogicalTopForFloat):
(WebCore::RenderBlock::pixelSnappedLogicalBottomForFloat):
(WebCore::RenderBlock::pixelSnappedLogicalLeftForFloat):
(WebCore::RenderBlock::pixelSnappedLogicalRightForFloat):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::pixelSnappedClientWidth):
(WebCore):
(WebCore::RenderBox::pixelSnappedClientHeight):
(WebCore::RenderBox::scrollHeight):
* rendering/RenderBox.h:
(WebCore::RenderBox::pixelSnappedWidth):
(WebCore::RenderBox::pixelSnappedHeight):
(RenderBox):
(WebCore::RenderBox::pixelSnappedOffsetWidth):
(WebCore::RenderBox::pixelSnappedOffsetHeight):
(WebCore::RenderBox::clientLogicalWidth):
(WebCore::RenderBox::clientLogicalHeight):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::pixelSnappedOffsetWidth):
(WebCore):
(WebCore::RenderBoxModelObject::pixelSnappedOffsetHeight):
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::pixelSnappedOffsetLeft):
(WebCore::RenderBoxModelObject::pixelSnappedOffsetTop):
(RenderBoxModelObject):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::pixelSnappedScrollWidth):
(WebCore):
(WebCore::RenderLayer::pixelSnappedScrollHeight):
(WebCore::RenderLayer::computeScrollDimensions):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
* rendering/RenderLayer.h:
(RenderLayer):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::scrollHeight):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
* rendering/RenderTreeAsText.cpp:
(WebCore::write):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107032 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/PrintContext.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTreeAsText.cpp

index 51fc385..ff75d0b 100644 (file)
@@ -1,3 +1,92 @@
+2012-02-07  Emil A Eklund  <eae@chromium.org>
+
+        Add pixelSnappedX/Y/Width/Height methods
+        https://bugs.webkit.org/show_bug.cgi?id=78040
+
+        Reviewed by Eric Seidel.
+
+        Add pixel snapped versions of x/y/width/height methods. These return the
+        same value as the x/w/width/height methods for now but once we move over
+        to sub pixel layout they will snap the subpixel value to a device pixel
+        and return an integer value.
+
+        When snapping the left and top edge is simply rounded to the nearest
+        device pixel.
+        The right and bottom edges are computed by subtracting the rounded left/
+        top edge from the precise location and size. This ensures that the edges
+        all line up with device pixels and that the total size of an object,
+        including borders, is at most one pixel off.
+
+        In summary, the values are computed as follows:
+                x: round(x)
+                y: round(y)
+                maxX: round(x + width)
+                maxY: round(y + height)
+                width: round(x + width) - round(x)
+                height: round(y + height) - round(y)
+
+        We use the term pixel snapped to indicate that the numbers are not merely
+        rounded. This also matches the naming used by the line box tree.
+
+        No new tests, no functionality changes.
+
+        * page/PrintContext.cpp:
+        (WebCore::PrintContext::pageNumberForElement):
+        * rendering/RenderBlock.cpp:
+        (WebCore::::collectIfNeeded):
+        * rendering/RenderBlock.h:
+        (RenderBlock):
+        (WebCore::RenderBlock::pixelSnappedLogicalRightOffsetForLine):
+        (WebCore::RenderBlock::pixelSnappedLogicalLeftOffsetForLine):
+        (WebCore::RenderBlock::FloatingObject::pixelSnappedX):
+        (WebCore::RenderBlock::FloatingObject::pixelSnappedMaxX):
+        (WebCore::RenderBlock::FloatingObject::pixelSnappedY):
+        (WebCore::RenderBlock::FloatingObject::pixelSnappedMaxY):
+        (WebCore::RenderBlock::FloatingObject::pixelSnappedWidth):
+        (WebCore::RenderBlock::FloatingObject::pixelSnappedHeight):
+        (FloatingObject):
+        (WebCore::RenderBlock::pixelSnappedLogicalTopForFloat):
+        (WebCore::RenderBlock::pixelSnappedLogicalBottomForFloat):
+        (WebCore::RenderBlock::pixelSnappedLogicalLeftForFloat):
+        (WebCore::RenderBlock::pixelSnappedLogicalRightForFloat):
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::pixelSnappedClientWidth):
+        (WebCore):
+        (WebCore::RenderBox::pixelSnappedClientHeight):
+        (WebCore::RenderBox::scrollHeight):
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::pixelSnappedWidth):
+        (WebCore::RenderBox::pixelSnappedHeight):
+        (RenderBox):
+        (WebCore::RenderBox::pixelSnappedOffsetWidth):
+        (WebCore::RenderBox::pixelSnappedOffsetHeight):
+        (WebCore::RenderBox::clientLogicalWidth):
+        (WebCore::RenderBox::clientLogicalHeight):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::pixelSnappedOffsetWidth):
+        (WebCore):
+        (WebCore::RenderBoxModelObject::pixelSnappedOffsetHeight):
+        * rendering/RenderBoxModelObject.h:
+        (WebCore::RenderBoxModelObject::pixelSnappedOffsetLeft):
+        (WebCore::RenderBoxModelObject::pixelSnappedOffsetTop):
+        (RenderBoxModelObject):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::pixelSnappedScrollWidth):
+        (WebCore):
+        (WebCore::RenderLayer::pixelSnappedScrollHeight):
+        (WebCore::RenderLayer::computeScrollDimensions):
+        (WebCore::RenderLayer::updateScrollInfoAfterLayout):
+        * rendering/RenderLayer.h:
+        (RenderLayer):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::scrollHeight):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::write):
+
 2012-02-07  Mike Lawther  <mikelawther@chromium.org>
 
         CSS3 calc() - simple parse time evaluation
index abb4171..0af0bb5 100644 (file)
@@ -249,8 +249,8 @@ int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi
     scaledPageSize.scale(frame->view()->contentsSize().width() / pageRect.width());
     printContext.computePageRectsWithPageSize(scaledPageSize, false);
 
-    int top = box->offsetTop();
-    int left = box->offsetLeft();
+    int top = box->pixelSnappedOffsetTop();
+    int left = box->pixelSnappedOffsetLeft();
     size_t pageNumber = 0;
     for (; pageNumber < printContext.pageCount(); pageNumber++) {
         const IntRect& page = printContext.pageRect(pageNumber);
index 2ca9266..1404e0d 100755 (executable)
@@ -3673,7 +3673,7 @@ inline void RenderBlock::FloatIntervalSearchAdapter<FloatTypeValue>::collectIfNe
     const FloatingObject* r = interval.data();
     if (r->type() == FloatTypeValue && interval.low() <= m_value && m_value < interval.high()) {
         // All the objects returned from the tree should be already placed.
-        ASSERT(r->isPlaced() && m_renderer->logicalTopForFloat(r) <= m_value && m_renderer->logicalBottomForFloat(r) > m_value);
+        ASSERT(r->isPlaced() && m_renderer->pixelSnappedLogicalTopForFloat(r) <= m_value && m_renderer->pixelSnappedLogicalBottomForFloat(r) > m_value);
 
         if (FloatTypeValue == FloatingObject::FloatLeft 
             && m_renderer->logicalRightForFloat(r) > m_offset) {
index f009443..2ccf0aa 100644 (file)
@@ -163,6 +163,17 @@ public:
         return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(position, firstLine)
             : logicalWidth() - logicalRightOffsetForLine(position, firstLine);
     }
+
+    // FIXME: The implementation for these functions will change once we move to subpixel layout. See bug 60318.
+    int pixelSnappedLogicalRightOffsetForLine(LayoutUnit position, bool firstLine) const
+    {
+        return logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), firstLine, 0);
+    }
+
+    int pixelSnappedLogicalLeftOffsetForLine(LayoutUnit position, bool firstLine) const
+    {
+        return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), firstLine, 0);
+    }
     
     LayoutUnit startAlignedOffsetForLine(RenderBox* child, LayoutUnit position, bool firstLine);
     LayoutUnit textIndentOffset() const;
@@ -561,6 +572,14 @@ private:
         LayoutUnit width() const { return m_frameRect.width(); }
         LayoutUnit height() const { return m_frameRect.height(); }
 
+        // FIXME: The implementation for these functions will change once we move to subpixel layout. See bug 60318.
+        int pixelSnappedX() const { return x(); }
+        int pixelSnappedMaxX() const { return maxX(); }
+        int pixelSnappedY() const { return y(); }
+        int pixelSnappedMaxY() const { return maxY(); }
+        int pixelSnappedWidth() const { return width(); }
+        int pixelSnappedHeight() const { return height(); }
+
         void setX(LayoutUnit x) { ASSERT(!isInPlacedTree()); m_frameRect.setX(x); }
         void setY(LayoutUnit y) { ASSERT(!isInPlacedTree()); m_frameRect.setY(y); }
         void setWidth(LayoutUnit width) { ASSERT(!isInPlacedTree()); m_frameRect.setWidth(width); }
@@ -595,6 +614,12 @@ private:
     LayoutUnit logicalRightForFloat(const FloatingObject* child) const { return isHorizontalWritingMode() ? child->maxX() : child->maxY(); }
     LayoutUnit logicalWidthForFloat(const FloatingObject* child) const { return isHorizontalWritingMode() ? child->width() : child->height(); }
 
+    // FIXME: The implementation for these functions will change once we move to subpixel layout. See bug 60318.
+    int pixelSnappedLogicalTopForFloat(const FloatingObject* child) const { return logicalTopForFloat(child); }
+    int pixelSnappedLogicalBottomForFloat(const FloatingObject* child) const { return logicalBottomForFloat(child); }
+    int pixelSnappedLogicalLeftForFloat(const FloatingObject* child) const { return logicalLeftForFloat(child); }
+    int pixelSnappedLogicalRightForFloat(const FloatingObject* child) const { return logicalRightForFloat(child); }
+
     void setLogicalTopForFloat(FloatingObject* child, LayoutUnit logicalTop)
     {
         if (isHorizontalWritingMode())
index f8094d1..0dfb9af 100755 (executable)
@@ -128,11 +128,11 @@ inline void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(RenderBlock::Floa
         return;
 
     if (newFloat->type() == RenderBlock::FloatingObject::FloatLeft) {
-        m_left = m_block->logicalRightForFloat(newFloat);
+        m_left = m_block->pixelSnappedLogicalRightForFloat(newFloat);
         if (m_isFirstLine && m_block->style()->isLeftToRightDirection())
             m_left += m_block->textIndentOffset();
     } else {
-        m_right = m_block->logicalLeftForFloat(newFloat);
+        m_right = m_block->pixelSnappedLogicalLeftForFloat(newFloat);
         if (m_isFirstLine && !m_block->style()->isLeftToRightDirection())
             m_right -= m_block->textIndentOffset();
     }
index 63fd6f8..f3ca0b1 100644 (file)
@@ -478,6 +478,16 @@ LayoutUnit RenderBox::clientHeight() const
     return height() - borderTop() - borderBottom() - horizontalScrollbarHeight();
 }
 
+int RenderBox::pixelSnappedClientWidth() const
+{
+    return clientWidth();
+}
+
+int RenderBox::pixelSnappedClientHeight() const
+{
+    return clientHeight();
+}
+
 int RenderBox::scrollWidth() const
 {
     if (hasOverflowClip())
@@ -495,7 +505,7 @@ int RenderBox::scrollHeight() const
         return layer()->scrollHeight();
     // For objects with visible overflow, this matches IE.
     // FIXME: Need to work right with writing modes.
-    return max(clientHeight(), maxYLayoutOverflow() - borderTop());
+    return max(pixelSnappedClientHeight(), maxYLayoutOverflow() - borderTop());
 }
 
 int RenderBox::scrollLeft() const
index d1637fa..f9b852c 100644 (file)
@@ -51,6 +51,10 @@ public:
     LayoutUnit width() const { return m_frameRect.width(); }
     LayoutUnit height() const { return m_frameRect.height(); }
 
+    // FIXME: The implementation for these functions will change once we move to subpixel layout. See bug 60318.
+    int pixelSnappedWidth() const { return m_frameRect.width(); }
+    int pixelSnappedHeight() const { return m_frameRect.height(); }
+
     // These represent your location relative to your container as a physical offset.
     // In layout related methods you almost always want the logical location (e.g. x() and y()).
     LayoutUnit top() const { return topLeftLocation().y(); }
@@ -183,17 +187,24 @@ public:
     virtual LayoutUnit offsetWidth() const { return width(); }
     virtual LayoutUnit offsetHeight() const { return height(); }
 
+    // FIXME: The implementation for these functions will change once we move to subpixel layout. See bug 60318.
+    virtual int pixelSnappedOffsetWidth() const { return pixelSnappedWidth(); }
+    virtual int pixelSnappedOffsetHeight() const { return pixelSnappedHeight(); }
+
     // 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 clientLogicalWidth() const { return style()->isHorizontalWritingMode() ? pixelSnappedClientWidth() : pixelSnappedClientHeight(); }
+    LayoutUnit clientLogicalHeight() const { return style()->isHorizontalWritingMode() ? pixelSnappedClientHeight() : pixelSnappedClientWidth(); }
     LayoutUnit clientLogicalBottom() const { return borderBefore() + clientLogicalHeight(); }
     LayoutRect clientBoxRect() const { return LayoutRect(clientLeft(), clientTop(), clientWidth(), clientHeight()); }
 
+    int pixelSnappedClientWidth() const;
+    int pixelSnappedClientHeight() const;
+
     // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the
     // object has overflow:hidden/scroll/auto specified and also has overflow.
     // scrollLeft/Top return the current scroll position.  These methods are virtual so that objects like
index 37eedf4..3aadee9 100644 (file)
@@ -512,6 +512,16 @@ LayoutUnit RenderBoxModelObject::offsetTop() const
     return yPos;
 }
 
+int RenderBoxModelObject::pixelSnappedOffsetWidth() const
+{
+    return offsetWidth();
+}
+
+int RenderBoxModelObject::pixelSnappedOffsetHeight() const
+{
+    return offsetHeight();
+}
+
 LayoutUnit RenderBoxModelObject::paddingTop(bool) const
 {
     LayoutUnit w = 0;
index bb81bd3..027b1fb 100644 (file)
@@ -60,6 +60,12 @@ public:
     virtual LayoutUnit offsetWidth() const = 0;
     virtual LayoutUnit offsetHeight() const = 0;
 
+    // FIXME: The implementation for these functions will change once we move to subpixel layout. See bug 60318.
+    int pixelSnappedOffsetLeft() const { return offsetLeft(); }
+    int pixelSnappedOffsetTop() const { return offsetTop(); }
+    int pixelSnappedOffsetWidth() const;
+    int pixelSnappedOffsetHeight() const;
+
     virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     virtual void updateBoxModelInfoFromStyle();
index af910c5..9d424b1 100644 (file)
@@ -2226,6 +2226,16 @@ LayoutUnit RenderLayer::scrollHeight()
     return m_scrollSize.height();
 }
 
+int RenderLayer::pixelSnappedScrollWidth()
+{
+    return scrollWidth();
+}
+
+int RenderLayer::pixelSnappedScrollHeight()
+{
+    return scrollHeight();
+}
+
 LayoutUnit RenderLayer::overflowTop() const
 {
     RenderBox* box = renderBox();
@@ -2274,9 +2284,9 @@ void RenderLayer::computeScrollDimensions(bool* needHBar, bool* needVBar)
     setScrollOrigin(IntPoint(-m_scrollOverflow.width(), -m_scrollOverflow.height()));
 
     if (needHBar)
-        *needHBar = m_scrollSize.width() > box->clientWidth();
+        *needHBar = pixelSnappedScrollWidth() > box->pixelSnappedClientWidth();
     if (needVBar)
-        *needVBar = m_scrollSize.height() > box->clientHeight();
+        *needVBar = pixelSnappedScrollHeight() > box->pixelSnappedClientHeight();
 }
 
 void RenderLayer::updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow)
@@ -2381,14 +2391,14 @@ void RenderLayer::updateScrollInfoAfterLayout()
 
     // Set up the range (and page step/line step).
     if (m_hBar) {
-        LayoutUnit clientWidth = box->clientWidth();
-        LayoutUnit pageStep = max<LayoutUnit>(max<LayoutUnit>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1);
+        int clientWidth = box->pixelSnappedClientWidth();
+        int pageStep = max(max<int>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1);
         m_hBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
         m_hBar->setProportion(clientWidth, m_scrollSize.width());
     }
     if (m_vBar) {
-        LayoutUnit clientHeight = box->clientHeight();
-        LayoutUnit pageStep = max<LayoutUnit>(max<LayoutUnit>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1);
+        int clientHeight = box->pixelSnappedClientHeight();
+        int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1);
         m_vBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
         m_vBar->setProportion(clientHeight, m_scrollSize.height());
     }
index 3b91c71..776da1e 100644 (file)
@@ -282,6 +282,8 @@ public:
 
     LayoutUnit scrollWidth();
     LayoutUnit scrollHeight();
+    int pixelSnappedScrollWidth();
+    int pixelSnappedScrollHeight();
 
     void panScrollFromPoint(const LayoutPoint&);
 
index 59a3f79..d47a180 100644 (file)
@@ -651,7 +651,7 @@ LayoutUnit RenderListBox::scrollWidth() const
 
 int RenderListBox::scrollHeight() const
 {
-    return max(clientHeight(), listHeight());
+    return max(pixelSnappedClientHeight(), listHeight());
 }
 
 int RenderListBox::scrollLeft() const
index 1f25a84..d93a27e 100644 (file)
@@ -503,7 +503,7 @@ String RenderTheme::formatMediaControlsRemainingTime(float currentTime, float du
 LayoutPoint RenderTheme::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const
 {
     LayoutUnit y = -size.height();
-    FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->offsetLeft(), y), true, true);
+    FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->pixelSnappedOffsetLeft(), y), true, true);
     if (absPoint.y() < 0)
         y = muteButtonBox->height();
     return LayoutPoint(0, y);
index 20a06bd..06e0fe9 100644 (file)
@@ -617,10 +617,10 @@ static void write(TextStream& ts, RenderLayer& l,
             ts << " scrollX " << l.scrollXOffset();
         if (l.scrollYOffset())
             ts << " scrollY " << l.scrollYOffset();
-        if (l.renderBox() && l.renderBox()->clientWidth() != l.scrollWidth())
-            ts << " scrollWidth " << l.scrollWidth();
-        if (l.renderBox() && l.renderBox()->clientHeight() != l.scrollHeight())
-            ts << " scrollHeight " << l.scrollHeight();
+        if (l.renderBox() && l.renderBox()->pixelSnappedClientWidth() != l.pixelSnappedScrollWidth())
+            ts << " scrollWidth " << l.pixelSnappedScrollWidth();
+        if (l.renderBox() && l.renderBox()->pixelSnappedClientHeight() != l.pixelSnappedScrollHeight())
+            ts << " scrollHeight " << l.pixelSnappedScrollHeight();
     }
 
     if (paintPhase == LayerPaintPhaseBackground)