[Webkit-unassigned] [Bug 83993] Unsupported commands in execCommand/queryCommand* should throw except queryCommandSupported

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 16 12:33:56 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=83993





--- Comment #6 from Ehsan Akhgari [:ehsan] <ehsan at mozilla.com>  2012-04-16 12:33:52 PST ---
(In reply to comment #5)
> I don't see how the existence queryCommandSupported makes this right. If anything, it makes raising an exception for a wrong verb unnecessary!
> 
> The right way to check for whether a verb is supported is with queryCommandSupported, not by checking for exceptions.

Sure.  Throwing exceptions from execCommand should not be used to detect what commands are supported, it should be used to notify the web application that the call they have made has not taken the desired effect.  Note that without throwing an exception, there is no way to communicate to the caller that they've used an unsupported verb, so the caller might incorrectly assume that the editing command has taken effect, and the failure will manifest itself in some possibly subtle way somewhere else in the program.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list