[Webkit-unassigned] [Bug 15256] Impossible to place an editable selection inside empty elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 8 08:02:11 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=15256





--- Comment #25 from Frederico Caldeira Knabben <fredck at fredck.com>  2010-09-08 08:02:10 PST ---
(In reply to comment #23)
> Could you call document.execCommand('bold', false, null)

Well, that's the way we have it in FCKeditor 1.0... we were just using the standard execCommand stuff. But, later we've found limitations in this approach. Let me give you more info.

The very first issue is being able to produce the same output with all browsers. For the bold command, you have some browsers producing <b>, while others use <strong>. Depending on the setting, you can even have <span style="font-weight: bold;">, or the even worst <span class="Apple-style-span" style="font-weight: bold;">.

Consider that we're talking just about the bold command, but almost all commands have different implementation among browsers.

The other important factor is that CKEditor is extremely flexible, when considering styles. One can decide how to exactly apply styles. For bold, for example, you can easily choose to output <b>, <strong>, <span style="font-weight: bold;">, <span class="myBold">, or any other tag you want.

So far, we were just talking about bold... but you must also consider custom styles, which doesn't have their execCommand equivalent.

It has been always my opinion: execCommand is one of the worst things one could have for styling. It's badly designed and limited. It's a pity to see it's making its space in the HTML5 standards. The future doesn't look better because of it.

---

> We also have applyStyle command internally, which allows you to apply arbitrary CSS style on the selected region.  It's used by bold, italic, etc... as well as for style preservation.  We could expose either if that'll benefit you and other web developers.

Is this command that flexible, so you can apply a style that outputs not only <span style="..."> tags, but also things like <span class="xyz">, <b dir="rtl">, <font face="ABC">, etc.? In that case, it would be just perfect to workaround the problem, even if still not a real solution for the root of the problem.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list