Open smaug---- opened 5 years ago
FWIW in Chromium it doesn't seem to include shadow DOM. But that may be an oversight?
cc @atotic
Hmmm, that's a good question. I can't think of why shadow DOM shouldn't be included. I think it makes sense only if the shadow DOM has a mode
of open
though. @smaug---- @atotic @tabatkins any thoughts?
Why only open shadow trees? That doesn't make much sense to me. We should probably either use the flat tree depth, or the depth using "either parentNode
or host
if I'm a shadow root" (not sure the spec concept for that).
We should specify how to calculate depth with Shadow DOM. Would replacing
Let p be the parent-traversal path from node to a root Element of this element’s DOM tree.
with
Let p be the parent-traversal path from node to a root Element of this element’s flattened DOM tree.
work?
Let p be the parent-traversal path from node to a root Element of this element’s flattened DOM tree.
This looks ok to me. Actually, Firefox uses this way (I.e. calculates the depth by traversing the element’s flattened DOM tree) right now.
'parent-traversal path' isn't defined.
https://drafts.csswg.org/resize-observer/#calculate-depth-for-node-h doesn't explain what parent-traversal path means. Does it include Shadow DOM? In which way? Is ShadowRoot included?