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 18710 - [Templates]: Trigger parse errors when template content does not match the template context.
Summary: [Templates]: Trigger parse errors when template content does not match the te...
Status: RESOLVED INVALID
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 15476
  Show dependency treegraph
 
Reported: 2012-08-27 18:59 UTC by Tony Ross [MSFT]
Modified: 2015-08-28 07:39 UTC (History)
3 users (show)

See Also:


Attachments

Description Tony Ross [MSFT] 2012-08-27 18:59:32 UTC
Functionally we want templates to be declared anywhere and be able to declare anything. That said, I suspect this behavior could confuse some authors who mistakenly put content in a template that would normally be inappropriate for the context in which the template has been declared (e.g. <table><template><div>).

To help authors identify these scenarios (which are likely mistakes), I suggest we consider including context-sensitive parse errors. Functionally everything would still parse the same, but we would trigger an error for unexpected content (like <table><template><div>). We would not trigger these new errors for templates declared within <head> regardless of content.
Comment 1 Hayato Ito 2015-07-06 07:16:19 UTC
Changing the category:
  From: WebAppsWG => Components Model
  To: WHATWG => HTML
Comment 2 Anne 2015-08-28 07:39:27 UTC
This should not have been moved without considering whether the issue was already resolved, which I think it is.