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

Hi, Raman-

T.V Raman wrote (on 3/16/09 12:58 PM):
> And this is why in gneral, it would be a good idea for
> show-source to perhaps show a cleaned-up serialization, rather
> than the original tag-soup that was authored.

I think everyone is on board with this idea, not just for SVG and 
MathML, but even for HTML... if someone out there has a good rationale 
against it, I'd be curious to know what that is.  Note that there are a 
couple of open questions:

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.)

2) When it serializes it, what is the format for HTML?  Is it XHTML, or 
HTML5?  Looking to the MIME Type might not be appropriate, since "XHTML" 
(valid or not) doesn't render in IE, so folks serve it as text/html; 
going by the DOCTYPE might be a better indicator of author intent.  Or 
maybe some HTML5-specific attribute could be placed in the root.

With this normalized form, I wouldn't be surprised to find authors 
copying their own viewed source, as a quick-and-dirty way to clean up 
any errors in their own source code, to make sure it validates, works 
well with mashups and authoring tools, etc.

Regards-
-Doug Schepers
W3C Team Contact, SVG and WebApps WGs

Received on Tuesday, 17 March 2009 00:31:30 UTC