Chromium Code Reviews
DescriptionShadowRoot's getSelection().getRangeAt(0) returns an incorrect Range object
DOMSelection::getRangeAt() uses different calculation from what we do in
other methods such as DOMSelection::anchorNode(), and it always returns
parentOrShadowHostNode(), which is incorrect.
This patch makes DOMSelection::getRangeAt() to use the same logic as
DOMSelection::anchorNode() etc. if the selection is within a shadow
tree.
We keep existing code if the selection is not within a shadow tree
because it has a special case to return m_logicalSelection so that
we can return the range set by scripts without it being canonicalized.
BUG=380690
TEST=LayoutTests/editing/shadow/getRangeAt-end-of-text-node.html
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=187976
Patch Set 1 #Patch Set 2 : #
Total comments: 10
Patch Set 3 : #
Total comments: 2
Patch Set 4 : Removed an excessive ASSERT #Patch Set 5 : Fix test failures #
Total comments: 3
Messages
Total messages: 18 (7 generated)
|
||||||||||||||||||||||||||||