Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Unified Diff: third_party/WebKit/Source/core/dom/Range.cpp

Issue 2776103002: Make RenderedRectsForMarkers() to ignore disconnected nodes. (Closed)
Patch Set: test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Range.cpp
diff --git a/third_party/WebKit/Source/core/dom/Range.cpp b/third_party/WebKit/Source/core/dom/Range.cpp
index 304e806bad8f10962cec4d7f5806532a985743eb..c52f3a3aa5d849d047cc451bf3cb9c838fae5e8f 100644
--- a/third_party/WebKit/Source/core/dom/Range.cpp
+++ b/third_party/WebKit/Source/core/dom/Range.cpp
@@ -1443,34 +1443,7 @@ Node* Range::pastLastNode() const {
}
IntRect Range::boundingBox() const {
- IntRect result;
- Vector<IntRect> rects;
- textRects(rects);
- for (const IntRect& rect : rects)
- result.unite(rect);
- return result;
-}
-
-void Range::textRects(Vector<IntRect>& rects, bool useSelectionHeight) const {
- Node* startContainer = m_start.container();
- DCHECK(startContainer);
- Node* endContainer = m_end.container();
- DCHECK(endContainer);
-
- Node* stopNode = pastLastNode();
- for (Node* node = firstNode(); node != stopNode;
- node = NodeTraversal::next(*node)) {
- LayoutObject* r = node->layoutObject();
- if (!r || !r->isText())
- continue;
- LayoutText* layoutText = toLayoutText(r);
- unsigned startOffset = node == startContainer ? m_start.offset() : 0;
- unsigned endOffset = node == endContainer
- ? m_end.offset()
- : std::numeric_limits<unsigned>::max();
- layoutText->absoluteRectsForRange(rects, startOffset, endOffset,
- useSelectionHeight);
- }
+ return computeBoundingBox(EphemeralRange(this));
}
void Range::textQuads(Vector<FloatQuad>& quads, bool useSelectionHeight) const {

Powered by Google App Engine
This is Rietveld 408576698