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

Diff

Modified: branches/subpixellayout/Source/WebCore/dom/Document.cpp (110102 => 110103)


--- branches/subpixellayout/Source/WebCore/dom/Document.cpp	2012-03-07 22:17:28 UTC (rev 110102)
+++ branches/subpixellayout/Source/WebCore/dom/Document.cpp	2012-03-07 22:21:14 UTC (rev 110103)
@@ -1245,9 +1245,9 @@
         return 0;
 
     float zoomFactor = frame->pageZoomFactor();
-    LayoutPoint point = LayoutPoint(x * zoomFactor  + frameView->scrollX(), y * zoomFactor + frameView->scrollY());
+    IntPoint point = roundedIntPoint(FloatPoint(x * zoomFactor  + frameView->scrollX(), y * zoomFactor + frameView->scrollY()));
 
-    if (!frameView->visibleContentRect().contains(roundedIntPoint(point)))
+    if (!frameView->visibleContentRect().contains(point))
         return 0;
 
     HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);

Modified: branches/subpixellayout/Source/WebCore/html/TextFieldInputType.cpp (110102 => 110103)


--- branches/subpixellayout/Source/WebCore/html/TextFieldInputType.cpp	2012-03-07 22:17:28 UTC (rev 110102)
+++ branches/subpixellayout/Source/WebCore/html/TextFieldInputType.cpp	2012-03-07 22:21:14 UTC (rev 110103)
@@ -173,7 +173,7 @@
         if (event->type() == eventNames().blurEvent) {
             if (RenderBox* innerTextRenderer = innerTextElement()->renderBox()) {
                 if (RenderLayer* innerLayer = innerTextRenderer->layer())
-                    innerLayer->scrollToOffset(!renderTextControl->style()->isLeftToRightDirection() ? innerLayer->scrollWidth().toInt() : 0, 0, RenderLayer::ScrollOffsetClamped);
+                    innerLayer->scrollToOffset(!renderTextControl->style()->isLeftToRightDirection() ? innerLayer->scrollWidth() : 0, 0, RenderLayer::ScrollOffsetClamped);
             }
 
             renderTextControl->capsLockStateMayHaveChanged();

Modified: branches/subpixellayout/Source/WebCore/platform/ScrollView.h (110102 => 110103)


--- branches/subpixellayout/Source/WebCore/platform/ScrollView.h	2012-03-07 22:17:28 UTC (rev 110102)
+++ branches/subpixellayout/Source/WebCore/platform/ScrollView.h	2012-03-07 22:21:14 UTC (rev 110103)
@@ -27,7 +27,7 @@
 #ifndef ScrollView_h
 #define ScrollView_h
 
-#include "LayoutTypes.h"
+#include "IntRect.h"
 #include "Scrollbar.h"
 #include "ScrollableArea.h"
 #include "ScrollTypes.h"
@@ -170,7 +170,7 @@
     IntPoint maximumScrollPosition() const; // The maximum position we can be scrolled to.
     IntPoint minimumScrollPosition() const; // The minimum position we can be scrolled to.
     // Adjust the passed in scroll position to keep it between the minimum and maximum positions.
-    IntPoint adjustScrollPositionWithinRange(const IntPoint&) const;
+    IntPoint adjustScrollPositionWithinRange(const IntPoint&) const; 
     int scrollX() const { return scrollPosition().x(); }
     int scrollY() const { return scrollPosition().y(); }
 

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderLayer.cpp (110102 => 110103)


--- branches/subpixellayout/Source/WebCore/rendering/RenderLayer.cpp	2012-03-07 22:17:28 UTC (rev 110102)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderLayer.cpp	2012-03-07 22:21:14 UTC (rev 110103)
@@ -1387,7 +1387,7 @@
     scrollByRecursively(adjustedScrollDelta(xDelta), adjustedScrollDelta(yDelta), ScrollOffsetClamped);
 }
 
-void RenderLayer::scrollByRecursively(LayoutUnit xDelta, LayoutUnit yDelta, ScrollOffsetClamping clamp)
+void RenderLayer::scrollByRecursively(int xDelta, int yDelta, ScrollOffsetClamping clamp)
 {
     if (!xDelta && !yDelta)
         return;
@@ -1397,13 +1397,13 @@
         restrictedByLineClamp = !renderer()->parent()->style()->lineClamp().isNone();
 
     if (renderer()->hasOverflowClip() && !restrictedByLineClamp) {
-        LayoutUnit newOffsetX = scrollXOffset() + xDelta;
-        LayoutUnit newOffsetY = scrollYOffset() + yDelta;
+        int newOffsetX = scrollXOffset() + xDelta;
+        int newOffsetY = scrollYOffset() + yDelta;
         scrollToOffset(newOffsetX, newOffsetY, clamp);
 
         // If this layer can't do the scroll we ask the next layer up that can scroll to try
-        LayoutUnit leftToScrollX = newOffsetX - scrollXOffset();
-        LayoutUnit leftToScrollY = newOffsetY - scrollYOffset();
+        int leftToScrollX = newOffsetX - scrollXOffset();
+        int leftToScrollY = newOffsetY - scrollYOffset();
         if ((leftToScrollX || leftToScrollY) && renderer()->parent()) {
             if (RenderLayer* scrollableLayer = enclosingScrollableLayer())
                 scrollableLayer->scrollByRecursively(leftToScrollX, leftToScrollY);
@@ -1421,21 +1421,21 @@
     }
 }
 
-void RenderLayer::scrollToOffset(LayoutUnit x, LayoutUnit y, ScrollOffsetClamping clamp)
+void RenderLayer::scrollToOffset(int x, int y, ScrollOffsetClamping clamp)
 {
     if (clamp == ScrollOffsetClamped) {
         RenderBox* box = renderBox();
         if (!box)
             return;
 
-        LayoutUnit maxX = scrollWidth() - box->clientWidth();
-        LayoutUnit maxY = scrollHeight() - box->clientHeight();
+        int maxX = scrollWidth() - box->clientWidth();
+        int maxY = scrollHeight() - box->clientHeight();
 
-        x = min(max<LayoutUnit>(x, 0), maxX);
-        y = min(max<LayoutUnit>(y, 0), maxY);
+        x = min(max(x, 0), maxX);
+        y = min(max(y, 0), maxY);
     }
 
-    LayoutPoint newScrollOffset(x, y);
+    IntPoint newScrollOffset(x, y);
     if (newScrollOffset != LayoutPoint(scrollXOffset(), scrollYOffset()))
         scrollToOffsetWithoutAnimation(newScrollOffset);
 }
@@ -2240,34 +2240,24 @@
         m_resizer->setFrameRect(resizerCornerRect(this, borderBox));
 }
 
-LayoutUnit RenderLayer::scrollWidth()
+int RenderLayer::scrollWidth()
 {
+    RenderBox* box = renderBox();
+    ASSERT(box);
     if (m_scrollDimensionsDirty)
         computeScrollDimensions();
-    return m_scrollSize.width();
+    return snapSizeToPixel(m_scrollSize.width(), box->clientLeft());
 }
 
-LayoutUnit RenderLayer::scrollHeight()
+int RenderLayer::scrollHeight()
 {
+    RenderBox* box = renderBox();
+    ASSERT(box);
     if (m_scrollDimensionsDirty)
         computeScrollDimensions();
-    return m_scrollSize.height();
+    return snapSizeToPixel(m_scrollSize.height(), box->clientTop());
 }
 
-int RenderLayer::pixelSnappedScrollWidth()
-{
-    RenderBox* box = renderBox();
-    ASSERT(box);
-    return snapSizeToPixel(scrollWidth(), box->clientLeft());
-}
-
-int RenderLayer::pixelSnappedScrollHeight()
-{
-    RenderBox* box = renderBox();
-    ASSERT(box);
-    return snapSizeToPixel(scrollHeight(), box->clientTop());
-}
-
 LayoutUnit RenderLayer::overflowTop() const
 {
     RenderBox* box = renderBox();
@@ -2316,9 +2306,9 @@
     setScrollOrigin(IntPoint(-m_scrollOverflow.width(), -m_scrollOverflow.height()));
 
     if (needHBar)
-        *needHBar = pixelSnappedScrollWidth() > box->pixelSnappedClientWidth();
+        *needHBar = scrollWidth() > box->pixelSnappedClientWidth();
     if (needVBar)
-        *needVBar = pixelSnappedScrollHeight() > box->pixelSnappedClientHeight();
+        *needVBar = scrollHeight() > box->pixelSnappedClientHeight();
 }
 
 void RenderLayer::updateScrollInfoAfterLayout()

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderLayer.h (110102 => 110103)


--- branches/subpixellayout/Source/WebCore/rendering/RenderLayer.h	2012-03-07 22:17:28 UTC (rev 110102)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderLayer.h	2012-03-07 22:21:14 UTC (rev 110103)
@@ -280,10 +280,8 @@
 
     LayoutRect rect() const { return LayoutRect(location(), size()); }
 
-    LayoutUnit scrollWidth();
-    LayoutUnit scrollHeight();
-    int pixelSnappedScrollWidth();
-    int pixelSnappedScrollHeight();
+    int scrollWidth();
+    int scrollHeight();
 
     void panScrollFromPoint(const LayoutPoint&);
 
@@ -293,15 +291,15 @@
     };
 
     // Scrolling methods for layers that can scroll their overflow.
-    void scrollByRecursively(LayoutUnit xDelta, LayoutUnit yDelta, ScrollOffsetClamping = ScrollOffsetUnclamped);
+    void scrollByRecursively(int xDelta, int yDelta, ScrollOffsetClamping = ScrollOffsetUnclamped);
 
     int scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin().x(); }
     int scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin().y(); }
     IntSize scrollOffset() const { return IntSize(scrollXOffset(), scrollYOffset()); }
 
-    void scrollToOffset(LayoutUnit, LayoutUnit, ScrollOffsetClamping = ScrollOffsetUnclamped);
-    void scrollToXOffset(LayoutUnit x, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(x, scrollYOffset(), clamp); }
-    void scrollToYOffset(LayoutUnit y, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(scrollXOffset(), y, clamp); }
+    void scrollToOffset(int, int, ScrollOffsetClamping = ScrollOffsetUnclamped);
+    void scrollToXOffset(int x, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(x, scrollYOffset(), clamp); }
+    void scrollToYOffset(int y, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(scrollXOffset(), y, clamp); }
 
     void scrollRectToVisible(const LayoutRect&, const ScrollAlignment& alignX = ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlignment::alignCenterIfNeeded);
 

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderListBox.cpp (110102 => 110103)


--- branches/subpixellayout/Source/WebCore/rendering/RenderListBox.cpp	2012-03-07 22:17:28 UTC (rev 110102)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderListBox.cpp	2012-03-07 22:21:14 UTC (rev 110103)
@@ -646,7 +646,7 @@
 int RenderListBox::scrollWidth() const
 {
     // There is no horizontal scrolling allowed.
-    return clientWidth();
+    return pixelSnappedClientWidth();
 }
 
 int RenderListBox::scrollHeight() const

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderScrollbar.cpp (110102 => 110103)


--- branches/subpixellayout/Source/WebCore/rendering/RenderScrollbar.cpp	2012-03-07 22:17:28 UTC (rev 110102)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderScrollbar.cpp	2012-03-07 22:21:14 UTC (rev 110103)
@@ -202,7 +202,7 @@
     }
     
     if (newThickness != oldThickness) {
-        setFrameRect(IntRect(x(), y(), isHorizontal ? width() : newThickness, isHorizontal ? newThickness : height()));
+        setFrameRect(IntRect(location(), IntSize(isHorizontal ? width() : newThickness, isHorizontal ? newThickness : height())));
         if (RenderBox* box = owningRenderer())
             box->setChildNeedsLayout(true);
     }
@@ -279,12 +279,12 @@
         partRenderer->setStyle(partStyle.release());
 }
 
-void RenderScrollbar::paintPart(GraphicsContext* graphicsContext, ScrollbarPart partType, const LayoutRect& rect)
+void RenderScrollbar::paintPart(GraphicsContext* graphicsContext, ScrollbarPart partType, const IntRect& rect)
 {
     RenderScrollbarPart* partRenderer = m_parts.get(partType);
     if (!partRenderer)
         return;
-    partRenderer->paintIntoRect(graphicsContext, location(), enclosingIntRect(rect));
+    partRenderer->paintIntoRect(graphicsContext, location(), rect);
 }
 
 IntRect RenderScrollbar::buttonRect(ScrollbarPart partType)
@@ -343,7 +343,7 @@
     return IntRect(x(), y() + startLength, width(), height() - totalLength);
 }
 
-LayoutRect RenderScrollbar::trackPieceRectWithMargins(ScrollbarPart partType, const LayoutRect& oldRect)
+IntRect RenderScrollbar::trackPieceRectWithMargins(ScrollbarPart partType, const IntRect& oldRect)
 {
     RenderScrollbarPart* partRenderer = m_parts.get(partType);
     if (!partRenderer)
@@ -351,7 +351,7 @@
     
     partRenderer->layout();
     
-    LayoutRect rect = oldRect;
+    IntRect rect = oldRect;
     if (orientation() == HorizontalScrollbar) {
         rect.setX(rect.x() + partRenderer->marginLeft());
         rect.setWidth(rect.width() - (partRenderer->marginLeft() + partRenderer->marginRight()));

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderScrollbar.h (110102 => 110103)


--- branches/subpixellayout/Source/WebCore/rendering/RenderScrollbar.h	2012-03-07 22:17:28 UTC (rev 110102)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderScrollbar.h	2012-03-07 22:21:14 UTC (rev 110103)
@@ -26,7 +26,6 @@
 #ifndef RenderScrollbar_h
 #define RenderScrollbar_h
 
-#include "LayoutTypes.h"
 #include "RenderStyleConstants.h"
 #include "Scrollbar.h"
 #include <wtf/HashMap.h>
@@ -53,11 +52,11 @@
     RenderBox* owningRenderer() const;
     void clearOwningRenderer() { m_owner = 0; }
 
-    void paintPart(GraphicsContext*, ScrollbarPart, const LayoutRect&);
+    void paintPart(GraphicsContext*, ScrollbarPart, const IntRect&);
 
     IntRect buttonRect(ScrollbarPart);
     IntRect trackRect(int startLength, int endLength);
-    LayoutRect trackPieceRectWithMargins(ScrollbarPart, const LayoutRect&);
+    IntRect trackPieceRectWithMargins(ScrollbarPart, const IntRect&);
 
     int minimumThumbLength();
 

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderScrollbarTheme.cpp (110102 => 110103)


--- branches/subpixellayout/Source/WebCore/rendering/RenderScrollbarTheme.cpp	2012-03-07 22:17:28 UTC (rev 110102)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderScrollbarTheme.cpp	2012-03-07 22:21:14 UTC (rev 110103)
@@ -94,8 +94,8 @@
 
 IntRect RenderScrollbarTheme::constrainTrackRectToTrackPieces(ScrollbarThemeClient* scrollbar, const IntRect& rect)
 { 
-    IntRect backRect = pixelSnappedIntRect(toRenderScrollbar(scrollbar)->trackPieceRectWithMargins(BackTrackPart, rect));
-    IntRect forwardRect = pixelSnappedIntRect(toRenderScrollbar(scrollbar)->trackPieceRectWithMargins(ForwardTrackPart, rect));
+    IntRect backRect = toRenderScrollbar(scrollbar)->trackPieceRectWithMargins(BackTrackPart, rect);
+    IntRect forwardRect = toRenderScrollbar(scrollbar)->trackPieceRectWithMargins(ForwardTrackPart, rect);
     IntRect result = rect;
     if (scrollbar->orientation() == HorizontalScrollbar) {
         result.setX(backRect.x());

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderTreeAsText.cpp (110102 => 110103)


--- branches/subpixellayout/Source/WebCore/rendering/RenderTreeAsText.cpp	2012-03-07 22:17:28 UTC (rev 110102)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderTreeAsText.cpp	2012-03-07 22:21:14 UTC (rev 110103)
@@ -637,10 +637,10 @@
             ts << " scrollX " << l.scrollXOffset();
         if (l.scrollYOffset())
             ts << " scrollY " << l.scrollYOffset();
-        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 (l.renderBox() && l.renderBox()->pixelSnappedClientWidth() != l.scrollWidth())
+            ts << " scrollWidth " << l.scrollWidth();
+        if (l.renderBox() && l.renderBox()->pixelSnappedClientHeight() != l.scrollHeight())
+            ts << " scrollHeight " << l.scrollHeight();
     }
 
     if (paintPhase == LayerPaintPhaseBackground)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to