You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An object A is called a descendant of an object B, if either A is a child of B or A is a child of an object C that is a descendant of B.
An inclusive descendant is an object or one of its descendants.
Although the latter definition does not mention about shadow DOM boundaries, these definitions sound like that when a shadow containing a live range is deleted, the range is collapsed at the removed node position in the parent (or ancestor) tree. I wrote a test for this and now merged into the WPT tree that expects that Range is not collapsed to outside the shadow DOM tree. Then, all browsers now pass all tests.
So I think that the former definition should mention about that when the live range is in a subtree, removable of inclusive ancestor of the host does not affect to the range.
An inclusive descendant is an object or one of its descendants.
An object A is called a descendant of an object B, if either A is a child of B or A is a child of an object C that is a descendant of B.
My understanding of the spec is that since the above Node remove steps are for "inclusive descendants", they should be scoped to be within the tree scope and not cross shadow trees. I don't think the steps need to mention shadow host specific behavior.
@masayuki-nakano I think I agree with @dizhang168 that the current specification is okay for the scenario you wrote a test for. What exactly do you think is wrong?
(There's certainly issues when the selection crosses the boundary, but that's a separate topic.)
What is the issue with the DOM Standard?
https://dom.spec.whatwg.org/#concept-node-remove
"inclusive descendant" is defined as:
https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant
Although the latter definition does not mention about shadow DOM boundaries, these definitions sound like that when a shadow containing a live range is deleted, the range is collapsed at the removed node position in the parent (or ancestor) tree. I wrote a test for this and now merged into the WPT tree that expects that
Range
is not collapsed to outside the shadow DOM tree. Then, all browsers now pass all tests.So I think that the former definition should mention about that when the live range is in a subtree, removable of inclusive ancestor of the host does not affect to the range.
Cc: @sefeng211, @smaug----, @zcorpan
The text was updated successfully, but these errors were encountered: