W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2016

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

From: Ryosuke Niwa via GitHub <sysbot+gh@w3.org>
Date: Wed, 14 Dec 2016 06:46:35 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-266956573-1481697994-sysbot+gh@w3.org>
> 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

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:30:27 UTC