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 27978 - [Custom]: attachedCallback has no protocol for indicating that the custom tag is not applicable in this context
Summary: [Custom]: attachedCallback has no protocol for indicating that the custom tag...
Status: RESOLVED MOVED
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: 14968
  Show dependency treegraph
 
Reported: 2015-02-07 19:15 UTC by Randy Harmon
Modified: 2015-07-06 08:10 UTC (History)
3 users (show)

See Also:


Attachments

Description Randy Harmon 2015-02-07 19:15:55 UTC
I want to be able to call out cases where a custom tag has been used in a context where it's just not applicable.  <tr> outside a <table> is a traditional HTML example of this scenario, but we don't seem to have any allowances for that scenario in the custom elements spec.

"attachedCallback
Unless specified otherwise, this callback must be enqueued whenever custom element is inserted into a document and this document has a browsing context.
"

I was thinking that the component author should be able to raise an exception from the attachedCallback to indicate that it's a wrong context for creating the element.  Not that we can't console.log() to let component-users know about the problem, but so that the user-agent can have the indication that the element is invalid, perhaps triggering a visual treatment for the tag in developer tools.
Comment 1 Dominic Cooney 2015-02-09 02:31:58 UTC
The treatment of elements in developer tools aren't really specified in any W3C specifications as far as I know. For specific browsers you could file a bug, eg for Chrome at crbug.com/new .

I could be wrong, but I think in Chrome if attachedCallback throws an exception it will be logged to the console in Developer Tools. If not, file a bug at crbug!
Comment 2 Hayato Ito 2015-07-06 08:10:42 UTC
Moved to https://github.com/w3c/webcomponents/issues/151