Title: [121278] trunk
Revision
121278
Author
[email protected]
Date
2012-06-26 12:36:50 -0700 (Tue, 26 Jun 2012)

Log Message

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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (121277 => 121278)


--- trunk/LayoutTests/ChangeLog	2012-06-26 19:34:23 UTC (rev 121277)
+++ trunk/LayoutTests/ChangeLog	2012-06-26 19:36:50 UTC (rev 121278)
@@ -1,3 +1,12 @@
+2012-06-26  Adam Klein  <[email protected]>
+
+        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  <[email protected]>
 
         [chromium] Mark a layout test as timeout

Modified: trunk/LayoutTests/fast/mutation/observe-exceptions-expected.txt (121277 => 121278)


--- trunk/LayoutTests/fast/mutation/observe-exceptions-expected.txt	2012-06-26 19:34:23 UTC (rev 121277)
+++ trunk/LayoutTests/fast/mutation/observe-exceptions-expected.txt	2012-06-26 19:36:50 UTC (rev 121278)
@@ -7,8 +7,8 @@
 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.

Modified: trunk/Source/WebCore/ChangeLog (121277 => 121278)


--- trunk/Source/WebCore/ChangeLog	2012-06-26 19:34:23 UTC (rev 121277)
+++ trunk/Source/WebCore/ChangeLog	2012-06-26 19:36:50 UTC (rev 121278)
@@ -1,3 +1,21 @@
+2012-06-26  Adam Klein  <[email protected]>
+
+        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  <[email protected]>
 
         [chromium] The single thread proxy should not automatically tick new animations.

Modified: trunk/Source/WebCore/dom/WebKitMutationObserver.cpp (121277 => 121278)


--- trunk/Source/WebCore/dom/WebKitMutationObserver.cpp	2012-06-26 19:34:23 UTC (rev 121277)
+++ trunk/Source/WebCore/dom/WebKitMutationObserver.cpp	2012-06-26 19:36:50 UTC (rev 121278)
@@ -89,11 +89,6 @@
         return;
     }
 
-    if (optionsDictionary.isUndefinedOrNull()) {
-        ec = TYPE_MISMATCH_ERR;
-        return;
-    }
-
     static const struct {
         const char* name;
         MutationObserverOptions value;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to