Title: [99113] trunk/Source/WebCore
Revision
99113
Author
[email protected]
Date
2011-11-02 15:53:39 -0700 (Wed, 02 Nov 2011)

Log Message

Switch RenderText to new layout types
https://bugs.webkit.org/show_bug.cgi?id=71389

Reviewed by Eric Seidel.

Switch RenderText methods (and overriden methods in related classes) to
LayoutRect/LayoutUnit.

No new tests.

* rendering/RenderText.cpp:
(WebCore::RenderText::absoluteRectsForRange):
(WebCore::RenderText::linesBoundingBox):
(WebCore::RenderText::linesVisualOverflowBoundingBox):
* rendering/RenderText.h:
Change RenderText to expose its bounding box, selection and caret rects
as LayoutRects.

* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::localCaretRect):
* rendering/svg/RenderSVGInlineText.h:
Change localCaretRect to return a LayoutRect.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (99112 => 99113)


--- trunk/Source/WebCore/ChangeLog	2011-11-02 22:47:28 UTC (rev 99112)
+++ trunk/Source/WebCore/ChangeLog	2011-11-02 22:53:39 UTC (rev 99113)
@@ -1,3 +1,28 @@
+2011-11-02  Emil A Eklund  <[email protected]>
+
+        Switch RenderText to new layout types
+        https://bugs.webkit.org/show_bug.cgi?id=71389
+
+        Reviewed by Eric Seidel.
+
+        Switch RenderText methods (and overriden methods in related classes) to
+        LayoutRect/LayoutUnit.
+
+        No new tests.
+
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::absoluteRectsForRange):
+        (WebCore::RenderText::linesBoundingBox):
+        (WebCore::RenderText::linesVisualOverflowBoundingBox):
+        * rendering/RenderText.h:
+        Change RenderText to expose its bounding box, selection and caret rects
+        as LayoutRects.
+        
+        * rendering/svg/RenderSVGInlineText.cpp:
+        (WebCore::RenderSVGInlineText::localCaretRect):
+        * rendering/svg/RenderSVGInlineText.h:
+        Change localCaretRect to return a LayoutRect.
+
 2011-11-02  Levi Weintraub  <[email protected]>
 
         Infinite recursion in RenderSVGResourceContainer::markAllClientsForInvalidation

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (99112 => 99113)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2011-11-02 22:47:28 UTC (rev 99112)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2011-11-02 22:53:39 UTC (rev 99113)
@@ -328,7 +328,7 @@
     return FloatRect();
 }
 
-void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, unsigned end, bool useSelectionHeight, bool* wasFixed)
+void RenderText::absoluteRectsForRange(Vector<LayoutRect>& rects, unsigned start, unsigned end, bool useSelectionHeight, bool* wasFixed)
 {
     // Work around signed/unsigned issues. This function takes unsigneds, and is often passed UINT_MAX
     // to mean "all the way to the end". InlineTextBox coordinates are unsigneds, so changing this 
@@ -1497,24 +1497,24 @@
     return result;
 }
 
-IntRect RenderText::linesVisualOverflowBoundingBox() const
+LayoutRect RenderText::linesVisualOverflowBoundingBox() const
 {
     if (!firstTextBox())
-        return IntRect();
+        return LayoutRect();
 
     // Return the width of the minimal left side and the maximal right side.
-    int logicalLeftSide = numeric_limits<int>::max();
-    int logicalRightSide = numeric_limits<int>::min();
+    LayoutUnit logicalLeftSide = numeric_limits<LayoutUnit>::max();
+    LayoutUnit logicalRightSide = numeric_limits<LayoutUnit>::min();
     for (InlineTextBox* curr = firstTextBox(); curr; curr = curr->nextTextBox()) {
         logicalLeftSide = min(logicalLeftSide, curr->logicalLeftVisualOverflow());
         logicalRightSide = max(logicalRightSide, curr->logicalRightVisualOverflow());
     }
     
-    int logicalTop = firstTextBox()->logicalTopVisualOverflow();
-    int logicalWidth = logicalRightSide - logicalLeftSide;
-    int logicalHeight = lastTextBox()->logicalBottomVisualOverflow() - logicalTop;
+    LayoutUnit logicalTop = firstTextBox()->logicalTopVisualOverflow();
+    LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide;
+    LayoutUnit logicalHeight = lastTextBox()->logicalBottomVisualOverflow() - logicalTop;
     
-    IntRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);
+    LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);
     if (!style()->isHorizontalWritingMode())
         rect = rect.transposedRect();
     return rect;

Modified: trunk/Source/WebCore/rendering/RenderText.h (99112 => 99113)


--- trunk/Source/WebCore/rendering/RenderText.h	2011-11-02 22:47:28 UTC (rev 99112)
+++ trunk/Source/WebCore/rendering/RenderText.h	2011-11-02 22:53:39 UTC (rev 99113)
@@ -55,7 +55,7 @@
     void dirtyLineBoxes(bool fullLayout);
 
     virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const;
-    void absoluteRectsForRange(Vector<IntRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0);
+    void absoluteRectsForRange(Vector<LayoutRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0);
 
     virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const;
     void absoluteQuadsForRange(Vector<FloatQuad>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0);
@@ -83,7 +83,7 @@
                            float& minW, float& maxW, bool& stripFrontSpaces);
 
     virtual LayoutRect linesBoundingBox() const;
-    IntRect linesVisualOverflowBoundingBox() const;
+    LayoutRect linesVisualOverflowBoundingBox() const;
 
     FloatPoint firstRunOrigin() const;
     float firstRunX() const;
@@ -150,7 +150,7 @@
     // callers with a RenderObject* can continue to use length().
     virtual unsigned length() const { return textLength(); }
 
-    virtual void paint(PaintInfo&, const IntPoint&) { ASSERT_NOT_REACHED(); }
+    virtual void paint(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHED(); }
     virtual void layout() { ASSERT_NOT_REACHED(); }
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint&, const LayoutPoint&, HitTestAction) { ASSERT_NOT_REACHED(); return false; }
 

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp (99112 => 99113)


--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp	2011-11-02 22:47:28 UTC (rev 99112)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp	2011-11-02 22:53:39 UTC (rev 99113)
@@ -104,7 +104,7 @@
     return box;
 }
 
-LayoutRect RenderSVGInlineText::localCaretRect(InlineBox* box, int caretOffset, int*)
+LayoutRect RenderSVGInlineText::localCaretRect(InlineBox* box, int caretOffset, LayoutUnit*)
 {
     if (!box->isInlineTextBox())
         return LayoutRect();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to