Bug 11022 - queryCommandState('underline') returns false if the selected text is also bold and italic
: queryCommandState('underline') returns false if the selected text is also bol...
Status: RESOLVED FIXED
: WebKit
HTML Editing
: 420+
: Macintosh Mac OS X 10.4
: P2 Normal
Assigned To:
:
: GoogleBug, InRadar, ReviewedForRadar
:
: 9638
  Show dependency treegraph
 
Reported: 2006-09-25 08:59 PST by
Modified: 2009-08-19 19:17 PST (History)


Attachments
demo (574 bytes, text/html)
2009-08-18 17:31 PST, Ryosuke Niwa
no flags Details
fixes the bug, two lines of change in EditorsCommand.cpp and adds a test (8.45 KB, patch)
2009-08-18 17:42 PST, Ryosuke Niwa
darin: review+
eric: commit‑queue-
Review Patch | Details | Formatted Diff | Diff
test case is fixed (one line change: 19@text-decoration-state.js) (8.48 KB, patch)
2009-08-19 17:31 PST, Ryosuke Niwa
darin: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2006-09-25 08:59:35 PST
* 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.
------- Comment #1 From 2006-09-25 09:01:25 PST -------
This issue is covered in <rdar://problem/4748375>
------- Comment #2 From 2006-10-31 15:54:52 PST -------
*** Bug 11023 has been marked as a duplicate of this bug. ***
------- Comment #3 From 2008-06-19 18:41:24 PST -------
Looks like it's fixed for bold and italic.  Still broken for underline, though.
------- Comment #4 From 2008-06-19 18:44:34 PST -------
> 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.
------- Comment #5 From 2009-02-17 16:16:52 PST -------
*** Bug 20089 has been marked as a duplicate of this bug. ***
------- Comment #6 From 2009-08-18 15:25:42 PST -------
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.
------- Comment #7 From 2009-08-18 17:31:17 PST -------
Created an attachment (id=35089) [details]
demo
------- Comment #8 From 2009-08-18 17:42:49 PST -------
Created an attachment (id=35091) [details]
fixes the bug, two lines of change in EditorsCommand.cpp and adds a test
------- Comment #9 From 2009-08-18 17:52:43 PST -------
(From update of attachment 35091 [details])
r=me
------- Comment #10 From 2009-08-18 17:55:00 PST -------
(From update of attachment 35091 [details])
(In reply to comment #9)
> (From update of attachment 35091 [details] [details])
> r=me

Thanks, Darin!
------- Comment #11 From 2009-08-18 18:08:12 PST -------
(From update of attachment 35091 [details])
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
------- Comment #12 From 2009-08-18 19:00:38 PST -------
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
------- Comment #13 From 2009-08-19 17:31:59 PST -------
Created an attachment (id=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 #14 From 2009-08-19 17:40:46 PST -------
(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.
------- Comment #15 From 2009-08-19 19:17:01 PST -------
(In reply to comment #14)
> (From update of attachment 35165 [details] [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.