W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Components/constructable DOM elements: mandatory tag registration?

From: Roland Steiner <rolandsteiner@google.com>
Date: Fri, 26 Aug 2011 17:16:51 +0900
Message-ID: <CACFPSpgNzNa4oDJJcC2Zsyhh3z0a9ees=wJeUMBBnx2MBB6NGA@mail.gmail.com>
To: WebApps WG <public-webapps@w3.org>
Cc: Dimitri Glazkov <dglazkov@google.com>, Dominic Cooney <dominicc@google.com>, Hajime Morita <morrita@google.com>
>From the discussion about "x-" prefixed names another question crossed my
mind: Suppose an author defines a component, but doesn't register a tag
name. AFAICT, at this point nothing prevents him from inserting such a new
element into the DOM. E.g.:

<div id="div"></div>

<script>
    function MyNewElement() {
        HTMLElement.call(this);
        // ...
    }

    var div = document.getElementById("div");
    div.appendChild(new MyNewElement());

    // ... Look Ma, no Element.register() call!

    var text = div.innerHTML;  // <- what does this return?
</script>


Cheers,

- Roland
Received on Friday, 26 August 2011 08:17:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:47 GMT