Changeset 112237 in webkit
- Timestamp:
- Mar 27, 2012 3:06:49 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r112236 r112237 1 2012-03-27 Levi Weintraub <leviw@chromium.org> 2 3 Revert linesBoundingBox to integers 4 https://bugs.webkit.org/show_bug.cgi?id=82182 5 6 Reviewed by Eric Seidel. 7 8 LayoutRects are intended to be pixel snapped to determine the ultimate screen 9 coordinates, but the Inline Box tree is laid out using floats, and pixel snapping 10 the resulting box from linesBoundingBox would produce a potentially incorrect 11 rectangle. Keeping this using enclosingIntRect retains the previous accuracy and 12 prevents misuse. 13 14 No new tests. No change in behavior. 15 16 * rendering/RenderInline.cpp: 17 (WebCore::RenderInline::linesBoundingBox): 18 * rendering/RenderInline.h: 19 (RenderInline): 20 * rendering/RenderLayer.cpp: 21 (WebCore::RenderLayer::updateLayerPosition): 22 * rendering/RenderText.cpp: 23 (WebCore::RenderText::linesBoundingBox): 24 * rendering/svg/RenderSVGInlineText.cpp: 25 (WebCore::RenderSVGInlineText::linesBoundingBox): 26 * rendering/svg/RenderSVGInlineText.h: 27 (RenderSVGInlineText): 28 1 29 2012-03-26 Pavel Podivilov <podivilov@chromium.org> 2 30 -
trunk/Source/WebCore/rendering/RenderInline.cpp
r112198 r112237 786 786 } 787 787 788 LayoutRect RenderInline::linesBoundingBox() const788 IntRect RenderInline::linesBoundingBox() const 789 789 { 790 790 if (!alwaysCreateLineBoxes()) { 791 791 ASSERT(!firstLineBox()); 792 return enclosing LayoutRect(culledInlineBoundingBox(this));793 } 794 795 LayoutRect result;792 return enclosingIntRect(culledInlineBoundingBox(this)); 793 } 794 795 IntRect result; 796 796 797 797 // See <rdar://problem/5289721>, for an unknown reason the linked list here is sometimes inconsistent, first is non-zero and last is zero. We have been … … 816 816 float width = isHorizontal ? logicalRightSide - logicalLeftSide : lastLineBox()->logicalBottom() - x; 817 817 float height = isHorizontal ? lastLineBox()->logicalBottom() - y : logicalRightSide - logicalLeftSide; 818 result = enclosing LayoutRect(FloatRect(x, y, width, height));818 result = enclosingIntRect(FloatRect(x, y, width, height)); 819 819 } 820 820 -
trunk/Source/WebCore/rendering/RenderInline.h
r110224 r112237 52 52 virtual LayoutSize offsetFromContainer(RenderObject*, const LayoutPoint&) const; 53 53 54 LayoutRect linesBoundingBox() const;54 IntRect linesBoundingBox() const; 55 55 LayoutRect linesVisualOverflowBoundingBox() const; 56 56 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r111740 r112237 740 740 if (renderer()->isRenderInline()) { 741 741 RenderInline* inlineFlow = toRenderInline(renderer()); 742 LayoutRect lineBox = inlineFlow->linesBoundingBox();742 IntRect lineBox = inlineFlow->linesBoundingBox(); 743 743 setSize(lineBox.size()); 744 744 inlineBoundingBoxOffset = toSize(lineBox.location()); -
trunk/Source/WebCore/rendering/RenderText.cpp
r112200 r112237 1473 1473 } 1474 1474 1475 LayoutRect RenderText::linesBoundingBox() const1476 { 1477 LayoutRect result;1475 IntRect RenderText::linesBoundingBox() const 1476 { 1477 IntRect result; 1478 1478 1479 1479 ASSERT(!firstTextBox() == !lastTextBox()); // Either both are null or both exist. -
trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
r112166 r112237 166 166 } 167 167 168 LayoutRect RenderSVGInlineText::linesBoundingBox() const168 IntRect RenderSVGInlineText::linesBoundingBox() const 169 169 { 170 170 return enclosingIntRect(floatLinesBoundingBox()); -
trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h
r105143 r112237 60 60 virtual VisiblePosition positionForPoint(const LayoutPoint&); 61 61 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0); 62 virtual LayoutRect linesBoundingBox() const;62 virtual IntRect linesBoundingBox() const; 63 63 virtual InlineTextBox* createTextBox(); 64 64
Note: See TracChangeset
for help on using the changeset viewer.