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

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

Issue 2209513002: Exclude start/end container in Range::getBorderAndTextQuads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/Range/range-spanning-elements-bounding-client-rect.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 024fdf9aee204db8e67f4eeb67f56691ad75e043..c2b287b8330d9d4973587d90574795a344301f98 100644
--- a/third_party/WebKit/Source/core/dom/Range.cpp
+++ b/third_party/WebKit/Source/core/dom/Range.cpp
@@ -1530,7 +1530,11 @@ void Range::getBorderAndTextQuads(Vector<FloatQuad>& quads) const
for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(*node)) {
if (node->isElementNode()) {
- if (!nodeSet.contains(node->parentNode())) {
+ // Exclude start & end container unless the entire corresponding
+ // node is included in the range.
+ if (!nodeSet.contains(node->parentNode())
+ && (startContainer == endContainer
+ || (!node->contains(startContainer) && !node->contains(endContainer)))) {
if (LayoutObject* layoutObject = toElement(node)->layoutObject()) {
Vector<FloatQuad> elementQuads;
layoutObject->absoluteQuads(elementQuads);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/Range/range-spanning-elements-bounding-client-rect.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698