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 21204 - [Custom]: "Custom tag wins" policy can be inconsistent.
Summary: [Custom]: "Custom tag wins" policy can be inconsistent.
Status: RESOLVED INVALID
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: 14968
  Show dependency treegraph
 
Reported: 2013-03-06 12:07 UTC by Morrita Hajime
Modified: 2013-03-07 01:34 UTC (History)
0 users

See Also:


Attachments

Description Morrita Hajime 2013-03-06 12:07:44 UTC
Section4: "If both types of custom element names are provided at the time of element's instantiation, the custom tag must win over the type extension."

Thinking about createElement() behavior:

Given this being defined:
> var FooElement = document.register(
>   "x-foo", 
>   { prototype: Object.create(HTMLDivElement.prototype) });

Question 1: What kind of element is created when calling this?

> var foo = document.createElement("div", "x-foo");

- 1a: <x-foo> of FooElement 
- 1b: <div is="x-foo"> of FooElement

My reading (of Section 4) is 1b. This is fine, but...

Given an additional definition:

> var BarElement = document.register(
>   "x-bar", { prototype: Object.create(FooElement.prototype) });

Question 2: What kind of element is created when calling this?

> var bar = document.createElement("x-foo", "x-bar");

- 2a: <x-bar> of BarElement
- 2b: <x-foo is="x-bar"> of BarElement

My reading is 2b. But this contradicts the statement
"the custom tag must win over the type extension".
It could be 2a by taking the statement.
In such case, the behavior is inconsistent to IMO.

Also, with same definitions..

Question 3: What kind of element is created when parsing this?

someDiv.innerHTML = "<x-foo is='x-bar'></x-foo>";

- 3a: <x-foo is='x-bar'> of BarElement
- 3b: <x-foo is="x-bar"> of FooElement

I'm not sure which is correct.
3a seems natural. but it also contradicts "custom tag wins" rule.
3b matches the rule. But it is different from what createElement() is doing.

My feeling is that we can just drop "custom tag wins" rule.
Does this make sense? Or I misunderstand the spec?
Comment 1 Morrita Hajime 2013-03-07 01:34:55 UTC
Looks like I was confused. Closing.