Title: [98883] trunk/Source/WebCore
Revision
98883
Author
e...@chromium.org
Date
2011-10-31 14:33:35 -0700 (Mon, 31 Oct 2011)

Log Message

Overridden LayoutRect method still uses IntRects
https://bugs.webkit.org/show_bug.cgi?id=71166

Reviewed by Eric Seidel.

Change all virtual controlClipRect, windowResizerRect, windowClipRect,
visibleContentRect, scrollCornerRect, outlineBoundsForRepaint and
localCaretRect functions to have the same signature.

* page/FrameView.cpp:
(WebCore::FrameView::windowClipRect):
(WebCore::FrameView::windowClipRectForLayer):
(WebCore::FrameView::windowResizerRect):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::wheelEvent):
* platform/ScrollView.h:
* platform/ScrollableArea.h:
* rendering/RenderButton.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::visibleContentRect):
* rendering/RenderLayer.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::localCaretRect):
* rendering/RenderObject.h:
(WebCore::RenderObject::outlineBoundsForRepaint):
* rendering/RenderText.cpp:
(WebCore::RenderText::localCaretRect):
(WebCore::RenderText::linesBoundingBox):
* rendering/RenderText.h:
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::localCaretRect):
* rendering/svg/RenderSVGInlineText.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98882 => 98883)


--- trunk/Source/WebCore/ChangeLog	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/ChangeLog	2011-10-31 21:33:35 UTC (rev 98883)
@@ -1,3 +1,39 @@
+2011-10-31  Emil A Eklund  <e...@chromium.org>
+
+        Overridden LayoutRect method still uses IntRects
+        https://bugs.webkit.org/show_bug.cgi?id=71166
+
+        Reviewed by Eric Seidel.
+
+        Change all virtual controlClipRect, windowResizerRect, windowClipRect,
+        visibleContentRect, scrollCornerRect, outlineBoundsForRepaint and
+        localCaretRect functions to have the same signature.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::windowClipRect):
+        (WebCore::FrameView::windowClipRectForLayer):
+        (WebCore::FrameView::windowResizerRect):
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::wheelEvent):
+        * platform/ScrollView.h:
+        * platform/ScrollableArea.h:
+        * rendering/RenderButton.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::visibleContentRect):
+        * rendering/RenderLayer.h:
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::localCaretRect):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::outlineBoundsForRepaint):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::localCaretRect):
+        (WebCore::RenderText::linesBoundingBox):
+        * rendering/RenderText.h:
+        * rendering/svg/RenderSVGInlineText.cpp:
+        (WebCore::RenderSVGInlineText::localCaretRect):
+        * rendering/svg/RenderSVGInlineText.h:
+
 2011-10-31  Dmitry Lomov  <dslo...@google.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=70658

Modified: trunk/Source/WebCore/page/FrameView.cpp (98882 => 98883)


--- trunk/Source/WebCore/page/FrameView.cpp	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/page/FrameView.cpp	2011-10-31 21:33:35 UTC (rev 98883)
@@ -2309,15 +2309,15 @@
     
 }
 
-LayoutRect FrameView::windowClipRect(bool clipToContents) const
+IntRect FrameView::windowClipRect(bool clipToContents) const
 {
     ASSERT(m_frame->view() == this);
 
     if (paintsEntireContents())
-        return LayoutRect(LayoutPoint(), contentsSize());
+        return IntRect(IntPoint(), contentsSize());
 
     // Set our clip rect to be our contents.
-    LayoutRect clipRect = contentsToWindow(visibleContentRect(!clipToContents));
+    IntRect clipRect = contentsToWindow(visibleContentRect(!clipToContents));
     if (!m_frame || !m_frame->ownerElement())
         return clipRect;
 
@@ -2333,14 +2333,14 @@
     return clipRect;
 }
 
-LayoutRect FrameView::windowClipRectForLayer(const RenderLayer* layer, bool clipToLayerContents) const
+IntRect FrameView::windowClipRectForLayer(const RenderLayer* layer, bool clipToLayerContents) const
 {
     // If we have no layer, just return our window clip rect.
     if (!layer)
         return windowClipRect();
 
     // Apply the clip from the layer.
-    LayoutRect clipRect;
+    IntRect clipRect;
     if (clipToLayerContents)
         clipRect = layer->childrenClipRect();
     else
@@ -2377,7 +2377,7 @@
     tickmarks = frame()->document()->markers()->renderedRectsForMarkers(DocumentMarker::TextMatch);
 }
 
-LayoutRect FrameView::windowResizerRect() const
+IntRect FrameView::windowResizerRect() const
 {
     Page* page = frame() ? frame()->page() : 0;
     if (!page)

Modified: trunk/Source/WebCore/page/FrameView.h (98882 => 98883)


--- trunk/Source/WebCore/page/FrameView.h	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/page/FrameView.h	2011-10-31 21:33:35 UTC (rev 98883)
@@ -160,10 +160,10 @@
 
     void adjustViewSize();
     
-    virtual LayoutRect windowClipRect(bool clipToContents = true) const;
-    LayoutRect windowClipRectForLayer(const RenderLayer*, bool clipToLayerContents) const;
+    virtual IntRect windowClipRect(bool clipToContents = true) const;
+    IntRect windowClipRectForLayer(const RenderLayer*, bool clipToLayerContents) const;
 
-    virtual LayoutRect windowResizerRect() const;
+    virtual IntRect windowResizerRect() const;
 
     virtual void setFixedVisibleContentRect(const IntRect&) OVERRIDE;
     void setScrollPosition(const LayoutPoint&);

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (98882 => 98883)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2011-10-31 21:33:35 UTC (rev 98883)
@@ -929,25 +929,25 @@
         hostWindow()->invalidateContentsAndWindow(contentsToWindow(paintRect), now /*immediate*/);
 }
 
-IntRect ScrollView::scrollCornerRect() const
+LayoutRect ScrollView::scrollCornerRect() const
 {
-    IntRect cornerRect;
+    LayoutRect cornerRect;
 
     if (hasOverlayScrollbars())
         return cornerRect;
 
     if (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() > 0) {
-        cornerRect.unite(IntRect(m_horizontalScrollbar->width(),
-                                 height() - m_horizontalScrollbar->height(),
-                                 width() - m_horizontalScrollbar->width(),
-                                 m_horizontalScrollbar->height()));
+        cornerRect.unite(LayoutRect(m_horizontalScrollbar->width(),
+                                    height() - m_horizontalScrollbar->height(),
+                                    width() - m_horizontalScrollbar->width(),
+                                    m_horizontalScrollbar->height()));
     }
 
     if (m_verticalScrollbar && height() - m_verticalScrollbar->height() > 0) {
-        cornerRect.unite(IntRect(width() - m_verticalScrollbar->width(),
-                                 m_verticalScrollbar->height(),
-                                 m_verticalScrollbar->width(),
-                                 height() - m_verticalScrollbar->height()));
+        cornerRect.unite(LayoutRect(width() - m_verticalScrollbar->width(),
+                                    m_verticalScrollbar->height(),
+                                    m_verticalScrollbar->width(),
+                                    height() - m_verticalScrollbar->height()));
     }
     
     return cornerRect;

Modified: trunk/Source/WebCore/platform/ScrollView.h (98882 => 98883)


--- trunk/Source/WebCore/platform/ScrollView.h	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/platform/ScrollView.h	2011-10-31 21:33:35 UTC (rev 98883)
@@ -279,7 +279,7 @@
 
     virtual bool isPointInScrollbarCorner(const IntPoint&);
     virtual bool scrollbarCornerPresent() const;
-    virtual IntRect scrollCornerRect() const;
+    virtual LayoutRect scrollCornerRect() const;
     virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
 
     virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect&) const;

Modified: trunk/Source/WebCore/platform/ScrollableArea.h (98882 => 98883)


--- trunk/Source/WebCore/platform/ScrollableArea.h	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/platform/ScrollableArea.h	2011-10-31 21:33:35 UTC (rev 98883)
@@ -92,7 +92,7 @@
     virtual int scrollPosition(Scrollbar*) const = 0;
     void invalidateScrollbar(Scrollbar*, const IntRect&);
     virtual bool isScrollCornerVisible() const = 0;
-    virtual IntRect scrollCornerRect() const = 0;
+    virtual LayoutRect scrollCornerRect() const = 0;
     void invalidateScrollCorner(const IntRect&);
     virtual void getTickmarks(Vector<IntRect>&) const { }
 

Modified: trunk/Source/WebCore/rendering/RenderButton.h (98882 => 98883)


--- trunk/Source/WebCore/rendering/RenderButton.h	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/rendering/RenderButton.h	2011-10-31 21:33:35 UTC (rev 98883)
@@ -51,7 +51,7 @@
     virtual void updateBeforeAfterContent(PseudoId);
 
     virtual bool hasControlClip() const { return true; }
-    virtual IntRect controlClipRect(const IntPoint&) const;
+    virtual LayoutRect controlClipRect(const IntPoint&) const;
 
     void setText(const String&);
     String text() const;

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (98882 => 98883)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2011-10-31 21:33:35 UTC (rev 98883)
@@ -1723,18 +1723,18 @@
     return m_scrollOrigin + m_scrollSize - visibleContentRect(true).size();
 }
 
-LayoutRect RenderLayer::visibleContentRect(bool includeScrollbars) const
+IntRect RenderLayer::visibleContentRect(bool includeScrollbars) const
 {
-    LayoutUnit verticalScrollbarWidth = 0;
-    LayoutUnit horizontalScrollbarHeight = 0;
+    int verticalScrollbarWidth = 0;
+    int horizontalScrollbarHeight = 0;
     if (includeScrollbars) {
         verticalScrollbarWidth = (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar()) ? verticalScrollbar()->width() : 0;
         horizontalScrollbarHeight = (horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar()) ? horizontalScrollbar()->height() : 0;
     }
     
-    return LayoutRect(LayoutPoint(scrollXOffset(), scrollYOffset()),
-                      LayoutSize(max<LayoutUnit>(0, m_layerSize.width() - verticalScrollbarWidth), 
-                                 max<LayoutUnit>(0, m_layerSize.height() - horizontalScrollbarHeight)));
+    return IntRect(IntPoint(scrollXOffset(), scrollYOffset()),
+                   IntSize(max(0, m_layerSize.width() - verticalScrollbarWidth), 
+                           max(0, m_layerSize.height() - horizontalScrollbarHeight)));
 }
 
 LayoutSize RenderLayer::overhangAmount() const

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (98882 => 98883)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2011-10-31 21:33:35 UTC (rev 98883)
@@ -608,7 +608,7 @@
     virtual LayoutPoint scrollPosition() const;
     virtual LayoutPoint minimumScrollPosition() const;
     virtual LayoutPoint maximumScrollPosition() const;
-    virtual LayoutRect visibleContentRect(bool includeScrollbars) const;
+    virtual IntRect visibleContentRect(bool includeScrollbars) const;
     virtual LayoutUnit visibleHeight() const;
     virtual LayoutUnit visibleWidth() const;
     virtual LayoutSize contentsSize() const;

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (98882 => 98883)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2011-10-31 21:33:35 UTC (rev 98883)
@@ -2081,12 +2081,12 @@
     return offset;
 }
 
-IntRect RenderObject::localCaretRect(InlineBox*, int, int* extraWidthToEndOfLine)
+LayoutRect RenderObject::localCaretRect(InlineBox*, int, LayoutUnit* extraWidthToEndOfLine)
 {
     if (extraWidthToEndOfLine)
         *extraWidthToEndOfLine = 0;
 
-    return IntRect();
+    return LayoutRect();
 }
 
 RenderView* RenderObject::view() const

Modified: trunk/Source/WebCore/rendering/RenderObject.h (98882 => 98883)


--- trunk/Source/WebCore/rendering/RenderObject.h	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2011-10-31 21:33:35 UTC (rev 98883)
@@ -780,7 +780,7 @@
      * @param extraWidthToEndOfLine optional out arg to give extra width to end of line -
      * useful for character range rect computations
      */
-    virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0);
+    virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0);
 
     bool isMarginBeforeQuirk() const { return m_marginBeforeQuirk; }
     bool isMarginAfterQuirk() const { return m_marginAfterQuirk; }
@@ -869,7 +869,7 @@
     virtual void willBeDestroyed();
     void arenaDelete(RenderArena*, void* objectBase);
 
-    virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/, IntPoint* /*cachedOffsetToRepaintContainer*/ = 0) const { return IntRect(); }
+    virtual LayoutRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/, IntPoint* /*cachedOffsetToRepaintContainer*/ = 0) const { return LayoutRect(); }
 
 private:
     RenderStyle* firstLineStyleSlowCase() const;

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (98882 => 98883)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2011-10-31 21:33:35 UTC (rev 98883)
@@ -637,14 +637,14 @@
     return createVisiblePosition(lastBoxAbove ? lastBoxAbove->start() + lastBoxAbove->len() : 0, DOWNSTREAM);
 }
 
-IntRect RenderText::localCaretRect(InlineBox* inlineBox, int caretOffset, int* extraWidthToEndOfLine)
+LayoutRect RenderText::localCaretRect(InlineBox* inlineBox, int caretOffset, LayoutUnit* extraWidthToEndOfLine)
 {
     if (!inlineBox)
-        return IntRect();
+        return LayoutRect();
 
     ASSERT(inlineBox->isInlineTextBox());
     if (!inlineBox->isInlineTextBox())
-        return IntRect();
+        return LayoutRect();
 
     InlineTextBox* box = toInlineTextBox(inlineBox);
 
@@ -1469,9 +1469,9 @@
     return w;
 }
 
-IntRect RenderText::linesBoundingBox() const
+LayoutRect RenderText::linesBoundingBox() const
 {
-    IntRect result;
+    LayoutRect result;
     
     ASSERT(!firstTextBox() == !lastTextBox());  // Either both are null or both exist.
     if (firstTextBox() && lastTextBox()) {

Modified: trunk/Source/WebCore/rendering/RenderText.h (98882 => 98883)


--- trunk/Source/WebCore/rendering/RenderText.h	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/rendering/RenderText.h	2011-10-31 21:33:35 UTC (rev 98883)
@@ -82,7 +82,7 @@
                            float& beginMaxW, float& endMaxW,
                            float& minW, float& maxW, bool& stripFrontSpaces);
 
-    virtual IntRect linesBoundingBox() const;
+    virtual LayoutRect linesBoundingBox() const;
     IntRect linesVisualOverflowBoundingBox() const;
 
     FloatPoint firstRunOrigin() const;
@@ -95,7 +95,7 @@
     virtual bool canBeSelectionLeaf() const { return true; }
     virtual void setSelectionState(SelectionState s);
     virtual LayoutRect selectionRectForRepaint(RenderBoxModelObject* repaintContainer, bool clipToVisibleContent = true);
-    virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0);
+    virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0);
 
     virtual LayoutUnit marginLeft() const { return style()->marginLeft().calcMinValue(0); }
     virtual LayoutUnit marginRight() const { return style()->marginRight().calcMinValue(0); }

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp (98882 => 98883)


--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp	2011-10-31 21:33:35 UTC (rev 98883)
@@ -104,25 +104,25 @@
     return box;
 }
 
-IntRect RenderSVGInlineText::localCaretRect(InlineBox* box, int caretOffset, int*)
+LayoutRect RenderSVGInlineText::localCaretRect(InlineBox* box, int caretOffset, int*)
 {
     if (!box->isInlineTextBox())
-        return IntRect();
+        return LayoutRect();
 
     InlineTextBox* textBox = static_cast<InlineTextBox*>(box);
     if (static_cast<unsigned>(caretOffset) < textBox->start() || static_cast<unsigned>(caretOffset) > textBox->start() + textBox->len())
-        return IntRect();
+        return LayoutRect();
 
     // Use the edge of the selection rect to determine the caret rect.
     if (static_cast<unsigned>(caretOffset) < textBox->start() + textBox->len()) {
         IntRect rect = textBox->localSelectionRect(caretOffset, caretOffset + 1);
         int x = box->isLeftToRightDirection() ? rect.x() : rect.maxX();
-        return IntRect(x, rect.y(), caretWidth, rect.height());
+        return LayoutRect(x, rect.y(), caretWidth, rect.height());
     }
 
     IntRect rect = textBox->localSelectionRect(caretOffset - 1, caretOffset);
     int x = box->isLeftToRightDirection() ? rect.maxX() : rect.x();
-    return IntRect(x, rect.y(), caretWidth, rect.height());
+    return LayoutRect(x, rect.y(), caretWidth, rect.height());
 }
 
 LayoutRect RenderSVGInlineText::linesBoundingBox() const

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h (98882 => 98883)


--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h	2011-10-31 21:31:32 UTC (rev 98882)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h	2011-10-31 21:33:35 UTC (rev 98883)
@@ -61,7 +61,7 @@
     virtual bool isSVGInlineText() const { return true; }
 
     virtual VisiblePosition positionForPoint(const LayoutPoint&);
-    virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0);
+    virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0);
     virtual LayoutRect linesBoundingBox() const;
     virtual InlineTextBox* createTextBox();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to