Re: View Source (was: SVG Feedback on HTML5 SVG Proposal)

On Mar 17, 2009, at 01:31 , Doug Schepers wrote:
> 1) Would the HTML (or other spec) *mandate* a "view source"  
> mechanism? It could be on right-click, or as a menu option, or  
> whatever; but as I understand it, the HTML spec steers well clear of  
> any such normative behavior on UAs... I personally don't see why we  
> couldn't make a conditional normative statement, such as, "For user  
> agents which expose markup source code to users (such as a "View  
> Source" menu option), the user agent must (should?) normalize the  
> DOM serialization to present a valid and well-formed document."  It  
> could go further and say, "For languages intended for use in XML  
> parsers, such as MathML, SVG, or XHTML, the serialization must be  
> valid for that language."  (Or something.)

You can't clean up the DOM and guarantee that scripts will run. They  
could depend on anything, there could be steganographic meaning in the  
white space (http://search.cpan.org/~dconway/Acme-Bleach-1.12/lib/Acme/Bleach.pm 
) or the author could be running a poorly crafted regex on innerHTML  
(more likely). It's quite possible that if you change the shape of the  
source you will break the rendering in some older browsers. It's  
certain that if you clean up the CSS, in many cases you will. You will  
also have to properly reproduce IE conditional comments and a million  
other things, and still you wouldn't be able to guarantee that it'll  
work.

More importantly, the reason why this is out of scope is because there  
is no need for interoperability here. The purpose of a specification  
is not to dictate to implementers what they should do, it's to enable  
the production of interoperable content.

-- 
Robin Berjon - http://berjon.com/
     Feel like hiring me? Go to http://robineko.com/

Received on Tuesday, 17 March 2009 11:11:15 UTC