- From: Maciej Stachowiak <mjs@apple.com>
- Date: Tue, 17 Mar 2009 03:38:35 -0700
- To: Henri Sivonen <hsivonen@iki.fi>
- Cc: Doug Schepers <schepers@w3.org>, public-html@w3.org, www-svg@w3.org
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:20 UTC