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 15157 - [Explainer]: Add an example testing an element for the right prototype
Summary: [Explainer]: Add an example testing an element for the right prototype
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14949
  Show dependency treegraph
 
Reported: 2011-12-12 23:07 UTC by Divya Manian
Modified: 2014-01-20 02:02 UTC (History)
1 user (show)

See Also:


Attachments

Description Divya Manian 2011-12-12 23:07:36 UTC
the sample code suggests:

if (!event.target.razzle) {…

However, when you have multiple revisions of an API, it is likely some api functions will be deprecated. This introduces a dependency on this api function all for just testing if an upgrade event has occurred. 

I think we might be better served if we have an 'upgraded' property or something like that? Or maybe completely different way of testing.
Comment 1 Dimitri Glazkov 2011-12-21 21:07:42 UTC
Routing to custom elements.
Comment 2 Dominic Cooney 2012-05-22 01:56:36 UTC
Probably the best way to do this test is:

if (!(y instanceof FancyButton)) {
  …

This seems pretty clean; it does not depend on the specifics of the FancyButton interface and it is clear that the "else" branch can depend on that interface.
Comment 3 Dominic Cooney 2013-08-29 20:55:31 UTC
I think that this is an Explainer bug; the example mentioned in Comment 1 is was in the Explainer.
Comment 4 Dominic Cooney 2014-01-20 02:02:49 UTC
This has been fixed. The specific 'razzle' example has been removed from the explainer, and there's commentary in there now about using :unresolved to determine whether an element has been upgraded.