Changeset 87443 in webkit


Ignore:
Timestamp:
May 26, 2011 3:49:00 PM (13 years ago)
Author:
leviw@chromium.org
Message:

2011-05-25 Levi Weintraub <leviw@chromium.org>

Reviewed by Eric Seidel.

Switch controlClipRect to use IntPoint
https://bugs.webkit.org/show_bug.cgi?id=60806

Switching controlClipRect to take an IntPoint representing the
offset to be added instead of a pair of ints.

No new tests as this is just refactoring.

  • WebCore.xcodeproj/project.pbxproj:
  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::nodeAtPoint):
  • rendering/RenderBox.cpp: (WebCore::RenderBox::pushContentsClip):
  • rendering/RenderBox.h: (WebCore::RenderBox::controlClipRect):
  • rendering/RenderButton.cpp: (WebCore::RenderButton::controlClipRect):
  • rendering/RenderButton.h:
  • rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintItemBackground): (WebCore::RenderListBox::controlClipRect):
  • rendering/RenderListBox.h:
  • rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::controlClipRect):
  • rendering/RenderMenuList.h:
  • rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::controlClipRect):
  • rendering/RenderTextControlSingleLine.h:
Location:
trunk/Source/WebCore
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87442 r87443  
     12011-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
     352011-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=======
    1692011-05-26  Jeff Miller  <jeffm@apple.com>
    270
     
    1482        (FullScreenController::enterFullScreenRepaintCompleted): Make m_fullScreenWindow a topmost window before animating it in to ensure the taskbar is hidden.
    1583
     84>>>>>>> .r87442
    16852011-05-26  James Robinson  <jamesr@chromium.org>
    1786
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r87387 r87443  
    39273927    bool useClip = (hasControlClip() || useOverflowClip);
    39283928    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));
    39303930    if (checkChildren) {
    39313931        // Hit test descendants first.
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r87303 r87443  
    11171117        paintInfo.phase = PaintPhaseChildBlockBackgrounds;
    11181118    }
    1119     IntRect clipRect(isControlClip ? controlClipRect(tx, ty) : overflowClipRect(tx, ty));
     1119    IntRect clipRect(isControlClip ? controlClipRect(IntPoint(tx, ty)) : overflowClipRect(tx, ty));
    11201120    paintInfo.context->save();
    11211121    if (style()->hasBorderRadius())
  • trunk/Source/WebCore/rendering/RenderBox.h

    r87302 r87443  
    346346    IntRect clipRect(int tx, int ty);
    347347    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(); }
    349349    bool pushContentsClip(PaintInfo&, int tx, int ty);
    350350    void popContentsClip(PaintInfo&, PaintPhase originalPhase, int tx, int ty);
  • trunk/Source/WebCore/rendering/RenderButton.cpp

    r85256 r87443  
    158158}
    159159
    160 IntRect RenderButton::controlClipRect(int tx, int ty) const
     160IntRect RenderButton::controlClipRect(const IntPoint& additionalOffset) const
    161161{
    162162    // 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());
    164164}
    165165
  • trunk/Source/WebCore/rendering/RenderButton.h

    r69437 r87443  
    5252
    5353    virtual bool hasControlClip() const { return true; }
    54     virtual IntRect controlClipRect(int /*tx*/, int /*ty*/) const;
     54    virtual IntRect controlClipRect(const IntPoint&) const;
    5555
    5656    void setText(const String&);
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r87352 r87443  
    428428        ColorSpace colorSpace = element->renderStyle() ? element->renderStyle()->colorSpace() : style()->colorSpace();
    429429        IntRect itemRect = itemBoundingBoxRect(IntPoint(tx, ty), listIndex);
    430         itemRect.intersect(controlClipRect(tx, ty));
     430        itemRect.intersect(controlClipRect(IntPoint(tx, ty)));
    431431        paintInfo.context->fillRect(itemRect, backColor, colorSpace);
    432432    }
     
    688688}
    689689
    690 IntRect RenderListBox::controlClipRect(int tx, int ty) const
     690IntRect RenderListBox::controlClipRect(const IntPoint& additionalOffset) const
    691691{
    692692    IntRect clipRect = contentBoxRect();
    693     clipRect.move(tx, ty);
     693    clipRect.move(additionalOffset);
    694694    return clipRect;
    695695}
  • trunk/Source/WebCore/rendering/RenderListBox.h

    r87352 r87443  
    6767    virtual bool hasControlClip() const { return true; }
    6868    virtual void paintObject(PaintInfo&, int tx, int ty);
    69     virtual IntRect controlClipRect(int tx, int ty) const;
     69    virtual IntRect controlClipRect(const IntPoint&) const;
    7070
    7171    virtual bool isPointInOverflowControl(HitTestResult&, const IntPoint& pointInContainer, int tx, int ty);
  • trunk/Source/WebCore/rendering/RenderMenuList.cpp

    r86451 r87443  
    233233}
    234234
    235 IntRect RenderMenuList::controlClipRect(int tx, int ty) const
     235IntRect RenderMenuList::controlClipRect(const IntPoint& additionalOffset) const
    236236{
    237237    // Clip to the intersection of the content box and the content box for the inner box
    238238    // This will leave room for the arrows which sit in the inner box padding,
    239239    // 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(),
    242242                   contentWidth(),
    243243                   contentHeight());
    244244   
    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(),
    247247                   m_innerBlock->contentWidth(),
    248248                   m_innerBlock->contentHeight());
  • trunk/Source/WebCore/rendering/RenderMenuList.h

    r76983 r87443  
    7171
    7272    virtual bool hasControlClip() const { return true; }
    73     virtual IntRect controlClipRect(int tx, int ty) const;
     73    virtual IntRect controlClipRect(const IntPoint&) const;
    7474
    7575    virtual const char* renderName() const { return "RenderMenuList"; }
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r87303 r87443  
    519519}
    520520
    521 IntRect RenderTextControlSingleLine::controlClipRect(int tx, int ty) const
     521IntRect RenderTextControlSingleLine::controlClipRect(const IntPoint& additionalOffset) const
    522522{
    523523    // This should only get called for search & speech inputs.
     
    525525
    526526    IntRect clipRect = IntRect(innerBlockElement()->renderBox()->frameRect());
    527     clipRect.move(tx, ty);
     527    clipRect.move(additionalOffset);
    528528    return clipRect;
    529529}
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h

    r87302 r87443  
    6262    int preferredDecorationWidthRight() const;
    6363    virtual bool hasControlClip() const;
    64     virtual IntRect controlClipRect(int tx, int ty) const;
     64    virtual IntRect controlClipRect(const IntPoint&) const;
    6565    virtual bool isTextField() const { return true; }
    6666
Note: See TracChangeset for help on using the changeset viewer.