Changeset 99113 in webkit
- Timestamp:
- Nov 2, 2011 3:53:39 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r99109 r99113 1 2011-11-02 Emil A Eklund <eae@chromium.org> 2 3 Switch RenderText to new layout types 4 https://bugs.webkit.org/show_bug.cgi?id=71389 5 6 Reviewed by Eric Seidel. 7 8 Switch RenderText methods (and overriden methods in related classes) to 9 LayoutRect/LayoutUnit. 10 11 No new tests. 12 13 * rendering/RenderText.cpp: 14 (WebCore::RenderText::absoluteRectsForRange): 15 (WebCore::RenderText::linesBoundingBox): 16 (WebCore::RenderText::linesVisualOverflowBoundingBox): 17 * rendering/RenderText.h: 18 Change RenderText to expose its bounding box, selection and caret rects 19 as LayoutRects. 20 21 * rendering/svg/RenderSVGInlineText.cpp: 22 (WebCore::RenderSVGInlineText::localCaretRect): 23 * rendering/svg/RenderSVGInlineText.h: 24 Change localCaretRect to return a LayoutRect. 25 1 26 2011-11-02 Levi Weintraub <leviw@chromium.org> 2 27 -
trunk/Source/WebCore/rendering/RenderText.cpp
r98883 r99113 329 329 } 330 330 331 void RenderText::absoluteRectsForRange(Vector< IntRect>& rects, unsigned start, unsigned end, bool useSelectionHeight, bool* wasFixed)331 void RenderText::absoluteRectsForRange(Vector<LayoutRect>& rects, unsigned start, unsigned end, bool useSelectionHeight, bool* wasFixed) 332 332 { 333 333 // Work around signed/unsigned issues. This function takes unsigneds, and is often passed UINT_MAX … … 1498 1498 } 1499 1499 1500 IntRect RenderText::linesVisualOverflowBoundingBox() const1500 LayoutRect RenderText::linesVisualOverflowBoundingBox() const 1501 1501 { 1502 1502 if (!firstTextBox()) 1503 return IntRect();1503 return LayoutRect(); 1504 1504 1505 1505 // Return the width of the minimal left side and the maximal right side. 1506 int logicalLeftSide = numeric_limits<int>::max();1507 int logicalRightSide = numeric_limits<int>::min();1506 LayoutUnit logicalLeftSide = numeric_limits<LayoutUnit>::max(); 1507 LayoutUnit logicalRightSide = numeric_limits<LayoutUnit>::min(); 1508 1508 for (InlineTextBox* curr = firstTextBox(); curr; curr = curr->nextTextBox()) { 1509 1509 logicalLeftSide = min(logicalLeftSide, curr->logicalLeftVisualOverflow()); … … 1511 1511 } 1512 1512 1513 int logicalTop = firstTextBox()->logicalTopVisualOverflow();1514 int logicalWidth = logicalRightSide - logicalLeftSide;1515 int logicalHeight = lastTextBox()->logicalBottomVisualOverflow() - logicalTop;1513 LayoutUnit logicalTop = firstTextBox()->logicalTopVisualOverflow(); 1514 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; 1515 LayoutUnit logicalHeight = lastTextBox()->logicalBottomVisualOverflow() - logicalTop; 1516 1516 1517 IntRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);1517 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); 1518 1518 if (!style()->isHorizontalWritingMode()) 1519 1519 rect = rect.transposedRect(); -
trunk/Source/WebCore/rendering/RenderText.h
r98883 r99113 56 56 57 57 virtual void absoluteRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const; 58 void absoluteRectsForRange(Vector< IntRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0);58 void absoluteRectsForRange(Vector<LayoutRect>&, unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = 0); 59 59 60 60 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const; … … 84 84 85 85 virtual LayoutRect linesBoundingBox() const; 86 IntRect linesVisualOverflowBoundingBox() const;86 LayoutRect linesVisualOverflowBoundingBox() const; 87 87 88 88 FloatPoint firstRunOrigin() const; … … 151 151 virtual unsigned length() const { return textLength(); } 152 152 153 virtual void paint(PaintInfo&, const IntPoint&) { ASSERT_NOT_REACHED(); }153 virtual void paint(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHED(); } 154 154 virtual void layout() { ASSERT_NOT_REACHED(); } 155 155 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint&, const LayoutPoint&, HitTestAction) { ASSERT_NOT_REACHED(); return false; } -
trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
r98883 r99113 105 105 } 106 106 107 LayoutRect RenderSVGInlineText::localCaretRect(InlineBox* box, int caretOffset, int*)107 LayoutRect RenderSVGInlineText::localCaretRect(InlineBox* box, int caretOffset, LayoutUnit*) 108 108 { 109 109 if (!box->isInlineTextBox())
Note: See TracChangeset
for help on using the changeset viewer.