You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Custom]: Need to define global/Realm handling for registerElement (bugzilla: 27260) #185
<iframe></iframe>
<script>
var f = document.registerElement.call(frames[0].document, "x-foo");
</script>
Per the spec, this should "let PROTOTYPE be the result of invoking Object.create with HTMLElement's interface prototype object as only argument". But it doesn't say which "HTMLElement's interface prototype object" should be used.
Then the spec says to run the "custom element constructor generation algorithm", but this algorithm assumes an ambient global, which the spec doesn't define.
In practice, the Chrome and Firefox implementations differ, as the attached testcase shows. The output in Chrome:
ctor instanceof iframe Function: false
ctor instanceof parent Function: true
proto comes from iframe: false
proto comes from parent: true
The output in Firefox:
ctor instanceof iframe Function: true
ctor instanceof parent Function: false
proto comes from iframe: true
proto comes from parent: false
I believe the Firefox behavior is more correct here, by the way, since we're supposed to be using the registry of the iframe document, so should use its prototypes and constructors.
Oh, and also, the "definition construction algorithm" is making assumptions about which global's prototypes or interfaces are supposed to be used. This part is also not interoperable in Chrome and Firefox: Firefox seems to require that the passed-in proto come from the same global as the document involved, as you can see in the testcase.
Activity
rniwa commentedon Mar 1, 2016
Also see the issue #366 which replaces
registerElementwithdefineElement.Large custom element spec rewrite to implement some F2F decisions
Large custom element spec rewrite to implement some F2F decisions
Large custom element spec rewrite to implement some F2F decisions
Large custom element spec rewrite to implement some F2F decisions
Large custom element spec rewrite to implement some F2F decisions