[Webkit-unassigned] [Bug 7360] Typing style isn't bold in a bold context

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 18 14:27:08 PDT 2011


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


Aryeh Gregor <ayg at aryeh.name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ayg at aryeh.name




--- Comment #14 from Aryeh Gregor <ayg at aryeh.name>  2011-08-18 14:27:08 PST ---
(In reply to comment #10)
> My solution to this problem is where a bolding region (or styling region in general) would cover an entire paragraph (actually any Block element), the style is applied to the block element itself, instead of creating a styling span within it. This way, when all text in a block is deleted (and any empty styling spans removed), when the cursor moves away and back again, the style that was applied to the block will still apply to the text.

This is not a good idea.  Gecko does something like this, and it causes problems:

1) It doesn't work at all if styleWithCSS is false.  You can't use CSS for styling in that case: it would break non-CSS UAs, like some mail clients.  (Or so I've been told.)

2) If you do it only when styleWithCSS is true, it will produce markup that has different effects in some cases.  For instance, <p style="text-decoration:underline"><font color=red>foo</font></p> has a different underline color than <p style="color:red; text-decoration:underline">foo</p>.  This is bad, because styleWithCSS vs. not should only affect the markup produced, not the visual effect.

3) It breaks hiliteColor, because background-color does something different on block vs. inline elements.  <p style="background-color:teal">foo</p> is different from <p><span style="background-color:teal">foo</span></p>.

4) It makes everything more complicated.  You'll have to add lots of different code paths everywhere to properly handle the two different types of style.

Instead, I would suggest that if the entire contents of the block are deleted, the styling tag should just be left.  So instead of <p><b>foo</b></p> -> <p><br></p> with a typing style set, it should become <p><b><br></b></p> with no typing style.

This bug also affects the editing spec.  I filed a bug against that:

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13831

I plan to specify the solution that I just outlined, if no one has any objections to it.

-- 
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