RESOLVED FIXED 71596
WebKitMutationObserver.observe should raise a DOMException if passed invalid arguments
https://bugs.webkit.org/show_bug.cgi?id=71596
Summary WebKitMutationObserver.observe should raise a DOMException if passed invalid ...
Adam Klein
Reported 2011-11-04 17:04:26 PDT
For example, a null Node currently leads to a crash. We should also validate the options argument.
Attachments
Patch (9.32 KB, patch)
2011-11-07 13:54 PST, Adam Klein
no flags
Patch for landing (9.36 KB, patch)
2011-11-08 09:33 PST, Adam Klein
no flags
Patch for landing (9.43 KB, patch)
2011-11-08 12:13 PST, Adam Klein
no flags
Adam Klein
Comment 1 2011-11-07 13:54:35 PST
Ryosuke Niwa
Comment 2 2011-11-07 21:31:33 PST
Comment on attachment 113923 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=113923&action=review > Source/WebCore/ChangeLog:9 > + exception: Could you fit "exception:" on the previous line specially because the bug title is already longer than the previous line? > Source/WebCore/dom/WebKitMutationObserver.cpp:78 > + ec = NOT_FOUND_ERR; > + return; > + } > + > + if (!validateOptions(options)) { > + ec = SYNTAX_ERR; We should really agree which exceptions are thrown for each one of cases we're throwing on public-webapps. > Source/WebCore/dom/WebKitMutationObserver.h:51 > +typedef int ExceptionCode; > + Please include ExceptionCode.h instead. r=me provided this change.
Adam Klein
Comment 3 2011-11-08 09:28:02 PST
Comment on attachment 113923 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=113923&action=review >> Source/WebCore/dom/WebKitMutationObserver.cpp:78 >> + ec = SYNTAX_ERR; > > We should really agree which exceptions are thrown for each one of cases we're throwing on public-webapps. Yeah, I'll ask Anne for his opinion on these (right now the spec says these throw an "Error", which isn't right). NOT_FOUND_ERR was picked to be consistent with other Node-typed arguments, but SYNTAX_ERR may well be wrong here; added a FIXME. >> Source/WebCore/dom/WebKitMutationObserver.h:51 >> + > > Please include ExceptionCode.h instead. r=me provided this change. Done. I'll send you a separate patch to get rid of the rest of these typedefs in WebCore (the typedef is about as common as the include).
Adam Klein
Comment 4 2011-11-08 09:33:50 PST
Created attachment 114094 [details] Patch for landing
WebKit Review Bot
Comment 5 2011-11-08 10:45:30 PST
Comment on attachment 114094 [details] Patch for landing Rejecting attachment 114094 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: n/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc First, rewinding head to replay your work on top of it... Fast-forwarded master to refs/remotes/origin/master. Updating chromium port dependencies using gclient... ________ running '/usr/bin/python tools/clang/scripts/update.py --mac-only' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' ________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' Updating webkit projects from gyp files... Full output: http://queues.webkit.org/results/10375151
Adam Klein
Comment 6 2011-11-08 12:13:38 PST
Created attachment 114131 [details] Patch for landing
WebKit Review Bot
Comment 7 2011-11-08 13:00:06 PST
Comment on attachment 114131 [details] Patch for landing Clearing flags on attachment: 114131 Committed r99611: <http://trac.webkit.org/changeset/99611>
WebKit Review Bot
Comment 8 2011-11-08 13:00:11 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.