- From: <bugzilla@jessica.w3.org>
- Date: Wed, 06 Mar 2013 12:07:44 +0000
- To: public-webapps-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=21204
Bug ID: 21204
Summary: [Custom]: "Custom tag wins" policy can be
inconsistent.
Classification: Unclassified
Product: WebAppsWG
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: Component Model
Assignee: dglazkov@chromium.org
Reporter: morrita@google.com
QA Contact: public-webapps-bugzilla@w3.org
Blocks: 14968
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?
--
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Wednesday, 6 March 2013 12:07:51 UTC