Changeset 92625 in webkit
- Timestamp:
- Aug 8, 2011 1:11:22 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r92623 r92625 1 2011-08-08 Emil A Eklund <eae@chromium.org> 2 3 Rename absoluteQuadsForRange and InlineTextBox::selectionRect to local* 4 https://bugs.webkit.org/show_bug.cgi?id=65722 5 6 Reviewed by Simon Fraser. 7 8 No new tests, no new functionality. 9 10 * rendering/InlineTextBox.cpp: 11 (WebCore::InlineTextBox::localSelectionRect): 12 Rename InlineTextBox::selectionRect to localSelectionRect to reflect that 13 it, unlike RenderObject::selectionRect returns a rect in the local 14 coordinate space. 15 16 * rendering/InlineTextBox.h: 17 * rendering/RenderText.cpp: 18 (WebCore::localQuadForTextBox): 19 (WebCore::RenderText::absoluteRectsForRange): 20 (WebCore::RenderText::absoluteQuadsForRange): 21 (WebCore::RenderText::selectionRectForRepaint): 22 Rename absoluteQuadForTextBox to localQuadForTextBox to reflect that it 23 returns a quad in the local coordinate space. 24 25 * rendering/svg/RenderSVGInlineText.cpp: 26 (WebCore::RenderSVGInlineText::localCaretRect): 27 * rendering/svg/SVGInlineTextBox.cpp: 28 (WebCore::SVGInlineTextBox::localSelectionRect): 29 * rendering/svg/SVGInlineTextBox.h: 30 1 31 2011-08-08 Jochen Eisinger <jochen@chromium.org> 2 32 -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r90908 r92625 174 174 } 175 175 176 IntRect InlineTextBox:: selectionRect(int startPos, int endPos)176 IntRect InlineTextBox::localSelectionRect(int startPos, int endPos) 177 177 { 178 178 int sPos = max(startPos - m_start, 0); -
trunk/Source/WebCore/rendering/InlineTextBox.h
r90901 r92625 106 106 virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), width(), height()); } 107 107 108 virtual IntRect selectionRect(int startPos, int endPos);108 virtual IntRect localSelectionRect(int startPos, int endPos); 109 109 bool isSelected(int startPos, int endPos) const; 110 110 void selectionStartEnd(int& sPos, int& ePos); -
trunk/Source/WebCore/rendering/RenderText.cpp
r92438 r92625 273 273 } 274 274 275 static FloatRect absoluteQuadForTextBox(InlineTextBox* box, unsigned start, unsigned end, bool useSelectionHeight)275 static FloatRect localQuadForTextBox(InlineTextBox* box, unsigned start, unsigned end, bool useSelectionHeight) 276 276 { 277 277 unsigned realEnd = min(box->end() + 1, end); 278 IntRect r = box-> selectionRect(start, realEnd);278 IntRect r = box->localSelectionRect(start, realEnd); 279 279 if (r.height()) { 280 280 if (!useSelectionHeight) { … … 311 311 IntRect r = box->calculateBoundaries(); 312 312 if (useSelectionHeight) { 313 IntRect selectionRect = box-> selectionRect(start, end);313 IntRect selectionRect = box->localSelectionRect(start, end); 314 314 if (box->isHorizontal()) { 315 315 r.setHeight(selectionRect.height()); … … 323 323 } else { 324 324 // FIXME: This code is wrong. It's converting local to absolute twice. http://webkit.org/b/65722 325 FloatRect rect = absoluteQuadForTextBox(box, start, end, useSelectionHeight);325 FloatRect rect = localQuadForTextBox(box, start, end, useSelectionHeight); 326 326 if (!rect.isZero()) 327 327 rects.append(localToAbsoluteQuad(rect, false, wasFixed).enclosingBoundingBox()); … … 393 393 IntRect r(box->calculateBoundaries()); 394 394 if (useSelectionHeight) { 395 IntRect selectionRect = box-> selectionRect(start, end);395 IntRect selectionRect = box->localSelectionRect(start, end); 396 396 if (box->isHorizontal()) { 397 397 r.setHeight(selectionRect.height()); … … 404 404 quads.append(localToAbsoluteQuad(FloatRect(r), false, wasFixed)); 405 405 } else { 406 FloatRect rect = absoluteQuadForTextBox(box, start, end, useSelectionHeight);406 FloatRect rect = localQuadForTextBox(box, start, end, useSelectionHeight); 407 407 if (!rect.isZero()) 408 408 quads.append(localToAbsoluteQuad(rect, false, wasFixed)); … … 1407 1407 LayoutRect rect; 1408 1408 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 1409 rect.unite(box-> selectionRect(startPos, endPos));1409 rect.unite(box->localSelectionRect(startPos, endPos)); 1410 1410 rect.unite(ellipsisRectForBox(box, startPos, endPos)); 1411 1411 } -
trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
r90675 r92625 118 118 // Use the edge of the selection rect to determine the caret rect. 119 119 if (static_cast<unsigned>(caretOffset) < textBox->start() + textBox->len()) { 120 IntRect rect = textBox-> selectionRect(caretOffset, caretOffset + 1);120 IntRect rect = textBox->localSelectionRect(caretOffset, caretOffset + 1); 121 121 int x = box->isLeftToRightDirection() ? rect.x() : rect.maxX(); 122 122 return IntRect(x, rect.y(), caretWidth, rect.height()); 123 123 } 124 124 125 IntRect rect = textBox-> selectionRect(caretOffset - 1, caretOffset);125 IntRect rect = textBox->localSelectionRect(caretOffset - 1, caretOffset); 126 126 int x = box->isLeftToRightDirection() ? rect.maxX() : rect.x(); 127 127 return IntRect(x, rect.y(), caretWidth, rect.height()); -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
r90791 r92625 118 118 } 119 119 120 IntRect SVGInlineTextBox:: selectionRect(int startPosition, int endPosition)120 IntRect SVGInlineTextBox::localSelectionRect(int startPosition, int endPosition) 121 121 { 122 122 int boxStart = start(); -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h
r90791 r92625 48 48 void paintSelectionBackground(PaintInfo&); 49 49 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom); 50 virtual IntRect selectionRect(int startPosition, int endPosition);50 virtual IntRect localSelectionRect(int startPosition, int endPosition); 51 51 52 52 bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, int& startPosition, int& endPosition) const;
Note: See TracChangeset
for help on using the changeset viewer.