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

Unified Diff: Source/core/editing/htmlediting.cpp

Issue 1149373003: Remove Range.compareNode() as it is not in the spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: layout tests changed Created 5 years, 6 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: Source/core/editing/htmlediting.cpp
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp
index 5931c1f11ca9c7c35860319ffbe13b96b61f26ee..5db5d916645babd99f1ccf326ea7cf77d518ae77 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -1102,8 +1102,9 @@ VisiblePosition visiblePositionForIndex(int index, ContainerNode* scope)
// Call this function to determine whether a node is visibly fit inside selectedRange
bool isNodeVisiblyContainedWithin(Node& node, const Range& selectedRange)
{
- // If the node is inside the range, then it surely is contained within
- if (selectedRange.compareNode(&node, IGNORE_EXCEPTION) == Range::NODE_INSIDE)
+ bool nodeFullySelected = Range::compareBoundaryPoints(node.parentNode(), node.nodeIndex(), selectedRange.startContainer(), selectedRange.startOffset(), IGNORE_EXCEPTION) >= 0
philipj_slow 2015/06/08 10:12:27 Could this be written as a static helper and used
deepak.s 2015/06/08 11:44:02 Done.
+ && Range::compareBoundaryPoints(node.parentNode(), node.nodeIndex() + 1, selectedRange.endContainer(), selectedRange.endOffset(), IGNORE_EXCEPTION) <= 0;
+ if (nodeFullySelected)
return true;
bool startIsVisuallySame = visiblePositionBeforeNode(node) == VisiblePosition(selectedRange.startPosition());

Powered by Google App Engine
This is Rietveld 408576698