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 15852 - [Shadow]: nodeName cannot be '#shadow-root'?
Summary: [Shadow]: nodeName cannot be '#shadow-root'?
Status: RESOLVED LATER
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14978
  Show dependency treegraph
 
Reported: 2012-02-02 05:53 UTC by Hayato Ito
Modified: 2012-02-16 23:31 UTC (History)
0 users

See Also:


Attachments

Description Hayato Ito 2012-02-02 05:53:18 UTC
The latest spec says:

"The nodeType attribute of a ShadowRoot instance must return DOCUMENT_FRAGMENT_NODE. Accordingly, the nodeName attribute of a ShadowRoot instance must return "#document-fragment"."


I agree that nodeType must return DOCUMENT_FRAGMENT once ShadowRoot inherits DocumentFragment.
But how about nodeName?
It seems natural for me that ShadowRoot has '#shadow-root' as nodeName instead of '#document-fragment' unless there is a strong reason to make ShadowRoot have '#document-fragment'.
Comment 1 Dimitri Glazkov 2012-02-02 17:11:07 UTC
(In reply to comment #0)
> The latest spec says:
> 
> "The nodeType attribute of a ShadowRoot instance must return
> DOCUMENT_FRAGMENT_NODE. Accordingly, the nodeName attribute of a ShadowRoot
> instance must return "#document-fragment"."
> 
> 
> I agree that nodeType must return DOCUMENT_FRAGMENT once ShadowRoot inherits
> DocumentFragment.
> But how about nodeName?
> It seems natural for me that ShadowRoot has '#shadow-root' as nodeName instead
> of '#document-fragment' unless there is a strong reason to make ShadowRoot have
> '#document-fragment'.

My initial reaction is that these are all obscure artifacts of the olden days, and as such, should be kept with as little change as possible. Introducing inconsistency between the nodeType and nodeName seems a bit unappealing for this reason. However, I am willing to keep an open mind if see real need for something like this.
Comment 2 Hayato Ito 2012-02-03 03:58:21 UTC
Thank you. I don't have strong opinion. So either is okay.
But in my opinion, it seems that most elements return its tagname as 'nodeName'. That's helpful for us to know each kinds of elements easily without any tweaks if we dump dom tree using their nodeName.

I am afraid that this is not a strong reason...:)

(In reply to comment #1)
> (In reply to comment #0)
> > The latest spec says:
> > 
> > "The nodeType attribute of a ShadowRoot instance must return
> > DOCUMENT_FRAGMENT_NODE. Accordingly, the nodeName attribute of a ShadowRoot
> > instance must return "#document-fragment"."
> > 
> > 
> > I agree that nodeType must return DOCUMENT_FRAGMENT once ShadowRoot inherits
> > DocumentFragment.
> > But how about nodeName?
> > It seems natural for me that ShadowRoot has '#shadow-root' as nodeName instead
> > of '#document-fragment' unless there is a strong reason to make ShadowRoot have
> > '#document-fragment'.
> 
> My initial reaction is that these are all obscure artifacts of the olden days,
> and as such, should be kept with as little change as possible. Introducing
> inconsistency between the nodeType and nodeName seems a bit unappealing for
> this reason. However, I am willing to keep an open mind if see real need for
> something like this.