RESOLVED FIXED 48479
queryCommandValue should fall back to queryCommandState
https://bugs.webkit.org/show_bug.cgi?id=48479
Summary queryCommandValue should fall back to queryCommandState
Ryosuke Niwa
Reported 2010-10-27 15:53:57 PDT
queryCommandValue should return 'true' or 'false' when the command doesn't return any string and queryCommandState is supported. This is consistent with IE and will greatly improve WebKit's score on http://www.browserscope.org/richtext2/test
Attachments
fixes the bug (5.47 KB, patch)
2010-10-27 16:54 PDT, Ryosuke Niwa
darin: review+
Ryosuke Niwa
Comment 1 2010-10-27 16:54:11 PDT
Created attachment 72113 [details] fixes the bug
Darin Adler
Comment 2 2010-10-27 17:19:29 PDT
Comment on attachment 72113 [details] fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=72113&action=review I’m surprised that this functions works that way, but change looks OK. Do any of the test cases cover the mapping of mixed state to "false"? > LayoutTests/editing/execCommand/script-tests/query-text-alignment.js:7 > +function isEquivalentBoolean(string, bool) { The function name here isn't all that clear.
Ryosuke Niwa
Comment 3 2010-10-27 17:59:36 PDT
(In reply to comment #2) > I’m surprised that this functions works that way, but change looks OK. Do any of the test cases cover the mapping of mixed state to "false"? I'm pretty certain that query-command-state.js do test that. > > LayoutTests/editing/execCommand/script-tests/query-text-alignment.js:7 > > +function isEquivalentBoolean(string, bool) { > > The function name here isn't all that clear. I don't like that name either but couldn't come up with a better name. isEquivalentBooleanValue? isBooleanValueEqualTo? isBooleanEqualTo?
Ryosuke Niwa
Comment 4 2010-10-28 14:20:50 PDT
(In reply to comment #3) > > > LayoutTests/editing/execCommand/script-tests/query-text-alignment.js:7 > > > +function isEquivalentBoolean(string, bool) { > > > > The function name here isn't all that clear. > > I don't like that name either but couldn't come up with a better name. isEquivalentBooleanValue? isBooleanValueEqualTo? isBooleanEqualTo? Tony pointed out that we can just do centerValue != center.toString() and get rid of the function. I'll land after making this change.
Ryosuke Niwa
Comment 5 2010-10-28 14:39:00 PDT
Aryeh Gregor
Comment 6 2011-09-16 11:41:21 PDT
For anyone interested, this is currently being discussed: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-September/033235.html
Note You need to log in before you can comment on or make changes to this bug.