Changeset 88188 in webkit
- Timestamp:
- Jun 6, 2011 2:26:24 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88187 r88188 1 2011-06-06 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Remove tx/ty offset from selectionRect 6 https://bugs.webkit.org/show_bug.cgi?id=62146 7 8 Removing unused offset parameters from selectionRect. 9 10 No new tests since this is just cleanup. 11 12 * rendering/EllipsisBox.cpp: 13 (WebCore::EllipsisBox::selectionRect): 14 * rendering/EllipsisBox.h: 15 * rendering/InlineTextBox.cpp: 16 (WebCore::InlineTextBox::selectionRect): 17 * rendering/InlineTextBox.h: 18 * rendering/RenderText.cpp: 19 (WebCore::RenderText::absoluteRectsForRange): 20 (WebCore::ellipsisRectForBox): 21 (WebCore::RenderText::absoluteQuadsForRange): 22 (WebCore::RenderText::selectionRectForRepaint): 23 * rendering/svg/RenderSVGInlineText.cpp: 24 (WebCore::RenderSVGInlineText::localCaretRect): 25 * rendering/svg/SVGInlineTextBox.cpp: 26 (WebCore::SVGInlineTextBox::selectionRect): 27 * rendering/svg/SVGInlineTextBox.h: 28 1 29 2011-06-06 Paul Kinlan <paulkinlan@google.com> 2 30 -
trunk/Source/WebCore/rendering/EllipsisBox.cpp
r88186 r88188 74 74 } 75 75 76 IntRect EllipsisBox::selectionRect( int tx, int ty)76 IntRect EllipsisBox::selectionRect() 77 77 { 78 78 RenderStyle* style = m_renderer->style(m_firstLine); 79 79 const Font& font = style->font(); 80 80 // FIXME: Why is this always LTR? Fix by passing correct text run flags below. 81 return enclosingIntRect(font.selectionRectForText(RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x() + tx, y() + ty+ root()->selectionTop()), root()->selectionHeight()));81 return enclosingIntRect(font.selectionRectForText(RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x(), y() + root()->selectionTop()), root()->selectionHeight())); 82 82 } 83 83 -
trunk/Source/WebCore/rendering/EllipsisBox.h
r88186 r88188 43 43 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, int lineTop, int lineBottom); 44 44 void setSelectionState(RenderObject::SelectionState s) { m_selectionState = s; } 45 IntRect selectionRect( int tx, int ty);45 IntRect selectionRect(); 46 46 47 47 private: -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r87964 r88188 173 173 } 174 174 175 IntRect InlineTextBox::selectionRect(int tx, int ty, intstartPos, int endPos)175 IntRect InlineTextBox::selectionRect(int startPos, int endPos) 176 176 { 177 177 int sPos = max(startPos - m_start, 0); … … 201 201 logicalWidth = logicalRight() - r.x(); 202 202 203 IntPoint topPoint = isHorizontal() ? IntPoint(r.x(), ty + selTop) : IntPoint(tx +selTop, r.x());203 IntPoint topPoint = isHorizontal() ? IntPoint(r.x(), selTop) : IntPoint(selTop, r.x()); 204 204 int width = isHorizontal() ? logicalWidth : selHeight; 205 205 int height = isHorizontal() ? selHeight : logicalWidth; -
trunk/Source/WebCore/rendering/InlineTextBox.h
r87866 r88188 106 106 virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), width(), height()); } 107 107 108 virtual IntRect selectionRect(int absx, int absy, intstartPos, int endPos);108 virtual IntRect selectionRect(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
r87964 r88188 293 293 IntRect r = box->calculateBoundaries(); 294 294 if (useSelectionHeight) { 295 IntRect selectionRect = box->selectionRect( 0, 0,start, end);295 IntRect selectionRect = box->selectionRect(start, end); 296 296 if (box->isHorizontal()) { 297 297 r.setHeight(selectionRect.height()); … … 305 305 } else { 306 306 unsigned realEnd = min(box->end() + 1, end); 307 IntRect r = box->selectionRect( 0, 0,start, realEnd);307 IntRect r = box->selectionRect(start, realEnd); 308 308 if (!r.isEmpty()) { 309 309 if (!useSelectionHeight) { … … 341 341 // beginning of the selection is before or at the beginning of the truncation. 342 342 if (ellipsisEndPosition >= truncation && ellipsisStartPosition <= truncation) 343 return ellipsis->selectionRect( 0, 0);343 return ellipsis->selectionRect(); 344 344 } 345 345 … … 386 386 IntRect r(box->calculateBoundaries()); 387 387 if (useSelectionHeight) { 388 IntRect selectionRect = box->selectionRect( 0, 0,start, end);388 IntRect selectionRect = box->selectionRect(start, end); 389 389 if (box->isHorizontal()) { 390 390 r.setHeight(selectionRect.height()); … … 398 398 } else { 399 399 unsigned realEnd = min(box->end() + 1, end); 400 IntRect r = box->selectionRect( 0, 0,start, realEnd);400 IntRect r = box->selectionRect(start, realEnd); 401 401 if (r.height()) { 402 402 if (!useSelectionHeight) { … … 1398 1398 IntRect rect; 1399 1399 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 1400 rect.unite(box->selectionRect( 0, 0,startPos, endPos));1400 rect.unite(box->selectionRect(startPos, endPos)); 1401 1401 rect.unite(ellipsisRectForBox(box, startPos, endPos)); 1402 1402 } -
trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
r87846 r88188 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( 0, 0,caretOffset, caretOffset + 1);120 IntRect rect = textBox->selectionRect(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( 0, 0,caretOffset - 1, caretOffset);125 IntRect rect = textBox->selectionRect(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
r87753 r88188 113 113 } 114 114 115 IntRect SVGInlineTextBox::selectionRect(int , int, intstartPosition, int endPosition)115 IntRect SVGInlineTextBox::selectionRect(int startPosition, int endPosition) 116 116 { 117 117 int boxStart = start(); -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.h
r87964 r88188 48 48 void paintSelectionBackground(PaintInfo&); 49 49 virtual void paint(PaintInfo&, const IntPoint&, int lineTop, int lineBottom); 50 virtual IntRect selectionRect(int absx, int absy, intstartPosition, int endPosition);50 virtual IntRect selectionRect(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.