Bug 46382
Summary: | queryCommandState returns true even when in the mixed state | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | HTML Editing | Assignee: | Ryosuke Niwa <rniwa> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | darin, enrica, jparent, ojan, tonikitoo, tony |
Priority: | P2 | Keywords: | EasyFix |
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | 41989 | ||
Bug Blocks: | 45910 |
Ryosuke Niwa
queryCommandState shouldn't return true when the state is in the mixed tri state to be consistent with other browsers.
In particular,
bool Document::queryCommandState(const String& commandName)
{
return command(this, commandName).state() != FalseTriState;
}
should be
bool Document::queryCommandState(const String& commandName)
{
return command(this, commandName).state() == TrueTriState;
}
instead.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Darin Adler
Code change seems great as long as we are sure the other browsers do indeed work that way.
Ryosuke Niwa
Resolving bug naively is likely to produce a regression on Mac platforms if we don't fix https://bugs.webkit.org/show_bug.cgi?id=41989 first because we'll be inconsistently judging whether or not style is present in queryCommandState('bold') and execCommandState('bold', false, null).
Ryosuke Niwa
(In reply to comment #1)
> Code change seems great as long as we are sure the other browsers do indeed work that way.
Yes, only WebKit returns true for queryCommandState('bold') on "hello <b>world</b>" for example.
Ryosuke Niwa
http://trac.webkit.org/changeset/68423 fixed this bug as well.