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 26899 - [Shadow]: ShadowRoot.getElementById overrides DocumentFragment's getElementById
Summary: [Shadow]: ShadowRoot.getElementById overrides DocumentFragment's getElementById
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Hayato Ito
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14978
  Show dependency treegraph
 
Reported: 2014-09-24 21:22 UTC by Olli Pettay
Modified: 2014-09-25 03:16 UTC (History)
5 users (show)

See Also:


Attachments

Description Olli Pettay 2014-09-24 21:22:33 UTC
... but ShadowRoot.getElementById() returns HTMLElement, not Element like the
DocumentFragment's getElementbyId()

http://w3c.github.io/webcomponents/spec/shadow/#shadowroot-object
https://dom.spec.whatwg.org/#nonelementparentnode
Comment 1 Anne 2014-09-24 21:46:22 UTC
Why does it override it to begin with? I think that's a separate bug.
Comment 2 Olli Pettay 2014-09-24 21:49:39 UTC
perhaps I was unclear.
I think ShadowRoot shouldn't have getElementById, since it is there already
in DocumentFragment.
Comment 3 Adam Klein 2014-09-24 22:31:32 UTC
Looks like the mismatched return type is only a spec bug: Blink's ShadowRoot.idl lists the return time as Element.
Comment 4 Hayato Ito 2014-09-25 02:28:58 UTC
Nice catch.

It seems we can get rid of getElementById from ShadowRoot.
Let me update the spec.