Bug 73047 - Justifying text resets typing style
Summary: Justifying text resets typing style
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2011-11-23 13:31 PST by Ryosuke Niwa
Modified: 2019-05-02 16:20 PDT (History)
10 users (show)

See Also:


Attachments
demo (438 bytes, text/html)
2011-11-23 13:31 PST, Ryosuke Niwa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2011-11-23 13:31:59 PST
Created attachment 116412 [details]
demo

Justifying text via execCommand erroneously resets typing style.

http:://crbug.com/103741
Comment 1 Ryosuke Niwa 2011-11-23 13:36:42 PST
Actually, this behavior matches IE, FF, & Opera. So won't fix.
Comment 2 Vasiliy Baranov 2011-11-23 22:08:18 PST
May I ask how it was concluded that this behavior matches IE, FF, & Opera? I tried the original test from the Chromium bug in FF 6.0.1, FF 8.0, IE 6, and IE 8, and found that it works as expected in these browsers, whereas in Safari, Chromium, and WebKit nightly build it does not.

The test attached to this issue does not do any editing in FF and IE: you will see that if you remove the following text from the test:

    <b>hello</b><div style="text-align: left;"><b>world</b>
Comment 3 Vasiliy Baranov 2011-11-23 22:57:16 PST
(In reply to comment #2)
> The test attached to this issue does not do any editing in FF and IE

If it is not obvious, FF and IE do not support the "InsertText" command, that is why the test attached to this issue does not work in these browsers.

I spent some time trying to modify the test to insert text in cross-browser manner, but could not come up with a reliable solution.

So, at the moment, I can only reproduce this problem manually, e.g. using the test attached to the Chromium bug.
Comment 4 Ryosuke Niwa 2011-11-23 23:00:13 PST
You're right. It's a bad test case :(
Comment 5 Aryeh Gregor 2011-12-01 10:49:39 PST
Correct behavior here is that justify* should preserve typing style (overrides in the spec's terminology).  The spec currently does this, with the "Record current overrides" and "Restore states and values" steps here:

http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#justify-the-selection

It doesn't actually preserve overrides for insertParagraph right now, but that's a separate bug.