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

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: Added test 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
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 d1489f442ba9e1a93b31ee4b57d8d46fbf7aa89f..66768e7296187bdb821bb9e55d7edc4be7cc05a8 100644
--- a/third_party/WebKit/Source/core/dom/Range.cpp
+++ b/third_party/WebKit/Source/core/dom/Range.cpp
@@ -1530,7 +1530,9 @@ 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())) {
+ if (!nodeSet.contains(node->parentNode())
+ && !node->contains(startContainer)
yosin_UTC9 2016/08/03 01:25:04 Since |nodeSet| is used only here, we have two opt
eae 2016/08/03 01:49:48 Oh, that's a good idea. Thanks for the suggestions
+ && !node->contains(endContainer)) {
if (LayoutObject* layoutObject = toElement(node)->layoutObject()) {
Vector<FloatQuad> elementQuads;
layoutObject->absoluteQuads(elementQuads);

Powered by Google App Engine
This is Rietveld 408576698