Changeset 87443 in webkit
- Timestamp:
- May 26, 2011 3:49:00 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87442 r87443 1 2011-05-25 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Switch controlClipRect to use IntPoint 6 https://bugs.webkit.org/show_bug.cgi?id=60806 7 8 Switching controlClipRect to take an IntPoint representing the 9 offset to be added instead of a pair of ints. 10 11 No new tests as this is just refactoring. 12 13 * WebCore.xcodeproj/project.pbxproj: 14 * rendering/RenderBlock.cpp: 15 (WebCore::RenderBlock::nodeAtPoint): 16 * rendering/RenderBox.cpp: 17 (WebCore::RenderBox::pushContentsClip): 18 * rendering/RenderBox.h: 19 (WebCore::RenderBox::controlClipRect): 20 * rendering/RenderButton.cpp: 21 (WebCore::RenderButton::controlClipRect): 22 * rendering/RenderButton.h: 23 * rendering/RenderListBox.cpp: 24 (WebCore::RenderListBox::paintItemBackground): 25 (WebCore::RenderListBox::controlClipRect): 26 * rendering/RenderListBox.h: 27 * rendering/RenderMenuList.cpp: 28 (WebCore::RenderMenuList::controlClipRect): 29 * rendering/RenderMenuList.h: 30 * rendering/RenderTextControlSingleLine.cpp: 31 (WebCore::RenderTextControlSingleLine::controlClipRect): 32 * rendering/RenderTextControlSingleLine.h: 33 34 <<<<<<< .mine 35 2011-05-25 Levi Weintraub <leviw@chromium.org> 36 37 Reviewed by Eric Seidel. 38 39 Switch controlClipRect to use IntPoint 40 https://bugs.webkit.org/show_bug.cgi?id=60806 41 42 Switching controlClipRect to take an IntPoint representing the 43 offset to be added instead of a pair of ints. 44 45 No new tests as this is just refactoring. 46 47 * WebCore.xcodeproj/project.pbxproj: 48 * rendering/RenderBlock.cpp: 49 (WebCore::RenderBlock::nodeAtPoint): 50 * rendering/RenderBox.cpp: 51 (WebCore::RenderBox::pushContentsClip): 52 * rendering/RenderBox.h: 53 (WebCore::RenderBox::controlClipRect): 54 * rendering/RenderButton.cpp: 55 (WebCore::RenderButton::controlClipRect): 56 * rendering/RenderButton.h: 57 * rendering/RenderListBox.cpp: 58 (WebCore::RenderListBox::paintItemBackground): 59 (WebCore::RenderListBox::controlClipRect): 60 * rendering/RenderListBox.h: 61 * rendering/RenderMenuList.cpp: 62 (WebCore::RenderMenuList::controlClipRect): 63 * rendering/RenderMenuList.h: 64 * rendering/RenderTextControlSingleLine.cpp: 65 (WebCore::RenderTextControlSingleLine::controlClipRect): 66 * rendering/RenderTextControlSingleLine.h: 67 68 ======= 1 69 2011-05-26 Jeff Miller <jeffm@apple.com> 2 70 … … 14 82 (FullScreenController::enterFullScreenRepaintCompleted): Make m_fullScreenWindow a topmost window before animating it in to ensure the taskbar is hidden. 15 83 84 >>>>>>> .r87442 16 85 2011-05-26 James Robinson <jamesr@chromium.org> 17 86 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r87387 r87443 3927 3927 bool useClip = (hasControlClip() || useOverflowClip); 3928 3928 IntRect hitTestArea(result.rectForPoint(pointInContainer)); 3929 bool checkChildren = !useClip || (hasControlClip() ? controlClipRect( localOffset.width(), localOffset.height()).intersects(hitTestArea) : overflowClipRect(localOffset.width(), localOffset.height(), IncludeOverlayScrollbarSize).intersects(hitTestArea));3929 bool checkChildren = !useClip || (hasControlClip() ? controlClipRect(toPoint(localOffset)).intersects(hitTestArea) : overflowClipRect(localOffset.width(), localOffset.height(), IncludeOverlayScrollbarSize).intersects(hitTestArea)); 3930 3930 if (checkChildren) { 3931 3931 // Hit test descendants first. -
trunk/Source/WebCore/rendering/RenderBox.cpp
r87303 r87443 1117 1117 paintInfo.phase = PaintPhaseChildBlockBackgrounds; 1118 1118 } 1119 IntRect clipRect(isControlClip ? controlClipRect( tx, ty) : overflowClipRect(tx, ty));1119 IntRect clipRect(isControlClip ? controlClipRect(IntPoint(tx, ty)) : overflowClipRect(tx, ty)); 1120 1120 paintInfo.context->save(); 1121 1121 if (style()->hasBorderRadius()) -
trunk/Source/WebCore/rendering/RenderBox.h
r87302 r87443 346 346 IntRect clipRect(int tx, int ty); 347 347 virtual bool hasControlClip() const { return false; } 348 virtual IntRect controlClipRect( int /*tx*/, int /*ty*/) const { return IntRect(); }348 virtual IntRect controlClipRect(const IntPoint&) const { return IntRect(); } 349 349 bool pushContentsClip(PaintInfo&, int tx, int ty); 350 350 void popContentsClip(PaintInfo&, PaintPhase originalPhase, int tx, int ty); -
trunk/Source/WebCore/rendering/RenderButton.cpp
r85256 r87443 158 158 } 159 159 160 IntRect RenderButton::controlClipRect( int tx, int ty) const160 IntRect RenderButton::controlClipRect(const IntPoint& additionalOffset) const 161 161 { 162 162 // Clip to the padding box to at least give content the extra padding space. 163 return IntRect( tx + borderLeft(), ty+ borderTop(), width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom());163 return IntRect(additionalOffset.x() + borderLeft(), additionalOffset.y() + borderTop(), width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom()); 164 164 } 165 165 -
trunk/Source/WebCore/rendering/RenderButton.h
r69437 r87443 52 52 53 53 virtual bool hasControlClip() const { return true; } 54 virtual IntRect controlClipRect( int /*tx*/, int /*ty*/) const;54 virtual IntRect controlClipRect(const IntPoint&) const; 55 55 56 56 void setText(const String&); -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r87352 r87443 428 428 ColorSpace colorSpace = element->renderStyle() ? element->renderStyle()->colorSpace() : style()->colorSpace(); 429 429 IntRect itemRect = itemBoundingBoxRect(IntPoint(tx, ty), listIndex); 430 itemRect.intersect(controlClipRect( tx, ty));430 itemRect.intersect(controlClipRect(IntPoint(tx, ty))); 431 431 paintInfo.context->fillRect(itemRect, backColor, colorSpace); 432 432 } … … 688 688 } 689 689 690 IntRect RenderListBox::controlClipRect( int tx, int ty) const690 IntRect RenderListBox::controlClipRect(const IntPoint& additionalOffset) const 691 691 { 692 692 IntRect clipRect = contentBoxRect(); 693 clipRect.move( tx, ty);693 clipRect.move(additionalOffset); 694 694 return clipRect; 695 695 } -
trunk/Source/WebCore/rendering/RenderListBox.h
r87352 r87443 67 67 virtual bool hasControlClip() const { return true; } 68 68 virtual void paintObject(PaintInfo&, int tx, int ty); 69 virtual IntRect controlClipRect( int tx, int ty) const;69 virtual IntRect controlClipRect(const IntPoint&) const; 70 70 71 71 virtual bool isPointInOverflowControl(HitTestResult&, const IntPoint& pointInContainer, int tx, int ty); -
trunk/Source/WebCore/rendering/RenderMenuList.cpp
r86451 r87443 233 233 } 234 234 235 IntRect RenderMenuList::controlClipRect( int tx, int ty) const235 IntRect RenderMenuList::controlClipRect(const IntPoint& additionalOffset) const 236 236 { 237 237 // Clip to the intersection of the content box and the content box for the inner box 238 238 // This will leave room for the arrows which sit in the inner box padding, 239 239 // and if the inner box ever spills out of the outer box, that will get clipped too. 240 IntRect outerBox( tx+ borderLeft() + paddingLeft(),241 ty+ borderTop() + paddingTop(),240 IntRect outerBox(additionalOffset.x() + borderLeft() + paddingLeft(), 241 additionalOffset.y() + borderTop() + paddingTop(), 242 242 contentWidth(), 243 243 contentHeight()); 244 244 245 IntRect innerBox( tx+ m_innerBlock->x() + m_innerBlock->paddingLeft(),246 ty+ m_innerBlock->y() + m_innerBlock->paddingTop(),245 IntRect innerBox(additionalOffset.x() + m_innerBlock->x() + m_innerBlock->paddingLeft(), 246 additionalOffset.y() + m_innerBlock->y() + m_innerBlock->paddingTop(), 247 247 m_innerBlock->contentWidth(), 248 248 m_innerBlock->contentHeight()); -
trunk/Source/WebCore/rendering/RenderMenuList.h
r76983 r87443 71 71 72 72 virtual bool hasControlClip() const { return true; } 73 virtual IntRect controlClipRect( int tx, int ty) const;73 virtual IntRect controlClipRect(const IntPoint&) const; 74 74 75 75 virtual const char* renderName() const { return "RenderMenuList"; } -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r87303 r87443 519 519 } 520 520 521 IntRect RenderTextControlSingleLine::controlClipRect( int tx, int ty) const521 IntRect RenderTextControlSingleLine::controlClipRect(const IntPoint& additionalOffset) const 522 522 { 523 523 // This should only get called for search & speech inputs. … … 525 525 526 526 IntRect clipRect = IntRect(innerBlockElement()->renderBox()->frameRect()); 527 clipRect.move( tx, ty);527 clipRect.move(additionalOffset); 528 528 return clipRect; 529 529 } -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h
r87302 r87443 62 62 int preferredDecorationWidthRight() const; 63 63 virtual bool hasControlClip() const; 64 virtual IntRect controlClipRect( int tx, int ty) const;64 virtual IntRect controlClipRect(const IntPoint&) const; 65 65 virtual bool isTextField() const { return true; } 66 66
Note: See TracChangeset
for help on using the changeset viewer.