Bug 99375 - Add force parameter to DOMTokenList.toggle
Summary: Add force parameter to DOMTokenList.toggle
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pablo Flouret
Keywords: WebExposed
Depends on:
Reported: 2012-10-15 15:47 PDT by Pablo Flouret
Modified: 2012-10-15 20:57 PDT (History)
5 users (show)

See Also:

Patch (8.47 KB, patch)
2012-10-15 16:08 PDT, Pablo Flouret
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo Flouret 2012-10-15 15:47:40 PDT

The optional boolean force parameter, if present, basically makes toggle always add or remove a class.
Comment 1 Pablo Flouret 2012-10-15 16:08:21 PDT
Created attachment 168797 [details]
Comment 2 Darin Adler 2012-10-15 20:39:45 PDT
Comment on attachment 168797 [details]

Code change looks fine. Test cases are not nearly extensive enough. We should do the toggle version of all the add and remove tests, plus we need to check the behavior when the argument is a non-boolean JavaScript value such as the numbers 0 and 1, null, undefined, or a string.
Comment 3 WebKit Review Bot 2012-10-15 20:57:05 PDT
Comment on attachment 168797 [details]

Clearing flags on attachment: 168797

Committed r131408: <http://trac.webkit.org/changeset/131408>
Comment 4 WebKit Review Bot 2012-10-15 20:57:09 PDT
All reviewed patches have been landed.  Closing bug.