1. Fetch the attached testpage. 2. Start back-deleting from the end of the word "World" which is in blue color. 3. Notice how after deleting a few characters of this word, typing anything new would take on the existing word's style, i.e. newly typed content would be in blue color. 4. However continue deleting and start deleting the word "Hello". 5. Notice that even this time new content will appear in blue color, instead of taking on the existing content's style. Typing style should be reset or cleared when we move into a different node.
Created attachment 210551 [details] Testpage
Confirmed. WebKit doesn't match either TextEdit or Firefox in this case.
<rdar://problem/14916114>
Created attachment 210597 [details] Patch
Comment on attachment 210597 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=210597&action=review > Source/WebCore/editing/DeleteSelectionCommand.cpp:283 > // typing style at the start of the selection, nor is there a reason to > // compute the style at the start of the selection after deletion (see the > // early return in calculateTypingStyleAfterDelete). Perhaps you should update this comment as well. > LayoutTests/editing/deleting/maintain-style-after-delete-expected.txt:3 > +Dump of markup 1: This is rather mysterious title. > LayoutTests/editing/deleting/maintain-style-after-delete.html:19 > +Markup.dump(test); You can pass in a description as the second argument. e.g. "Deleting the blue text and typing O immediately after it. O should be blue below" > LayoutTests/editing/deleting/maintain-style-after-delete.html:24 > +Markup.dump(test); e.g. "Deleting O and the preceding space, then typing W. W should not be in blue below"
Created attachment 210712 [details] Patch
(In reply to comment #5) > (From update of attachment 210597 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=210597&action=review > Many thanks for the review rniwa! Have made the suggested changes and uploaded another patch. > > Source/WebCore/editing/DeleteSelectionCommand.cpp:283 > > // typing style at the start of the selection, nor is there a reason to > > // compute the style at the start of the selection after deletion (see the > > // early return in calculateTypingStyleAfterDelete). > > Perhaps you should update this comment as well. > > > LayoutTests/editing/deleting/maintain-style-after-delete-expected.txt:3 > > +Dump of markup 1: > > This is rather mysterious title. > > > LayoutTests/editing/deleting/maintain-style-after-delete.html:19 > > +Markup.dump(test); > > You can pass in a description as the second argument. e.g. "Deleting the blue text and typing O immediately after it. O should be blue below" > > > LayoutTests/editing/deleting/maintain-style-after-delete.html:24 > > +Markup.dump(test); > > e.g. "Deleting O and the preceding space, then typing W. W should not be in blue below"
Comment on attachment 210712 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=210712&action=review > LayoutTests/editing/deleting/maintain-style-after-delete-expected.txt:3 > +Deleting 'W' in blue color and then inserting 'O'. The following markup should show 'O' in blue color.: We shouldn't have . before :. > LayoutTests/editing/deleting/maintain-style-after-delete-expected.txt:9 > +Deleting the blue colored text and the preceding space and then inserting 'W'. 'W' should be not be in blue color in the following markup.: Ditto.
Created attachment 211177 [details] Patch for landing
Comment on attachment 211177 [details] Patch for landing Clearing flags on attachment: 211177 Committed r155425: <http://trac.webkit.org/changeset/155425>
All reviewed patches have been landed. Closing bug.
(In reply to comment #8) > (From update of attachment 210712 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=210712&action=review > > > LayoutTests/editing/deleting/maintain-style-after-delete-expected.txt:3 > > +Deleting 'W' in blue color and then inserting 'O'. The following markup should show 'O' in blue color.: > > We shouldn't have . before :. > > > LayoutTests/editing/deleting/maintain-style-after-delete-expected.txt:9 > > +Deleting the blue colored text and the preceding space and then inserting 'W'. 'W' should be not be in blue color in the following markup.: > > Ditto. Thanks for the review rniwa! I made the aforementioned changes and landed the patch.