Changeset 99040 in webkit


Ignore:
Timestamp:
Nov 1, 2011 11:26:16 PM (12 years ago)
Author:
leviw@chromium.org
Message:

Fix uses of LayoutUnit in Frame-, Scroll-, and RenderView
https://bugs.webkit.org/show_bug.cgi?id=71321

Reviewed by Darin Adler.

Updating the usage of LayoutUnits in the *View classes to mirror the proper use
as derived in the subpixellayout branch.

This entails scrolling only with integers (and rounding once we've made the switch)
and using integers for window coordinates, with LayoutUnits for content coordinates.

No new tests -- no change in behavior.

  • page/FrameView.cpp:

(WebCore::FrameView::invalidateRect):
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::zoomAnimatorTransformChanged):
(WebCore::FrameView::scrollContentsFastPath):
(WebCore::FrameView::scrollContentsSlowPath):
(WebCore::FrameView::scrollElementToRect):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::repaintContentRectangle):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::updateScrollCorner):

  • page/FrameView.h:

(WebCore::FrameView::trackedRepaintRects):

  • platform/ScrollView.cpp:

(WebCore::ScrollView::visibleContentRect):
(WebCore::ScrollView::layoutWidth):
(WebCore::ScrollView::layoutHeight):
(WebCore::ScrollView::fixedLayoutSize):
(WebCore::ScrollView::setFixedLayoutSize):
(WebCore::ScrollView::contentsSize):
(WebCore::ScrollView::setContentsSize):
(WebCore::ScrollView::overhangAmount):
(WebCore::ScrollView::updateScrollbars):
(WebCore::ScrollView::rectToCopyOnScroll):
(WebCore::ScrollView::scrollContents):
(WebCore::ScrollView::windowToContents):
(WebCore::ScrollView::screenToContents):
(WebCore::ScrollView::scrollbarAtPoint):
(WebCore::ScrollView::wheelEvent):

  • platform/ScrollView.h:

(WebCore::ScrollView::visibleWidth):
(WebCore::ScrollView::visibleHeight):
(WebCore::ScrollView::contentsWidth):
(WebCore::ScrollView::contentsHeight):
(WebCore::ScrollView::adjustScrollPositionWithinRange):

  • rendering/RenderView.cpp:

(WebCore::RenderView::paint):
(WebCore::RenderView::shouldRepaint):
(WebCore::RenderView::repaintViewRectangle):
(WebCore::RenderView::repaintRectangleInViewAndCompositedLayers):
(WebCore::RenderView::computeRectForRepaint):
(WebCore::RenderView::selectionBounds):
(WebCore::RenderView::viewRect):
(WebCore::RenderView::unscaledDocumentRect):
(WebCore::RenderView::documentRect):

  • rendering/RenderView.h:

(WebCore::RenderView::printRect):
(WebCore::RenderView::setPrintRect):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r99039 r99040  
     12011-11-01  Levi Weintraub  <leviw@chromium.org>
     2
     3        Fix uses of LayoutUnit in Frame-, Scroll-, and RenderView
     4        https://bugs.webkit.org/show_bug.cgi?id=71321
     5
     6        Reviewed by Darin Adler.
     7
     8        Updating the usage of LayoutUnits in the *View classes to mirror the proper use
     9        as derived in the subpixellayout branch.
     10
     11        This entails scrolling only with integers (and rounding once we've made the switch)
     12        and using integers for window coordinates, with LayoutUnits for content coordinates.
     13
     14        No new tests -- no change in behavior.
     15
     16        * page/FrameView.cpp:
     17        (WebCore::FrameView::invalidateRect):
     18        (WebCore::FrameView::setFrameRect):
     19        (WebCore::FrameView::zoomAnimatorTransformChanged):
     20        (WebCore::FrameView::scrollContentsFastPath):
     21        (WebCore::FrameView::scrollContentsSlowPath):
     22        (WebCore::FrameView::scrollElementToRect):
     23        (WebCore::FrameView::setScrollPosition):
     24        (WebCore::FrameView::repaintContentRectangle):
     25        (WebCore::FrameView::scrollTo):
     26        (WebCore::FrameView::updateScrollCorner):
     27        * page/FrameView.h:
     28        (WebCore::FrameView::trackedRepaintRects):
     29        * platform/ScrollView.cpp:
     30        (WebCore::ScrollView::visibleContentRect):
     31        (WebCore::ScrollView::layoutWidth):
     32        (WebCore::ScrollView::layoutHeight):
     33        (WebCore::ScrollView::fixedLayoutSize):
     34        (WebCore::ScrollView::setFixedLayoutSize):
     35        (WebCore::ScrollView::contentsSize):
     36        (WebCore::ScrollView::setContentsSize):
     37        (WebCore::ScrollView::overhangAmount):
     38        (WebCore::ScrollView::updateScrollbars):
     39        (WebCore::ScrollView::rectToCopyOnScroll):
     40        (WebCore::ScrollView::scrollContents):
     41        (WebCore::ScrollView::windowToContents):
     42        (WebCore::ScrollView::screenToContents):
     43        (WebCore::ScrollView::scrollbarAtPoint):
     44        (WebCore::ScrollView::wheelEvent):
     45        * platform/ScrollView.h:
     46        (WebCore::ScrollView::visibleWidth):
     47        (WebCore::ScrollView::visibleHeight):
     48        (WebCore::ScrollView::contentsWidth):
     49        (WebCore::ScrollView::contentsHeight):
     50        (WebCore::ScrollView::adjustScrollPositionWithinRange):
     51        * rendering/RenderView.cpp:
     52        (WebCore::RenderView::paint):
     53        (WebCore::RenderView::shouldRepaint):
     54        (WebCore::RenderView::repaintViewRectangle):
     55        (WebCore::RenderView::repaintRectangleInViewAndCompositedLayers):
     56        (WebCore::RenderView::computeRectForRepaint):
     57        (WebCore::RenderView::selectionBounds):
     58        (WebCore::RenderView::viewRect):
     59        (WebCore::RenderView::unscaledDocumentRect):
     60        (WebCore::RenderView::documentRect):
     61        * rendering/RenderView.h:
     62        (WebCore::RenderView::printRect):
     63        (WebCore::RenderView::setPrintRect):
     64
    1652011-11-01  Anna Cavender  <annacc@chromium.org>
    266
  • trunk/Source/WebCore/page/FrameView.cpp

    r99002 r99040  
    377377}
    378378
    379 void FrameView::invalidateRect(const IntRect& rect)
     379void FrameView::invalidateRect(const LayoutRect& rect)
    380380{
    381381    if (!parent()) {
     
    398398}
    399399
    400 void FrameView::setFrameRect(const IntRect& newRect)
    401 {
    402     IntRect oldRect = frameRect();
     400void FrameView::setFrameRect(const LayoutRect& newRect)
     401{
     402    LayoutRect oldRect = frameRect();
    403403    if (newRect == oldRect)
    404404        return;
     
    12281228    if (state == ZoomAnimationFinishing) {
    12291229        m_page->setPageScaleFactor(m_page->pageScaleFactor() * scale,
    1230                                    LayoutPoint(scale * scrollX() - x, scale * scrollY() - y));
     1230                                   IntPoint(scale * scrollX() - x, scale * scrollY() - y));
    12311231        scrollAnimator()->resetZoom();
    12321232    }
     
    14341434}
    14351435
    1436 bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const LayoutRect& rectToScroll, const LayoutRect& clipRect)
     1436bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
    14371437{
    14381438    const size_t fixedObjectThreshold = 5;
     
    14501450
    14511451    // Get the rects of the fixed objects visible in the rectToScroll
    1452     Vector<LayoutRect, fixedObjectThreshold> subRectToUpdate;
     1452    Vector<IntRect, fixedObjectThreshold> subRectToUpdate;
    14531453    bool updateInvalidatedSubRect = true;
    14541454    RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
     
    14571457        if (renderBox->style()->position() != FixedPosition)
    14581458            continue;
    1459         LayoutRect updateRect = renderBox->layer()->repaintRectIncludingDescendants();
     1459        IntRect updateRect = renderBox->layer()->repaintRectIncludingDescendants();
    14601460        updateRect = contentsToWindow(updateRect);
    14611461        if (!isCompositedContentLayer && clipsRepaints())
     
    14781478        size_t fixObjectsCount = subRectToUpdate.size();
    14791479        for (size_t i = 0; i < fixObjectsCount; ++i) {
    1480             LayoutRect updateRect = subRectToUpdate[i];
    1481             LayoutRect scrolledRect = updateRect;
     1480            IntRect updateRect = subRectToUpdate[i];
     1481            IntRect scrolledRect = updateRect;
    14821482            scrolledRect.move(scrollDelta);
    14831483            updateRect.unite(scrolledRect);
     
    15021502}
    15031503
    1504 void FrameView::scrollContentsSlowPath(const LayoutRect& updateRect)
     1504void FrameView::scrollContentsSlowPath(const IntRect& updateRect)
    15051505{
    15061506#if USE(ACCELERATED_COMPOSITING)
     
    16651665    int centeringOffsetX = (rect.width() - bounds.width()) / 2;
    16661666    int centeringOffsetY = (rect.height() - bounds.height()) / 2;
    1667     setScrollPosition(LayoutPoint(bounds.x() - centeringOffsetX - rect.x(), bounds.y() - centeringOffsetY - rect.y()));
    1668 }
    1669 
    1670 void FrameView::setScrollPosition(const LayoutPoint& scrollPoint)
     1667    setScrollPosition(IntPoint(bounds.x() - centeringOffsetX - rect.x(), bounds.y() - centeringOffsetY - rect.y()));
     1668}
     1669
     1670void FrameView::setScrollPosition(const IntPoint& scrollPoint)
    16711671{
    16721672    bool wasInProgrammaticScroll = m_inProgrammaticScroll;
     
    17421742   
    17431743    if (m_isTrackingRepaints) {
    1744         IntRect repaintRect = r;
     1744        LayoutRect repaintRect = r;
    17451745        repaintRect.move(-scrollOffset());
    17461746        m_trackedRepaintRects.append(repaintRect);
     
    23562356}
    23572357
    2358 void FrameView::scrollTo(const LayoutSize& newOffset)
     2358void FrameView::scrollTo(const IntSize& newOffset)
    23592359{
    23602360    LayoutSize offset = scrollOffset();
     
    25122512    RenderObject* renderer = 0;
    25132513    RefPtr<RenderStyle> cornerStyle;
    2514     IntRect cornerRect = scrollCornerRect();
     2514    LayoutRect cornerRect = scrollCornerRect();
    25152515   
    25162516    if (!cornerRect.isEmpty()) {
  • trunk/Source/WebCore/page/FrameView.h

    r98883 r99040  
    6565    virtual HostWindow* hostWindow() const;
    6666   
    67     virtual void invalidateRect(const IntRect&);
    68     virtual void setFrameRect(const IntRect&);
     67    virtual void invalidateRect(const LayoutRect&);
     68    virtual void setFrameRect(const LayoutRect&);
    6969
    7070#if ENABLE(REQUEST_ANIMATION_FRAME)
     
    302302    bool isTrackingRepaints() const { return m_isTrackingRepaints; }
    303303    void resetTrackedRepaints() { m_trackedRepaintRects.clear(); }
    304     const Vector<IntRect>& trackedRepaintRects() const { return m_trackedRepaintRects; }
     304    const Vector<LayoutRect>& trackedRepaintRects() const { return m_trackedRepaintRects; }
    305305
    306306protected:
    307     virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const LayoutRect& rectToScroll, const LayoutRect& clipRect);
    308     virtual void scrollContentsSlowPath(const LayoutRect& updateRect);
     307    virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
     308    virtual void scrollContentsSlowPath(const IntRect& updateRect);
    309309
    310310    virtual bool isVerticalDocument() const;
     
    351351    virtual bool isActive() const;
    352352    virtual void getTickmarks(Vector<LayoutRect>&) const;
    353     virtual void scrollTo(const LayoutSize&);
     353    virtual void scrollTo(const IntSize&);
    354354    virtual void didStartRubberBand(const IntSize&) const;
    355355    virtual void didCompleteRubberBand(const IntSize&) const;
     
    457457   
    458458    bool m_isTrackingRepaints; // Used for testing.
    459     Vector<IntRect> m_trackedRepaintRects;
     459    Vector<LayoutRect> m_trackedRepaintRects;
    460460
    461461    bool m_shouldUpdateWhileOffscreen;
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r99002 r99040  
    232232        return m_fixedVisibleContentRect;
    233233
    234     int verticalScrollbarWidth = verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar()
     234    LayoutUnit verticalScrollbarWidth = verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar()
    235235        && !includeScrollbars ? verticalScrollbar()->width() : 0;
    236     int horizontalScrollbarHeight = horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar()
     236    LayoutUnit horizontalScrollbarHeight = horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar()
    237237        && !includeScrollbars ? horizontalScrollbar()->height() : 0;
    238238
    239     return IntRect(IntPoint(m_scrollOffset.width(), m_scrollOffset.height()),
    240                    IntSize(max(0, width() - verticalScrollbarWidth),
    241                            max(0, height() - horizontalScrollbarHeight)));
    242 }
    243 #endif
    244 
    245 int ScrollView::layoutWidth() const
     239    return LayoutRect(LayoutPoint(m_scrollOffset.width(), m_scrollOffset.height()),
     240                      LayoutSize(max<LayoutUnit>(0, width() - verticalScrollbarWidth),
     241                                 max<LayoutUnit>(0, height() - horizontalScrollbarHeight)));
     242
     243}
     244#endif
     245
     246LayoutUnit ScrollView::layoutWidth() const
    246247{
    247248    return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? visibleWidth() : m_fixedLayoutSize.width();
    248249}
    249250
    250 int ScrollView::layoutHeight() const
     251LayoutUnit ScrollView::layoutHeight() const
    251252{
    252253    return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? visibleHeight() : m_fixedLayoutSize.height();
    253254}
    254255
    255 IntSize ScrollView::fixedLayoutSize() const
     256LayoutSize ScrollView::fixedLayoutSize() const
    256257{
    257258    return m_fixedLayoutSize;
    258259}
    259260
    260 void ScrollView::setFixedLayoutSize(const IntSize& newSize)
     261void ScrollView::setFixedLayoutSize(const LayoutSize& newSize)
    261262{
    262263    if (fixedLayoutSize() == newSize)
     
    279280}
    280281
    281 IntSize ScrollView::contentsSize() const
     282LayoutSize ScrollView::contentsSize() const
    282283{
    283284    return m_contentsSize;
    284285}
    285286
    286 void ScrollView::setContentsSize(const IntSize& newSize)
     287void ScrollView::setContentsSize(const LayoutSize& newSize)
    287288{
    288289    if (contentsSize() == newSize)
     
    405406}
    406407
    407 IntSize ScrollView::overhangAmount() const
    408 {
    409     IntSize stretch;
    410 
    411     int physicalScrollY = scrollPosition().y() + scrollOrigin().y();
     408LayoutSize ScrollView::overhangAmount() const
     409{
     410    LayoutSize stretch;
     411
     412    LayoutUnit physicalScrollY = scrollPosition().y() + scrollOrigin().y();
    412413    if (physicalScrollY < 0)
    413414        stretch.setHeight(physicalScrollY);
     
    415416        stretch.setHeight(physicalScrollY - (contentsHeight() - visibleHeight()));
    416417
    417     int physicalScrollX = scrollPosition().x() + scrollOrigin().x();
     418    LayoutUnit physicalScrollX = scrollPosition().x() + scrollOrigin().x();
    418419    if (physicalScrollX < 0)
    419420        stretch.setWidth(physicalScrollX);
     
    448449    }
    449450
    450     IntRect oldScrollCornerRect = scrollCornerRect();
     451    LayoutRect oldScrollCornerRect = scrollCornerRect();
    451452
    452453    bool hasHorizontalScrollbar = m_horizontalScrollbar;
     
    472473        bool sendContentResizedNotification = false;
    473474       
    474         IntSize docSize = contentsSize();
    475         IntSize frameSize = frameRect().size();
     475        LayoutSize docSize = contentsSize();
     476        LayoutSize frameSize = frameRect().size();
    476477
    477478        if (hScroll == ScrollbarAuto) {
     
    515516            contentsResized();
    516517            visibleContentsResized();
    517             IntSize newDocSize = contentsSize();
     518            LayoutSize newDocSize = contentsSize();
    518519            if (newDocSize == docSize) {
    519520                // The layout with the new scroll state had no impact on
     
    535536    if (m_horizontalScrollbar) {
    536537        int clientWidth = visibleWidth();
    537         int pageStep = max(max<int>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1);
    538         IntRect oldRect(m_horizontalScrollbar->frameRect());
    539         IntRect hBarRect = IntRect(0,
    540                                    height() - m_horizontalScrollbar->height(),
    541                                    width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0),
    542                                    m_horizontalScrollbar->height());
     538        LayoutUnit pageStep = max<LayoutUnit>(max<LayoutUnit>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1);
     539        LayoutRect oldRect(m_horizontalScrollbar->frameRect());
     540        LayoutRect hBarRect = LayoutRect(0,
     541                                         height() - m_horizontalScrollbar->height(),
     542                                         width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0),
     543                                         m_horizontalScrollbar->height());
    543544        m_horizontalScrollbar->setFrameRect(hBarRect);
    544545        if (!m_scrollbarsSuppressed && oldRect != m_horizontalScrollbar->frameRect())
     
    556557    if (m_verticalScrollbar) {
    557558        int clientHeight = visibleHeight();
    558         int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1);
    559         IntRect oldRect(m_verticalScrollbar->frameRect());
    560         IntRect vBarRect = IntRect(width() - m_verticalScrollbar->width(),
    561                                    0,
    562                                    m_verticalScrollbar->width(),
    563                                    height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height() : 0));
     559        LayoutUnit pageStep = max<LayoutUnit>(max<LayoutUnit>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1);
     560        LayoutRect oldRect(m_verticalScrollbar->frameRect());
     561        LayoutRect vBarRect = LayoutRect(width() - m_verticalScrollbar->width(),
     562            0,
     563            m_verticalScrollbar->width(),
     564            height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height() : 0));
    564565        m_verticalScrollbar->setFrameRect(vBarRect);
    565566        if (!m_scrollbarsSuppressed && oldRect != m_verticalScrollbar->frameRect())
     
    603604    IntRect scrollViewRect = convertToContainingWindow(IntRect(0, 0, visibleWidth(), visibleHeight()));
    604605    if (hasOverlayScrollbars()) {
    605         int verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVerticalScrollbar()) ? verticalScrollbar()->width() : 0;
    606         int horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHorizontalScrollbar()) ? horizontalScrollbar()->height() : 0;
     606        LayoutUnit verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVerticalScrollbar()) ? verticalScrollbar()->width() : 0;
     607        LayoutUnit horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHorizontalScrollbar()) ? horizontalScrollbar()->height() : 0;
    607608       
    608609        scrollViewRect.setWidth(scrollViewRect.width() - verticalScrollbarWidth);
     
    630631        // FIXME: the pan icon is broken when accelerated compositing is on, since it will draw under the compositing layers.
    631632        // https://bugs.webkit.org/show_bug.cgi?id=47837
    632         int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
    633         IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
    634         IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation , IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
     633        LayoutUnit panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
     634        LayoutPoint panIconDirtySquareLocation = LayoutPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
     635        LayoutRect panScrollIconDirtyRect = LayoutRect(panIconDirtySquareLocation , LayoutSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
    635636        panScrollIconDirtyRect.intersect(clipRect);
    636637        hostWindow()->invalidateContentsAndWindow(panScrollIconDirtyRect, false /*immediate*/);
     
    648649
    649650    // Invalidate the overhang areas if they are visible.
    650     IntRect horizontalOverhangRect;
    651     IntRect verticalOverhangRect;
     651    LayoutRect horizontalOverhangRect;
     652    LayoutRect verticalOverhangRect;
    652653    calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
    653654#if USE(ACCELERATED_COMPOSITING) && PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
     
    722723IntRect ScrollView::windowToContents(const IntRect& windowRect) const
    723724{
    724     IntRect viewRect = convertFromContainingWindow(windowRect);
     725    LayoutRect viewRect = convertFromContainingWindow(windowRect);
    725726    viewRect.move(scrollOffset());
    726727    return viewRect;
     
    743744}
    744745
    745 IntPoint ScrollView::screenToContents(const IntPoint& point) const
     746LayoutPoint ScrollView::screenToContents(const IntPoint& point) const
    746747{
    747748    if (platformWidget())
    748749        return platformScreenToContents(point);
    749750    if (!hostWindow())
    750         return IntPoint();
     751        return LayoutPoint();
    751752    return windowToContents(hostWindow()->screenToWindow(point));
    752753}
     
    812813        return 0;
    813814
    814     IntPoint viewPoint = convertFromContainingWindow(windowPoint);
     815    LayoutPoint viewPoint = convertFromContainingWindow(windowPoint);
    815816    if (m_horizontalScrollbar && m_horizontalScrollbar->frameRect().contains(viewPoint))
    816817        return m_horizontalScrollbar.get();
     
    850851#endif
    851852
    852 void ScrollView::setFrameRect(const IntRect& newRect)
    853 {
    854     IntRect oldRect = frameRect();
     853void ScrollView::setFrameRect(const LayoutRect& newRect)
     854{
     855    LayoutRect oldRect = frameRect();
    855856   
    856857    if (newRect == oldRect)
     
    883884        return;
    884885    graphicsLayer->setDrawsContent(true);
    885     IntRect scrollbarRect = scrollbar->frameRect();
     886    LayoutRect scrollbarRect = scrollbar->frameRect();
    886887    graphicsLayer->setPosition(scrollbarRect.location());
    887888    if (scrollbarRect.size() != graphicsLayer->size())
     
    890891}
    891892
    892 static void positionScrollCornerLayer(GraphicsLayer* graphicsLayer, const IntRect& cornerRect)
     893static void positionScrollCornerLayer(GraphicsLayer* graphicsLayer, const LayoutRect& cornerRect)
    893894{
    894895    if (!graphicsLayer)
     
    912913}
    913914
    914 void ScrollView::repaintContentRectangle(const IntRect& rect, bool now)
    915 {
    916     IntRect paintRect = rect;
     915void ScrollView::repaintContentRectangle(const LayoutRect& rect, bool now)
     916{
     917    LayoutRect paintRect = rect;
    917918    if (clipsRepaints() && !paintsEntireContents())
    918919        paintRect.intersect(visibleContentRect());
     
    969970}
    970971
    971 void ScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
     972void ScrollView::paintScrollCorner(GraphicsContext* context, const LayoutRect& cornerRect)
    972973{
    973974    ScrollbarTheme::theme()->paintScrollCorner(this, context, cornerRect);
    974975}
    975976
    976 void ScrollView::invalidateScrollCornerRect(const IntRect& rect)
     977void ScrollView::invalidateScrollCornerRect(const LayoutRect& rect)
    977978{
    978979    invalidateRect(rect);
    979980}
    980981
    981 void ScrollView::paintScrollbars(GraphicsContext* context, const IntRect& rect)
     982void ScrollView::paintScrollbars(GraphicsContext* context, const LayoutRect& rect)
    982983{
    983984    if (m_horizontalScrollbar
     
    10071008}
    10081009
    1009 void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
     1010void ScrollView::paint(GraphicsContext* context, const LayoutRect& rect)
    10101011{
    10111012    if (platformWidget()) {
     
    10221023    m_containsScrollableAreaWithOverlayScrollbars = false;
    10231024
    1024     IntRect clipRect = frameRect();
     1025    LayoutRect clipRect = frameRect();
    10251026    if (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar())
    10261027        clipRect.setWidth(clipRect.width() - verticalScrollbar()->width());
     
    10281029        clipRect.setHeight(clipRect.height() - horizontalScrollbar()->height());
    10291030
    1030     IntRect documentDirtyRect = rect;
     1031    LayoutRect documentDirtyRect = rect;
    10311032    documentDirtyRect.intersect(clipRect);
    10321033
     
    10571058    if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar)) {
    10581059        GraphicsContextStateSaver stateSaver(*context);
    1059         IntRect scrollViewDirtyRect = rect;
     1060        LayoutRect scrollViewDirtyRect = rect;
    10601061        scrollViewDirtyRect.intersect(frameRect());
    10611062        context->translate(x(), y());
     
    10701071}
    10711072
    1072 void ScrollView::calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntRect& verticalOverhangRect)
    1073 {
    1074     int verticalScrollbarWidth = (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar())
     1073void ScrollView::calculateOverhangAreasForPainting(LayoutRect& horizontalOverhangRect, LayoutRect& verticalOverhangRect)
     1074{
     1075    LayoutUnit verticalScrollbarWidth = (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar())
    10751076        ? verticalScrollbar()->width() : 0;
    1076     int horizontalScrollbarHeight = (horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar())
     1077    LayoutUnit horizontalScrollbarHeight = (horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar())
    10771078        ? horizontalScrollbar()->height() : 0;
    10781079
    1079     int physicalScrollY = scrollPosition().y() + scrollOrigin().y();
     1080    LayoutUnit physicalScrollY = scrollPosition().y() + scrollOrigin().y();
    10801081    if (physicalScrollY < 0) {
    10811082        horizontalOverhangRect = frameRect();
    10821083        horizontalOverhangRect.setHeight(-physicalScrollY);
    10831084    } else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight()) {
    1084         int height = physicalScrollY - (contentsHeight() - visibleHeight());
     1085        LayoutUnit height = physicalScrollY - (contentsHeight() - visibleHeight());
    10851086        horizontalOverhangRect = frameRect();
    10861087        horizontalOverhangRect.setY(frameRect().maxY() - height - horizontalScrollbarHeight);
     
    10881089    }
    10891090
    1090     int physicalScrollX = scrollPosition().x() + scrollOrigin().x();
     1091    LayoutUnit physicalScrollX = scrollPosition().x() + scrollOrigin().x();
    10911092    if (physicalScrollX < 0) {
    10921093        verticalOverhangRect.setWidth(-physicalScrollX);
     
    10981099            verticalOverhangRect.setY(frameRect().y());
    10991100    } else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth()) {
    1100         int width = physicalScrollX - (contentsWidth() - visibleWidth());
     1101        LayoutUnit width = physicalScrollX - (contentsWidth() - visibleWidth());
    11011102        verticalOverhangRect.setWidth(width);
    11021103        verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height());
     
    11091110}
    11101111
    1111 void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
     1112void ScrollView::paintOverhangAreas(GraphicsContext* context, const LayoutRect& horizontalOverhangRect, const LayoutRect& verticalOverhangRect, const LayoutRect& dirtyRect)
    11121113{
    11131114    ScrollbarTheme::theme()->paintOverhangAreas(this, context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
    11141115}
    11151116
    1116 void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext* context, const IntRect& dirtyRect)
    1117 {
    1118     IntRect horizontalOverhangRect;
    1119     IntRect verticalOverhangRect;
     1117void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext* context, const LayoutRect& dirtyRect)
     1118{
     1119    LayoutRect horizontalOverhangRect;
     1120    LayoutRect verticalOverhangRect;
    11201121    calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
    11211122
     
    11291130        return false;
    11301131
    1131     IntPoint viewPoint = convertFromContainingWindow(windowPoint);
     1132    LayoutPoint viewPoint = convertFromContainingWindow(windowPoint);
    11321133
    11331134    if (m_horizontalScrollbar) {
    1134         int horizontalScrollbarYMin = m_horizontalScrollbar->frameRect().y();
    1135         int horizontalScrollbarYMax = m_horizontalScrollbar->frameRect().y() + m_horizontalScrollbar->frameRect().height();
    1136         int horizontalScrollbarXMin = m_horizontalScrollbar->frameRect().x() + m_horizontalScrollbar->frameRect().width();
     1135        LayoutUnit horizontalScrollbarYMin = m_horizontalScrollbar->frameRect().y();
     1136        LayoutUnit horizontalScrollbarYMax = m_horizontalScrollbar->frameRect().y() + m_horizontalScrollbar->frameRect().height();
     1137        LayoutUnit horizontalScrollbarXMin = m_horizontalScrollbar->frameRect().x() + m_horizontalScrollbar->frameRect().width();
    11371138
    11381139        return viewPoint.y() > horizontalScrollbarYMin && viewPoint.y() < horizontalScrollbarYMax && viewPoint.x() > horizontalScrollbarXMin;
    11391140    }
    11401141
    1141     int verticalScrollbarXMin = m_verticalScrollbar->frameRect().x();
    1142     int verticalScrollbarXMax = m_verticalScrollbar->frameRect().x() + m_verticalScrollbar->frameRect().width();
    1143     int verticalScrollbarYMin = m_verticalScrollbar->frameRect().y() + m_verticalScrollbar->frameRect().height();
     1142    LayoutUnit verticalScrollbarXMin = m_verticalScrollbar->frameRect().x();
     1143    LayoutUnit verticalScrollbarXMax = m_verticalScrollbar->frameRect().x() + m_verticalScrollbar->frameRect().width();
     1144    LayoutUnit verticalScrollbarYMin = m_verticalScrollbar->frameRect().y() + m_verticalScrollbar->frameRect().height();
    11441145   
    11451146    return viewPoint.x() > verticalScrollbarXMin && viewPoint.x() < verticalScrollbarXMax && viewPoint.y() > verticalScrollbarYMin;
     
    11521153}
    11531154
    1154 IntRect ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& localRect) const
     1155LayoutRect ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutRect& localRect) const
    11551156{
    11561157    // Scrollbars won't be transformed within us
    1157     IntRect newRect = localRect;
     1158    LayoutRect newRect = localRect;
    11581159    newRect.moveBy(scrollbar->location());
    11591160    return newRect;
    11601161}
    11611162
    1162 IntRect ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
    1163 {
    1164     IntRect newRect = parentRect;
     1163LayoutRect ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutRect& parentRect) const
     1164{
     1165    LayoutRect newRect = parentRect;
    11651166    // Scrollbars won't be transformed within us
    11661167    newRect.moveBy(-scrollbar->location());
     
    11691170
    11701171// FIXME: test these on windows
    1171 IntPoint ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& localPoint) const
     1172LayoutPoint ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutPoint& localPoint) const
    11721173{
    11731174    // Scrollbars won't be transformed within us
    1174     IntPoint newPoint = localPoint;
     1175    LayoutPoint newPoint = localPoint;
    11751176    newPoint.moveBy(scrollbar->location());
    11761177    return newPoint;
    11771178}
    11781179
    1179 IntPoint ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
    1180 {
    1181     IntPoint newPoint = parentPoint;
     1180LayoutPoint ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutPoint& parentPoint) const
     1181{
     1182    LayoutPoint newPoint = parentPoint;
    11821183    // Scrollbars won't be transformed within us
    11831184    newPoint.moveBy(-scrollbar->location());
     
    12421243
    12431244
    1244 void ScrollView::addPanScrollIcon(const IntPoint& iconPosition)
     1245void ScrollView::addPanScrollIcon(const LayoutPoint& iconPosition)
    12451246{
    12461247    if (!hostWindow())
     
    13461347}
    13471348
    1348 IntRect ScrollView::platformContentsToScreen(const IntRect& rect) const
     1349IntRect ScrollView::platformContentsToScreen(const LayoutRect& rect) const
    13491350{
    13501351    return rect;
    13511352}
    13521353
    1353 IntPoint ScrollView::platformScreenToContents(const IntPoint& point) const
     1354LayoutPoint ScrollView::platformScreenToContents(const IntPoint& point) const
    13541355{
    13551356    return point;
     
    13651366}
    13661367
    1367 void ScrollView::platformRepaintContentRectangle(const IntRect&, bool /*now*/)
     1368void ScrollView::platformRepaintContentRectangle(const LayoutRect&, bool /*now*/)
    13681369{
    13691370}
Note: See TracChangeset for help on using the changeset viewer.