Title: [92998] trunk/Source/WebCore
Revision
92998
Author
[email protected]
Date
2011-08-12 14:35:02 -0700 (Fri, 12 Aug 2011)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (92997 => 92998)


--- trunk/Source/WebCore/ChangeLog	2011-08-12 21:28:37 UTC (rev 92997)
+++ trunk/Source/WebCore/ChangeLog	2011-08-12 21:35:02 UTC (rev 92998)
@@ -1,3 +1,51 @@
+2011-08-12  Levi Weintraub  <[email protected]>
+
+        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:
+
 2011-08-12  David Hyatt  <[email protected]>
 
         https://bugs.webkit.org/show_bug.cgi?id=66133

Modified: trunk/Source/WebCore/dom/SelectElement.cpp (92997 => 92998)


--- trunk/Source/WebCore/dom/SelectElement.cpp	2011-08-12 21:28:37 UTC (rev 92997)
+++ trunk/Source/WebCore/dom/SelectElement.cpp	2011-08-12 21:35:02 UTC (rev 92998)
@@ -774,7 +774,7 @@
         // Convert to coords relative to the list box if needed.
         MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
         IntPoint localOffset = roundedIntPoint(element->renderer()->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
-        int listIndex = toRenderListBox(element->renderer())->listIndexAtOffset(localOffset.x(), localOffset.y());
+        int listIndex = toRenderListBox(element->renderer())->listIndexAtOffset(toSize(localOffset));
         if (listIndex >= 0) {
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
             updateSelectedState(data, element, listIndex, mouseEvent->metaKey(), mouseEvent->shiftKey());

Modified: trunk/Source/WebCore/rendering/LayoutTypes.h (92997 => 92998)


--- trunk/Source/WebCore/rendering/LayoutTypes.h	2011-08-12 21:28:37 UTC (rev 92997)
+++ trunk/Source/WebCore/rendering/LayoutTypes.h	2011-08-12 21:35:02 UTC (rev 92998)
@@ -51,6 +51,11 @@
     return enclosingIntRect(rect);
 }
 
+inline LayoutSize roundedLayoutSize(const FloatSize& s)
+{
+    return roundedIntSize(s);
+}
+
 inline LayoutPoint roundedLayoutPoint(const FloatPoint& p)
 {
     return roundedIntPoint(p);

Modified: trunk/Source/WebCore/rendering/RenderFieldset.cpp (92997 => 92998)


--- trunk/Source/WebCore/rendering/RenderFieldset.cpp	2011-08-12 21:28:37 UTC (rev 92997)
+++ trunk/Source/WebCore/rendering/RenderFieldset.cpp	2011-08-12 21:35:02 UTC (rev 92998)
@@ -68,7 +68,7 @@
             legend->setNeedsLayout(true);
         legend->layoutIfNeeded();
 
-        int logicalLeft;
+        LayoutUnit logicalLeft;
         if (style()->isLeftToRightDirection()) {
             switch (legend->style()->textAlign()) {
             case CENTER:
@@ -89,7 +89,7 @@
             case CENTER: {
                 // Make sure that the extra pixel goes to the end side in RTL (since it went to the end side
                 // in LTR).
-                int centeredWidth = logicalWidth() - logicalWidthForChild(legend);
+                LayoutUnit centeredWidth = logicalWidth() - logicalWidthForChild(legend);
                 logicalLeft = centeredWidth - centeredWidth / 2;
                 break;
             }
@@ -101,9 +101,9 @@
 
         setLogicalLeftForChild(legend, logicalLeft);
 
-        int b = borderBefore();
-        int h = logicalHeightForChild(legend);
-        setLogicalTopForChild(legend, max((b - h) / 2, 0));
+        LayoutUnit b = borderBefore();
+        LayoutUnit h = logicalHeightForChild(legend);
+        setLogicalTopForChild(legend, max<LayoutUnit>((b - h) / 2, 0));
         setLogicalHeight(max(b, h) + paddingBefore());
     }
     return legend;

Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (92997 => 92998)


--- trunk/Source/WebCore/rendering/RenderListBox.cpp	2011-08-12 21:28:37 UTC (rev 92997)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp	2011-08-12 21:35:02 UTC (rev 92998)
@@ -217,7 +217,7 @@
 int RenderListBox::numVisibleItems() const
 {
     // Only count fully visible rows. But don't return 0 even if only part of a row shows.
-    return max(1, (contentHeight() + rowSpacing) / itemHeight());
+    return max<int>(1, (contentHeight() + rowSpacing) / itemHeight());
 }
 
 int RenderListBox::numItems() const
@@ -225,7 +225,7 @@
     return toSelectElement(static_cast<Element*>(node()))->listItems().size();
 }
 
-int RenderListBox::listHeight() const
+LayoutUnit RenderListBox::listHeight() const
 {
     return itemHeight() * numItems() - rowSpacing;
 }
@@ -249,14 +249,14 @@
     }
 }
 
-int RenderListBox::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const
+LayoutUnit RenderListBox::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const
 {
     return RenderBox::baselinePosition(baselineType, firstLine, lineDirection, linePositionMode) - baselineAdjustment;
 }
 
-IntRect RenderListBox::itemBoundingBoxRect(const LayoutPoint& additionalOffset, int index)
+LayoutRect RenderListBox::itemBoundingBoxRect(const LayoutPoint& additionalOffset, int index)
 {
-    return IntRect(additionalOffset.x() + borderLeft() + paddingLeft(),
+    return LayoutRect(additionalOffset.x() + borderLeft() + paddingLeft(),
                    additionalOffset.y() + borderTop() + paddingTop() + itemHeight() * (index - m_indexOffset),
                    contentWidth(), itemHeight());
 }
@@ -342,14 +342,14 @@
     }
 }
 
-static IntSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, Font itemFont, IntRect itemBoudingBox)
+static LayoutSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, Font itemFont, LayoutRect itemBoudingBox)
 {
     ETextAlign actualAlignment = itemStyle->textAlign();
     // FIXME: Firefox doesn't respect JUSTIFY. Should we?
     if (actualAlignment == TAAUTO || actualAlignment == JUSTIFY)
       actualAlignment = itemStyle->isLeftToRightDirection() ? LEFT : RIGHT;
 
-    IntSize offset = IntSize(0, itemFont.fontMetrics().ascent());
+    LayoutSize offset = LayoutSize(0, itemFont.fontMetrics().ascent());
     if (actualAlignment == RIGHT || actualAlignment == WEBKIT_RIGHT) {
         float textWidth = itemFont.width(textRun);
         offset.setWidth(itemBoudingBox.width() - textWidth - optionsSpacingHorizontal);
@@ -456,19 +456,19 @@
     return false;
 }
 
-int RenderListBox::listIndexAtOffset(int offsetX, int offsetY)
+int RenderListBox::listIndexAtOffset(const LayoutSize& offset)
 {
     if (!numItems())
         return -1;
 
-    if (offsetY < borderTop() + paddingTop() || offsetY > height() - paddingBottom() - borderBottom())
+    if (offset.height() < borderTop() + paddingTop() || offset.height() > height() - paddingBottom() - borderBottom())
         return -1;
 
-    int scrollbarWidth = m_vBar ? m_vBar->width() : 0;
-    if (offsetX < borderLeft() + paddingLeft() || offsetX > width() - borderRight() - paddingRight() - scrollbarWidth)
+    LayoutUnit scrollbarWidth = m_vBar ? m_vBar->width() : 0;
+    if (offset.width() < borderLeft() + paddingLeft() || offset.width() > width() - borderRight() - paddingRight() - scrollbarWidth)
         return -1;
 
-    int newOffset = (offsetY - borderTop() - paddingTop()) / itemHeight() + m_indexOffset;
+    int newOffset = (offset.height() - borderTop() - paddingTop()) / itemHeight() + m_indexOffset;
     return newOffset < numItems() ? newOffset : -1;
 }
 
@@ -481,7 +481,7 @@
     // FIXME: This doesn't work correctly with transforms.
     FloatPoint absOffset = localToAbsolute();
 
-    IntPoint currentMousePosition = frame()->eventHandler()->currentMousePosition();
+    IntPoint currentMousePosition = roundedIntPoint(frame()->eventHandler()->currentMousePosition());
     // 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
     static IntPoint previousMousePosition;
     if (currentMousePosition.y() < 0)
@@ -489,10 +489,10 @@
     else
         previousMousePosition = currentMousePosition;
 
-    int yDelta = currentMousePosition.y() - panStartMousePosition.y();
+    LayoutUnit yDelta = currentMousePosition.y() - panStartMousePosition.y();
 
     // If the point is too far from the center we limit the speed
-    yDelta = max(min(yDelta, maxSpeed), -maxSpeed);
+    yDelta = max<LayoutUnit>(min<LayoutUnit>(yDelta, maxSpeed), -maxSpeed);
     
     if (abs(yDelta) < iconRadius) // at the center we let the space for the icon
         return;
@@ -506,9 +506,9 @@
     // Let's attenuate the speed
     yDelta /= speedReducer;
 
-    IntPoint scrollPoint(0, 0);
+    LayoutPoint scrollPoint(0, 0);
     scrollPoint.setY(absOffset.y() + yDelta);
-    int newOffset = scrollToward(scrollPoint);
+    LayoutUnit newOffset = scrollToward(scrollPoint);
     if (newOffset < 0) 
         return;
 
@@ -518,28 +518,27 @@
     m_inAutoscroll = false;
 }
 
-int RenderListBox::scrollToward(const IntPoint& destination)
+int RenderListBox::scrollToward(const LayoutPoint& destination)
 {
     // FIXME: This doesn't work correctly with transforms.
     FloatPoint absPos = localToAbsolute();
-    int offsetX = destination.x() - absPos.x();
-    int offsetY = destination.y() - absPos.y();
+    LayoutSize positionOffset = roundedLayoutSize(destination - absPos);
 
     int rows = numVisibleItems();
     int offset = m_indexOffset;
     
-    if (offsetY < borderTop() + paddingTop() && scrollToRevealElementAtListIndex(offset - 1))
+    if (positionOffset.height() < borderTop() + paddingTop() && scrollToRevealElementAtListIndex(offset - 1))
         return offset - 1;
     
-    if (offsetY > height() - paddingBottom() - borderBottom() && scrollToRevealElementAtListIndex(offset + rows))
+    if (positionOffset.height() > height() - paddingBottom() - borderBottom() && scrollToRevealElementAtListIndex(offset + rows))
         return offset + rows - 1;
     
-    return listIndexAtOffset(offsetX, offsetY);
+    return listIndexAtOffset(positionOffset);
 }
 
 void RenderListBox::autoscroll()
 {
-    IntPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->currentMousePosition());
+    LayoutPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->currentMousePosition());
 
     int endIndex = scrollToward(pos);
     if (endIndex >= 0) {
@@ -599,17 +598,17 @@
     element->dispatchFormControlChangeEvent();
 }
 
-int RenderListBox::scrollSize(ScrollbarOrientation orientation) const
+LayoutUnit RenderListBox::scrollSize(ScrollbarOrientation orientation) const
 {
     return ((orientation == VerticalScrollbar) && m_vBar) ? (m_vBar->totalSize() - m_vBar->visibleSize()) : 0;
 }
 
-int RenderListBox::scrollPosition(Scrollbar*) const
+LayoutUnit RenderListBox::scrollPosition(Scrollbar*) const
 {
     return m_indexOffset;
 }
 
-void RenderListBox::setScrollOffset(const IntPoint& offset)
+void RenderListBox::setScrollOffset(const LayoutPoint& offset)
 {
     scrollTo(offset.y());
 }
@@ -624,44 +623,44 @@
     node()->document()->eventQueue()->enqueueOrDispatchScrollEvent(node(), EventQueue::ScrollEventElementTarget);
 }
 
-int RenderListBox::itemHeight() const
+LayoutUnit RenderListBox::itemHeight() const
 {
     return style()->fontMetrics().height() + rowSpacing;
 }
 
-int RenderListBox::verticalScrollbarWidth() const
+LayoutUnit RenderListBox::verticalScrollbarWidth() const
 {
     return m_vBar && !m_vBar->isOverlayScrollbar() ? m_vBar->width() : 0;
 }
 
 // FIXME: We ignore padding in the vertical direction as far as these values are concerned, since that's
 // how the control currently paints.
-int RenderListBox::scrollWidth() const
+LayoutUnit RenderListBox::scrollWidth() const
 {
     // There is no horizontal scrolling allowed.
     return clientWidth();
 }
 
-int RenderListBox::scrollHeight() const
+LayoutUnit RenderListBox::scrollHeight() const
 {
     return max(clientHeight(), listHeight());
 }
 
-int RenderListBox::scrollLeft() const
+LayoutUnit RenderListBox::scrollLeft() const
 {
     return 0;
 }
 
-void RenderListBox::setScrollLeft(int)
+void RenderListBox::setScrollLeft(LayoutUnit)
 {
 }
 
-int RenderListBox::scrollTop() const
+LayoutUnit RenderListBox::scrollTop() const
 {
     return m_indexOffset * itemHeight();
 }
 
-void RenderListBox::setScrollTop(int newTop)
+void RenderListBox::setScrollTop(LayoutUnit newTop)
 {
     // Determine an index and scroll to it.    
     int index = newTop / itemHeight();
@@ -694,9 +693,9 @@
     return true;
 }
 
-IntRect RenderListBox::controlClipRect(const IntPoint& additionalOffset) const
+LayoutRect RenderListBox::controlClipRect(const LayoutPoint& additionalOffset) const
 {
-    IntRect clipRect = contentBoxRect();
+    LayoutRect clipRect = contentBoxRect();
     clipRect.moveBy(additionalOffset);
     return clipRect;
 }
@@ -707,74 +706,74 @@
     return page && page->focusController()->isActive();
 }
 
-void RenderListBox::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect)
+void RenderListBox::invalidateScrollbarRect(Scrollbar* scrollbar, const LayoutRect& rect)
 {
-    IntRect scrollRect = rect;
+    LayoutRect scrollRect = rect;
     scrollRect.move(width() - borderRight() - scrollbar->width(), borderTop());
     repaintRectangle(scrollRect);
 }
 
-IntRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const
+LayoutRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutRect& scrollbarRect) const
 {
     RenderView* view = this->view();
     if (!view)
         return scrollbarRect;
 
-    IntRect rect = scrollbarRect;
+    LayoutRect rect = scrollbarRect;
 
-    int scrollbarLeft = width() - borderRight() - scrollbar->width();
-    int scrollbarTop = borderTop();
+    LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();
+    LayoutUnit scrollbarTop = borderTop();
     rect.move(scrollbarLeft, scrollbarTop);
 
     return view->frameView()->convertFromRenderer(this, rect);
 }
 
-IntRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
+LayoutRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutRect& parentRect) const
 {
     RenderView* view = this->view();
     if (!view)
         return parentRect;
 
-    IntRect rect = view->frameView()->convertToRenderer(this, parentRect);
+    LayoutRect rect = view->frameView()->convertToRenderer(this, parentRect);
 
-    int scrollbarLeft = width() - borderRight() - scrollbar->width();
-    int scrollbarTop = borderTop();
+    LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();
+    LayoutUnit scrollbarTop = borderTop();
     rect.move(-scrollbarLeft, -scrollbarTop);
     return rect;
 }
 
-IntPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const
+LayoutPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutPoint& scrollbarPoint) const
 {
     RenderView* view = this->view();
     if (!view)
         return scrollbarPoint;
 
-    IntPoint point = scrollbarPoint;
+    LayoutPoint point = scrollbarPoint;
 
-    int scrollbarLeft = width() - borderRight() - scrollbar->width();
-    int scrollbarTop = borderTop();
+    LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();
+    LayoutUnit scrollbarTop = borderTop();
     point.move(scrollbarLeft, scrollbarTop);
 
     return view->frameView()->convertFromRenderer(this, point);
 }
 
-IntPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
+LayoutPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutPoint& parentPoint) const
 {
     RenderView* view = this->view();
     if (!view)
         return parentPoint;
 
-    IntPoint point = view->frameView()->convertToRenderer(this, parentPoint);
+    LayoutPoint point = view->frameView()->convertToRenderer(this, parentPoint);
 
-    int scrollbarLeft = width() - borderRight() - scrollbar->width();
-    int scrollbarTop = borderTop();
+    LayoutUnit scrollbarLeft = width() - borderRight() - scrollbar->width();
+    LayoutUnit scrollbarTop = borderTop();
     point.move(-scrollbarLeft, -scrollbarTop);
     return point;
 }
 
-IntSize RenderListBox::contentsSize() const
+LayoutSize RenderListBox::contentsSize() const
 {
-    return IntSize(scrollWidth(), scrollHeight());
+    return LayoutSize(scrollWidth(), scrollHeight());
 }
 
 LayoutUnit RenderListBox::visibleHeight() const
@@ -787,11 +786,11 @@
     return width();
 }
 
-IntPoint RenderListBox::currentMousePosition() const
+LayoutPoint RenderListBox::currentMousePosition() const
 {
     RenderView* view = this->view();
     if (!view)
-        return IntPoint();
+        return LayoutPoint();
     return view->frameView()->currentMousePosition();
 }
 

Modified: trunk/Source/WebCore/rendering/RenderListBox.h (92997 => 92998)


--- trunk/Source/WebCore/rendering/RenderListBox.h	2011-08-12 21:28:37 UTC (rev 92997)
+++ trunk/Source/WebCore/rendering/RenderListBox.h	2011-08-12 21:35:02 UTC (rev 92998)
@@ -45,13 +45,13 @@
 
     void setOptionsChanged(bool changed) { m_optionsChanged = changed; }
 
-    int listIndexAtOffset(int x, int y);
-    IntRect itemBoundingBoxRect(const LayoutPoint&, int index);
+    int listIndexAtOffset(const LayoutSize&);
+    LayoutRect itemBoundingBoxRect(const LayoutPoint&, int index);
 
     bool scrollToRevealElementAtListIndex(int index);
     bool listIndexIsVisible(int index);
 
-    int scrollToward(const IntPoint&); // Returns the new index or -1 if no scroll occurred
+    int scrollToward(const LayoutPoint&); // Returns the new index or -1 if no scroll occurred
 
     int size() const;
 
@@ -66,7 +66,7 @@
 
     virtual bool hasControlClip() const { return true; }
     virtual void paintObject(PaintInfo&, const LayoutPoint&);
-    virtual IntRect controlClipRect(const IntPoint&) const;
+    virtual LayoutRect controlClipRect(const LayoutPoint&) const;
 
     virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset);
 
@@ -74,7 +74,7 @@
     virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
 
     virtual void computePreferredLogicalWidths();
-    virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
+    virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
     virtual void computeLogicalHeight();
 
     virtual void layout();
@@ -88,34 +88,34 @@
     virtual bool shouldPanScroll() const { return true; }
     virtual void panScroll(const IntPoint&);
 
-    virtual int verticalScrollbarWidth() const;
-    virtual int scrollLeft() const;
-    virtual int scrollTop() const;
-    virtual int scrollWidth() const;
-    virtual int scrollHeight() const;
-    virtual void setScrollLeft(int);
-    virtual void setScrollTop(int);
+    virtual LayoutUnit verticalScrollbarWidth() const;
+    virtual LayoutUnit scrollLeft() const;
+    virtual LayoutUnit scrollTop() const;
+    virtual LayoutUnit scrollWidth() const;
+    virtual LayoutUnit scrollHeight() const;
+    virtual void setScrollLeft(LayoutUnit);
+    virtual void setScrollTop(LayoutUnit);
 
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
 
     // ScrollableArea interface.
-    virtual int scrollSize(ScrollbarOrientation orientation) const;
-    virtual int scrollPosition(Scrollbar*) const;
-    virtual void setScrollOffset(const IntPoint&);
-    virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
+    virtual LayoutUnit scrollSize(ScrollbarOrientation) const;
+    virtual LayoutUnit scrollPosition(Scrollbar*) const;
+    virtual void setScrollOffset(const LayoutPoint&);
+    virtual void invalidateScrollbarRect(Scrollbar*, const LayoutRect&);
     virtual bool isActive() const;
     virtual bool isScrollCornerVisible() const { return false; } // We don't support resize on list boxes yet. If we did these would have to change.
-    virtual IntRect scrollCornerRect() const { return IntRect(); }
-    virtual void invalidateScrollCornerRect(const IntRect&) { }
-    virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect&) const;
-    virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const;
-    virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const;
-    virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const;
+    virtual LayoutRect scrollCornerRect() const { return LayoutRect(); }
+    virtual void invalidateScrollCornerRect(const LayoutRect&) { }
+    virtual LayoutRect convertFromScrollbarToContainingView(const Scrollbar*, const LayoutRect&) const;
+    virtual LayoutRect convertFromContainingViewToScrollbar(const Scrollbar*, const LayoutRect&) const;
+    virtual LayoutPoint convertFromScrollbarToContainingView(const Scrollbar*, const LayoutPoint&) const;
+    virtual LayoutPoint convertFromContainingViewToScrollbar(const Scrollbar*, const LayoutPoint&) const;
     virtual Scrollbar* verticalScrollbar() const { return m_vBar.get(); }
-    virtual IntSize contentsSize() const;
+    virtual LayoutSize contentsSize() const;
     virtual LayoutUnit visibleHeight() const;
     virtual LayoutUnit visibleWidth() const;
-    virtual IntPoint currentMousePosition() const;
+    virtual LayoutPoint currentMousePosition() const;
     virtual bool shouldSuspendScrollAnimations() const;
     virtual bool isOnActivePage() const;
 
@@ -130,11 +130,11 @@
     PassRefPtr<Scrollbar> createScrollbar();
     void destroyScrollbar();
     
-    int itemHeight() const;
+    LayoutUnit itemHeight() const;
     void valueChanged(unsigned listIndex);
     int numVisibleItems() const;
     int numItems() const;
-    int listHeight() const;
+    LayoutUnit listHeight() const;
     void paintScrollbar(PaintInfo&, const LayoutPoint&);
     void paintItemForeground(PaintInfo&, const LayoutPoint&, int listIndex);
     void paintItemBackground(PaintInfo&, const LayoutPoint&, int listIndex);

Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (92997 => 92998)


--- trunk/Source/WebCore/rendering/RenderMenuList.cpp	2011-08-12 21:28:37 UTC (rev 92997)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp	2011-08-12 21:35:02 UTC (rev 92998)
@@ -237,17 +237,17 @@
     return m_buttonText ? m_buttonText->text() : 0;
 }
 
-IntRect RenderMenuList::controlClipRect(const IntPoint& additionalOffset) const
+LayoutRect RenderMenuList::controlClipRect(const LayoutPoint& additionalOffset) const
 {
     // Clip to the intersection of the content box and the content box for the inner box
     // This will leave room for the arrows which sit in the inner box padding,
     // and if the inner box ever spills out of the outer box, that will get clipped too.
-    IntRect outerBox(additionalOffset.x() + borderLeft() + paddingLeft(), 
+    LayoutRect outerBox(additionalOffset.x() + borderLeft() + paddingLeft(), 
                    additionalOffset.y() + borderTop() + paddingTop(),
                    contentWidth(), 
                    contentHeight());
     
-    IntRect innerBox(additionalOffset.x() + m_innerBlock->x() + m_innerBlock->paddingLeft(), 
+    LayoutRect innerBox(additionalOffset.x() + m_innerBlock->x() + m_innerBlock->paddingLeft(), 
                    additionalOffset.y() + m_innerBlock->y() + m_innerBlock->paddingTop(),
                    m_innerBlock->contentWidth(), 
                    m_innerBlock->contentHeight());
@@ -302,7 +302,7 @@
     // Compute the top left taking transforms into account, but use
     // the actual width of the element to size the popup.
     FloatPoint absTopLeft = localToAbsolute(FloatPoint(), false, true);
-    IntRect absBounds = absoluteBoundingBoxRect();
+    LayoutRect absBounds = absoluteBoundingBoxRect();
     absBounds.setLocation(roundedIntPoint(absTopLeft));
     m_popup->show(absBounds, document()->view(),
         select->optionToListIndex(select->selectedIndex()));

Modified: trunk/Source/WebCore/rendering/RenderMenuList.h (92997 => 92998)


--- trunk/Source/WebCore/rendering/RenderMenuList.h	2011-08-12 21:28:37 UTC (rev 92997)
+++ trunk/Source/WebCore/rendering/RenderMenuList.h	2011-08-12 21:35:02 UTC (rev 92998)
@@ -70,7 +70,7 @@
     virtual void updateFromElement();
 
     virtual bool hasControlClip() const { return true; }
-    virtual IntRect controlClipRect(const IntPoint&) const;
+    virtual LayoutRect controlClipRect(const LayoutPoint&) const;
 
     virtual const char* renderName() const { return "RenderMenuList"; }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to