Title: [87443] trunk/Source/WebCore
Revision
87443
Author
[email protected]
Date
2011-05-26 15:49:00 -0700 (Thu, 26 May 2011)

Log Message

2011-05-25  Levi Weintraub  <[email protected]>

        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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87442 => 87443)


--- trunk/Source/WebCore/ChangeLog	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/ChangeLog	2011-05-26 22:49:00 UTC (rev 87443)
@@ -1,3 +1,71 @@
+2011-05-25  Levi Weintraub  <[email protected]>
+
+        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:
+
+<<<<<<< .mine
+2011-05-25  Levi Weintraub  <[email protected]>
+
+        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:
+
+=======
 2011-05-26  Jeff Miller  <[email protected]>
 
         Reviewed by Steve Falkenburg.
@@ -13,6 +81,7 @@
         (FullScreenController::Private::fullscreenClientWndProc): Exit fullscreen when m_fullScreenWindow is deactivated.
         (FullScreenController::enterFullScreenRepaintCompleted): Make m_fullScreenWindow a topmost window before animating it in to ensure the taskbar is hidden.
 
+>>>>>>> .r87442
 2011-05-26  James Robinson  <[email protected]>
 
         Reviewed by Darin Fisher.

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2011-05-26 22:49:00 UTC (rev 87443)
@@ -3926,7 +3926,7 @@
     bool useOverflowClip = hasOverflowClip() && !hasSelfPaintingLayer();
     bool useClip = (hasControlClip() || useOverflowClip);
     IntRect hitTestArea(result.rectForPoint(pointInContainer));
-    bool checkChildren = !useClip || (hasControlClip() ? controlClipRect(localOffset.width(), localOffset.height()).intersects(hitTestArea) : overflowClipRect(localOffset.width(), localOffset.height(), IncludeOverlayScrollbarSize).intersects(hitTestArea));
+    bool checkChildren = !useClip || (hasControlClip() ? controlClipRect(toPoint(localOffset)).intersects(hitTestArea) : overflowClipRect(localOffset.width(), localOffset.height(), IncludeOverlayScrollbarSize).intersects(hitTestArea));
     if (checkChildren) {
         // Hit test descendants first.
         IntSize scrolledOffset(localOffset);

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2011-05-26 22:49:00 UTC (rev 87443)
@@ -1116,7 +1116,7 @@
         paintObject(paintInfo, tx, ty);
         paintInfo.phase = PaintPhaseChildBlockBackgrounds;
     }
-    IntRect clipRect(isControlClip ? controlClipRect(tx, ty) : overflowClipRect(tx, ty));
+    IntRect clipRect(isControlClip ? controlClipRect(IntPoint(tx, ty)) : overflowClipRect(tx, ty));
     paintInfo.context->save();
     if (style()->hasBorderRadius())
         paintInfo.context->addRoundedRectClip(style()->getRoundedBorderFor(IntRect(tx, ty, width(), height())));

Modified: trunk/Source/WebCore/rendering/RenderBox.h (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderBox.h	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2011-05-26 22:49:00 UTC (rev 87443)
@@ -345,7 +345,7 @@
     virtual IntRect overflowClipRect(int tx, int ty, OverlayScrollbarSizeRelevancy relevancy = IgnoreOverlayScrollbarSize);
     IntRect clipRect(int tx, int ty);
     virtual bool hasControlClip() const { return false; }
-    virtual IntRect controlClipRect(int /*tx*/, int /*ty*/) const { return IntRect(); }
+    virtual IntRect controlClipRect(const IntPoint&) const { return IntRect(); }
     bool pushContentsClip(PaintInfo&, int tx, int ty);
     void popContentsClip(PaintInfo&, PaintPhase originalPhase, int tx, int ty);
 

Modified: trunk/Source/WebCore/rendering/RenderButton.cpp (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderButton.cpp	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderButton.cpp	2011-05-26 22:49:00 UTC (rev 87443)
@@ -157,10 +157,10 @@
         children()->updateBeforeAfterContent(this, type);
 }
 
-IntRect RenderButton::controlClipRect(int tx, int ty) const
+IntRect RenderButton::controlClipRect(const IntPoint& additionalOffset) const
 {
     // Clip to the padding box to at least give content the extra padding space.
-    return IntRect(tx + borderLeft(), ty + borderTop(), width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom());
+    return IntRect(additionalOffset.x() + borderLeft(), additionalOffset.y() + borderTop(), width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom());
 }
 
 void RenderButton::timerFired(Timer<RenderButton>*)

Modified: trunk/Source/WebCore/rendering/RenderButton.h (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderButton.h	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderButton.h	2011-05-26 22:49:00 UTC (rev 87443)
@@ -51,7 +51,7 @@
     virtual void updateBeforeAfterContent(PseudoId);
 
     virtual bool hasControlClip() const { return true; }
-    virtual IntRect controlClipRect(int /*tx*/, int /*ty*/) const;
+    virtual IntRect controlClipRect(const IntPoint&) const;
 
     void setText(const String&);
     String text() const;

Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderListBox.cpp	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp	2011-05-26 22:49:00 UTC (rev 87443)
@@ -427,7 +427,7 @@
     if (!element->renderStyle() || element->renderStyle()->visibility() != HIDDEN) {
         ColorSpace colorSpace = element->renderStyle() ? element->renderStyle()->colorSpace() : style()->colorSpace();
         IntRect itemRect = itemBoundingBoxRect(IntPoint(tx, ty), listIndex);
-        itemRect.intersect(controlClipRect(tx, ty));
+        itemRect.intersect(controlClipRect(IntPoint(tx, ty)));
         paintInfo.context->fillRect(itemRect, backColor, colorSpace);
     }
 }
@@ -687,10 +687,10 @@
     return true;
 }
 
-IntRect RenderListBox::controlClipRect(int tx, int ty) const
+IntRect RenderListBox::controlClipRect(const IntPoint& additionalOffset) const
 {
     IntRect clipRect = contentBoxRect();
-    clipRect.move(tx, ty);
+    clipRect.move(additionalOffset);
     return clipRect;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderListBox.h (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderListBox.h	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderListBox.h	2011-05-26 22:49:00 UTC (rev 87443)
@@ -66,7 +66,7 @@
 
     virtual bool hasControlClip() const { return true; }
     virtual void paintObject(PaintInfo&, int tx, int ty);
-    virtual IntRect controlClipRect(int tx, int ty) const;
+    virtual IntRect controlClipRect(const IntPoint&) const;
 
     virtual bool isPointInOverflowControl(HitTestResult&, const IntPoint& pointInContainer, int tx, int ty);
 

Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderMenuList.cpp	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp	2011-05-26 22:49:00 UTC (rev 87443)
@@ -232,18 +232,18 @@
     return m_buttonText ? m_buttonText->text() : 0;
 }
 
-IntRect RenderMenuList::controlClipRect(int tx, int ty) const
+IntRect RenderMenuList::controlClipRect(const IntPoint& 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(tx + borderLeft() + paddingLeft(), 
-                   ty + borderTop() + paddingTop(),
+    IntRect outerBox(additionalOffset.x() + borderLeft() + paddingLeft(), 
+                   additionalOffset.y() + borderTop() + paddingTop(),
                    contentWidth(), 
                    contentHeight());
     
-    IntRect innerBox(tx + m_innerBlock->x() + m_innerBlock->paddingLeft(), 
-                   ty + m_innerBlock->y() + m_innerBlock->paddingTop(),
+    IntRect innerBox(additionalOffset.x() + m_innerBlock->x() + m_innerBlock->paddingLeft(), 
+                   additionalOffset.y() + m_innerBlock->y() + m_innerBlock->paddingTop(),
                    m_innerBlock->contentWidth(), 
                    m_innerBlock->contentHeight());
 

Modified: trunk/Source/WebCore/rendering/RenderMenuList.h (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderMenuList.h	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderMenuList.h	2011-05-26 22:49:00 UTC (rev 87443)
@@ -70,7 +70,7 @@
     virtual void updateFromElement();
 
     virtual bool hasControlClip() const { return true; }
-    virtual IntRect controlClipRect(int tx, int ty) const;
+    virtual IntRect controlClipRect(const IntPoint&) const;
 
     virtual const char* renderName() const { return "RenderMenuList"; }
 

Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp	2011-05-26 22:49:00 UTC (rev 87443)
@@ -518,13 +518,13 @@
     return clip;
 }
 
-IntRect RenderTextControlSingleLine::controlClipRect(int tx, int ty) const
+IntRect RenderTextControlSingleLine::controlClipRect(const IntPoint& additionalOffset) const
 {
     // This should only get called for search & speech inputs.
     ASSERT(hasControlClip());
 
     IntRect clipRect = IntRect(innerBlockElement()->renderBox()->frameRect());
-    clipRect.move(tx, ty);
+    clipRect.move(additionalOffset);
     return clipRect;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h (87442 => 87443)


--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h	2011-05-26 22:43:51 UTC (rev 87442)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h	2011-05-26 22:49:00 UTC (rev 87443)
@@ -61,7 +61,7 @@
 private:
     int preferredDecorationWidthRight() const;
     virtual bool hasControlClip() const;
-    virtual IntRect controlClipRect(int tx, int ty) const;
+    virtual IntRect controlClipRect(const IntPoint&) const;
     virtual bool isTextField() const { return true; }
 
     virtual void subtreeHasChanged();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to