Created attachment 116412 [details] demo Justifying text via execCommand erroneously resets typing style. http:://crbug.com/103741
Actually, this behavior matches IE, FF, & Opera. So won't fix.
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>
(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.
You're right. It's a bad test case :(
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.