W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2014

[Bug 27260] New: [Custom]: Need to define global/Realm handling for registerElement

From: <bugzilla@jessica.w3.org>
Date: Thu, 06 Nov 2014 17:18:44 +0000
To: public-webapps@w3.org
Message-ID: <bug-27260-2927@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27260

            Bug ID: 27260
           Summary: [Custom]: Need to define global/Realm handling for
                    registerElement
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Component Model
          Assignee: dglazkov@chromium.org
          Reporter: bzbarsky@mit.edu
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-webapps@w3.org
            Blocks: 14968

Created attachment 1535
  --> https://www.w3.org/Bugs/Public/attachment.cgi?id=1535&action=edit
Testcase

Consider this testcase:

  <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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Thursday, 6 November 2014 17:18:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:32 UTC