Re: Valid use of <embed> in HTML4

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 UTC