Title: [113768] branches/subpixellayout/Source/WebCore/editing
- Revision
- 113768
- Author
- [email protected]
- Date
- 2012-04-10 14:25:50 -0700 (Tue, 10 Apr 2012)
Log Message
Fix that mirrors the change from Bug 83604. Cleaning up RenderedPosition::absoluteRect and its usage in Editor.
Modified Paths
Diff
Modified: branches/subpixellayout/Source/WebCore/editing/Editor.cpp (113767 => 113768)
--- branches/subpixellayout/Source/WebCore/editing/Editor.cpp 2012-04-10 21:16:54 UTC (rev 113767)
+++ branches/subpixellayout/Source/WebCore/editing/Editor.cpp 2012-04-10 21:25:50 UTC (rev 113768)
@@ -2575,11 +2575,11 @@
ASSERT(range->startContainer());
ASSERT(range->endContainer());
- IntRect startCaretRect = pixelSnappedIntRect(RenderedPosition(VisiblePosition(range->startPosition()).deepEquivalent(), DOWNSTREAM).absoluteRect(extraWidthToEndOfLine));
+ IntRect startCaretRect = RenderedPosition(VisiblePosition(range->startPosition()).deepEquivalent(), DOWNSTREAM).absoluteRect(&extraWidthToEndOfLine);
if (startCaretRect == IntRect())
return IntRect();
- IntRect endCaretRect = pixelSnappedIntRect(RenderedPosition(VisiblePosition(range->endPosition()).deepEquivalent(), UPSTREAM).absoluteRect());
+ IntRect endCaretRect = RenderedPosition(VisiblePosition(range->endPosition()).deepEquivalent(), UPSTREAM).absoluteRect();
if (endCaretRect == IntRect())
return IntRect();
Modified: branches/subpixellayout/Source/WebCore/editing/RenderedPosition.cpp (113767 => 113768)
--- branches/subpixellayout/Source/WebCore/editing/RenderedPosition.cpp 2012-04-10 21:16:54 UTC (rev 113767)
+++ branches/subpixellayout/Source/WebCore/editing/RenderedPosition.cpp 2012-04-10 21:25:50 UTC (rev 113768)
@@ -224,13 +224,13 @@
return createLegacyEditingPosition(prevLeafChild()->renderer()->node(), prevLeafChild()->caretRightmostOffset());
}
-LayoutRect RenderedPosition::absoluteRect(LayoutUnit* extraWidthToEndOfLine) const
+IntRect RenderedPosition::absoluteRect(LayoutUnit* extraWidthToEndOfLine) const
{
if (isNull())
- return LayoutRect();
+ return IntRect();
- LayoutRect localRect = m_renderer->localCaretRect(m_inlineBox, m_offset, extraWidthToEndOfLine);
- return localRect == LayoutRect() ? LayoutRect() : m_renderer->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
+ IntRect localRect = pixelSnappedIntRect(m_renderer->localCaretRect(m_inlineBox, m_offset, extraWidthToEndOfLine));
+ return localRect == IntRect() ? IntRect() : m_renderer->localToAbsoluteQuad(FloatRect(localRect)).enclosingBoundingBox();
}
bool renderObjectContainsPosition(RenderObject* target, const Position& position)
Modified: branches/subpixellayout/Source/WebCore/editing/RenderedPosition.h (113767 => 113768)
--- branches/subpixellayout/Source/WebCore/editing/RenderedPosition.h 2012-04-10 21:16:54 UTC (rev 113767)
+++ branches/subpixellayout/Source/WebCore/editing/RenderedPosition.h 2012-04-10 21:25:50 UTC (rev 113768)
@@ -67,8 +67,7 @@
Position positionAtLeftBoundaryOfBiDiRun() const;
Position positionAtRightBoundaryOfBiDiRun() const;
- LayoutRect absoluteRect() const { return absoluteRect(0); }
- LayoutRect absoluteRect(LayoutUnit& extraWidthToEndOfLine) const { return absoluteRect(&extraWidthToEndOfLine); }
+ IntRect absoluteRect(LayoutUnit* extraWidthToEndOfLine = 0) const;
private:
bool operator==(const RenderedPosition&) const { return false; }
@@ -81,8 +80,6 @@
bool atLeftBoundaryOfBidiRun(ShouldMatchBidiLevel, unsigned char bidiLevelOfRun) const;
bool atRightBoundaryOfBidiRun(ShouldMatchBidiLevel, unsigned char bidiLevelOfRun) const;
- LayoutRect absoluteRect(LayoutUnit* extraWidthToEndOfLine) const;
-
RenderObject* m_renderer;
InlineBox* m_inlineBox;
int m_offset;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes