⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 197156 in webkit


Ignore:
Timestamp:
Feb 25, 2016, 8:36:37 PM (11 years ago)
Author:
Chris Dumez
Message:

[Web IDL] Mark DOMString parameters as nullable when they should be
​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:

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.
Location:
trunk
Files:
9 added
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r197152 r197156  
     12016-02-25  Chris Dumez  <cdumez@apple.com>
     2
     3        [Web IDL] Mark DOMString parameters as nullable when they should be
     4        https://bugs.webkit.org/show_bug.cgi?id=154666
     5
     6        Reviewed by Darin Adler.
     7
     8        Add test coverage for minor behavioral changes in this patch.
     9
     10        * fast/dom/Element/getElementsByTagNameNS-nullable-expected.txt: Added.
     11        * fast/dom/Element/getElementsByTagNameNS-nullable.html: Added.
     12        * fast/dom/Node/nullable-parameters-expected.txt: Added.
     13        * fast/dom/Node/nullable-parameters.html: Added.
     14        * fast/dom/Node/resources/testdoc.xml: Added.
     15        * fast/dom/Node/resources/testdoc2.xml: Added.
     16        * fast/events/storageevent-initStorageEvent-nullable-expected.txt: Added.
     17        * fast/events/storageevent-initStorageEvent-nullable.html: Added.
     18
    1192016-02-25  Ryan Haddad  <ryanhaddad@apple.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r197154 r197156  
     12016-02-25  Chris Dumez  <cdumez@apple.com>
     2
     3        [Web IDL] Mark DOMString parameters as nullable when they should be
     4        https://bugs.webkit.org/show_bug.cgi?id=154666
     5
     6        Reviewed by Darin Adler.
     7
     8        Mark DOMString parameters as nullable when they should be. We previously
     9        emulated nullable DOMString attributes by using:
     10        [TreatNullAs=NullString, TreatUndefinedAs=NullString]
     11        However, this was non-standard and very verbose. Also, developers would
     12        sometimes forget the [TreatUndefinedAs=NullString] part and the behavior
     13        would end up being wrong for undefined.
     14
     15        After this clean up, the non-standard [TreatUndefinedAs=NullString] is
     16        no longer used so this patch drops support for it. Only
     17        [TreatNullAs=NullString] remains and this one will be renamed to
     18        [TreatNullAs=EmptyString] via Bug 154654 to match Web IDL standard.
     19
     20        Tests: fast/dom/Element/getElementsByTagNameNS-nullable.html
     21               fast/dom/Node/nullable-parameters.html
     22               fast/events/storageevent-initStorageEvent-nullable.html
     23
     24        * Modules/mediastream/RTCPeerConnection.idl:
     25        Drop [TreatUndefinedAs=NullString] from createDataChannel()'s first
     26        parameter instead of marking it as nullable. This matches the
     27        specification:
     28        - http://w3c.github.io/webrtc-pc/#rtcpeerconnection-interface-extensions-1
     29        This means there is a slight behavior change when undefined is passed, it
     30        now becomes the string "undefined" instead of a null String.
     31
     32        * bindings/scripts/CodeGeneratorJS.pm:
     33        (JSValueToNative):
     34        Drop handling of [TreatUndefinedAs=] as it is no longer used.
     35
     36        * bindings/scripts/IDLAttributes.txt:
     37        Drop support for [TreatUndefinedAs=] as it is no longer used.
     38
     39        * bindings/scripts/test/TestObj.idl:
     40
     41        * dom/DOMImplementation.idl:
     42        Make a few parameters nullable and drop [TreatNullAs=NullString,
     43        TreatUndefinedAs=NullString]. There is no web-exposed behavior
     44        change.
     45
     46        * dom/Document.idl:
     47        - Make a few parameters nullable and drop [TreatNullAs=NullString,
     48          TreatUndefinedAs=NullString]. There is no web-exposed behavior
     49          change from this.
     50        - Drop these attributes from ObjC-specific bindings as they only
     51          matter to JS bindings.
     52        - The namespaceURI parameter to getElementsByTagNameNS() is now marked
     53          as nullable even though it only treated null as a null String, not
     54          undefined. This was a bug and did not match the specification:
     55          https://dom.spec.whatwg.org/#document
     56
     57        * dom/Element.idl:
     58        - Make a few parameters nullable and drop [TreatNullAs=NullString,
     59          TreatUndefinedAs=NullString]. There is no web-exposed behavior
     60          change from this.
     61        - Drop these attributes from ObjC-specific bindings as they only
     62          matter to JS bindings.
     63        - The namespaceURI parameter to getElementsByTagNameNS() is now marked
     64          as nullable even though it only treated null as a null String, not
     65          undefined. This was a bug and did not match the specification:
     66          https://dom.spec.whatwg.org/#interface-element
     67
     68        * dom/NamedNodeMap.idl:
     69        Make a few parameters nullable and drop [TreatNullAs=NullString,
     70        TreatUndefinedAs=NullString]. There is no web-exposed behavior
     71        change from this.
     72
     73        * dom/Node.idl:
     74        - Drop these attributes from isSupported() as this is not exposed
     75          to JS (only native bindings) and these attributes only matter to
     76          JS bindings.
     77        - Make the first parameter to lookupPrefix() / isDefaultNamespace()
     78          and lookupNamespaceURI() nullable. Previously, we treated null
     79          as a null string but not undefined. There is therefore a slight
     80          behavior change but this matches the specification:
     81          https://dom.spec.whatwg.org/#node
     82
     83        * fileapi/Blob.idl:
     84        * html/HTMLButtonElement.idl:
     85        * html/HTMLCanvasElement.idl:
     86        * html/HTMLFieldSetElement.idl:
     87        * html/HTMLInputElement.idl:
     88        * html/HTMLKeygenElement.idl:
     89        * html/HTMLMediaElement.idl:
     90        * html/HTMLObjectElement.idl:
     91        * html/HTMLOutputElement.idl:
     92        * html/HTMLSelectElement.idl:
     93        * html/HTMLTextAreaElement.idl:
     94        * page/DOMWindow.idl:
     95        Make a few parameters nullable and drop [TreatNullAs=NullString,
     96        TreatUndefinedAs=NullString]. There is no web-exposed behavior
     97        change from this.
     98
     99        * storage/StorageEvent.idl:
     100        Mark oldValueArg / newValueArg parameters to initStorageEvent()
     101        as nullable. Previously, we only treated null as a null string,
     102        not undefined. This is therefore a slight behavior change but
     103        it matches the specification:
     104        https://www.w3.org/TR/webstorage/#storageeventinit
     105
    11062016-02-25  David Kilzer  <ddkilzer@apple.com>
    2107
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl

    r196568 r197156  
    101101    //                                 RTCPeerConnectionErrorCallback errorCallback);
    102102
    103     [RaisesException] RTCDataChannel createDataChannel([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString label, optional Dictionary options);
     103    [RaisesException] RTCDataChannel createDataChannel([TreatNullAs=NullString] DOMString label, optional Dictionary options);
    104104
    105105    void close();
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r197139 r197156  
    41424142
    41434143    if ($type eq "DOMString") {
    4144         # FIXME: This implements [TreatNullAs=NullString] and [TreatUndefinedAs=NullString],
    4145         # but the Web IDL spec requires [TreatNullAs=EmptyString] and [TreatUndefinedAs=EmptyString].
    4146         if (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") and ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString")) {
    4147             return "valueToStringWithUndefinedOrNullCheck(state, $value)"
    4148         }
    41494144        if ($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") {
    41504145            return "valueToStringWithNullCheck(state, $value)"
    41514146        }
    4152         if ($signature->isNullable) {
    4153             return "valueToStringWithUndefinedOrNullCheck(state, $value)";
    4154         }
    4155         if ($signature->extendedAttributes->{"AtomicString"}) {
    4156             return "$value.toString(state)->toAtomicString(state)";
    4157         }
    4158         # FIXME: Add the case for 'if ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString"))'.
     4147        return "valueToStringWithUndefinedOrNullCheck(state, $value)" if $signature->isNullable;
     4148        return "$value.toString(state)->toAtomicString(state)" if $signature->extendedAttributes->{"AtomicString"};
     4149
    41594150        return "$value.toString(state)->value(state)";
    41604151    }
  • trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt

    r197139 r197156  
    122122TreatNullAs=NullString
    123123TreatReturnedNaNDateAs=Null|NaN
    124 TreatUndefinedAs=NullString
    125124TypedArray=*
    126125URL
  • trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp

    r197060 r197156  
    15681568}
    15691569
    1570 void webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, WebKitDOMTestNode* value)
     1570void webkit_dom_test_obj_convert2(WebKitDOMTestObj* self, WebKitDOMTestNode* value)
    15711571{
    15721572    WebCore::JSMainThreadNullState state;
    … …  
    15751575    WebCore::TestObj* item = WebKit::core(self);
    15761576    WebCore::TestNode* convertedValue = WebKit::core(value);
     1577    item->convert2(convertedValue);
     1578}
     1579
     1580void webkit_dom_test_obj_convert3(WebKitDOMTestObj* self, const gchar* value)
     1581{
     1582    WebCore::JSMainThreadNullState state;
     1583    g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
     1584    g_return_if_fail(value);
     1585    WebCore::TestObj* item = WebKit::core(self);
     1586    WTF::String convertedValue = WTF::String::fromUTF8(value);
     1587    item->convert3(convertedValue);
     1588}
     1589
     1590void webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, const gchar* value)
     1591{
     1592    WebCore::JSMainThreadNullState state;
     1593    g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
     1594    g_return_if_fail(value);
     1595    WebCore::TestObj* item = WebKit::core(self);
     1596    WTF::String convertedValue = WTF::String::fromUTF8(value);
    15771597    item->convert4(convertedValue);
    1578 }
    1579 
    1580 void webkit_dom_test_obj_convert5(WebKitDOMTestObj* self, WebKitDOMTestNode* value)
    1581 {
    1582     WebCore::JSMainThreadNullState state;
    1583     g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
    1584     g_return_if_fail(WEBKIT_DOM_IS_TEST_NODE(value));
    1585     WebCore::TestObj* item = WebKit::core(self);
    1586     WebCore::TestNode* convertedValue = WebKit::core(value);
    1587     item->convert5(convertedValue);
    15881598}
    15891599
  • trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h

    r197060 r197156  
    550550
    551551/**
     552 * webkit_dom_test_obj_convert2:
     553 * @self: A #WebKitDOMTestObj
     554 * @value: A #WebKitDOMTestNode
     555 *
     556 * Stability: Unstable
     557**/
     558WEBKIT_API void
     559webkit_dom_test_obj_convert2(WebKitDOMTestObj* self, WebKitDOMTestNode* value);
     560
     561/**
     562 * webkit_dom_test_obj_convert3:
     563 * @self: A #WebKitDOMTestObj
     564 * @value: A #gchar
     565 *
     566 * Stability: Unstable
     567**/
     568WEBKIT_API void
     569webkit_dom_test_obj_convert3(WebKitDOMTestObj* self, const gchar* value);
     570
     571/**
    552572 * webkit_dom_test_obj_convert4:
    553573 * @self: A #WebKitDOMTestObj
    554  * @value: A #WebKitDOMTestNode
    555  *
    556  * Stability: Unstable
    557 **/
    558 WEBKIT_API void
    559 webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, WebKitDOMTestNode* value);
    560 
    561 /**
    562  * webkit_dom_test_obj_convert5:
    563  * @self: A #WebKitDOMTestObj
    564  * @value: A #WebKitDOMTestNode
    565  *
    566  * Stability: Unstable
    567 **/
    568 WEBKIT_API void
    569 webkit_dom_test_obj_convert5(WebKitDOMTestObj* self, WebKitDOMTestNode* value);
     574 * @value: A #gchar
     575 *
     576 * Stability: Unstable
     577**/
     578WEBKIT_API void
     579webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, const gchar* value);
    570580
    571581/**
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r197060 r197156  
    168168JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionGetSVGDocument(JSC::ExecState*);
    169169JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(JSC::ExecState*);
     170JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(JSC::ExecState*);
     171JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(JSC::ExecState*);
    170172JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(JSC::ExecState*);
    171 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(JSC::ExecState*);
    172173JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMutablePointFunction(JSC::ExecState*);
    173174JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionImmutablePointFunction(JSC::ExecState*);
    … …  
    691692    { "getSVGDocument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionGetSVGDocument), (intptr_t) (0) } },
    692693    { "convert1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert1), (intptr_t) (1) } },
     694    { "convert2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert2), (intptr_t) (1) } },
     695    { "convert3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert3), (intptr_t) (1) } },
    693696    { "convert4", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert4), (intptr_t) (1) } },
    694     { "convert5", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert5), (intptr_t) (1) } },
    695697    { "mutablePointFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMutablePointFunction), (intptr_t) (0) } },
    696698    { "immutablePointFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionImmutablePointFunction), (intptr_t) (0) } },
    … …  
    46274629}
    46284630
     4631EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(ExecState* state)
     4632{
     4633    JSValue thisValue = state->thisValue();
     4634    auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
     4635    if (UNLIKELY(!castedThis))
     4636        return throwThisTypeError(*state, "TestObj", "convert2");
     4637    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     4638    auto& impl = castedThis->wrapped();
     4639    if (UNLIKELY(state->argumentCount() < 1))
     4640        return throwVMError(state, createNotEnoughArgumentsError(state));
     4641    TestNode* value = JSTestNode::toWrapped(state->argument(0));
     4642    if (UNLIKELY(state->hadException()))
     4643        return JSValue::encode(jsUndefined());
     4644    impl.convert2(value);
     4645    return JSValue::encode(jsUndefined());
     4646}
     4647
     4648EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(ExecState* state)
     4649{
     4650    JSValue thisValue = state->thisValue();
     4651    auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
     4652    if (UNLIKELY(!castedThis))
     4653        return throwThisTypeError(*state, "TestObj", "convert3");
     4654    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
     4655    auto& impl = castedThis->wrapped();
     4656    if (UNLIKELY(state->argumentCount() < 1))
     4657        return throwVMError(state, createNotEnoughArgumentsError(state));
     4658    String value = state->argument(0).toString(state)->value(state);
     4659    if (UNLIKELY(state->hadException()))
     4660        return JSValue::encode(jsUndefined());
     4661    impl.convert3(value);
     4662    return JSValue::encode(jsUndefined());
     4663}
     4664
    46294665EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* state)
    46304666{
    … …  
    46374673    if (UNLIKELY(state->argumentCount() < 1))
    46384674        return throwVMError(state, createNotEnoughArgumentsError(state));
    4639     TestNode* value = JSTestNode::toWrapped(state->argument(0));
     4675    String value = valueToStringWithUndefinedOrNullCheck(state, state->argument(0));
    46404676    if (UNLIKELY(state->hadException()))
    46414677        return JSValue::encode(jsUndefined());
    46424678    impl.convert4(value);
    4643     return JSValue::encode(jsUndefined());
    4644 }
    4645 
    4646 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(ExecState* state)
    4647 {
    4648     JSValue thisValue = state->thisValue();
    4649     auto castedThis = jsDynamicCast<JSTestObj*>(thisValue);
    4650     if (UNLIKELY(!castedThis))
    4651         return throwThisTypeError(*state, "TestObj", "convert5");
    4652     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
    4653     auto& impl = castedThis->wrapped();
    4654     if (UNLIKELY(state->argumentCount() < 1))
    4655         return throwVMError(state, createNotEnoughArgumentsError(state));
    4656     TestNode* value = JSTestNode::toWrapped(state->argument(0));
    4657     if (UNLIKELY(state->hadException()))
    4658         return JSValue::encode(jsUndefined());
    4659     impl.convert5(value);
    46604679    return JSValue::encode(jsUndefined());
    46614680}
  • trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h

    r197060 r197156  
    180180- (DOMSVGDocument *)getSVGDocument;
    181181- (void)convert1:(DOMTestNode *)value;
    182 - (void)convert4:(DOMTestNode *)value;
    183 - (void)convert5:(DOMTestNode *)value;
     182- (void)convert2:(DOMTestNode *)value;
     183- (void)convert3:(NSString *)value;
     184- (void)convert4:(NSString *)value;
    184185- (DOMSVGPoint *)mutablePointFunction;
    185186- (DOMSVGPoint *)immutablePointFunction;
  • trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm

    r197060 r197156  
    12861286}
    12871287
    1288 - (void)convert4:(DOMTestNode *)value
    1289 {
    1290     WebCore::JSMainThreadNullState state;
    1291     IMPL->convert4(core(value));
    1292 }
    1293 
    1294 - (void)convert5:(DOMTestNode *)value
    1295 {
    1296     WebCore::JSMainThreadNullState state;
    1297     IMPL->convert5(core(value));
     1288- (void)convert2:(DOMTestNode *)value
     1289{
     1290    WebCore::JSMainThreadNullState state;
     1291    IMPL->convert2(core(value));
     1292}
     1293
     1294- (void)convert3:(NSString *)value
     1295{
     1296    WebCore::JSMainThreadNullState state;
     1297    IMPL->convert3(value);
     1298}
     1299
     1300- (void)convert4:(NSString *)value
     1301{
     1302    WebCore::JSMainThreadNullState state;
     1303    IMPL->convert4(value);
    12981304}
    12991305
  • trunk/Source/WebCore/bindings/scripts/test/TestObj.idl

    r197060 r197156  
    263263
    264264    void convert1(TestNode value);
    265     void convert4([TreatNullAs=NullString] TestNode value);
    266     void convert5([TreatNullAs=NullString, TreatUndefinedAs=NullString] TestNode value);
     265    void convert2(TestNode? value);
     266    void convert3(DOMString value);
     267    void convert4(DOMString? value);
    267268
    268269    attribute SVGPoint mutablePoint;
  • trunk/Source/WebCore/dom/DOMImplementation.idl

    r195520 r197156  
    2626    // DOM Level 1
    2727
    28     [ObjCLegacyUnnamedParameters] boolean hasFeature([Default=Undefined] optional DOMString feature, 
    29                                       [TreatNullAs=NullString, Default=Undefined] optional DOMString version);
     28    [ObjCLegacyUnnamedParameters] boolean hasFeature([Default=Undefined] optional DOMString feature,
     29        [TreatNullAs=NullString, Default=Undefined] optional DOMString version);
    3030
    3131    // DOM Level 2
    3232
    33     [ObjCLegacyUnnamedParameters, RaisesException, NewObject] DocumentType createDocumentType([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString qualifiedName,
    34                                                    [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString publicId,
    35                                                    [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString systemId);
     33    [ObjCLegacyUnnamedParameters, RaisesException, NewObject] DocumentType createDocumentType([Default=Undefined] optional DOMString? qualifiedName,
     34        [Default=Undefined] optional DOMString? publicId, [Default=Undefined] optional DOMString? systemId);
    3635
    3736#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT
    … …  
    3938        optional DocumentType doctype);
    4039#else
    41     [RaisesException, NewObject] XMLDocument createDocument([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString namespaceURI,
    42         [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName,
    43         [TreatNullAs=NullString, Default=Undefined] optional DocumentType doctype);
     40    [RaisesException, NewObject] XMLDocument createDocument([Default=Undefined] optional DOMString? namespaceURI,
     41        [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName, [Default=Undefined] optional DocumentType? doctype);
    4442#endif
    4543
  • trunk/Source/WebCore/dom/Document.idl

    r197142 r197156  
    5555    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
    5656                    optional boolean deep);
    57     [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS([TreatNullAs=NullString,TreatUndefinedAs=NullString,Default=Undefined] optional DOMString namespaceURI,
    58                             [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
    59     [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,TreatUndefinedAs=NullString,Default=Undefined] optional DOMString namespaceURI,
    60                                                                           [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
    61 
    62 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
    63     [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
    64 #else
    65     HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
     57    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS([Default=Undefined] optional DOMString? namespaceURI,
     58        [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName);
     59    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS([Default=Undefined] optional DOMString? namespaceURI,
     60        [TreatNullAs=NullString, Default=Undefined] optional DOMString qualifiedName);
     61
     62#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
     63    [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(optional DOMString namespaceURI, optional DOMString localName);
     64#else
     65    HTMLCollection getElementsByTagNameNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
    6666#endif
    6767
    … …  
    142142    boolean            execCommand([Default=Undefined] optional DOMString command,
    143143                                   [Default=Undefined] optional boolean userInterface,
    144                                    [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString value);
     144                                   optional DOMString? value);
    145145
    146146#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
  • trunk/Source/WebCore/dom/Element.idl

    r197060 r197156  
    5050    // DOM Level 2 Core
    5151
    52     [ObjCLegacyUnnamedParameters] DOMString? getAttributeNS([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString namespaceURI,
    53                                             [Default=Undefined] optional DOMString localName);
    54     [ObjCLegacyUnnamedParameters, RaisesException] void setAttributeNS([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString namespaceURI,
    55                                        [Default=Undefined] optional DOMString qualifiedName,
    56                                        [Default=Undefined] optional DOMString value);
    57     [ObjCLegacyUnnamedParameters] void removeAttributeNS([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString namespaceURI,
    58                                           DOMString localName);
    59 
    60 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
    61     [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
    62 #else
    63     HTMLCollection getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI, [Default=Undefined] optional DOMString localName);
    64 #endif
    65     [ObjCLegacyUnnamedParameters] Attr getAttributeNodeNS([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString namespaceURI,
    66                                            [Default=Undefined] optional DOMString localName);
     52    [ObjCLegacyUnnamedParameters] DOMString? getAttributeNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
     53    [ObjCLegacyUnnamedParameters, RaisesException] void setAttributeNS([Default=Undefined] optional DOMString? namespaceURI,
     54        [Default=Undefined] optional DOMString qualifiedName,
     55        [Default=Undefined] optional DOMString value);
     56    [ObjCLegacyUnnamedParameters] void removeAttributeNS(DOMString? namespaceURI, DOMString localName);
     57
     58#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
     59    [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(optional DOMString namespaceURI, optional DOMString localName);
     60#else
     61    HTMLCollection getElementsByTagNameNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
     62#endif
     63    [ObjCLegacyUnnamedParameters] Attr getAttributeNodeNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
    6764    [RaisesException] Attr setAttributeNodeNS([Default=Undefined] optional Attr newAttr);
    6865    boolean hasAttribute(DOMString name);
    69     [ObjCLegacyUnnamedParameters] boolean hasAttributeNS([TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString namespaceURI,
    70                                           [Default=Undefined] optional DOMString localName);
     66    [ObjCLegacyUnnamedParameters] boolean hasAttributeNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
    7167
    7268    [ImplementedAs=cssomStyle] readonly attribute CSSStyleDeclaration style;
  • trunk/Source/WebCore/dom/NamedNodeMap.idl

    r159061 r197156  
    3737    // Introduced in DOM Level 2:
    3838
    39     [ObjCLegacyUnnamedParameters] Node getNamedItemNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
    40                                        [Default=Undefined] optional DOMString localName);
     39    [ObjCLegacyUnnamedParameters] Node getNamedItemNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
    4140
    4241    [RaisesException] Node setNamedItemNS([Default=Undefined] optional Node node);
    4342
    44     [ObjCLegacyUnnamedParameters, RaisesException] Node removeNamedItemNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
    45                                           [Default=Undefined] optional DOMString localName);
    46 
     43    [ObjCLegacyUnnamedParameters, RaisesException] Node removeNamedItemNS([Default=Undefined] optional DOMString? namespaceURI, [Default=Undefined] optional DOMString localName);
    4744};
    4845
  • trunk/Source/WebCore/dom/Node.idl

    r197060 r197156  
    7777
    7878#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
    79     [ObjCLegacyUnnamedParameters, ImplementedAs=isSupportedForBindings] boolean isSupported([Default=Undefined] optional DOMString feature,
    80                                        [TreatNullAs=NullString,Default=Undefined] optional DOMString version);
     79    [ObjCLegacyUnnamedParameters, ImplementedAs=isSupportedForBindings] boolean isSupported(optional DOMString feature, optional DOMString version);
    8180#endif
    8281
    … …  
    10099    boolean            isSameNode([Default=Undefined] optional Node other);
    101100    boolean            isEqualNode([Default=Undefined] optional Node other);
    102     DOMString?         lookupPrefix([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI);
    103     boolean            isDefaultNamespace([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI);
    104     DOMString?         lookupNamespaceURI([TreatNullAs=NullString,Default=Undefined] optional DOMString prefix);
     101    DOMString?         lookupPrefix([Default=Undefined] optional DOMString? namespaceURI);
     102    boolean            isDefaultNamespace([Default=Undefined] optional DOMString? namespaceURI);
     103    DOMString?         lookupNamespaceURI([Default=Undefined] optional DOMString? prefix);
    105104
    106105    // DocumentPosition
  • trunk/Source/WebCore/fileapi/Blob.idl

    r171824 r197156  
    4040
    4141#if !defined(LANGUAGE_OBJECTIVE_C)
    42     Blob slice(optional long long start, optional long long end, [TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString contentType);
     42    Blob slice(optional long long start, optional long long end, optional DOMString? contentType);
    4343#endif
    4444};
  • trunk/Source/WebCore/html/HTMLButtonElement.idl

    r194999 r197156  
    3636    readonly attribute DOMString validationMessage;
    3737    boolean checkValidity();
    38     void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
     38    void setCustomValidity(DOMString? error);
    3939
    4040    readonly attribute NodeList labels;
  • trunk/Source/WebCore/html/HTMLCanvasElement.idl

    r181415 r197156  
    3333    attribute long height;
    3434
    35     [Custom, RaisesException] DOMString toDataURL([TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString type);
     35    [Custom, RaisesException] DOMString toDataURL(optional DOMString? type);
    3636
    3737#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
  • trunk/Source/WebCore/html/HTMLFieldSetElement.idl

    r191358 r197156  
    3535    readonly attribute DOMString       validationMessage;
    3636    boolean  checkValidity();
    37     void     setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
     37    void     setCustomValidity(DOMString? error);
    3838};
  • trunk/Source/WebCore/html/HTMLInputElement.idl

    r195700 r197156  
    7474    readonly attribute DOMString validationMessage;
    7575    boolean checkValidity();
    76     void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
     76    void setCustomValidity(DOMString? error);
    7777
    7878    readonly attribute NodeList labels;
    … …  
    111111
    112112#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
    113     void setValueForUser([TreatNullAs=NullString] DOMString value);
     113    void setValueForUser(DOMString value);
    114114#endif
    115115
  • trunk/Source/WebCore/html/HTMLKeygenElement.idl

    r159061 r197156  
    4343    readonly attribute DOMString validationMessage;
    4444    boolean checkValidity();
    45     void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
     45    void setCustomValidity(DOMString? error);
    4646
    4747    readonly attribute NodeList labels;
  • trunk/Source/WebCore/html/HTMLMediaElement.idl

    r186020 r197156  
    4747    void load();
    4848#if defined(ENABLE_ENCRYPTED_MEDIA) && ENABLE_ENCRYPTED_MEDIA
    49     DOMString canPlayType([Default=Undefined] optional DOMString type, [Default=Undefined, TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString keySystem);
     49    DOMString canPlayType([Default=Undefined] optional DOMString type, optional DOMString? keySystem);
    5050#elif defined(ENABLE_ENCRYPTED_MEDIA_V2) && ENABLE_ENCRYPTED_MEDIA_V2
    51     DOMString canPlayType([Default=Undefined] optional DOMString type, [Default=Undefined, TreatNullAs=NullString, TreatUndefinedAs=NullString] optional DOMString keySystem);
     51    DOMString canPlayType([Default=Undefined] optional DOMString type, optional DOMString? keySystem);
    5252#else
    5353    DOMString canPlayType([Default=Undefined] optional DOMString type);
    … …  
    9696
    9797#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT // Work around shortcomings in the gobject binding generator handling of conditional features by turning these off for gobject.
    98     [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitGenerateKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, optional Uint8Array initData);
    99     [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitAddKey([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, Uint8Array key, optional Uint8Array initData, [Default=NullString] optional DOMString sessionId);
    100     [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitCancelKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, [Default=NullString] optional DOMString sessionId);
     98    [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitGenerateKeyRequest(DOMString? keySystem, optional Uint8Array initData);
     99    [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitAddKey(DOMString? keySystem, Uint8Array key, optional Uint8Array initData, [Default=NullString] optional DOMString sessionId);
     100    [Conditional=ENCRYPTED_MEDIA, RaisesException] void webkitCancelKeyRequest(DOMString? keySystem, [Default=NullString] optional DOMString sessionId);
    101101
    102102    [Conditional=ENCRYPTED_MEDIA_V2, ImplementedAs=keys] readonly attribute MediaKeys webkitKeys;
  • trunk/Source/WebCore/html/HTMLObjectElement.idl

    r163440 r197156  
    4545    readonly attribute DOMString validationMessage;
    4646    boolean checkValidity();
    47     void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
     47    void setCustomValidity(DOMString? error);
    4848
    4949    // Introduced in DOM Level 2:
  • trunk/Source/WebCore/html/HTMLOutputElement.idl

    r196123 r197156  
    3737    readonly attribute DOMString validationMessage;
    3838    boolean checkValidity();
    39     void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
     39    void setCustomValidity(DOMString? error);
    4040
    4141    readonly attribute NodeList labels;
  • trunk/Source/WebCore/html/HTMLSelectElement.idl

    r196893 r197156  
    7171    readonly attribute DOMString validationMessage;
    7272    boolean checkValidity();
    73     void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
     73    void setCustomValidity(DOMString? error);
    7474
    7575    readonly attribute NodeList labels;
  • trunk/Source/WebCore/html/HTMLTextAreaElement.idl

    r196805 r197156  
    4848    readonly attribute DOMString validationMessage;
    4949    boolean checkValidity();
    50     void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
     50    void setCustomValidity(DOMString? error);
    5151
    5252    readonly attribute NodeList labels;
  • trunk/Source/WebCore/page/DOMWindow.idl

    r197060 r197156  
    7575    void alert([Default=Undefined] optional DOMString message);
    7676    boolean confirm([Default=Undefined] optional DOMString message);
    77     DOMString? prompt([Default=Undefined] optional DOMString message,
    78                                                 [TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString defaultValue);
     77    DOMString? prompt([Default=Undefined] optional DOMString message, [Default=Undefined] optional DOMString? defaultValue);
    7978
    8079    boolean find([Default=Undefined] optional DOMString string,
    … …  
    141140
    142141    // DOM Level 2 Style Interface
    143     CSSStyleDeclaration getComputedStyle([Default=Undefined] optional Element element,
    144                                                               [TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString pseudoElement);
     142    CSSStyleDeclaration getComputedStyle([Default=Undefined] optional Element element, [Default=Undefined] optional DOMString? pseudoElement);
    145143
    146144    // WebKit extensions
    147145#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
    148     CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element,
    149                                    [TreatNullAs=NullString, TreatUndefinedAs=NullString,Default=Undefined] optional DOMString pseudoElement);
     146    CSSRuleList getMatchedCSSRules([Default=Undefined] optional Element element, [Default=Undefined] optional DOMString? pseudoElement);
    150147#endif
    151148
  • trunk/Source/WebCore/storage/StorageEvent.idl

    r197060 r197156  
    3737                          [Default=Undefined] optional boolean cancelableArg,
    3838                          [Default=Undefined] optional DOMString keyArg,
    39                           [Default=Undefined,TreatNullAs=NullString] optional DOMString oldValueArg,
    40                           [Default=Undefined,TreatNullAs=NullString] optional DOMString newValueArg,
     39                          [Default=Undefined] optional DOMString? oldValueArg,
     40                          [Default=Undefined] optional DOMString? newValueArg,
    4141                          [Default=Undefined] optional DOMString urlArg,
    4242                          [Default=Undefined] optional Storage storageAreaArg);
Note: See TracChangeset for help on using the changeset viewer.