Changeset 92998 in webkit


Ignore:
Timestamp:
Aug 12, 2011 2:35:02 PM (13 years ago)
Author:
leviw@chromium.org
Message:

Switch RenderMenuList, RenderListBox, and RenderFieldSet to new layout units
https://bugs.webkit.org/show_bug.cgi?id=66149

Reviewed by Eric Seidel.

Changing RenderMenuList, RenderListBox, and RenderFieldSet to the LayoutUnit
abstraction from ints.

No tests as no change in functionality.

  • rendering/RenderFieldset.cpp:

(WebCore::RenderFieldset::layoutSpecialExcludedChild):

  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::numVisibleItems):
(WebCore::RenderListBox::listHeight):
(WebCore::RenderListBox::baselinePosition):
(WebCore::RenderListBox::itemBoundingBoxRect):
(WebCore::itemOffsetForAlignment):
(WebCore::RenderListBox::panScroll):
(WebCore::RenderListBox::scrollToward):
(WebCore::RenderListBox::autoscroll):
(WebCore::RenderListBox::scrollSize):
(WebCore::RenderListBox::scrollPosition):
(WebCore::RenderListBox::setScrollOffset):
(WebCore::RenderListBox::itemHeight):
(WebCore::RenderListBox::verticalScrollbarWidth):
(WebCore::RenderListBox::scrollWidth):
(WebCore::RenderListBox::scrollHeight):
(WebCore::RenderListBox::scrollLeft):
(WebCore::RenderListBox::setScrollLeft):
(WebCore::RenderListBox::scrollTop):
(WebCore::RenderListBox::setScrollTop):
(WebCore::RenderListBox::controlClipRect):
(WebCore::RenderListBox::invalidateScrollbarRect):
(WebCore::RenderListBox::convertFromScrollbarToContainingView):
(WebCore::RenderListBox::convertFromContainingViewToScrollbar):
(WebCore::RenderListBox::contentsSize):
(WebCore::RenderListBox::currentMousePosition):

  • rendering/RenderListBox.h:

(WebCore::RenderListBox::scrollCornerRect):
(WebCore::RenderListBox::invalidateScrollCornerRect):

  • rendering/RenderMenuList.cpp:

(WebCore::RenderMenuList::controlClipRect):
(WebCore::RenderMenuList::showPopup):

  • rendering/RenderMenuList.h:
Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r92993 r92998  
     12011-08-12  Levi Weintraub  <leviw@chromium.org>
     2
     3        Switch RenderMenuList, RenderListBox, and RenderFieldSet to new layout units
     4        https://bugs.webkit.org/show_bug.cgi?id=66149
     5
     6        Reviewed by Eric Seidel.
     7
     8        Changing RenderMenuList, RenderListBox, and RenderFieldSet to the LayoutUnit
     9        abstraction from ints.
     10
     11        No tests as no change in functionality.
     12
     13        * rendering/RenderFieldset.cpp:
     14        (WebCore::RenderFieldset::layoutSpecialExcludedChild):
     15        * rendering/RenderListBox.cpp:
     16        (WebCore::RenderListBox::numVisibleItems):
     17        (WebCore::RenderListBox::listHeight):
     18        (WebCore::RenderListBox::baselinePosition):
     19        (WebCore::RenderListBox::itemBoundingBoxRect):
     20        (WebCore::itemOffsetForAlignment):
     21        (WebCore::RenderListBox::panScroll):
     22        (WebCore::RenderListBox::scrollToward):
     23        (WebCore::RenderListBox::autoscroll):
     24        (WebCore::RenderListBox::scrollSize):
     25        (WebCore::RenderListBox::scrollPosition):
     26        (WebCore::RenderListBox::setScrollOffset):
     27        (WebCore::RenderListBox::itemHeight):
     28        (WebCore::RenderListBox::verticalScrollbarWidth):
     29        (WebCore::RenderListBox::scrollWidth):
     30        (WebCore::RenderListBox::scrollHeight):
     31        (WebCore::RenderListBox::scrollLeft):
     32        (WebCore::RenderListBox::setScrollLeft):
     33        (WebCore::RenderListBox::scrollTop):
     34        (WebCore::RenderListBox::setScrollTop):
     35        (WebCore::RenderListBox::controlClipRect):
     36        (WebCore::RenderListBox::invalidateScrollbarRect):
     37        (WebCore::RenderListBox::convertFromScrollbarToContainingView):
     38        (WebCore::RenderListBox::convertFromContainingViewToScrollbar):
     39        (WebCore::RenderListBox::contentsSize):
     40        (WebCore::RenderListBox::currentMousePosition):
     41        * rendering/RenderListBox.h:
     42        (WebCore::RenderListBox::scrollCornerRect):
     43        (WebCore::RenderListBox::invalidateScrollCornerRect):
     44        * rendering/RenderMenuList.cpp:
     45        (WebCore::RenderMenuList::controlClipRect):
     46        (WebCore::RenderMenuList::showPopup):
     47        * rendering/RenderMenuList.h:
     48
    1492011-08-12  David Hyatt  <hyatt@apple.com>
    250
  • trunk/Source/WebCore/dom/SelectElement.cpp

    r91219 r92998  
    775775        MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
    776776        IntPoint localOffset = roundedIntPoint(element->renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
    777         int listIndex = toRenderListBox(element->renderer())->listIndexAtOffset(localOffset.x(), localOffset.y());
     777        int listIndex = toRenderListBox(element->renderer())->listIndexAtOffset(toSize(localOffset));
    778778        if (listIndex >= 0) {
    779779#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
  • trunk/Source/WebCore/rendering/LayoutTypes.h

    r90833 r92998  
    5252}
    5353
     54inline LayoutSize roundedLayoutSize(const FloatSize& s)
     55{
     56    return roundedIntSize(s);
     57}
     58
    5459inline LayoutPoint roundedLayoutPoint(const FloatPoint& p)
    5560{
  • trunk/Source/WebCore/rendering/RenderFieldset.cpp

    r92340 r92998  
    6969        legend->layoutIfNeeded();
    7070
    71         int logicalLeft;
     71        LayoutUnit logicalLeft;
    7272        if (style()->isLeftToRightDirection()) {
    7373            switch (legend->style()->textAlign()) {
     
    9090                // Make sure that the extra pixel goes to the end side in RTL (since it went to the end side
    9191                // in LTR).
    92                 int centeredWidth = logicalWidth() - logicalWidthForChild(legend);
     92                LayoutUnit centeredWidth = logicalWidth() - logicalWidthForChild(legend);
    9393                logicalLeft = centeredWidth - centeredWidth / 2;
    9494                break;
     
    102102        setLogicalLeftForChild(legend, logicalLeft);
    103103
    104         int b = borderBefore();
    105         int h = logicalHeightForChild(legend);
    106         setLogicalTopForChild(legend, max((b - h) / 2, 0));
     104        LayoutUnit b = borderBefore();
     105        LayoutUnit h = logicalHeightForChild(legend);
     106        setLogicalTopForChild(legend, max<LayoutUnit>((b - h) / 2, 0));
    107107        setLogicalHeight(max(b, h) + paddingBefore());
    108108    }
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r90833 r92998  
    218218{
    219219    // Only count fully visible rows. But don't return 0 even if only part of a row shows.
    220     return max(1, (contentHeight() + rowSpacing) / itemHeight());
     220    return max<int>(1, (contentHeight() + rowSpacing) / itemHeight());
    221221}
    222222
     
    226226}
    227227
    228 int RenderListBox::listHeight() const
     228LayoutUnit RenderListBox::listHeight() const
    229229{
    230230    return itemHeight() * numItems() - rowSpacing;
     
    250250}
    251251
    252 int RenderListBox::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const
     252LayoutUnit RenderListBox::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const
    253253{
    254254    return RenderBox::baselinePosition(baselineType, firstLine, lineDirection, linePositionMode) - baselineAdjustment;
    255255}
    256256
    257 IntRect RenderListBox::itemBoundingBoxRect(const LayoutPoint& additionalOffset, int index)
    258 {
    259     return IntRect(additionalOffset.x() + borderLeft() + paddingLeft(),
     257LayoutRect RenderListBox::itemBoundingBoxRect(const LayoutPoint& additionalOffset, int index)
     258{
     259    return LayoutRect(additionalOffset.x() + borderLeft() + paddingLeft(),
    260260                   additionalOffset.y() + borderTop() + paddingTop() + itemHeight() * (index - m_indexOffset),
    261261                   contentWidth(), itemHeight());
     
    343343}
    344344
    345 static IntSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, Font itemFont, IntRect itemBoudingBox)
     345static LayoutSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, Font itemFont, LayoutRect itemBoudingBox)
    346346{
    347347    ETextAlign actualAlignment = itemStyle->textAlign();
     
    350350      actualAlignment = itemStyle->isLeftToRightDirection() ? LEFT : RIGHT;
    351351
    352     IntSize offset = IntSize(0, itemFont.fontMetrics().ascent());
     352    LayoutSize offset = LayoutSize(0, itemFont.fontMetrics().ascent());
    353353    if (actualAlignment == RIGHT || actualAlignment == WEBKIT_RIGHT) {
    354354        float textWidth = itemFont.width(textRun);
     
    457457}
    458458
    459 int RenderListBox::listIndexAtOffset(int offsetX, int offsetY)
     459int RenderListBox::listIndexAtOffset(const LayoutSize& offset)
    460460{
    461461    if (!numItems())
    462462        return -1;
    463463
    464     if (offsetY < borderTop() + paddingTop() || offsetY > height() - paddingBottom() - borderBottom())
     464    if (offset.height() < borderTop() + paddingTop() || offset.height() > height() - paddingBottom() - borderBottom())
    465465        return -1;
    466466
    467     int scrollbarWidth = m_vBar ? m_vBar->width() : 0;
    468     if (offsetX < borderLeft() + paddingLeft() || offsetX > width() - borderRight() - paddingRight() - scrollbarWidth)
     467    LayoutUnit scrollbarWidth = m_vBar ? m_vBar->width() : 0;
     468    if (offset.width() < borderLeft() + paddingLeft() || offset.width() > width() - borderRight() - paddingRight() - scrollbarWidth)
    469469        return -1;
    470470
    471     int newOffset = (offsetY - borderTop() - paddingTop()) / itemHeight() + m_indexOffset;
     471    int newOffset = (offset.height() - borderTop() - paddingTop()) / itemHeight() + m_indexOffset;
    472472    return newOffset < numItems() ? newOffset : -1;
    473473}
     
    482482    FloatPoint absOffset = localToAbsolute();
    483483
    484     IntPoint currentMousePosition = frame()->eventHandler()->currentMousePosition();
     484    IntPoint currentMousePosition = roundedIntPoint(frame()->eventHandler()->currentMousePosition());
    485485    // We need to check if the current mouse position is out of the window. When the mouse is out of the window, the position is incoherent
    486486    static IntPoint previousMousePosition;
     
    490490        previousMousePosition = currentMousePosition;
    491491
    492     int yDelta = currentMousePosition.y() - panStartMousePosition.y();
     492    LayoutUnit yDelta = currentMousePosition.y() - panStartMousePosition.y();
    493493
    494494    // If the point is too far from the center we limit the speed
    495     yDelta = max(min(yDelta, maxSpeed), -maxSpeed);
     495    yDelta = max<LayoutUnit>(min<LayoutUnit>(yDelta, maxSpeed), -maxSpeed);
    496496   
    497497    if (abs(yDelta) < iconRadius) // at the center we let the space for the icon
     
    507507    yDelta /= speedReducer;
    508508
    509     IntPoint scrollPoint(0, 0);
     509    LayoutPoint scrollPoint(0, 0);
    510510    scrollPoint.setY(absOffset.y() + yDelta);
    511     int newOffset = scrollToward(scrollPoint);
     511    LayoutUnit newOffset = scrollToward(scrollPoint);
    512512    if (newOffset < 0)
    513513        return;
     
    519519}
    520520
    521 int RenderListBox::scrollToward(const IntPoint& destination)
     521int RenderListBox::scrollToward(const LayoutPoint& destination)
    522522{
    523523    // FIXME: This doesn't work correctly with transforms.
    524524    FloatPoint absPos = localToAbsolute();
    525     int offsetX = destination.x() - absPos.x();
    526     int offsetY = destination.y() - absPos.y();
     525    LayoutSize positionOffset = roundedLayoutSize(destination - absPos);
    527526
    528527    int rows = numVisibleItems();
    529528    int offset = m_indexOffset;
    530529   
    531     if (offsetY < borderTop() + paddingTop() && scrollToRevealElementAtListIndex(offset - 1))
     530    if (positionOffset.height() < borderTop() + paddingTop() && scrollToRevealElementAtListIndex(offset - 1))
    532531        return offset - 1;
    533532   
    534     if (offsetY > height() - paddingBottom() - borderBottom() && scrollToRevealElementAtListIndex(offset + rows))
     533    if (positionOffset.height() > height() - paddingBottom() - borderBottom() && scrollToRevealElementAtListIndex(offset + rows))
    535534        return offset + rows - 1;
    536535   
    537     return listIndexAtOffset(offsetX, offsetY);
     536    return listIndexAtOffset(positionOffset);
    538537}
    539538
    540539void RenderListBox::autoscroll()
    541540{
    542     IntPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->currentMousePosition());
     541    LayoutPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->currentMousePosition());
    543542
    544543    int endIndex = scrollToward(pos);
     
    600599}
    601600
    602 int RenderListBox::scrollSize(ScrollbarOrientation orientation) const
     601LayoutUnit RenderListBox::scrollSize(ScrollbarOrientation orientation) const
    603602{
    604603    return ((orientation == VerticalScrollbar) && m_vBar) ? (m_vBar->totalSize() - m_vBar->visibleSize()) : 0;
    605604}
    606605
    607 int RenderListBox::scrollPosition(Scrollbar*) const
     606LayoutUnit RenderListBox::scrollPosition(Scrollbar*) const
    608607{
    609608    return m_indexOffset;
    610609}
    611610
    612 void RenderListBox::setScrollOffset(const IntPoint& offset)
     611void RenderListBox::setScrollOffset(const LayoutPoint& offset)
    613612{
    614613    scrollTo(offset.y());
     
    625624}
    626625
    627 int RenderListBox::itemHeight() const
     626LayoutUnit RenderListBox::itemHeight() const
    628627{
    629628    return style()->fontMetrics().height() + rowSpacing;
    630629}
    631630
    632 int RenderListBox::verticalScrollbarWidth() const
     631LayoutUnit RenderListBox::verticalScrollbarWidth() const
    633632{
    634633    return m_vBar && !m_vBar->isOverlayScrollbar() ? m_vBar->width() : 0;
     
    637636// FIXME: We ignore padding in the vertical direction as far as these values are concerned, since that's
    638637// how the control currently paints.
    639 int RenderListBox::scrollWidth() const
     638LayoutUnit RenderListBox::scrollWidth() const
    640639{
    641640    // There is no horizontal scrolling allowed.
     
    643642}
    644643
    645 int RenderListBox::scrollHeight() const
     644LayoutUnit RenderListBox::scrollHeight() const
    646645{
    647646    return max(clientHeight(), listHeight());
    648647}
    649648
    650 int RenderListBox::scrollLeft() const
     649LayoutUnit RenderListBox::scrollLeft() const
    651650{
    652651    return 0;
    653652}
    654653
    655 void RenderListBox::setScrollLeft(int)
    656 {
    657 }
    658 
    659 int RenderListBox::scrollTop() const
     654void RenderListBox::setScrollLeft(LayoutUnit)
     655{
     656}
     657
     658LayoutUnit RenderListBox::scrollTop() const
    660659{
    661660    return m_indexOffset * itemHeight();
    662661}
    663662
    664 void RenderListBox::setScrollTop(int newTop)
     663void RenderListBox::setScrollTop(LayoutUnit newTop)
    665664{
    666665    // Determine an index and scroll to it.   
     
    695694}
    696695
    697 IntRect RenderListBox::controlClipRect(const IntPoint& additionalOffset) const
    698 {
    699     IntRect clipRect = contentBoxRect();
     696LayoutRect RenderListBox::controlClipRect(const LayoutPoint& additionalOffset) const
     697{
     698    LayoutRect clipRect = contentBoxRect();
    700699    clipRect.moveBy(additionalOffset);
    701700    return clipRect;
     
    708707}
    709708
    710 void RenderListBox::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect)
    711 {
    712     IntRect scrollRect = rect;
     709void RenderListBox::invalidateScrollbarRect(Scrollbar* scrollbar, const LayoutRect& rect)
     710{
     711    LayoutRect scrollRect = rect;
    713712    scrollRect.move(width() - borderRight() - scrollbar->width(), borderTop());
    714713    repaintRectangle(scrollRect);
    715714}
    716715
    717 IntRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const
     716LayoutRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutRect& scrollbarRect) const
    718717{
    719718    RenderView* view = this->view();
     
    721720        return scrollbarRect;
    722721
    723     IntRect rect = scrollbarRect;
    724 
    725     int scrollbarLeft = width() - borderRight() - scrollbar->width();
    726     int scrollbarTop = borderTop();
     722    LayoutRect rect = scrollbarRect;
     723
     724    LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();
     725    LayoutUnit scrollbarTop = borderTop();
    727726    rect.move(scrollbarLeft, scrollbarTop);
    728727
     
    730729}
    731730
    732 IntRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
     731LayoutRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutRect& parentRect) const
    733732{
    734733    RenderView* view = this->view();
     
    736735        return parentRect;
    737736
    738     IntRect rect = view->frameView()->convertToRenderer(this, parentRect);
    739 
    740     int scrollbarLeft = width() - borderRight() - scrollbar->width();
    741     int scrollbarTop = borderTop();
     737    LayoutRect rect = view->frameView()->convertToRenderer(this, parentRect);
     738
     739    LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();
     740    LayoutUnit scrollbarTop = borderTop();
    742741    rect.move(-scrollbarLeft, -scrollbarTop);
    743742    return rect;
    744743}
    745744
    746 IntPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const
     745LayoutPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutPoint& scrollbarPoint) const
    747746{
    748747    RenderView* view = this->view();
     
    750749        return scrollbarPoint;
    751750
    752     IntPoint point = scrollbarPoint;
    753 
    754     int scrollbarLeft = width() - borderRight() - scrollbar->width();
    755     int scrollbarTop = borderTop();
     751    LayoutPoint point = scrollbarPoint;
     752
     753    LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();
     754    LayoutUnit scrollbarTop = borderTop();
    756755    point.move(scrollbarLeft, scrollbarTop);
    757756
     
    759758}
    760759
    761 IntPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
     760LayoutPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutPoint& parentPoint) const
    762761{
    763762    RenderView* view = this->view();
     
    765764        return parentPoint;
    766765
    767     IntPoint point = view->frameView()->convertToRenderer(this, parentPoint);
    768 
    769     int scrollbarLeft = width() - borderRight() - scrollbar->width();
    770     int scrollbarTop = borderTop();
     766    LayoutPoint point = view->frameView()->convertToRenderer(this, parentPoint);
     767
     768    LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();
     769    LayoutUnit scrollbarTop = borderTop();
    771770    point.move(-scrollbarLeft, -scrollbarTop);
    772771    return point;
    773772}
    774773
    775 IntSize RenderListBox::contentsSize() const
    776 {
    777     return IntSize(scrollWidth(), scrollHeight());
     774LayoutSize RenderListBox::contentsSize() const
     775{
     776    return LayoutSize(scrollWidth(), scrollHeight());
    778777}
    779778
     
    788787}
    789788
    790 IntPoint RenderListBox::currentMousePosition() const
     789LayoutPoint RenderListBox::currentMousePosition() const
    791790{
    792791    RenderView* view = this->view();
    793792    if (!view)
    794         return IntPoint();
     793        return LayoutPoint();
    795794    return view->frameView()->currentMousePosition();
    796795}
  • trunk/Source/WebCore/rendering/RenderListBox.h

    r90833 r92998  
    4646    void setOptionsChanged(bool changed) { m_optionsChanged = changed; }
    4747
    48     int listIndexAtOffset(int x, int y);
    49     IntRect itemBoundingBoxRect(const LayoutPoint&, int index);
     48    int listIndexAtOffset(const LayoutSize&);
     49    LayoutRect itemBoundingBoxRect(const LayoutPoint&, int index);
    5050
    5151    bool scrollToRevealElementAtListIndex(int index);
    5252    bool listIndexIsVisible(int index);
    5353
    54     int scrollToward(const IntPoint&); // Returns the new index or -1 if no scroll occurred
     54    int scrollToward(const LayoutPoint&); // Returns the new index or -1 if no scroll occurred
    5555
    5656    int size() const;
     
    6767    virtual bool hasControlClip() const { return true; }
    6868    virtual void paintObject(PaintInfo&, const LayoutPoint&);
    69     virtual IntRect controlClipRect(const IntPoint&) const;
     69    virtual LayoutRect controlClipRect(const LayoutPoint&) const;
    7070
    7171    virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset);
     
    7575
    7676    virtual void computePreferredLogicalWidths();
    77     virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
     77    virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
    7878    virtual void computeLogicalHeight();
    7979
     
    8989    virtual void panScroll(const IntPoint&);
    9090
    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);
     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);
    9898
    9999    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
    100100
    101101    // ScrollableArea interface.
    102     virtual int scrollSize(ScrollbarOrientation orientation) const;
    103     virtual int scrollPosition(Scrollbar*) const;
    104     virtual void setScrollOffset(const IntPoint&);
    105     virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
     102    virtual LayoutUnit scrollSize(ScrollbarOrientation) const;
     103    virtual LayoutUnit scrollPosition(Scrollbar*) const;
     104    virtual void setScrollOffset(const LayoutPoint&);
     105    virtual void invalidateScrollbarRect(Scrollbar*, const LayoutRect&);
    106106    virtual bool isActive() const;
    107107    virtual bool isScrollCornerVisible() const { return false; } // We don't support resize on list boxes yet. If we did these would have to change.
    108     virtual IntRect scrollCornerRect() const { return IntRect(); }
    109     virtual void invalidateScrollCornerRect(const IntRect&) { }
    110     virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect&) const;
    111     virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const;
    112     virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const;
    113     virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const;
     108    virtual LayoutRect scrollCornerRect() const { return LayoutRect(); }
     109    virtual void invalidateScrollCornerRect(const LayoutRect&) { }
     110    virtual LayoutRect convertFromScrollbarToContainingView(const Scrollbar*, const LayoutRect&) const;
     111    virtual LayoutRect convertFromContainingViewToScrollbar(const Scrollbar*, const LayoutRect&) const;
     112    virtual LayoutPoint convertFromScrollbarToContainingView(const Scrollbar*, const LayoutPoint&) const;
     113    virtual LayoutPoint convertFromContainingViewToScrollbar(const Scrollbar*, const LayoutPoint&) const;
    114114    virtual Scrollbar* verticalScrollbar() const { return m_vBar.get(); }
    115     virtual IntSize contentsSize() const;
     115    virtual LayoutSize contentsSize() const;
    116116    virtual LayoutUnit visibleHeight() const;
    117117    virtual LayoutUnit visibleWidth() const;
    118     virtual IntPoint currentMousePosition() const;
     118    virtual LayoutPoint currentMousePosition() const;
    119119    virtual bool shouldSuspendScrollAnimations() const;
    120120    virtual bool isOnActivePage() const;
     
    131131    void destroyScrollbar();
    132132   
    133     int itemHeight() const;
     133    LayoutUnit itemHeight() const;
    134134    void valueChanged(unsigned listIndex);
    135135    int numVisibleItems() const;
    136136    int numItems() const;
    137     int listHeight() const;
     137    LayoutUnit listHeight() const;
    138138    void paintScrollbar(PaintInfo&, const LayoutPoint&);
    139139    void paintItemForeground(PaintInfo&, const LayoutPoint&, int listIndex);
  • trunk/Source/WebCore/rendering/RenderMenuList.cpp

    r91219 r92998  
    238238}
    239239
    240 IntRect RenderMenuList::controlClipRect(const IntPoint& additionalOffset) const
     240LayoutRect RenderMenuList::controlClipRect(const LayoutPoint& additionalOffset) const
    241241{
    242242    // Clip to the intersection of the content box and the content box for the inner box
    243243    // This will leave room for the arrows which sit in the inner box padding,
    244244    // and if the inner box ever spills out of the outer box, that will get clipped too.
    245     IntRect outerBox(additionalOffset.x() + borderLeft() + paddingLeft(),
     245    LayoutRect outerBox(additionalOffset.x() + borderLeft() + paddingLeft(),
    246246                   additionalOffset.y() + borderTop() + paddingTop(),
    247247                   contentWidth(),
    248248                   contentHeight());
    249249   
    250     IntRect innerBox(additionalOffset.x() + m_innerBlock->x() + m_innerBlock->paddingLeft(),
     250    LayoutRect innerBox(additionalOffset.x() + m_innerBlock->x() + m_innerBlock->paddingLeft(),
    251251                   additionalOffset.y() + m_innerBlock->y() + m_innerBlock->paddingTop(),
    252252                   m_innerBlock->contentWidth(),
     
    303303    // the actual width of the element to size the popup.
    304304    FloatPoint absTopLeft = localToAbsolute(FloatPoint(), false, true);
    305     IntRect absBounds = absoluteBoundingBoxRect();
     305    LayoutRect absBounds = absoluteBoundingBoxRect();
    306306    absBounds.setLocation(roundedIntPoint(absTopLeft));
    307307    m_popup->show(absBounds, document()->view(),
  • trunk/Source/WebCore/rendering/RenderMenuList.h

    r91219 r92998  
    7171
    7272    virtual bool hasControlClip() const { return true; }
    73     virtual IntRect controlClipRect(const IntPoint&) const;
     73    virtual LayoutRect controlClipRect(const LayoutPoint&) const;
    7474
    7575    virtual const char* renderName() const { return "RenderMenuList"; }
Note: See TracChangeset for help on using the changeset viewer.