Re: [csswg-drafts] HTMLElement.prototype.offsetParent leaks a node inside a shadow tree

> What's so wrong with exposing an element within open shadow root? 
That element is also discoverable with `root.querySelector()`.

The whole point of shadow DOM is to encapsulate nodes within a shadow 
tree accidentally or unintentionally. I’d argue that this is precisely
 one of those cases where a component can accidentally expose a node 
inside a shadow tree.

Let me put this way. If we didn’t care about this encapsulation, why 
do we even need to retarget `event.target` or `event.relatedTarget`?  
You could have easily argued that it’s not that bad to expose nodes 
inside a shadow tree in those cases too because you’re concerned about
 where the event originates from.  But we didn’t because that’d break 
encapsulation.

-- 
GitHub Notification of comment by rniwa
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/159#issuecomment-266956573 
using your GitHub account

Received on Wednesday, 14 December 2016 06:46:44 UTC