From: adamk@chromium.org Date: Tue, 26 Jun 2012 19:36:50 +0000 (+0000) Subject: MutationObserver.observe should treat a null or undefined options argument as empty X-Git-Tag: 070512121124~609 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f57e545d5b45b0e8f96f5e754424b67984c95ef;p=profile%2Fivi%2Fwebkit-efl.git MutationObserver.observe should treat a null or undefined options argument as empty https://bugs.webkit.org/show_bug.cgi?id=89992 Reviewed by Ojan Vafai. Source/WebCore: The WebIDL spec was recently updated to treat null or undefined Dictionary arguments the same as the empty dictionary. This patch updates MutationObserver.observe to follow that spec. Note that we still throw a SYNTAX_ERR in this case, since it's an error not to pass one of "attributes", "childList", or "characterData" as a key in the dictionary. * dom/WebKitMutationObserver.cpp: (WebCore::WebKitMutationObserver::observe): LayoutTests: * fast/mutation/observe-exceptions-expected.txt: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121278 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 13dbdf9..a01cac9 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,12 @@ +2012-06-26 Adam Klein + + MutationObserver.observe should treat a null or undefined options argument as empty + https://bugs.webkit.org/show_bug.cgi?id=89992 + + Reviewed by Ojan Vafai. + + * fast/mutation/observe-exceptions-expected.txt: + 2012-06-26 Alpha Lam [chromium] Mark a layout test as timeout diff --git a/LayoutTests/fast/mutation/observe-exceptions-expected.txt b/LayoutTests/fast/mutation/observe-exceptions-expected.txt index 9f6e37a..ad625d1 100644 --- a/LayoutTests/fast/mutation/observe-exceptions-expected.txt +++ b/LayoutTests/fast/mutation/observe-exceptions-expected.txt @@ -7,8 +7,8 @@ PASS observer.observe() threw exception TypeError: Not enough arguments. PASS observer.observe(null) threw exception TypeError: Not enough arguments. PASS observer.observe(undefined) threw exception TypeError: Not enough arguments. PASS observer.observe(document.body) threw exception TypeError: Not enough arguments. -PASS observer.observe(document.body, null) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. -PASS observer.observe(document.body, undefined) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. +PASS observer.observe(document.body, null) threw exception Error: SYNTAX_ERR: DOM Exception 12. +PASS observer.observe(document.body, undefined) threw exception Error: SYNTAX_ERR: DOM Exception 12. PASS observer.observe(null, {attributes: true}) threw exception Error: NOT_FOUND_ERR: DOM Exception 8. PASS observer.observe(undefined, {attributes: true}) threw exception Error: NOT_FOUND_ERR: DOM Exception 8. PASS observer.observe(document.body, {subtree: true}) threw exception Error: SYNTAX_ERR: DOM Exception 12. diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index ea998ee..cfa74b3 100755 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,21 @@ +2012-06-26 Adam Klein + + MutationObserver.observe should treat a null or undefined options argument as empty + https://bugs.webkit.org/show_bug.cgi?id=89992 + + Reviewed by Ojan Vafai. + + The WebIDL spec was recently updated to treat null or undefined + Dictionary arguments the same as the empty dictionary. This patch + updates MutationObserver.observe to follow that spec. + + Note that we still throw a SYNTAX_ERR in this case, since it's an + error not to pass one of "attributes", "childList", or "characterData" + as a key in the dictionary. + + * dom/WebKitMutationObserver.cpp: + (WebCore::WebKitMutationObserver::observe): + 2012-06-26 Ian Vollick [chromium] The single thread proxy should not automatically tick new animations. diff --git a/Source/WebCore/dom/WebKitMutationObserver.cpp b/Source/WebCore/dom/WebKitMutationObserver.cpp index 6fe6aa7..80c26a5 100644 --- a/Source/WebCore/dom/WebKitMutationObserver.cpp +++ b/Source/WebCore/dom/WebKitMutationObserver.cpp @@ -89,11 +89,6 @@ void WebKitMutationObserver::observe(Node* node, const Dictionary& optionsDictio return; } - if (optionsDictionary.isUndefinedOrNull()) { - ec = TYPE_MISMATCH_ERR; - return; - } - static const struct { const char* name; MutationObserverOptions value;