[Web IDL] Mark DOMString parameters as nullable when they should be
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Feb 2016 04:36:37 +0000 (04:36 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Feb 2016 04:36:37 +0000 (04:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154666

Reviewed by Darin Adler.

Source/WebCore:

Mark DOMString parameters as nullable when they should be. We previously
emulated nullable DOMString attributes by using:
[TreatNullAs=NullString, TreatUndefinedAs=NullString]
However, this was non-standard and very verbose. Also, developers would
sometimes forget the [TreatUndefinedAs=NullString] part and the behavior
would end up being wrong for undefined.

After this clean up, the non-standard [TreatUndefinedAs=NullString] is
no longer used so this patch drops support for it. Only
[TreatNullAs=NullString] remains and this one will be renamed to
[TreatNullAs=EmptyString] via Bug 154654 to match Web IDL standard.

Tests: fast/dom/Element/getElementsByTagNameNS-nullable.html
       fast/dom/Node/nullable-parameters.html
       fast/events/storageevent-initStorageEvent-nullable.html

* Modules/mediastream/RTCPeerConnection.idl:
Drop [TreatUndefinedAs=NullString] from createDataChannel()'s first
parameter instead of marking it as nullable. This matches the
specification:
- http://w3c.github.io/webrtc-pc/#rtcpeerconnection-interface-extensions-1
This means there is a slight behavior change when undefined is passed, it
now becomes the string "undefined" instead of a null String.

* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
Drop handling of [TreatUndefinedAs=] as it is no longer used.

* bindings/scripts/IDLAttributes.txt:
Drop support for [TreatUndefinedAs=] as it is no longer used.

* bindings/scripts/test/TestObj.idl:

* dom/DOMImplementation.idl:
Make a few parameters nullable and drop [TreatNullAs=NullString,
TreatUndefinedAs=NullString]. There is no web-exposed behavior
change.

* dom/Document.idl:
- Make a few parameters nullable and drop [TreatNullAs=NullString,
  TreatUndefinedAs=NullString]. There is no web-exposed behavior
  change from this.
- Drop these attributes from ObjC-specific bindings as they only
  matter to JS bindings.
- The namespaceURI parameter to getElementsByTagNameNS() is now marked
  as nullable even though it only treated null as a null String, not
  undefined. This was a bug and did not match the specification:
  https://dom.spec.whatwg.org/#document

* dom/Element.idl:
- Make a few parameters nullable and drop [TreatNullAs=NullString,
  TreatUndefinedAs=NullString]. There is no web-exposed behavior
  change from this.
- Drop these attributes from ObjC-specific bindings as they only
  matter to JS bindings.
- The namespaceURI parameter to getElementsByTagNameNS() is now marked
  as nullable even though it only treated null as a null String, not
  undefined. This was a bug and did not match the specification:
  https://dom.spec.whatwg.org/#interface-element

* dom/NamedNodeMap.idl:
Make a few parameters nullable and drop [TreatNullAs=NullString,
TreatUndefinedAs=NullString]. There is no web-exposed behavior
change from this.

* dom/Node.idl:
- Drop these attributes from isSupported() as this is not exposed
  to JS (only native bindings) and these attributes only matter to
  JS bindings.
- Make the first parameter to lookupPrefix() / isDefaultNamespace()
  and lookupNamespaceURI() nullable. Previously, we treated null
  as a null string but not undefined. There is therefore a slight
  behavior change but this matches the specification:
  https://dom.spec.whatwg.org/#node

* fileapi/Blob.idl:
* html/HTMLButtonElement.idl:
* html/HTMLCanvasElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLKeygenElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTextAreaElement.idl:
* page/DOMWindow.idl:
Make a few parameters nullable and drop [TreatNullAs=NullString,
TreatUndefinedAs=NullString]. There is no web-exposed behavior
change from this.

* storage/StorageEvent.idl:
Mark oldValueArg / newValueArg parameters to initStorageEvent()
as nullable. Previously, we only treated null as a null string,
not undefined. This is therefore a slight behavior change but
it matches the specification:
https://www.w3.org/TR/webstorage/#storageeventinit

LayoutTests:

Add test coverage for minor behavioral changes in this patch.

* fast/dom/Element/getElementsByTagNameNS-nullable-expected.txt: Added.
* fast/dom/Element/getElementsByTagNameNS-nullable.html: Added.
* fast/dom/Node/nullable-parameters-expected.txt: Added.
* fast/dom/Node/nullable-parameters.html: Added.
* fast/dom/Node/resources/testdoc.xml: Added.
* fast/dom/Node/resources/testdoc2.xml: Added.
* fast/events/storageevent-initStorageEvent-nullable-expected.txt: Added.
* fast/events/storageevent-initStorageEvent-nullable.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197156 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/Element/getElementsByTagNameNS-nullable-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Element/getElementsByTagNameNS-nullable.html [new file with mode: 0644]
LayoutTests/fast/dom/Node/nullable-parameters-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Node/nullable-parameters.html [new file with mode: 0644]
LayoutTests/fast/dom/Node/resources/testdoc.xml [new file with mode: 0644]
LayoutTests/fast/dom/Node/resources/testdoc2.xml [new file with mode: 0644]
LayoutTests/fast/events/storageevent-initStorageEvent-nullable-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/storageevent-initStorageEvent-nullable.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/dom/DOMImplementation.idl
Source/WebCore/dom/Document.idl
Source/WebCore/dom/Element.idl
Source/WebCore/dom/NamedNodeMap.idl
Source/WebCore/dom/Node.idl
Source/WebCore/fileapi/Blob.idl
Source/WebCore/html/HTMLButtonElement.idl
Source/WebCore/html/HTMLCanvasElement.idl
Source/WebCore/html/HTMLFieldSetElement.idl
Source/WebCore/html/HTMLInputElement.idl
Source/WebCore/html/HTMLKeygenElement.idl
Source/WebCore/html/HTMLMediaElement.idl
Source/WebCore/html/HTMLObjectElement.idl
Source/WebCore/html/HTMLOutputElement.idl
Source/WebCore/html/HTMLSelectElement.idl
Source/WebCore/html/HTMLTextAreaElement.idl
Source/WebCore/page/DOMWindow.idl
Source/WebCore/storage/StorageEvent.idl

index 5b783f9..7fb8b53 100644 (file)
@@ -1,3 +1,21 @@
+2016-02-25  Chris Dumez  <cdumez@apple.com>
+
+        [Web IDL] Mark DOMString parameters as nullable when they should be
+        https://bugs.webkit.org/show_bug.cgi?id=154666
+
+        Reviewed by Darin Adler.
+
+        Add test coverage for minor behavioral changes in this patch.
+
+        * fast/dom/Element/getElementsByTagNameNS-nullable-expected.txt: Added.
+        * fast/dom/Element/getElementsByTagNameNS-nullable.html: Added.
+        * fast/dom/Node/nullable-parameters-expected.txt: Added.
+        * fast/dom/Node/nullable-parameters.html: Added.
+        * fast/dom/Node/resources/testdoc.xml: Added.
+        * fast/dom/Node/resources/testdoc2.xml: Added.
+        * fast/events/storageevent-initStorageEvent-nullable-expected.txt: Added.
+        * fast/events/storageevent-initStorageEvent-nullable.html: Added.
+
 2016-02-25  Ryan Haddad  <ryanhaddad@apple.com>
 
         Skipping flaky test storage/indexeddb/intversion-open-in-upgradeneeded.html on mac-wk2
diff --git a/LayoutTests/fast/dom/Element/getElementsByTagNameNS-nullable-expected.txt b/LayoutTests/fast/dom/Element/getElementsByTagNameNS-nullable-expected.txt
new file mode 100644 (file)
index 0000000..584dc31
--- /dev/null
@@ -0,0 +1,18 @@
+Tests that the first parameter to Element.getElementsByTagNameNS() is nullable
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.body.getElementsByTagName('a')[0].namespaceURI is null
+PASS document.body.getElementsByTagNameNS(null, 'a')[0].id is "testAnchor"
+PASS document.body.getElementsByTagNameNS(undefined, 'a')[0].id is "testAnchor"
+PASS document.getElementsByTagNameNS(null, 'a')[0].id is "testAnchor"
+PASS document.getElementsByTagNameNS(undefined, 'a')[0].id is "testAnchor"
+PASS document.body.getElementsByTagNameNS('null', 'a').length is 0
+PASS document.body.getElementsByTagNameNS('undefined', 'a').length is 0
+PASS document.getElementsByTagNameNS('null', 'a').length is 0
+PASS document.getElementsByTagNameNS('undefined', 'a').length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Element/getElementsByTagNameNS-nullable.html b/LayoutTests/fast/dom/Element/getElementsByTagNameNS-nullable.html
new file mode 100644 (file)
index 0000000..749df1e
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+</head>
+<body>
+<script>
+description("Tests that the first parameter to Element.getElementsByTagNameNS() is nullable");
+
+var a = document.createElementNS(null, "a");
+a.id = "testAnchor";
+document.body.appendChild(a);
+
+shouldBeNull("document.body.getElementsByTagName('a')[0].namespaceURI");
+shouldBeEqualToString("document.body.getElementsByTagNameNS(null, 'a')[0].id", "testAnchor");
+shouldBeEqualToString("document.body.getElementsByTagNameNS(undefined, 'a')[0].id", "testAnchor");
+shouldBeEqualToString("document.getElementsByTagNameNS(null, 'a')[0].id", "testAnchor");
+shouldBeEqualToString("document.getElementsByTagNameNS(undefined, 'a')[0].id", "testAnchor");
+shouldBe("document.body.getElementsByTagNameNS('null', 'a').length", "0");
+shouldBe("document.body.getElementsByTagNameNS('undefined', 'a').length", "0");
+shouldBe("document.getElementsByTagNameNS('null', 'a').length", "0");
+shouldBe("document.getElementsByTagNameNS('undefined', 'a').length", "0");
+</script>
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/Node/nullable-parameters-expected.txt b/LayoutTests/fast/dom/Node/nullable-parameters-expected.txt
new file mode 100644 (file)
index 0000000..94972af
--- /dev/null
@@ -0,0 +1,21 @@
+Tests the behavior of a few Node API parameters that should be nullable
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS xmlDoc.documentElement.lookupPrefix('undefined') is "c"
+PASS xmlDoc.documentElement.lookupPrefix(null) is null
+PASS xmlDoc.documentElement.lookupPrefix(undefined) is null
+
+PASS xmlDoc.documentElement.lookupNamespaceURI('undefined') is "test"
+PASS xmlDoc.documentElement.lookupNamespaceURI(null) is null
+PASS xmlDoc.documentElement.lookupNamespaceURI(undefined) is null
+
+PASS element.isDefaultNamespace('undefined') is true
+PASS element.isDefaultNamespace(undefined) is false
+PASS element.isDefaultNamespace('null') is true
+PASS element.isDefaultNamespace(null) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/Node/nullable-parameters.html b/LayoutTests/fast/dom/Node/nullable-parameters.html
new file mode 100644 (file)
index 0000000..8d98961
--- /dev/null
@@ -0,0 +1,35 @@
+<script src="../../../resources/js-test-pre.js"></script>
+<script>
+function loadXML(url)
+{
+    var xhr = new XMLHttpRequest();
+    xhr.open("GET", url, false);
+    xhr.send();
+    return xhr.responseXML;
+}
+
+description("Tests the behavior of a few Node API parameters that should be nullable");
+
+var xmlDoc = loadXML("resources/testDoc.xml");
+
+shouldBeEqualToString("xmlDoc.documentElement.lookupPrefix('undefined')", "c");
+shouldBeNull("xmlDoc.documentElement.lookupPrefix(null)");
+shouldBeNull("xmlDoc.documentElement.lookupPrefix(undefined)");
+
+debug("");
+xmlDoc = loadXML("resources/testDoc2.xml");
+shouldBeEqualToString("xmlDoc.documentElement.lookupNamespaceURI('undefined')", "test");
+shouldBeNull("xmlDoc.documentElement.lookupNamespaceURI(null)");
+shouldBeNull("xmlDoc.documentElement.lookupNamespaceURI(undefined)");
+
+debug("");
+var element = document.createElementNS("undefined", "test");
+shouldBeTrue("element.isDefaultNamespace('undefined')");
+shouldBeFalse("element.isDefaultNamespace(undefined)");
+
+element = document.createElementNS("null", "test");
+shouldBeTrue("element.isDefaultNamespace('null')");
+shouldBeFalse("element.isDefaultNamespace(null)");
+
+</script>
+<script src="../../../resources/js-test-post.js"></script>
diff --git a/LayoutTests/fast/dom/Node/resources/testdoc.xml b/LayoutTests/fast/dom/Node/resources/testdoc.xml
new file mode 100644 (file)
index 0000000..db4a3a3
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<bookstore xmlns:c="undefined" c:category="FANTASY">
+<book>
+<title>Harry Potter</title>
+<author>J K. Rowling</author>
+<year>2005</year>
+<price>29.99</price>
+</book>
+</bookstore>
diff --git a/LayoutTests/fast/dom/Node/resources/testdoc2.xml b/LayoutTests/fast/dom/Node/resources/testdoc2.xml
new file mode 100644 (file)
index 0000000..3a97ab1
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<bookstore xmlns:undefined="test">
+<book>
+<title>Harry Potter</title>
+<author>J K. Rowling</author>
+<year>2005</year>
+<price>29.99</price>
+</book>
+</bookstore>
diff --git a/LayoutTests/fast/events/storageevent-initStorageEvent-nullable-expected.txt b/LayoutTests/fast/events/storageevent-initStorageEvent-nullable-expected.txt
new file mode 100644 (file)
index 0000000..9efa130
--- /dev/null
@@ -0,0 +1,22 @@
+Tests nullable parameters to StorageEvent.initStorageEvent()
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS event.__proto__ is StorageEvent.prototype
+event.initStorageEvent("storage", false, false, "key", "oldValue", "newValue", "url")
+PASS event.oldValue is "oldValue"
+PASS event.newValue is "newValue"
+event.initStorageEvent("storage", false, false, "key", null, null, "url")
+PASS event.oldValue is null
+PASS event.newValue is null
+event.initStorageEvent("storage", false, false, "key", "oldValue", "newValue", "url")
+PASS event.oldValue is "oldValue"
+PASS event.newValue is "newValue"
+event.initStorageEvent("storage", false, false, "key", undefined, undefined, "url")
+PASS event.oldValue is null
+PASS event.newValue is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/storageevent-initStorageEvent-nullable.html b/LayoutTests/fast/events/storageevent-initStorageEvent-nullable.html
new file mode 100644 (file)
index 0000000..a6c3273
--- /dev/null
@@ -0,0 +1,25 @@
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+description("Tests nullable parameters to StorageEvent.initStorageEvent()");
+
+var event = new StorageEvent("storage");
+shouldBe("event.__proto__", "StorageEvent.prototype");
+
+evalAndLog('event.initStorageEvent("storage", false, false, "key", "oldValue", "newValue", "url")');
+shouldBeEqualToString("event.oldValue", "oldValue");
+shouldBeEqualToString("event.newValue", "newValue");
+
+evalAndLog('event.initStorageEvent("storage", false, false, "key", null, null, "url")');
+shouldBeNull("event.oldValue");
+shouldBeNull("event.newValue");
+
+evalAndLog('event.initStorageEvent("storage", false, false, "key", "oldValue", "newValue", "url")');
+shouldBeEqualToString("event.oldValue", "oldValue");
+shouldBeEqualToString("event.newValue", "newValue");
+
+evalAndLog('event.initStorageEvent("storage", false, false, "key", undefined, undefined, "url")');
+shouldBeNull("event.oldValue");
+shouldBeNull("event.newValue");
+
+</script>
+<script src="../../resources/js-test-post.js"></script>
index 3b13f0f..5a82099 100644 (file)
@@ -1,3 +1,108 @@
+2016-02-25  Chris Dumez  <cdumez@apple.com>
+
+        [Web IDL] Mark DOMString parameters as nullable when they should be
+        https://bugs.webkit.org/show_bug.cgi?id=154666
+
+        Reviewed by Darin Adler.
+
+        Mark DOMString parameters as nullable when they should be. We previously
+        emulated nullable DOMString attributes by using:
+        [TreatNullAs=NullString, TreatUndefinedAs=NullString]
+        However, this was non-standard and very verbose. Also, developers would
+        sometimes forget the [TreatUndefinedAs=NullString] part and the behavior
+        would end up being wrong for undefined.
+
+        After this clean up, the non-standard [TreatUndefinedAs=NullString] is
+        no longer used so this patch drops support for it. Only
+        [TreatNullAs=NullString] remains and this one will be renamed to
+        [TreatNullAs=EmptyString] via Bug 154654 to match Web IDL standard.
+
+        Tests: fast/dom/Element/getElementsByTagNameNS-nullable.html
+               fast/dom/Node/nullable-parameters.html
+               fast/events/storageevent-initStorageEvent-nullable.html
+
+        * Modules/mediastream/RTCPeerConnection.idl:
+        Drop [TreatUndefinedAs=NullString] from createDataChannel()'s first
+        parameter instead of marking it as nullable. This matches the
+        specification:
+        - http://w3c.github.io/webrtc-pc/#rtcpeerconnection-interface-extensions-1
+        This means there is a slight behavior change when undefined is passed, it
+        now becomes the string "undefined" instead of a null String.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (JSValueToNative):
+        Drop handling of [TreatUndefinedAs=] as it is no longer used.
+
+        * bindings/scripts/IDLAttributes.txt:
+        Drop support for [TreatUndefinedAs=] as it is no longer used.
+
+        * bindings/scripts/test/TestObj.idl:
+
+        * dom/DOMImplementation.idl:
+        Make a few parameters nullable and drop [TreatNullAs=NullString,
+        TreatUndefinedAs=NullString]. There is no web-exposed behavior
+        change.
+
+        * dom/Document.idl:
+        - Make a few parameters nullable and drop [TreatNullAs=NullString,
+          TreatUndefinedAs=NullString]. There is no web-exposed behavior
+          change from this.
+        - Drop these attributes from ObjC-specific bindings as they only
+          matter to JS bindings.
+        - The namespaceURI parameter to getElementsByTagNameNS() is now marked
+          as nullable even though it only treated null as a null String, not
+          undefined. This was a bug and did not match the specification:
+          https://dom.spec.whatwg.org/#document
+
+        * dom/Element.idl:
+        - Make a few parameters nullable and drop [TreatNullAs=NullString,
+          TreatUndefinedAs=NullString]. There is no web-exposed behavior
+          change from this.
+        - Drop these attributes from ObjC-specific bindings as they only
+          matter to JS bindings.
+        - The namespaceURI parameter to getElementsByTagNameNS() is now marked
+          as nullable even though it only treated null as a null String, not
+          undefined. This was a bug and did not match the specification:
+          https://dom.spec.whatwg.org/#interface-element
+
+        * dom/NamedNodeMap.idl:
+        Make a few parameters nullable and drop [TreatNullAs=NullString,
+        TreatUndefinedAs=NullString]. There is no web-exposed behavior
+        change from this.
+
+        * dom/Node.idl:
+        - Drop these attributes from isSupported() as this is not exposed
+          to JS (only native bindings) and these attributes only matter to
+          JS bindings.
+        - Make the first parameter to lookupPrefix() / isDefaultNamespace()
+          and lookupNamespaceURI() nullable. Previously, we treated null
+          as a null string but not undefined. There is therefore a slight
+          behavior change but this matches the specification:
+          https://dom.spec.whatwg.org/#node
+
+        * fileapi/Blob.idl:
+        * html/HTMLButtonElement.idl:
+        * html/HTMLCanvasElement.idl:
+        * html/HTMLFieldSetElement.idl:
+        * html/HTMLInputElement.idl:
+        * html/HTMLKeygenElement.idl:
+        * html/HTMLMediaElement.idl:
+        * html/HTMLObjectElement.idl:
+        * html/HTMLOutputElement.idl:
+        * html/HTMLSelectElement.idl:
+        * html/HTMLTextAreaElement.idl:
+        * page/DOMWindow.idl:
+        Make a few parameters nullable and drop [TreatNullAs=NullString,
+        TreatUndefinedAs=NullString]. There is no web-exposed behavior
+        change from this.
+
+        * storage/StorageEvent.idl:
+        Mark oldValueArg / newValueArg parameters to initStorageEvent()
+        as nullable. Previously, we only treated null as a null string,
+        not undefined. This is therefore a slight behavior change but
+        it matches the specification:
+        https://www.w3.org/TR/webstorage/#storageeventinit
+
 2016-02-25  David Kilzer  <ddkilzer@apple.com>
 
         REGRESSION (r196744): NetworkExtension.framework and NEFilterSource class are not available on Recovery partition
index 4ec69e7..9750d0a 100644 (file)
     //                                 RTCStatsCallback successCallback,
     //                                 RTCPeerConnectionErrorCallback errorCallback);
 
-    [RaisesException] RTCDataChannel createDataChannel([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString label, optional Dictionary options);
+    [RaisesException] RTCDataChannel createDataChannel([TreatNullAs=NullString] DOMString label, optional Dictionary options);
 
     void close();
 
index acde3ab..2bf8187 100644 (file)
@@ -4141,21 +4141,12 @@ sub JSValueToNative
     return "valueToDate(state, $value)" if $type eq "Date";
 
     if ($type eq "DOMString") {
-        # FIXME: This implements [TreatNullAs=NullString] and [TreatUndefinedAs=NullString],
-        # but the Web IDL spec requires [TreatNullAs=EmptyString] and [TreatUndefinedAs=EmptyString].
-        if (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") and ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString")) {
-            return "valueToStringWithUndefinedOrNullCheck(state, $value)"
-        }
         if ($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") {
             return "valueToStringWithNullCheck(state, $value)"
         }
-        if ($signature->isNullable) {
-            return "valueToStringWithUndefinedOrNullCheck(state, $value)";
-        }
-        if ($signature->extendedAttributes->{"AtomicString"}) {
-            return "$value.toString(state)->toAtomicString(state)";
-        }
-        # FIXME: Add the case for 'if ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString"))'.
+        return "valueToStringWithUndefinedOrNullCheck(state, $value)" if $signature->isNullable;
+        return "$value.toString(state)->toAtomicString(state)" if $signature->extendedAttributes->{"AtomicString"};
+
         return "$value.toString(state)->value(state)";
     }
 
index 91d9682..b9b1304 100644 (file)
@@ -121,7 +121,6 @@ StrictTypeChecking
 SuppressToJSObject
 TreatNullAs=NullString
 TreatReturnedNaNDateAs=Null|NaN
-TreatUndefinedAs=NullString
 TypedArray=*
 URL
 Unforgeable
index c4fb8a0..874ef8a 100644 (file)
@@ -1567,24 +1567,34 @@ void webkit_dom_test_obj_convert1(WebKitDOMTestObj* self, WebKitDOMTestNode* val
     item->convert1(convertedValue);
 }
 
-void webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, WebKitDOMTestNode* value)
+void webkit_dom_test_obj_convert2(WebKitDOMTestObj* self, WebKitDOMTestNode* value)
 {
     WebCore::JSMainThreadNullState state;
     g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
     g_return_if_fail(WEBKIT_DOM_IS_TEST_NODE(value));
     WebCore::TestObj* item = WebKit::core(self);
     WebCore::TestNode* convertedValue = WebKit::core(value);
-    item->convert4(convertedValue);
+    item->convert2(convertedValue);
 }
 
-void webkit_dom_test_obj_convert5(WebKitDOMTestObj* self, WebKitDOMTestNode* value)
+void webkit_dom_test_obj_convert3(WebKitDOMTestObj* self, const gchar* value)
 {
     WebCore::JSMainThreadNullState state;
     g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
-    g_return_if_fail(WEBKIT_DOM_IS_TEST_NODE(value));
+    g_return_if_fail(value);
     WebCore::TestObj* item = WebKit::core(self);
-    WebCore::TestNode* convertedValue = WebKit::core(value);
-    item->convert5(convertedValue);
+    WTF::String convertedValue = WTF::String::fromUTF8(value);
+    item->convert3(convertedValue);
+}
+
+void webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, const gchar* value)
+{
+    WebCore::JSMainThreadNullState state;
+    g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
+    g_return_if_fail(value);
+    WebCore::TestObj* item = WebKit::core(self);
+    WTF::String convertedValue = WTF::String::fromUTF8(value);
+    item->convert4(convertedValue);
 }
 
 WebKitDOMSVGPoint* webkit_dom_test_obj_mutable_point_function(WebKitDOMTestObj* self)
index 6ca34c7..c8cc1cc 100644 (file)
@@ -549,24 +549,34 @@ WEBKIT_API void
 webkit_dom_test_obj_convert1(WebKitDOMTestObj* self, WebKitDOMTestNode* value);
 
 /**
- * webkit_dom_test_obj_convert4:
+ * webkit_dom_test_obj_convert2:
  * @self: A #WebKitDOMTestObj
  * @value: A #WebKitDOMTestNode
  *
  * Stability: Unstable
 **/
 WEBKIT_API void
-webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, WebKitDOMTestNode* value);
+webkit_dom_test_obj_convert2(WebKitDOMTestObj* self, WebKitDOMTestNode* value);
 
 /**
- * webkit_dom_test_obj_convert5:
+ * webkit_dom_test_obj_convert3:
  * @self: A #WebKitDOMTestObj
- * @value: A #WebKitDOMTestNode
+ * @value: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_obj_convert3(WebKitDOMTestObj* self, const gchar* value);
+
+/**
+ * webkit_dom_test_obj_convert4:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #gchar
  *
  * Stability: Unstable
 **/
 WEBKIT_API void
-webkit_dom_test_obj_convert5(WebKitDOMTestObj* self, WebKitDOMTestNode* value);
+webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, const gchar* value);
 
 /**
  * webkit_dom_test_obj_mutable_point_function:
index fbda715..7cfcb8f 100644 (file)
@@ -167,8 +167,9 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithAndWithout
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence2(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionGetSVGDocument(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMutablePointFunction(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionImmutablePointFunction(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOrange(JSC::ExecState*);
@@ -690,8 +691,9 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
     { "methodWithAndWithoutNullableSequence2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence2), (intptr_t) (2) } },
     { "getSVGDocument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionGetSVGDocument), (intptr_t) (0) } },
     { "convert1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert1), (intptr_t) (1) } },
+    { "convert2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert2), (intptr_t) (1) } },
+    { "convert3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert3), (intptr_t) (1) } },
     { "convert4", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert4), (intptr_t) (1) } },
-    { "convert5", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert5), (intptr_t) (1) } },
     { "mutablePointFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMutablePointFunction), (intptr_t) (0) } },
     { "immutablePointFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionImmutablePointFunction), (intptr_t) (0) } },
     { "orange", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOrange), (intptr_t) (0) } },
@@ -4626,12 +4628,12 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(ExecState* state
     return JSValue::encode(jsUndefined());
 }
 
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* state)
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(ExecState* state)
 {
     JSValue thisValue = state->thisValue();
     auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
     if (UNLIKELY(!castedThis))
-        return throwThisTypeError(*state, "TestObj", "convert4");
+        return throwThisTypeError(*state, "TestObj", "convert2");
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 1))
@@ -4639,24 +4641,41 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* state
     TestNode* value = JSTestNode::toWrapped(state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
-    impl.convert4(value);
+    impl.convert2(value);
     return JSValue::encode(jsUndefined());
 }
 
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(ExecState* state)
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(ExecState* state)
 {
     JSValue thisValue = state->thisValue();
     auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
     if (UNLIKELY(!castedThis))
-        return throwThisTypeError(*state, "TestObj", "convert5");
+        return throwThisTypeError(*state, "TestObj", "convert3");
     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
-    TestNode* value = JSTestNode::toWrapped(state->argument(0));
+    String value = state->argument(0).toString(state)->value(state);
+    if (UNLIKELY(state->hadException()))
+        return JSValue::encode(jsUndefined());
+    impl.convert3(value);
+    return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* state)
+{
+    JSValue thisValue = state->thisValue();
+    auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
+    if (UNLIKELY(!castedThis))
+        return throwThisTypeError(*state, "TestObj", "convert4");
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+    auto& impl = castedThis->wrapped();
+    if (UNLIKELY(state->argumentCount() < 1))
+        return throwVMError(state, createNotEnoughArgumentsError(state));
+    String value = valueToStringWithUndefinedOrNullCheck(state, state->argument(0));
     if (UNLIKELY(state->hadException()))
         return JSValue::encode(jsUndefined());
-    impl.convert5(value);
+    impl.convert4(value);
     return JSValue::encode(jsUndefined());
 }
 
index a1ad1e2..cb68f35 100644 (file)
@@ -179,8 +179,9 @@ WEBCORE_EXPORT @interface DOMTestObj : DOMObject
 - (void)classMethod2:(int)arg;
 - (DOMSVGDocument *)getSVGDocument;
 - (void)convert1:(DOMTestNode *)value;
-- (void)convert4:(DOMTestNode *)value;
-- (void)convert5:(DOMTestNode *)value;
+- (void)convert2:(DOMTestNode *)value;
+- (void)convert3:(NSString *)value;
+- (void)convert4:(NSString *)value;
 - (DOMSVGPoint *)mutablePointFunction;
 - (DOMSVGPoint *)immutablePointFunction;
 - (void)orange;
index 78d3655..223abc4 100644 (file)
     IMPL->convert1(core(value));
 }
 
-- (void)convert4:(DOMTestNode *)value
+- (void)convert2:(DOMTestNode *)value
 {
     WebCore::JSMainThreadNullState state;
-    IMPL->convert4(core(value));
+    IMPL->convert2(core(value));
 }
 
-- (void)convert5:(DOMTestNode *)value
+- (void)convert3:(NSString *)value
 {
     WebCore::JSMainThreadNullState state;
-    IMPL->convert5(core(value));
+    IMPL->convert3(value);
+}
+
+- (void)convert4:(NSString *)value
+{
+    WebCore::JSMainThreadNullState state;
+    IMPL->convert4(value);
 }
 
 - (DOMSVGPoint *)mutablePointFunction
index dcc7a89..17c0fc5 100644 (file)
@@ -262,8 +262,9 @@ enum _optional { "", "OptionalValue1", "OptionalValue2", "OptionalValue3" };
     [CheckSecurityForNode, RaisesException] SVGDocument getSVGDocument();
 
     void convert1(TestNode value);
-    void convert4([TreatNullAs=NullString] TestNode value);
-    void convert5([TreatNullAs=NullString, TreatUndefinedAs=NullString] TestNode value);
+    void convert2(TestNode? value);
+    void convert3(DOMString value);
+    void convert4(DOMString? value);
 
     attribute SVGPoint mutablePoint;
     [Immutable] attribute SVGPoint immutablePoint;
index 42c8b63..8592ee0 100644 (file)
 
     // DOM Level 1
 
-    [ObjCLegacyUnnamedParameters] boolean hasFeature([Default=Undefined] optional DOMString feature, 
-                                      [TreatNullAs=NullString, Default=Undefined] optional DOMString version);
+    [ObjCLegacyUnnamedParameters] boolean hasFeature([Default=Undefined] optional DOMString feature,
+        [TreatNullAs=NullString, Default=Undefined] optional DOMString version);
 
     // DOM Level 2
 
-    [ObjCLegacyUnnamedParameters, RaisesException, NewObject] DocumentType createDocumentType([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString qualifiedName,
-                                                   [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString publicId,
-                                                   [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString systemId);
+    [ObjCLegacyUnnamedParameters, RaisesException, NewObject] DocumentType createDocumentType([Default=Undefined] optional DOMString? qualifiedName,
+        [Default=Undefined] optional DOMString? publicId, [Default=Undefined] optional DOMString? systemId);
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT
     [ObjCLegacyUnnamedParameters, RaisesException] Document createDocument(optional DOMString namespaceURI, optional DOMString qualifiedName,
         optional DocumentType doctype);
 #else
-    [RaisesException, NewObject] XMLDocument createDocument([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString namespaceURI,
-        [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName,
-        [TreatNullAs=NullString, Default=Undefined] optional DocumentType doctype);
+    [RaisesException, NewObject] XMLDocument createDocument([Default=Undefined] optional DOMString? namespaceURI,
+        [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName, [Default=Undefined] optional DocumentType? doctype);
 #endif
 
     // DOMImplementationCSS interface from DOM Level 2 CSS
index 5b45091..6bd6a96 100644 (file)
 
     [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
                     optional boolean deep);
-    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS([TreatNullAs=NullString,TreatUndefinedAs=NullString,Default=Undefined] optional DOMString namespaceURI,
-                            [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
-    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,TreatUndefinedAs=NullString,Default=Undefined] optional DOMString namespaceURI,
-                                                                          [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
+    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS([Default=Undefined] optional DOMString? namespaceURI,
+        [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName);
+    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS([Default=Undefined] optional DOMString? namespaceURI,
+        [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName);
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
-    [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
+    [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(optional DOMString namespaceURI, optional DOMString localName);
 #else
-    HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
+    HTMLCollection getElementsByTagNameNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
 #endif
 
     // DOM Level 3 Core
     // Common extensions
     boolean            execCommand([Default=Undefined] optional DOMString command,
                                    [Default=Undefined] optional boolean userInterface,
-                                   [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString value);
+                                   optional DOMString? value);
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
     // FIXME: remove the these two versions once optional is implemented for Objective-C.
index 727234b..aa25c12 100644 (file)
 
     // DOM Level 2 Core
 
-    [ObjCLegacyUnnamedParameters] DOMString? getAttributeNS([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString namespaceURI,
-                                            [Default=Undefined] optional DOMString localName);
-    [ObjCLegacyUnnamedParameters, RaisesException] void setAttributeNS([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString namespaceURI,
-                                       [Default=Undefined] optional DOMString qualifiedName, 
-                                       [Default=Undefined] optional DOMString value);
-    [ObjCLegacyUnnamedParameters] void removeAttributeNS([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString namespaceURI,
-                                          DOMString localName);
+    [ObjCLegacyUnnamedParameters] DOMString? getAttributeNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
+    [ObjCLegacyUnnamedParameters, RaisesException] void setAttributeNS([Default=Undefined] optional DOMString? namespaceURI,
+        [Default=Undefined] optional DOMString qualifiedName,
+        [Default=Undefined] optional DOMString value);
+    [ObjCLegacyUnnamedParameters] void removeAttributeNS(DOMString? namespaceURI, DOMString localName);
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
-    [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
+    [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(optional DOMString namespaceURI, optional DOMString localName);
 #else
-    HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
+    HTMLCollection getElementsByTagNameNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
 #endif
-    [ObjCLegacyUnnamedParameters] Attr getAttributeNodeNS([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString namespaceURI,
-                                           [Default=Undefined] optional DOMString localName);
+    [ObjCLegacyUnnamedParameters] Attr getAttributeNodeNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
     [RaisesException] Attr setAttributeNodeNS([Default=Undefined] optional Attr newAttr);
     boolean hasAttribute(DOMString name);
-    [ObjCLegacyUnnamedParameters] boolean hasAttributeNS([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString namespaceURI,
-                                          [Default=Undefined] optional DOMString localName);
+    [ObjCLegacyUnnamedParameters] boolean hasAttributeNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
 
     [ImplementedAs=cssomStyle] readonly attribute CSSStyleDeclaration style;
 
index 8f3ef89..0272cd7 100644 (file)
 
     // Introduced in DOM Level 2:
 
-    [ObjCLegacyUnnamedParameters] Node getNamedItemNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, 
-                                       [Default=Undefined] optional DOMString localName);
+    [ObjCLegacyUnnamedParameters] Node getNamedItemNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
 
     [RaisesException] Node setNamedItemNS([Default=Undefined] optional Node node);
 
-    [ObjCLegacyUnnamedParameters, RaisesException] Node removeNamedItemNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, 
-                                          [Default=Undefined] optional DOMString localName);
-
+    [ObjCLegacyUnnamedParameters, RaisesException] Node removeNamedItemNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
 };
 
index 21e3a55..9250e54 100644 (file)
@@ -76,8 +76,7 @@
     // Introduced in DOM Level 2:
 
 #if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
-    [ObjCLegacyUnnamedParameters, ImplementedAs=isSupportedForBindings] boolean isSupported([Default=Undefined] optional DOMString feature,
-                                       [TreatNullAs=NullString,Default=Undefined] optional DOMString version);
+    [ObjCLegacyUnnamedParameters, ImplementedAs=isSupportedForBindings] boolean isSupported(optional DOMString feature, optional DOMString version);
 #endif
 
     readonly attribute DOMString?        namespaceURI;
@@ -99,9 +98,9 @@
 
     boolean            isSameNode([Default=Undefined] optional Node other);
     boolean            isEqualNode([Default=Undefined] optional Node other);
-    DOMString?         lookupPrefix([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI);
-    boolean            isDefaultNamespace([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI);
-    DOMString?         lookupNamespaceURI([TreatNullAs=NullString,Default=Undefined] optional DOMString prefix);
+    DOMString?         lookupPrefix([Default=Undefined] optional DOMString? namespaceURI);
+    boolean            isDefaultNamespace([Default=Undefined] optional DOMString? namespaceURI);
+    DOMString?         lookupNamespaceURI([Default=Undefined] optional DOMString? prefix);
 
     // DocumentPosition
     const unsigned short      DOCUMENT_POSITION_DISCONNECTED = 0x01;
index 7078c32..cc7e4f5 100644 (file)
@@ -39,7 +39,7 @@
     readonly attribute DOMString type;
 
 #if !defined(LANGUAGE_OBJECTIVE_C)
-    Blob slice(optional long long start, optional long long end, [TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString contentType);
+    Blob slice(optional long long start, optional long long end, optional DOMString? contentType);
 #endif
 };
 
index 8d88f53..c18d74e 100644 (file)
@@ -35,7 +35,7 @@ interface HTMLButtonElement : HTMLElement {
     readonly attribute ValidityState validity;
     readonly attribute DOMString validationMessage;
     boolean checkValidity();
-    void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+    void setCustomValidity(DOMString? error);
 
     readonly attribute NodeList labels;
 
index aa346ef..ff5db08 100644 (file)
@@ -32,7 +32,7 @@
     attribute long width;
     attribute long height;
 
-    [Custom, RaisesException] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString type);
+    [Custom, RaisesException] DOMString toDataURL(optional DOMString? type);
 
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
     // The custom binding is needed to handle context creation attributes.
index 0232ed2..2f58701 100644 (file)
@@ -34,5 +34,5 @@ interface HTMLFieldSetElement : HTMLElement {
     readonly attribute ValidityState   validity;
     readonly attribute DOMString       validationMessage;
     boolean  checkValidity();
-    void     setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+    void     setCustomValidity(DOMString? error);
 };
index 6e86cdb..8ca20fb 100644 (file)
@@ -73,7 +73,7 @@ interface HTMLInputElement : HTMLElement {
     readonly attribute ValidityState validity;
     readonly attribute DOMString validationMessage;
     boolean checkValidity();
-    void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+    void setCustomValidity(DOMString? error);
 
     readonly attribute NodeList labels;
 
@@ -110,7 +110,7 @@ interface HTMLInputElement : HTMLElement {
 #endif
 
 #if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
-    void setValueForUser([TreatNullAs=NullString] DOMString value);
+    void setValueForUser(DOMString value);
 #endif
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
index c8361d8..a39feb9 100644 (file)
@@ -42,7 +42,7 @@ interface HTMLKeygenElement : HTMLElement {
     readonly attribute ValidityState validity;
     readonly attribute DOMString validationMessage;
     boolean checkValidity();
-    void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+    void setCustomValidity(DOMString? error);
 
     readonly attribute NodeList labels;
 };
index 26cfc8b..37a0825 100644 (file)
@@ -46,9 +46,9 @@
     readonly attribute TimeRanges buffered;
     void load();
 #if defined(ENABLE_ENCRYPTED_MEDIA) && ENABLE_ENCRYPTED_MEDIA
-    DOMString canPlayType([Default=Undefined] optional DOMString type, [Default=Undefined, TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString keySystem);
+    DOMString canPlayType([Default=Undefined] optional DOMString type, optional DOMString? keySystem);
 #elif defined(ENABLE_ENCRYPTED_MEDIA_V2) && ENABLE_ENCRYPTED_MEDIA_V2
-    DOMString canPlayType([Default=Undefined] optional DOMString type, [Default=Undefined, TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString keySystem);
+    DOMString canPlayType([Default=Undefined] optional DOMString type, optional DOMString? keySystem);
 #else
     DOMString canPlayType([Default=Undefined] optional DOMString type);
 #endif
@@ -95,9 +95,9 @@
     [Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitVideoDecodedByteCount;
 
 #if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT // Work around shortcomings in the gobject binding generator handling of conditional features by turning these off for gobject.
-    [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitGenerateKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, optional Uint8Array initData);
-    [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitAddKey([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, Uint8Array key, optional Uint8Array initData, [Default=NullString] optional DOMString sessionId);
-    [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitCancelKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, [Default=NullString] optional DOMString sessionId);
+    [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitGenerateKeyRequest(DOMString? keySystem, optional Uint8Array initData);
+    [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitAddKey(DOMString? keySystem, Uint8Array key, optional Uint8Array initData, [Default=NullString] optional DOMString sessionId);
+    [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitCancelKeyRequest(DOMString? keySystem, [Default=NullString] optional DOMString sessionId);
 
     [Conditional=ENCRYPTED_MEDIA_V2, ImplementedAs=keys] readonly attribute MediaKeys webkitKeys;
     [Conditional=ENCRYPTED_MEDIA_V2, ImplementedAs=setMediaKeys] void webkitSetMediaKeys(MediaKeys mediaKeys);
index 7d225ee..38ffda4 100644 (file)
@@ -44,7 +44,7 @@
     readonly attribute ValidityState validity;
     readonly attribute DOMString validationMessage;
     boolean checkValidity();
-    void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+    void setCustomValidity(DOMString? error);
 
     // Introduced in DOM Level 2:
     [CheckSecurityForNode] readonly attribute Document contentDocument;
index cd5b2f5..68f5d58 100644 (file)
@@ -36,7 +36,7 @@ interface HTMLOutputElement : HTMLElement {
     readonly attribute ValidityState validity;
     readonly attribute DOMString validationMessage;
     boolean checkValidity();
-    void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+    void setCustomValidity(DOMString? error);
 
     readonly attribute NodeList labels;
 };
index 9f419b2..6ded36a 100644 (file)
@@ -70,7 +70,7 @@
     readonly attribute ValidityState validity;
     readonly attribute DOMString validationMessage;
     boolean checkValidity();
-    void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+    void setCustomValidity(DOMString? error);
 
     readonly attribute NodeList labels;
 
index 1b3b421..a1f2b63 100644 (file)
@@ -47,7 +47,7 @@ interface HTMLTextAreaElement : HTMLElement {
     readonly attribute ValidityState validity;
     readonly attribute DOMString validationMessage;
     boolean checkValidity();
-    void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
+    void setCustomValidity(DOMString? error);
 
     readonly attribute NodeList labels;
 
index fccd87f..84860fd 100644 (file)
@@ -74,8 +74,7 @@
 
     void alert([Default=Undefined] optional DOMString message);
     boolean confirm([Default=Undefined] optional DOMString message);
-    DOMString? prompt([Default=Undefined] optional DOMString message,
-                                                [TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString defaultValue);
+    DOMString? prompt([Default=Undefined] optional DOMString message, [Default=Undefined] optional DOMString? defaultValue);
 
     boolean find([Default=Undefined] optional DOMString string,
                  [Default=Undefined] optional boolean caseSensitive,
     readonly attribute StyleMedia styleMedia;
 
     // DOM Level 2 Style Interface
-    CSSStyleDeclaration getComputedStyle([Default=Undefined] optional Element element,
-                                                              [TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString pseudoElement);
+    CSSStyleDeclaration getComputedStyle([Default=Undefined] optional Element element, [Default=Undefined] optional DOMString? pseudoElement);
 
     // WebKit extensions
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-    CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element,
-                                   [TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString pseudoElement);
+    CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element, [Default=Undefined] optional DOMString? pseudoElement);
 #endif
 
     [Replaceable] readonly attribute unrestricted double devicePixelRatio;
index 8ecd28e..5c9396d 100644 (file)
@@ -36,8 +36,8 @@
                           [Default=Undefined] optional boolean canBubbleArg, 
                           [Default=Undefined] optional boolean cancelableArg, 
                           [Default=Undefined] optional DOMString keyArg, 
-                          [Default=Undefined,TreatNullAs=NullString] optional DOMString oldValueArg, 
-                          [Default=Undefined,TreatNullAs=NullString] optional DOMString newValueArg, 
+                          [Default=Undefined] optional DOMString? oldValueArg,
+                          [Default=Undefined] optional DOMString? newValueArg,
                           [Default=Undefined] optional DOMString urlArg, 
                           [Default=Undefined] optional Storage storageAreaArg);