Changeset 92998 in webkit
- Timestamp:
- Aug 12, 2011 2:35:02 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r92993 r92998 1 2011-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 1 49 2011-08-12 David Hyatt <hyatt@apple.com> 2 50 -
trunk/Source/WebCore/dom/SelectElement.cpp
r91219 r92998 775 775 MouseEvent* mouseEvent = static_cast<MouseEvent*>(event); 776 776 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)); 778 778 if (listIndex >= 0) { 779 779 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) -
trunk/Source/WebCore/rendering/LayoutTypes.h
r90833 r92998 52 52 } 53 53 54 inline LayoutSize roundedLayoutSize(const FloatSize& s) 55 { 56 return roundedIntSize(s); 57 } 58 54 59 inline LayoutPoint roundedLayoutPoint(const FloatPoint& p) 55 60 { -
trunk/Source/WebCore/rendering/RenderFieldset.cpp
r92340 r92998 69 69 legend->layoutIfNeeded(); 70 70 71 int logicalLeft;71 LayoutUnit logicalLeft; 72 72 if (style()->isLeftToRightDirection()) { 73 73 switch (legend->style()->textAlign()) { … … 90 90 // Make sure that the extra pixel goes to the end side in RTL (since it went to the end side 91 91 // in LTR). 92 int centeredWidth = logicalWidth() - logicalWidthForChild(legend);92 LayoutUnit centeredWidth = logicalWidth() - logicalWidthForChild(legend); 93 93 logicalLeft = centeredWidth - centeredWidth / 2; 94 94 break; … … 102 102 setLogicalLeftForChild(legend, logicalLeft); 103 103 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)); 107 107 setLogicalHeight(max(b, h) + paddingBefore()); 108 108 } -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r90833 r92998 218 218 { 219 219 // 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()); 221 221 } 222 222 … … 226 226 } 227 227 228 int RenderListBox::listHeight() const228 LayoutUnit RenderListBox::listHeight() const 229 229 { 230 230 return itemHeight() * numItems() - rowSpacing; … … 250 250 } 251 251 252 int RenderListBox::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const252 LayoutUnit RenderListBox::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const 253 253 { 254 254 return RenderBox::baselinePosition(baselineType, firstLine, lineDirection, linePositionMode) - baselineAdjustment; 255 255 } 256 256 257 IntRect RenderListBox::itemBoundingBoxRect(const LayoutPoint& additionalOffset, int index)258 { 259 return IntRect(additionalOffset.x() + borderLeft() + paddingLeft(),257 LayoutRect RenderListBox::itemBoundingBoxRect(const LayoutPoint& additionalOffset, int index) 258 { 259 return LayoutRect(additionalOffset.x() + borderLeft() + paddingLeft(), 260 260 additionalOffset.y() + borderTop() + paddingTop() + itemHeight() * (index - m_indexOffset), 261 261 contentWidth(), itemHeight()); … … 343 343 } 344 344 345 static IntSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, Font itemFont, IntRect itemBoudingBox)345 static LayoutSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, Font itemFont, LayoutRect itemBoudingBox) 346 346 { 347 347 ETextAlign actualAlignment = itemStyle->textAlign(); … … 350 350 actualAlignment = itemStyle->isLeftToRightDirection() ? LEFT : RIGHT; 351 351 352 IntSize offset = IntSize(0, itemFont.fontMetrics().ascent());352 LayoutSize offset = LayoutSize(0, itemFont.fontMetrics().ascent()); 353 353 if (actualAlignment == RIGHT || actualAlignment == WEBKIT_RIGHT) { 354 354 float textWidth = itemFont.width(textRun); … … 457 457 } 458 458 459 int RenderListBox::listIndexAtOffset( int offsetX, int offsetY)459 int RenderListBox::listIndexAtOffset(const LayoutSize& offset) 460 460 { 461 461 if (!numItems()) 462 462 return -1; 463 463 464 if (offset Y < borderTop() + paddingTop() || offsetY> height() - paddingBottom() - borderBottom())464 if (offset.height() < borderTop() + paddingTop() || offset.height() > height() - paddingBottom() - borderBottom()) 465 465 return -1; 466 466 467 int scrollbarWidth = m_vBar ? m_vBar->width() : 0;468 if (offset X < 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) 469 469 return -1; 470 470 471 int newOffset = (offset Y- borderTop() - paddingTop()) / itemHeight() + m_indexOffset;471 int newOffset = (offset.height() - borderTop() - paddingTop()) / itemHeight() + m_indexOffset; 472 472 return newOffset < numItems() ? newOffset : -1; 473 473 } … … 482 482 FloatPoint absOffset = localToAbsolute(); 483 483 484 IntPoint currentMousePosition = frame()->eventHandler()->currentMousePosition();484 IntPoint currentMousePosition = roundedIntPoint(frame()->eventHandler()->currentMousePosition()); 485 485 // 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 486 486 static IntPoint previousMousePosition; … … 490 490 previousMousePosition = currentMousePosition; 491 491 492 int yDelta = currentMousePosition.y() - panStartMousePosition.y();492 LayoutUnit yDelta = currentMousePosition.y() - panStartMousePosition.y(); 493 493 494 494 // 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); 496 496 497 497 if (abs(yDelta) < iconRadius) // at the center we let the space for the icon … … 507 507 yDelta /= speedReducer; 508 508 509 IntPoint scrollPoint(0, 0);509 LayoutPoint scrollPoint(0, 0); 510 510 scrollPoint.setY(absOffset.y() + yDelta); 511 int newOffset = scrollToward(scrollPoint);511 LayoutUnit newOffset = scrollToward(scrollPoint); 512 512 if (newOffset < 0) 513 513 return; … … 519 519 } 520 520 521 int RenderListBox::scrollToward(const IntPoint& destination)521 int RenderListBox::scrollToward(const LayoutPoint& destination) 522 522 { 523 523 // FIXME: This doesn't work correctly with transforms. 524 524 FloatPoint absPos = localToAbsolute(); 525 int offsetX = destination.x() - absPos.x(); 526 int offsetY = destination.y() - absPos.y(); 525 LayoutSize positionOffset = roundedLayoutSize(destination - absPos); 527 526 528 527 int rows = numVisibleItems(); 529 528 int offset = m_indexOffset; 530 529 531 if ( offsetY< borderTop() + paddingTop() && scrollToRevealElementAtListIndex(offset - 1))530 if (positionOffset.height() < borderTop() + paddingTop() && scrollToRevealElementAtListIndex(offset - 1)) 532 531 return offset - 1; 533 532 534 if ( offsetY> height() - paddingBottom() - borderBottom() && scrollToRevealElementAtListIndex(offset + rows))533 if (positionOffset.height() > height() - paddingBottom() - borderBottom() && scrollToRevealElementAtListIndex(offset + rows)) 535 534 return offset + rows - 1; 536 535 537 return listIndexAtOffset( offsetX, offsetY);536 return listIndexAtOffset(positionOffset); 538 537 } 539 538 540 539 void RenderListBox::autoscroll() 541 540 { 542 IntPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->currentMousePosition());541 LayoutPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->currentMousePosition()); 543 542 544 543 int endIndex = scrollToward(pos); … … 600 599 } 601 600 602 int RenderListBox::scrollSize(ScrollbarOrientation orientation) const601 LayoutUnit RenderListBox::scrollSize(ScrollbarOrientation orientation) const 603 602 { 604 603 return ((orientation == VerticalScrollbar) && m_vBar) ? (m_vBar->totalSize() - m_vBar->visibleSize()) : 0; 605 604 } 606 605 607 int RenderListBox::scrollPosition(Scrollbar*) const606 LayoutUnit RenderListBox::scrollPosition(Scrollbar*) const 608 607 { 609 608 return m_indexOffset; 610 609 } 611 610 612 void RenderListBox::setScrollOffset(const IntPoint& offset)611 void RenderListBox::setScrollOffset(const LayoutPoint& offset) 613 612 { 614 613 scrollTo(offset.y()); … … 625 624 } 626 625 627 int RenderListBox::itemHeight() const626 LayoutUnit RenderListBox::itemHeight() const 628 627 { 629 628 return style()->fontMetrics().height() + rowSpacing; 630 629 } 631 630 632 int RenderListBox::verticalScrollbarWidth() const631 LayoutUnit RenderListBox::verticalScrollbarWidth() const 633 632 { 634 633 return m_vBar && !m_vBar->isOverlayScrollbar() ? m_vBar->width() : 0; … … 637 636 // FIXME: We ignore padding in the vertical direction as far as these values are concerned, since that's 638 637 // how the control currently paints. 639 int RenderListBox::scrollWidth() const638 LayoutUnit RenderListBox::scrollWidth() const 640 639 { 641 640 // There is no horizontal scrolling allowed. … … 643 642 } 644 643 645 int RenderListBox::scrollHeight() const644 LayoutUnit RenderListBox::scrollHeight() const 646 645 { 647 646 return max(clientHeight(), listHeight()); 648 647 } 649 648 650 int RenderListBox::scrollLeft() const649 LayoutUnit RenderListBox::scrollLeft() const 651 650 { 652 651 return 0; 653 652 } 654 653 655 void RenderListBox::setScrollLeft( int)656 { 657 } 658 659 int RenderListBox::scrollTop() const654 void RenderListBox::setScrollLeft(LayoutUnit) 655 { 656 } 657 658 LayoutUnit RenderListBox::scrollTop() const 660 659 { 661 660 return m_indexOffset * itemHeight(); 662 661 } 663 662 664 void RenderListBox::setScrollTop( int newTop)663 void RenderListBox::setScrollTop(LayoutUnit newTop) 665 664 { 666 665 // Determine an index and scroll to it. … … 695 694 } 696 695 697 IntRect RenderListBox::controlClipRect(const IntPoint& additionalOffset) const698 { 699 IntRect clipRect = contentBoxRect();696 LayoutRect RenderListBox::controlClipRect(const LayoutPoint& additionalOffset) const 697 { 698 LayoutRect clipRect = contentBoxRect(); 700 699 clipRect.moveBy(additionalOffset); 701 700 return clipRect; … … 708 707 } 709 708 710 void RenderListBox::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect)711 { 712 IntRect scrollRect = rect;709 void RenderListBox::invalidateScrollbarRect(Scrollbar* scrollbar, const LayoutRect& rect) 710 { 711 LayoutRect scrollRect = rect; 713 712 scrollRect.move(width() - borderRight() - scrollbar->width(), borderTop()); 714 713 repaintRectangle(scrollRect); 715 714 } 716 715 717 IntRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const716 LayoutRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutRect& scrollbarRect) const 718 717 { 719 718 RenderView* view = this->view(); … … 721 720 return scrollbarRect; 722 721 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(); 727 726 rect.move(scrollbarLeft, scrollbarTop); 728 727 … … 730 729 } 731 730 732 IntRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const731 LayoutRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutRect& parentRect) const 733 732 { 734 733 RenderView* view = this->view(); … … 736 735 return parentRect; 737 736 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(); 742 741 rect.move(-scrollbarLeft, -scrollbarTop); 743 742 return rect; 744 743 } 745 744 746 IntPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const745 LayoutPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const LayoutPoint& scrollbarPoint) const 747 746 { 748 747 RenderView* view = this->view(); … … 750 749 return scrollbarPoint; 751 750 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(); 756 755 point.move(scrollbarLeft, scrollbarTop); 757 756 … … 759 758 } 760 759 761 IntPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const760 LayoutPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const LayoutPoint& parentPoint) const 762 761 { 763 762 RenderView* view = this->view(); … … 765 764 return parentPoint; 766 765 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(); 771 770 point.move(-scrollbarLeft, -scrollbarTop); 772 771 return point; 773 772 } 774 773 775 IntSize RenderListBox::contentsSize() const776 { 777 return IntSize(scrollWidth(), scrollHeight());774 LayoutSize RenderListBox::contentsSize() const 775 { 776 return LayoutSize(scrollWidth(), scrollHeight()); 778 777 } 779 778 … … 788 787 } 789 788 790 IntPoint RenderListBox::currentMousePosition() const789 LayoutPoint RenderListBox::currentMousePosition() const 791 790 { 792 791 RenderView* view = this->view(); 793 792 if (!view) 794 return IntPoint();793 return LayoutPoint(); 795 794 return view->frameView()->currentMousePosition(); 796 795 } -
trunk/Source/WebCore/rendering/RenderListBox.h
r90833 r92998 46 46 void setOptionsChanged(bool changed) { m_optionsChanged = changed; } 47 47 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); 50 50 51 51 bool scrollToRevealElementAtListIndex(int index); 52 52 bool listIndexIsVisible(int index); 53 53 54 int scrollToward(const IntPoint&); // Returns the new index or -1 if no scroll occurred54 int scrollToward(const LayoutPoint&); // Returns the new index or -1 if no scroll occurred 55 55 56 56 int size() const; … … 67 67 virtual bool hasControlClip() const { return true; } 68 68 virtual void paintObject(PaintInfo&, const LayoutPoint&); 69 virtual IntRect controlClipRect(const IntPoint&) const;69 virtual LayoutRect controlClipRect(const LayoutPoint&) const; 70 70 71 71 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset); … … 75 75 76 76 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; 78 78 virtual void computeLogicalHeight(); 79 79 … … 89 89 virtual void panScroll(const IntPoint&); 90 90 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); 98 98 99 99 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction); 100 100 101 101 // 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&); 106 106 virtual bool isActive() const; 107 107 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; 114 114 virtual Scrollbar* verticalScrollbar() const { return m_vBar.get(); } 115 virtual IntSize contentsSize() const;115 virtual LayoutSize contentsSize() const; 116 116 virtual LayoutUnit visibleHeight() const; 117 117 virtual LayoutUnit visibleWidth() const; 118 virtual IntPoint currentMousePosition() const;118 virtual LayoutPoint currentMousePosition() const; 119 119 virtual bool shouldSuspendScrollAnimations() const; 120 120 virtual bool isOnActivePage() const; … … 131 131 void destroyScrollbar(); 132 132 133 int itemHeight() const;133 LayoutUnit itemHeight() const; 134 134 void valueChanged(unsigned listIndex); 135 135 int numVisibleItems() const; 136 136 int numItems() const; 137 int listHeight() const;137 LayoutUnit listHeight() const; 138 138 void paintScrollbar(PaintInfo&, const LayoutPoint&); 139 139 void paintItemForeground(PaintInfo&, const LayoutPoint&, int listIndex); -
trunk/Source/WebCore/rendering/RenderMenuList.cpp
r91219 r92998 238 238 } 239 239 240 IntRect RenderMenuList::controlClipRect(const IntPoint& additionalOffset) const240 LayoutRect RenderMenuList::controlClipRect(const LayoutPoint& additionalOffset) const 241 241 { 242 242 // Clip to the intersection of the content box and the content box for the inner box 243 243 // This will leave room for the arrows which sit in the inner box padding, 244 244 // 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(), 246 246 additionalOffset.y() + borderTop() + paddingTop(), 247 247 contentWidth(), 248 248 contentHeight()); 249 249 250 IntRect innerBox(additionalOffset.x() + m_innerBlock->x() + m_innerBlock->paddingLeft(),250 LayoutRect innerBox(additionalOffset.x() + m_innerBlock->x() + m_innerBlock->paddingLeft(), 251 251 additionalOffset.y() + m_innerBlock->y() + m_innerBlock->paddingTop(), 252 252 m_innerBlock->contentWidth(), … … 303 303 // the actual width of the element to size the popup. 304 304 FloatPoint absTopLeft = localToAbsolute(FloatPoint(), false, true); 305 IntRect absBounds = absoluteBoundingBoxRect();305 LayoutRect absBounds = absoluteBoundingBoxRect(); 306 306 absBounds.setLocation(roundedIntPoint(absTopLeft)); 307 307 m_popup->show(absBounds, document()->view(), -
trunk/Source/WebCore/rendering/RenderMenuList.h
r91219 r92998 71 71 72 72 virtual bool hasControlClip() const { return true; } 73 virtual IntRect controlClipRect(const IntPoint&) const;73 virtual LayoutRect controlClipRect(const LayoutPoint&) const; 74 74 75 75 virtual const char* renderName() const { return "RenderMenuList"; }
Note: See TracChangeset
for help on using the changeset viewer.