* SUMMARY Inserting a caret into styled text (bold, italic, underline) doesn't highlight the associated toolbar buttons (bold, italic, underline) * STEPS TO REPRODUCE 1. With TOT Webkit r-16541 , login to your gmail account 2. Create a new message (Rich Formatting) 3. Place caret in message body and and click "B", "I" and "U" . Notice the button are highlighted when pressed. 4. Type out "This is some text". Verify this text has all three styles applied. 5. With this caret at the end of this text, press the return to create a new line 6. Place the caret at the end of "This is some text" and press the return key. This will place the caret on a new line. 7. Click "B", "I", and "U" to remove this style then start to type some text 8. Now, click in the line above which contains styling on the text. Notice , the B, U, I buttons don't become highlighted. * RESULTS Style buttons on the toolbar should become highlighted if caret is inserted into style text but isn't.
This issue is covered in <rdar://problem/4748375>
*** Bug 11023 has been marked as a duplicate of this bug. ***
Looks like it's fixed for bold and italic. Still broken for underline, though.
> Looks like it's fixed for bold and italic. Still broken for underline, though. Underline seems to only have problems when the text has is also Bold and Italic.
*** Bug 20089 has been marked as a duplicate of this bug. ***
This bug is caused by us checking text-decoration property. We should be checking -webkit-text-decorations-in-effect. It's literally two-line change for underline and line-through. I'll submit a patch after writing some tests.
Created attachment 35089 [details] demo
Created attachment 35091 [details] fixes the bug, two lines of change in EditorsCommand.cpp and adds a test
Comment on attachment 35091 [details] fixes the bug, two lines of change in EditorsCommand.cpp and adds a test r=me
Comment on attachment 35091 [details] fixes the bug, two lines of change in EditorsCommand.cpp and adds a test (In reply to comment #9) > (From update of attachment 35091 [details]) > r=me Thanks, Darin!
Comment on attachment 35091 [details] fixes the bug, two lines of change in EditorsCommand.cpp and adds a test Rejecting patch 35091 from commit-queue. This patch will require manual commit. ['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--quiet', '--exit-after-n-failures=1'] failed with exit code 1
Testing 11102 test cases. editing/style/text-decoration-state.html -> failed Exiting early after 1 failures. 4342 tests run. 73.44s total testing time 4341 test cases (99%) succeeded 1 test case (<1%) had incorrect layout 1 test case (<1%) had stderr output
Created attachment 35165 [details] test case is fixed (one line change: 19@text-decoration-state.js) The original patch had a bug in the test case.
Comment on attachment 35165 [details] test case is fixed (one line change: 19@text-decoration-state.js) > + * editing/EditorCommand.cpp: > + (WebCore::stateStrikethrough): ditto > + (WebCore::stateUnderline): ditto This is a little mysterious. Usually "ditto" means "repeat the comment above". In this case the only comment above is the summary one describing the entire change. I'd suggest writing something other than "ditto" here in patches in the future. I would have written: (WebCore::stateStrikethrough): Use -webkit-test-decorations-in-effect instead of text-decoration. (WebCore::stateUnderline): Ditto.
(In reply to comment #14) > (From update of attachment 35165 [details]) > > + * editing/EditorCommand.cpp: > > + (WebCore::stateStrikethrough): ditto > > + (WebCore::stateUnderline): ditto > > This is a little mysterious. Usually "ditto" means "repeat the comment above". > In this case the only comment above is the summary one describing the entire > change. I'd suggest writing something other than "ditto" here in patches in the > future. > > I would have written: > > (WebCore::stateStrikethrough): Use -webkit-test-decorations-in-effect > instead of text-decoration. > (WebCore::stateUnderline): Ditto. Fixed and committed as http://trac.webkit.org/changeset/47541.