W3C home > Mailing lists > Public > public-webapps-bugzilla@w3.org > August 2012

[Bug 18596] New: [Custom]: Use a "has a" relationship instead of "is a" for custom types

From: <bugzilla@jessica.w3.org>
Date: Thu, 16 Aug 2012 16:37:32 +0000
To: public-webapps-bugzilla@w3.org
Message-ID: <bug-18596-2532@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18596

           Summary: [Custom]: Use a "has a" relationship instead of "is a"
                    for custom types
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Component Model
        AssignedTo: dglazkov@chromium.org
        ReportedBy: tross@microsoft.com
         QAContact: public-webapps-bugzilla@w3.org


Perhaps this has been discussed before, but I think we could simplify custom
elements significantly by creating a 'custom' property (or some similar name)
on HTMLElement. This property would hold the instance of the created custom
element type (and return null until the custom type was bound).

E.g. instead of:

    elm.myCustomMethod()

You get:

    elm.custom.myCustomMethod()

This has a number of effects:

1. The concept of "upgrading" an element to a custom element no longer requires
mutating the DOM tree or the prototype chain. 

2. Makes it obvious whether or not a custom type has been bound (just check if
elm.custom is truthy).

3. Eliminates the risk of custom APIs masking future, standardized DOM APIs.

4. Clearly indicates to the consumer of a component which APIs are custom vs.
native.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Thursday, 16 August 2012 16:37:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 16 August 2012 16:37:33 GMT