Changeset 101045 in webkit


Ignore:
Timestamp:
Nov 23, 2011 12:21:18 AM (12 years ago)
Author:
eae@chromium.org
Message:

Change remaining scrollTop/Left/Width/Height methods back to int
https://bugs.webkit.org/show_bug.cgi?id=72771

Reviewed by Eric Seidel.

Change remaining scrollTop/Left/Width/Height, setScrollLeft/Top and
verticalScrollbarWidth, horizontalScrollbarHeight methods back to int as
scrolling will remain int based to line up with device pixels.

No new tests.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::scrollWidth):
(WebCore::RenderBox::scrollHeight):
(WebCore::RenderBox::scrollLeft):
(WebCore::RenderBox::scrollTop):
(WebCore::RenderBox::setScrollLeft):
(WebCore::RenderBox::setScrollTop):
(WebCore::RenderBox::verticalScrollbarWidth):
(WebCore::RenderBox::horizontalScrollbarHeight):

  • rendering/RenderBox.h:

(WebCore::RenderBox::scrollbarLogicalHeight):

  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::verticalScrollbarWidth):
(WebCore::RenderListBox::scrollHeight):
(WebCore::RenderListBox::scrollLeft):
(WebCore::RenderListBox::setScrollLeft):
(WebCore::RenderListBox::scrollTop):
(WebCore::RenderListBox::setScrollTop):

  • rendering/RenderListBox.h:
  • rendering/RenderTextControlSingleLine.cpp:

(WebCore::RenderTextControlSingleLine::scrollWidth):
(WebCore::RenderTextControlSingleLine::scrollHeight):
(WebCore::RenderTextControlSingleLine::scrollLeft):
(WebCore::RenderTextControlSingleLine::scrollTop):
(WebCore::RenderTextControlSingleLine::setScrollLeft):
(WebCore::RenderTextControlSingleLine::setScrollTop):

  • rendering/RenderTextControlSingleLine.h:
Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r101035 r101045  
     12011-11-23  Emil A Eklund  <eae@chromium.org>
     2
     3        Change remaining scrollTop/Left/Width/Height methods back to int
     4        https://bugs.webkit.org/show_bug.cgi?id=72771
     5
     6        Reviewed by Eric Seidel.
     7
     8        Change remaining scrollTop/Left/Width/Height, setScrollLeft/Top and
     9        verticalScrollbarWidth, horizontalScrollbarHeight methods back to int as
     10        scrolling will remain int based to line up with device pixels.
     11
     12        No new tests.
     13
     14        * rendering/RenderBox.cpp:
     15        (WebCore::RenderBox::scrollWidth):
     16        (WebCore::RenderBox::scrollHeight):
     17        (WebCore::RenderBox::scrollLeft):
     18        (WebCore::RenderBox::scrollTop):
     19        (WebCore::RenderBox::setScrollLeft):
     20        (WebCore::RenderBox::setScrollTop):
     21        (WebCore::RenderBox::verticalScrollbarWidth):
     22        (WebCore::RenderBox::horizontalScrollbarHeight):
     23        * rendering/RenderBox.h:
     24        (WebCore::RenderBox::scrollbarLogicalHeight):
     25        * rendering/RenderListBox.cpp:
     26        (WebCore::RenderListBox::verticalScrollbarWidth):
     27        (WebCore::RenderListBox::scrollHeight):
     28        (WebCore::RenderListBox::scrollLeft):
     29        (WebCore::RenderListBox::setScrollLeft):
     30        (WebCore::RenderListBox::scrollTop):
     31        (WebCore::RenderListBox::setScrollTop):
     32        * rendering/RenderListBox.h:
     33        * rendering/RenderTextControlSingleLine.cpp:
     34        (WebCore::RenderTextControlSingleLine::scrollWidth):
     35        (WebCore::RenderTextControlSingleLine::scrollHeight):
     36        (WebCore::RenderTextControlSingleLine::scrollLeft):
     37        (WebCore::RenderTextControlSingleLine::scrollTop):
     38        (WebCore::RenderTextControlSingleLine::setScrollLeft):
     39        (WebCore::RenderTextControlSingleLine::setScrollTop):
     40        * rendering/RenderTextControlSingleLine.h:
     41
    1422011-11-22  Kenneth Russell  <kbr@google.com>
    243
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r100365 r101045  
    476476}
    477477
    478 LayoutUnit RenderBox::scrollWidth() const
     478int RenderBox::scrollWidth() const
    479479{
    480480    if (hasOverflowClip())
     
    484484    if (style()->isLeftToRightDirection())
    485485        return max(clientWidth(), maxXLayoutOverflow() - borderLeft());
    486     return clientWidth() - min<LayoutUnit>(0, minXLayoutOverflow() - borderLeft());
    487 }
    488 
    489 LayoutUnit RenderBox::scrollHeight() const
     486    return clientWidth() - min(0, minXLayoutOverflow() - borderLeft());
     487}
     488
     489int RenderBox::scrollHeight() const
    490490{
    491491    if (hasOverflowClip())
     
    496496}
    497497
    498 LayoutUnit RenderBox::scrollLeft() const
     498int RenderBox::scrollLeft() const
    499499{
    500500    return hasOverflowClip() ? layer()->scrollXOffset() : 0;
    501501}
    502502
    503 LayoutUnit RenderBox::scrollTop() const
     503int RenderBox::scrollTop() const
    504504{
    505505    return hasOverflowClip() ? layer()->scrollYOffset() : 0;
    506506}
    507507
    508 void RenderBox::setScrollLeft(LayoutUnit newLeft)
     508void RenderBox::setScrollLeft(int newLeft)
    509509{
    510510    if (hasOverflowClip())
     
    512512}
    513513
    514 void RenderBox::setScrollTop(LayoutUnit newTop)
     514void RenderBox::setScrollTop(int newTop)
    515515{
    516516    if (hasOverflowClip())
     
    644644}
    645645
    646 LayoutUnit RenderBox::verticalScrollbarWidth() const
     646int RenderBox::verticalScrollbarWidth() const
    647647{
    648648    return includeVerticalScrollbarSize() ? layer()->verticalScrollbarWidth() : 0;
    649649}
    650650
    651 LayoutUnit RenderBox::horizontalScrollbarHeight() const
     651int RenderBox::horizontalScrollbarHeight() const
    652652{
    653653    return includeHorizontalScrollbarSize() ? layer()->horizontalScrollbarHeight() : 0;
  • trunk/Source/WebCore/rendering/RenderBox.h

    r100048 r101045  
    200200    // textareas can scroll shadow content (but pretend that they are the objects that are
    201201    // scrolling).
    202     virtual LayoutUnit scrollLeft() const;
    203     virtual LayoutUnit scrollTop() const;
    204     virtual LayoutUnit scrollWidth() const;
    205     virtual LayoutUnit scrollHeight() const;
    206     virtual void setScrollLeft(LayoutUnit);
    207     virtual void setScrollTop(LayoutUnit);
     202    virtual int scrollLeft() const;
     203    virtual int scrollTop() const;
     204    virtual int scrollWidth() const;
     205    virtual int scrollHeight() const;
     206    virtual void setScrollLeft(int);
     207    virtual void setScrollTop(int);
    208208
    209209    virtual LayoutUnit marginTop() const { return m_marginTop; }
     
    341341    LayoutUnit availableHeight() const { return style()->isHorizontalWritingMode() ? availableLogicalHeight() : availableLogicalWidth(); }
    342342
    343     virtual LayoutUnit verticalScrollbarWidth() const;
    344     LayoutUnit horizontalScrollbarHeight() const;
    345     LayoutUnit scrollbarLogicalHeight() const { return style()->isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); }
     343    virtual int verticalScrollbarWidth() const;
     344    int horizontalScrollbarHeight() const;
     345    int scrollbarLogicalHeight() const { return style()->isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); }
    346346    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
    347347    virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r100447 r101045  
    635635}
    636636
    637 LayoutUnit RenderListBox::verticalScrollbarWidth() const
     637int RenderListBox::verticalScrollbarWidth() const
    638638{
    639639    return m_vBar && !m_vBar->isOverlayScrollbar() ? m_vBar->width() : LayoutUnit(0);
     
    648648}
    649649
    650 LayoutUnit RenderListBox::scrollHeight() const
     650int RenderListBox::scrollHeight() const
    651651{
    652652    return max(clientHeight(), listHeight());
    653653}
    654654
    655 LayoutUnit RenderListBox::scrollLeft() const
     655int RenderListBox::scrollLeft() const
    656656{
    657657    return 0;
    658658}
    659659
    660 void RenderListBox::setScrollLeft(LayoutUnit)
    661 {
    662 }
    663 
    664 LayoutUnit RenderListBox::scrollTop() const
     660void RenderListBox::setScrollLeft(int)
     661{
     662}
     663
     664int RenderListBox::scrollTop() const
    665665{
    666666    return m_indexOffset * itemHeight();
    667667}
    668668
    669 void RenderListBox::setScrollTop(LayoutUnit newTop)
     669void RenderListBox::setScrollTop(int newTop)
    670670{
    671671    // Determine an index and scroll to it.   
  • trunk/Source/WebCore/rendering/RenderListBox.h

    r99511 r101045  
    8989    virtual void panScroll(const IntPoint&);
    9090
    91     virtual LayoutUnit verticalScrollbarWidth() const;
    92     virtual LayoutUnit scrollLeft() const;
    93     virtual LayoutUnit scrollTop() const;
    94     virtual LayoutUnit scrollWidth() const;
    95     virtual LayoutUnit scrollHeight() const;
    96     virtual void setScrollLeft(LayoutUnit);
    97     virtual void setScrollTop(LayoutUnit);
     91    virtual int verticalScrollbarWidth() const;
     92    virtual int scrollLeft() const;
     93    virtual int scrollTop() const;
     94    virtual int scrollWidth() const;
     95    virtual int scrollHeight() const;
     96    virtual void setScrollLeft(int);
     97    virtual void setScrollTop(int);
    9898
    9999    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r99511 r101045  
    708708}
    709709
    710 LayoutUnit RenderTextControlSingleLine::scrollWidth() const
     710int RenderTextControlSingleLine::scrollWidth() const
    711711{
    712712    if (innerTextElement())
     
    715715}
    716716
    717 LayoutUnit RenderTextControlSingleLine::scrollHeight() const
     717int RenderTextControlSingleLine::scrollHeight() const
    718718{
    719719    if (innerTextElement())
     
    722722}
    723723
    724 LayoutUnit RenderTextControlSingleLine::scrollLeft() const
     724int RenderTextControlSingleLine::scrollLeft() const
    725725{
    726726    if (innerTextElement())
     
    729729}
    730730
    731 LayoutUnit RenderTextControlSingleLine::scrollTop() const
     731int RenderTextControlSingleLine::scrollTop() const
    732732{
    733733    if (innerTextElement())
     
    736736}
    737737
    738 void RenderTextControlSingleLine::setScrollLeft(LayoutUnit newLeft)
     738void RenderTextControlSingleLine::setScrollLeft(int newLeft)
    739739{
    740740    if (innerTextElement())
     
    742742}
    743743
    744 void RenderTextControlSingleLine::setScrollTop(LayoutUnit newTop)
     744void RenderTextControlSingleLine::setScrollTop(int newTop)
    745745{
    746746    if (innerTextElement())
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h

    r99511 r101045  
    6767
    6868    // Subclassed to forward to our inner div.
    69     virtual LayoutUnit scrollLeft() const;
    70     virtual LayoutUnit scrollTop() const;
    71     virtual LayoutUnit scrollWidth() const;
    72     virtual LayoutUnit scrollHeight() const;
    73     virtual void setScrollLeft(LayoutUnit);
    74     virtual void setScrollTop(LayoutUnit);
     69    virtual int scrollLeft() const;
     70    virtual int scrollTop() const;
     71    virtual int scrollWidth() const;
     72    virtual int scrollHeight() const;
     73    virtual void setScrollLeft(int);
     74    virtual void setScrollTop(int);
    7575    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
    7676    virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
Note: See TracChangeset for help on using the changeset viewer.