----- Original Message ----- From: "Adrian Sutton" <[EMAIL PROTECTED]>
To: "Karl Dubost" <[EMAIL PROTECTED]>
Cc: <whatwg@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


Reply via email to