W3C home > Mailing lists > Public > www-validator@w3.org > February 2010

Re: Valid use of <embed> in HTML4

From: Michael A. Peters <mpeters@mac.com>
Date: Fri, 05 Feb 2010 11:44:28 -0800
Message-id: <4B6C751C.1030201@mac.com>
To: Shane McCarron <shane@aptest.com>
Cc: David Dorward <david@dorward.me.uk>, Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>, Tatham Oddie <tatham@oddie.com.au>, 'Cory S' <veneno-games@hotmail.com>, www-validator@w3.org
Shane McCarron wrote:
> David Dorward wrote:
>> Good luck with testing in every version of every browser out there.
>> Write code to the standard. Test common browsers to make sure that 
>> their bugs don't break the site. Don't give browsers you aren't 
>> testing something that *shouldn't* work.
> Amen brother!

I looked at that solution and it looked to me like it exploited a bug in 
browsers, the embed tag should not have been rendered because it is in a 
cdata block.

If you are going to use a non standard tag and still want validating 
content, better options exist. In order of my preference:

1) In this case, declare an html 5 doctype. It's not official yet, but 
I'm moving to it already, currently using <div> wrappers for the html5 
layout tags (IE:
<div class="section"><section><p>content</p></section></div>

That way, it renders how I want, doesn't depend upon html 5 
capabilities, html 5 validates, and provides html 5 semantic hints for 
clients that make use of them (are there any ??)

2) Write a custom DTD that supports your tag

3) Use JavaScript to insert your tag upon on pageload (not ideal but 
better than an ugly hackish looking thing that involves script node and 
cdata block)

Note that using a script node like that may invoke some of the various 
client side XSS filters. To get legitimate stuff past those filters, it 
is best to be as straight forward as you can and not write something 
that looks like it is trying to do something funny.
Received on Friday, 5 February 2010 19:45:23 UTC

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