[Bug 22080] [Shadow]: Node should expose there scope so that shared state can be scoped to components.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=22080

--- Comment #4 from Rafael Weinstein <rafaelw@chromium.org> ---
I can't tell if we're talking at cross purposes or not. I'm probably just being
dense.

The point I'm trying to make is that, for the sake of encapsulation, I think it
makes the most sense to think about being directly descended from a ShadowRoot
like being in a "little" document.

The key question that the node needs to answer is: "which document-like thing
am I inside, if any". If I'm not inside any, there's nothing to do, if I'm
inside one, I may go looking for local (encapsulated) shared or configuration
data *at* that document-like thing (the root of my encapsulated context).

This seems only natural to me. Maybe I'm suggesting that we need a need
Interface which implemented getElementById and both Document and ShadowRoot
implement that interface. node.treeScope would then return that interface if
the node had one.

To answer the questions above:

What does elem.treeScope return when...
...elem is not in the tree? (null)
...elem is in light DOM? (document)
...elem is in template content? (null)
...elem is in shadow DOM? (Shadow Root)
...elem is in a document fragment? (null)

The point is that ShadowRoots essentially become *local* documents. I claim
this is inline with the web components mantra of enabling local thinking.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 23 May 2013 23:17:02 UTC