Title: [92625] trunk/Source/WebCore
Revision
92625
Author
[email protected]
Date
2011-08-08 13:11:22 -0700 (Mon, 08 Aug 2011)

Log Message

Rename absoluteQuadsForRange and InlineTextBox::selectionRect to local*
https://bugs.webkit.org/show_bug.cgi?id=65722

Reviewed by Simon Fraser.

No new tests, no new functionality.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect):
Rename InlineTextBox::selectionRect to localSelectionRect to reflect that
it, unlike RenderObject::selectionRect returns a rect in the local
coordinate space.

* rendering/InlineTextBox.h:
* rendering/RenderText.cpp:
(WebCore::localQuadForTextBox):
(WebCore::RenderText::absoluteRectsForRange):
(WebCore::RenderText::absoluteQuadsForRange):
(WebCore::RenderText::selectionRectForRepaint):
Rename absoluteQuadForTextBox to localQuadForTextBox to reflect that it
returns a quad in the local coordinate space.

* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::localCaretRect):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::localSelectionRect):
* rendering/svg/SVGInlineTextBox.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (92624 => 92625)


--- trunk/Source/WebCore/ChangeLog	2011-08-08 19:59:31 UTC (rev 92624)
+++ trunk/Source/WebCore/ChangeLog	2011-08-08 20:11:22 UTC (rev 92625)
@@ -1,3 +1,33 @@
+2011-08-08  Emil A Eklund  <[email protected]>
+
+        Rename absoluteQuadsForRange and InlineTextBox::selectionRect to local*
+        https://bugs.webkit.org/show_bug.cgi?id=65722
+
+        Reviewed by Simon Fraser.
+
+        No new tests, no new functionality.
+
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::localSelectionRect):
+        Rename InlineTextBox::selectionRect to localSelectionRect to reflect that
+        it, unlike RenderObject::selectionRect returns a rect in the local
+        coordinate space.
+
+        * rendering/InlineTextBox.h:
+        * rendering/RenderText.cpp:
+        (WebCore::localQuadForTextBox):
+        (WebCore::RenderText::absoluteRectsForRange):
+        (WebCore::RenderText::absoluteQuadsForRange):
+        (WebCore::RenderText::selectionRectForRepaint):
+        Rename absoluteQuadForTextBox to localQuadForTextBox to reflect that it
+        returns a quad in the local coordinate space.
+        
+        * rendering/svg/RenderSVGInlineText.cpp:
+        (WebCore::RenderSVGInlineText::localCaretRect):
+        * rendering/svg/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::localSelectionRect):
+        * rendering/svg/SVGInlineTextBox.h:
+
 2011-08-08  Jochen Eisinger  <[email protected]>
 
         Use a raw pointer to the security origin in the ctor of FrameLoadRequest

Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (92624 => 92625)


--- trunk/Source/WebCore/rendering/InlineTextBox.cpp	2011-08-08 19:59:31 UTC (rev 92624)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp	2011-08-08 20:11:22 UTC (rev 92625)
@@ -173,7 +173,7 @@
     length += hyphenString.length();
 }
 
-IntRect InlineTextBox::selectionRect(int startPos, int endPos)
+IntRect InlineTextBox::localSelectionRect(int startPos, int endPos)
 {
     int sPos = max(startPos - m_start, 0);
     int ePos = min(endPos - m_start, (int)m_len);

Modified: trunk/Source/WebCore/rendering/InlineTextBox.h (92624 => 92625)


--- trunk/Source/WebCore/rendering/InlineTextBox.h	2011-08-08 19:59:31 UTC (rev 92624)
+++ trunk/Source/WebCore/rendering/InlineTextBox.h	2011-08-08 20:11:22 UTC (rev 92625)
@@ -105,7 +105,7 @@
 public:
     virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), width(), height()); }
 
-    virtual IntRect selectionRect(int startPos, int endPos);
+    virtual IntRect localSelectionRect(int startPos, int endPos);
     bool isSelected(int startPos, int endPos) const;
     void selectionStartEnd(int& sPos, int& ePos);
 

Modified: trunk/Source/WebCore/rendering/RenderText.cpp (92624 => 92625)


--- trunk/Source/WebCore/rendering/RenderText.cpp	2011-08-08 19:59:31 UTC (rev 92624)
+++ trunk/Source/WebCore/rendering/RenderText.cpp	2011-08-08 20:11:22 UTC (rev 92625)
@@ -272,10 +272,10 @@
         rects.append(enclosingLayoutRect(FloatRect(accumulatedOffset + box->topLeft(), box->size())));
 }
 
-static FloatRect absoluteQuadForTextBox(InlineTextBox* box, unsigned start, unsigned end, bool useSelectionHeight)
+static FloatRect localQuadForTextBox(InlineTextBox* box, unsigned start, unsigned end, bool useSelectionHeight)
 {
     unsigned realEnd = min(box->end() + 1, end);
-    IntRect r = box->selectionRect(start, realEnd);
+    IntRect r = box->localSelectionRect(start, realEnd);
     if (r.height()) {
         if (!useSelectionHeight) {
             // Change the height and y position (or width and x for vertical text)
@@ -310,7 +310,7 @@
         if (start <= box->start() && box->end() < end) {
             IntRect r = box->calculateBoundaries();
             if (useSelectionHeight) {
-                IntRect selectionRect = box->selectionRect(start, end);
+                IntRect selectionRect = box->localSelectionRect(start, end);
                 if (box->isHorizontal()) {
                     r.setHeight(selectionRect.height());
                     r.setY(selectionRect.y());
@@ -322,7 +322,7 @@
             rects.append(localToAbsoluteQuad(FloatQuad(r), false, wasFixed).enclosingBoundingBox());
         } else {
             // FIXME: This code is wrong. It's converting local to absolute twice. http://webkit.org/b/65722
-            FloatRect rect = absoluteQuadForTextBox(box, start, end, useSelectionHeight);
+            FloatRect rect = localQuadForTextBox(box, start, end, useSelectionHeight);
             if (!rect.isZero())
                 rects.append(localToAbsoluteQuad(rect, false, wasFixed).enclosingBoundingBox());
         }
@@ -392,7 +392,7 @@
         if (start <= box->start() && box->end() < end) {
             IntRect r(box->calculateBoundaries());
             if (useSelectionHeight) {
-                IntRect selectionRect = box->selectionRect(start, end);
+                IntRect selectionRect = box->localSelectionRect(start, end);
                 if (box->isHorizontal()) {
                     r.setHeight(selectionRect.height());
                     r.setY(selectionRect.y());
@@ -403,7 +403,7 @@
             }
             quads.append(localToAbsoluteQuad(FloatRect(r), false, wasFixed));
         } else {
-            FloatRect rect = absoluteQuadForTextBox(box, start, end, useSelectionHeight);
+            FloatRect rect = localQuadForTextBox(box, start, end, useSelectionHeight);
             if (!rect.isZero())
                 quads.append(localToAbsoluteQuad(rect, false, wasFixed));
         }
@@ -1406,7 +1406,7 @@
 
     LayoutRect rect;
     for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
-        rect.unite(box->selectionRect(startPos, endPos));
+        rect.unite(box->localSelectionRect(startPos, endPos));
         rect.unite(ellipsisRectForBox(box, startPos, endPos));
     }
 

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp (92624 => 92625)


--- trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp	2011-08-08 19:59:31 UTC (rev 92624)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp	2011-08-08 20:11:22 UTC (rev 92625)
@@ -117,12 +117,12 @@
 
     // Use the edge of the selection rect to determine the caret rect.
     if (static_cast<unsigned>(caretOffset) < textBox->start() + textBox->len()) {
-        IntRect rect = textBox->selectionRect(caretOffset, caretOffset + 1);
+        IntRect rect = textBox->localSelectionRect(caretOffset, caretOffset + 1);
         int x = box->isLeftToRightDirection() ? rect.x() : rect.maxX();
         return IntRect(x, rect.y(), caretWidth, rect.height());
     }
 
-    IntRect rect = textBox->selectionRect(caretOffset - 1, caretOffset);
+    IntRect rect = textBox->localSelectionRect(caretOffset - 1, caretOffset);
     int x = box->isLeftToRightDirection() ? rect.maxX() : rect.x();
     return IntRect(x, rect.y(), caretWidth, rect.height());
 }

Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (92624 => 92625)


--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp	2011-08-08 19:59:31 UTC (rev 92624)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp	2011-08-08 20:11:22 UTC (rev 92625)
@@ -117,7 +117,7 @@
     return selectionRect;
 }
 
-IntRect SVGInlineTextBox::selectionRect(int startPosition, int endPosition)
+IntRect SVGInlineTextBox::localSelectionRect(int startPosition, int endPosition)
 {
     int boxStart = start();
     startPosition = max(startPosition - boxStart, 0);

Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h (92624 => 92625)


--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h	2011-08-08 19:59:31 UTC (rev 92624)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h	2011-08-08 20:11:22 UTC (rev 92625)
@@ -47,7 +47,7 @@
 
     void paintSelectionBackground(PaintInfo&);
     virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom);
-    virtual IntRect selectionRect(int startPosition, int endPosition);
+    virtual IntRect localSelectionRect(int startPosition, int endPosition);
 
     bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, int& startPosition, int& endPosition) const;
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to