W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2007

[whatwg] Authoring Re: several messages about HTML5

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 21 Feb 2007 22:51:04 -0800
Message-ID: <001801c7564e$36f0b150$3501a8c0@TERRA>

----- Original Message ----- 
From: "Adrian Sutton" <adrian.sutton@ephox.com>
To: "Karl Dubost" <karl at w3.org>
Cc: <whatwg at lists.whatwg.org>
Sent: Wednesday, February 21, 2007 6:45 PM
Subject: Re: [whatwg] Authoring Re: several messages about HTML5


>> Did you notice in your development of an WYSIWYG HTML editor things
>> from the specification that
>> - were very difficult to implement?
....

> In terms of what is difficult to implement - lists and tables, but I'm
> not sure that's because of the HTML format. Lists and tables are just
> hard to get right in the first place (even Word's list support is
> regularly infuriating). In general I don't find that the back-end format
> matters that much in editing, you just need to parse it into a model
> that is suitable for an editor. I would hate to have to implement an
> editor based around a standard DOM model of the HTML document because
> the user doesn't view the document as a tree - they view it as a string
> of text. So the model used when editing needs to be more like a string
> of text than a tree.

....

I agree that HTML DOM is not suitable for WYSIWYG editing.
Especially in presence of CSS on top of it.
HTML/CSS rendering (direct) task is pretty much formalized currently.
But WYSIWYG editing is aiming to solve inverse problem - by 
having image on screen (or intention to have one) it needs to
build underlying DOM/CSS. And that task in presence of 
CSS has no unambiguous solution mathematically speaking - 
exactly same rendering (image) can be produced by various 
combinations of HTML/CSS markup/rules.

As for illustration to Adrian's comments:

This markup:

---start------
<ul>
   <li>one</li>
   <li>two</li>
</ul>
---end-------

will be rendered as 

---start------

* one
* two

---end-------

There are margins on top and bottom of the list.
Problem is that it is *very* hard to visualize what
part of what element is participating in formation
of the spacing between the lines.

For WYSIWYG editing purposes the DOM needs
to be flattened to something like this:
---start------
<ul-li>one</ul-li>
<ul-li>two</ul-li>
---end-------

Otherwise any WYSIWYG editor shall have 
1) sidebar with the text of the "8.3.1 Collapsing margins" [1]
   and around.
2) shall have so called "source view".

Last version of HTML that allow frustration-less 
WYSIWYG editing was pure v.3.2 I believe. 

Practically speaking: <richtextarea> or something
suitable for WYSIWYG on the web shall use 
some simplified markup (flat DOM).  
Markup like "bbcodes" or "wikicodes" is a good 
example of such practical formats.

Andrew Fedoniouk.
http://terrainformatica.com

[1] http://www.w3.org/TR/CSS21/box.html#collapsing-margins

 
Received on Wednesday, 21 February 2007 22:51:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:32 UTC