W3C home > Mailing lists > Public > www-validator@w3.org > January 2016

Re: Relax validation for the template tag

From: Michael[tm] Smith <mike@w3.org>
Date: Wed, 20 Jan 2016 20:33:42 +0900
To: Dane Foster <studdugie@gmail.com>
Cc: www-validator@w3.org
Message-ID: <20160120113342.GL20724@sideshowbarker.net>
Dane Foster <studdugie@gmail.com>, 2016-01-19 12:39 -0500:
> Archived-At: <http://www.w3.org/mid/CA+WxinLZhzXmf-kXUqCiBuMVDaLS_ZDdyAxMMnBocvtCa6cYog@mail.gmail.com>
> ...
> HTML5 introduced the <template> tag which I make extensive use of as a web
> app developer. Unfortunately, the validator has no special handling for
> <template> and therefore complains about violations perpetrated by its
> children. For example, a template may have an <img> descendant w/ an empty
> src attribute. But the src attribute will be set when the template is
> instantiated by JavaScript. So though technically speaking it's correct to
> say that the <img> violates the spec, from a functional perspective it
> doesn't because when instantiated and made live in the DOM it has the src
> attribute set.
> So the problem I would like to see addressed is this. The fact that the
> validator has no special handling for <template> means that validation for
> me is tedious and error prone because of the additional cognitive load
> expended to separate the signal (i.e., the legitimate issues w/ a page)
> from the noise (i.e., all the errors and warnings from <template> content).

Understood but the validator is actually conforming to the current HTML
spec requirements for template and its subtree, so changing the behavior
actually means changing the HTML spec. Which is possible and probably
should happen. But since you have a real-world problem case here to speak
from, I would much appreciate it you yourself could raise the spec issue;


I get Cc’ed on all issues there, so I can weigh in once you raise it.

> My recommended solution is that the validator only checks <template>
> content for well-formedness violations and nothing else.

That’s one way a possible solution could be expressed but more than a proposed
solution what we’d like to have is just a good description of what problems
the current situation causes for you (which I think can start from just a
copy/paste of what you wrote in the 3rd paragraph of your message above).


Michael[tm] Smith https://people.w3.org/mike

Received on Wednesday, 20 January 2016 11:34:07 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:14 UTC