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 26583 - [Custom]: Add the possibility to extend the custom element
Summary: [Custom]: Add the possibility to extend the custom element
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14968
  Show dependency treegraph
 
Reported: 2014-08-14 08:41 UTC by lohentertainment
Modified: 2015-07-06 08:17 UTC (History)
4 users (show)

See Also:


Attachments

Description lohentertainment 2014-08-14 08:41:54 UTC
Example:

var Modal = document.registerElement('x-modal', {
  prototype: Object.create(HTMLElement, {/* modal generic prototype */})
})
var WebcamModal = document.registerElement('x-webcam', {
  extends: 'x-modal',
  prototype: Object.create(Modal, {
    /* webcam modal specific prototype */
    show: {
        value: function() {
          Modal.prototype.show.call(this)
          // run webcam
        }
    }
  })
})

<x-modal></x-modal>
<x-modal is="webcam"></x-modal>

And will be cool if will be possible to have a non-dashed name of extend name (is="webcam" instead is="x-webcam").
Comment 1 Tab Atkins Jr. 2014-08-14 14:57:20 UTC
There is no "non-dashed version" of a name, because there's no common structure to the name that we can safely ignore.  The sole requirements it that a dash appears *somewhere* in the name, so it can occur between or around significant or insignificant parts, and there's no way to tell automatically what parts are insignificant.
Comment 2 Hayato Ito 2015-07-06 08:17:02 UTC
Moved to https://github.com/w3c/webcomponents/issues/201