[webcomponents] [Shadow]: Have a common interface between Document and ShadowRoot (bugzilla: 28493) (#91)

Title: [Shadow]: Have a common interface between Document and ShadowRoot (bugzilla: 28493)

Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28493

----
comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28493#c0
*Hayato Ito* wrote on 2015-04-15 06:37:12 +0000.

# This is separated from https://www.w3.org/Bugs/Public/show_bug.cgi?id=27829#c2


Instead of defining these in Shadow Root as well as in Document, I've started to feel that it'd be better that we have the common interface between Document and Shadow Root.


e.g.

interface NodeTreeRoot {
  Element? elementFromPoint(double x, double y);
  sequence<Element> elementsFromPoint(double x, double y);
  CaretPosition? caretPositionFromPoint(double x, double y);
  Selection? getSelection ();
  readonly    attribute Element?       activeElement;
  readonly    attribute StyleSheetList styleSheets;
};

Document implements NodeTreeRoot;
ShadowRoot implements NodeTreeRoot;

----

comment: 1
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28493#c1
*Anne* wrote on 2015-04-15 08:22:32 +0000.

Perhaps something along the lines of LayoutRoot?

----

comment: 2
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28493#c2
*Hayato Ito* wrote on 2015-04-15 09:27:47 +0000.

Thank you.

BTW, in Blink, we use a term of *TreeScope* for this purpose, at least in C++.
Both Document and ShadowRoot implements TreeScope.

(In reply to Anne from comment #1)
> Perhaps something along the lines of LayoutRoot?

So the candidates are:

- NodeTreeRoot
- LayoutRoot
- TreeScope

Any other better idea?

----

comment: 3
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28493#c3
*Anne* wrote on 2015-04-15 09:32:58 +0000.

TreeScope and NodeTreeRoot both have the problem that their terminology also applies to Element and DocumentFragment.

What's special about ShadowRoot and Document is that they are layout/CSS/stylesheet boundaries.

----

comment: 4
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28493#c4
*Hayato Ito* wrote on 2015-04-15 11:29:25 +0000.

Thank you for the explanation. I understand. Only Document and ShadowRoot contribute to Layout Tree. That's true!

+1 for LayoutRoot.

----

comment: 5
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28493#c5
*Tab Atkins Jr.* wrote on 2015-04-15 16:44:38 +0000.

I used the name "TreeScope" in <http://tabatkins.github.io/specs/construct-stylesheets/#adding-stylesheets>.

But Anne's comments make some sense.  I'm fine with LayoutRoot.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/91

Received on Monday, 25 May 2015 08:51:27 UTC