- From: Dave Raggett <dsr@w3.org>
- Date: Fri, 23 Feb 2007 11:11:18 +0000 (GMT)
On Thu, 22 Feb 2007, Andrew Fedoniouk wrote: > | On Wed, 21 Feb 2007, Andrew Fedoniouk wrote: > | > | > I agree that HTML DOM is not suitable for WYSIWYG editing. > | > | I beg to differ. It is true that an editing style sheet may be > | needed to avoid problems with delivery style sheets that use the > | display and visibility properties to hide content, or which use CSS > | positioning to layer things in complex ways. But apart from that, > | The HTML DOM is just fine as it is. > > So this means relaxation of requirements - strictly speaking > it will not be WYSIWYG anymore. If "editing style sheet may be > needed" then what you will see is not what you will get. The power of CSS kind of makes this inevitable for the general case as was nicely explained by Daniel Glazman in last year's XTech conference. You can't very well rely on wysiwyg when the style sheet has set display to none and visibility to hidden. When it comes to content management systems and supporting different roles for people in the website team, the use of an editing style sheet is beneficial as it focuses the editing task on the matter in hand -- producing copy -- since the layout job is someone else's responsibility. Special style sheets may also be needed to support certain kinds of templates. These style sheets are provided by the website. This is already commonplace, e.g. for blogging sites. > Let's take a look on example you've provided: "The enter key then > starts a new paragraph within that list item" So after enter you > will have: > Case #1: > <ul> > <li>First paragraph. > <p>Second paragraph.</p> > </li> > </ul> > > *or* Case #2: > > <ul> > <li> > <p>First paragraph.</p> > <p>Second paragraph.</p> > </li> > </ul> Yes, indeed. Two ways to deal with this are to either configure the stylesheet to make the two cases render identically, or for the editor to include rules that produce the 2nd version. This can be arranged via the notion of markup critics that look for particular patterns and suggest corrections. [Think of a crowd of people hovering over your shoulder as you type] > Beside of that , yes, "Manipulating the DOM is a > straightforward matter of tree walking algorithms.". You're right, I forgot to mention the expert system that directs the tree walking algorithms. Coming from an AI background, I tend to take the heuristic approach for granted. Thanks for the comment on contentEditable. I and doubtful just how useful the attribute would be in practice. I expect that instead most developers will use scripts to determine what can be edited and how. Such scripts will also be able to recognise and support microformats and other templates. Cheers, Dave Raggett <dsr at w3.org> http://www.w3.org/People/Raggett
Received on Friday, 23 February 2007 03:11:18 UTC