This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28493 - [Shadow]: Have a common interface between Document and ShadowRoot
Summary: [Shadow]: Have a common interface between Document and ShadowRoot
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Hayato Ito
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 28552
  Show dependency treegraph
 
Reported: 2015-04-15 06:37 UTC by Hayato Ito
Modified: 2015-05-27 03:04 UTC (History)
4 users (show)

See Also:


Attachments

Description Hayato Ito 2015-04-15 06:37:12 UTC
# 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 Anne 2015-04-15 08:22:32 UTC
Perhaps something along the lines of LayoutRoot?
Comment 2 Hayato Ito 2015-04-15 09:27:47 UTC
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 Anne 2015-04-15 09:32:58 UTC
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 Hayato Ito 2015-04-15 11:29:25 UTC
Thank you for the explanation. I understand. Only Document and ShadowRoot contribute to Layout Tree. That's true!

+1 for LayoutRoot.
Comment 5 Tab Atkins Jr. 2015-04-15 16:44:38 UTC
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.
Comment 6 Hayato Ito 2015-05-27 03:04:24 UTC
Moved to https://github.com/w3c/webcomponents/issues/91