W3C home > Mailing lists > Public > www-svg@w3.org > March 2009

Re: View Source

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 17 Mar 2009 03:38:35 -0700
Cc: Doug Schepers <schepers@w3.org>, public-html@w3.org, www-svg@w3.org
Message-id: <6015B0C5-6053-4CD7-B881-559EF8219D8D@apple.com>
To: Henri Sivonen <hsivonen@iki.fi>

Arbitrarily replying to Henri's post here, although my remarks apply  
to the whole thread:

View Source is a UI feature and largely a tool for Web developers and  
expert users. Seeing a cleaned up, reserialized DOM is also a cool  
idea for a developer/expert-user feature. I believe Firebug and the  
WebKit Web Inspector provide something similar, though primarily meant  
to be used as an outline view, not flat text. While it may be fun to  
design the details, I think details of UI features like this are out  
of scope for the HTML5 spec and off topic for this list.

Regards,
Maciej

On Mar 17, 2009, at 1:18 AM, Henri Sivonen wrote:

> On Mar 17, 2009, at 05:59, Doug Schepers wrote:
>
>> Karl Dubost wrote (on 3/16/09 11:32 PM):
>>>
>>> The real issue is how to make it "canonical". There are many  
>>> options and
>>> we do not have yet decided of the right options.
>>>
>>> Things like
>>> <center>foo</center>
>>> Does it become
>>> <span style="text-align:center;">foo</span>
>>> or foo
>>> or <span class="canon001">foo</span> (with external stylesheet)
>>
>> I would vote for it becoming
>> <center>foo</center>
>>
>> Who knows what's hanging on that element... maybe some CSS scope  
>> selector?
>
> I agree it should stay as <center>foo</center>.
>
>> There's things like adding quote marks, closing tags, and clearing  
>> up validity errors...
>
> But <center>foo</center> is a validity error. I think it follows  
> that adding quote marks and closing tags should be in but clearing  
> up validity errors shouldn't. In general, I think the clean-up  
> should reserialize the DOM output of the HTML5 parser but shouldn't  
> mutate the DOM before reserializing.
>
> I think a toggle between real source and reserialized source on the  
> View Source window, as Jonas suggested, would make sense. However, I  
> think making line numbering match between the real source and the  
> reserialized source would be complicated. I'd prefer to compute the  
> offset in <script> and <style> line numbers instead so that tools  
> like Firebug could adjust their JS and CSS line number offsets with  
> the reserialized source toggle if they so chose. Then the  
> reserializer could take line numbering-changing liberties in its  
> pretty-printing.
>
> P.S. The pretty-printing probably shouldn't add text nodes, since  
> those could break scripts, so it should look like this:
> <div
>   ><div
>       >foo</div
>   ></div
> >
> which is something authors aren't used to and isn't quite  
> 'pretty'. :-(
>
> A more traditional pretty-printing approach risks breaking scripts.
>
> -- 
> Henri Sivonen
> hsivonen@iki.fi
> http://hsivonen.iki.fi/
>
>
>
Received on Tuesday, 17 March 2009 10:39:18 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:41 GMT