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

Re: Valid use of <embed> in HTML4

From: David Dorward <david@dorward.me.uk>
Date: Fri, 5 Feb 2010 15:08:09 +0000
Cc: Tatham Oddie <tatham@oddie.com.au>, 'Cory S' <veneno-games@hotmail.com>, www-validator@w3.org
Message-Id: <9EDF68BD-6634-4414-9C77-5FF96E5A55D2@dorward.me.uk>
To: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>

On 5 Feb 2010, at 14:59, Leif Halvard Silli wrote:

> David Dorward, Fri, 5 Feb 2010 14:39:00 +0000:
>> 
>> On 5 Feb 2010, at 14:31, Leif Halvard Silli wrote:
>>> 
>>> Your remark about '--' inside HTML comments in the parallel thread made 
>>> me realize that there is (usually) a simpler way:
>>> 
>>> 	<!-- -- -->
>>> 	<embed src="http://example.org/" ></embed>
>>> 	<!-- -- -->
>> 
>> Some browsers (Slightly older versions of Opera for example) 
> 
> Would have been cool to see ... Do you know how old? Version 1 or 2?

Not off the top of my head. If my memory is serving me correctly it would be somewhere around version 8.

I've just tested:

   <!-->
   Commented out
   <!-->
   
   <!-- -->
   Not commented out
   <!-- -->
   
   <!-- -- -->
   Commented out
   <!-- -- -->

in Firefox 3.6. 

Only the text "Not commented out" is displayed.

So your example would successfully hide the embed element from Firefox.

>> ... which just goes to show that writing deliberately bad HTML in 
>> order to hide other deliberately bad HTML from QA tools is A Bad Idea.
> 
> Well, one must always test in order to be sure that it works ...

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.

-- 
David Dorward
http://dorward.me.uk
Received on Friday, 5 February 2010 15:08:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:39 GMT