Chromium Code Reviews
DescriptionMake Range::createAdjustedToTreeScope() to handle the shadow root at end of document tree correctly.
This patch makes |Range::createAdjustedToTreeScope()| to handle the shadow root
at end of document tree correctly.
Before this patch |createAdjustedToTreeScope()| to return the |Range| object
in shadow tree rather than document tree, since it attempts to check tree
scope of null-Node which is computed from collapsed |Range| object of the
position after shadow root.
This patch uses tree scope of anchor node of specified position instead of
first node in range, which is |nullptr| if there is no node after specified
position, e.g. |BeforeChildren| of the last node without child nodes,
|AfterAnchor| or |AfterChildren| of the last node. The tree scope of position
can be determined by anchor node rather than first node in the range because
tree scope of child nodes of anchor node is same as anchor node, tree scope of
before and after anchor node is also same as anchor node since parent of anchor
node and anchor node are in same tree scope.
BUG=666246
TEST=run_webkit_unit_tests --gtest_filter=RangeTest.createAdjustedToTreeScopeWithPositionInShadowTree
Review-Url: https://codereview.chromium.org/2519323002
Cr-Commit-Position: refs/heads/master@{#433851}
(cherry picked from commit 794ce12c31a9d697aaca28e24078c5d9f6edfe59)
Committed: https://chromium.googlesource.com/chromium/src/+/e4df1d54a0ca2d2274b61db80144f6230c56c0b7
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
||||||||||||||||||||||||||||