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

Changeset 197139 in webkit


Ignore:
Timestamp:
Feb 25, 2016, 3:24:14 PM (11 years ago)
Author:
Chris Dumez
Message:

Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
​https://bugs.webkit.org/show_bug.cgi?id=154662

Reviewed by Darin Adler.

Source/WebCore:

Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute.
This has no standard equivalent and all uses in WebKit are either useless
or wrong.

Test: fast/frames/detached-frame-document-defaultCharset.html

  • bindings/scripts/CodeGeneratorJS.pm:

(NativeToJSValue): Deleted.

  • bindings/scripts/IDLAttributes.txt:

Drop support for [TreatReturnedNullStringAs=X] entirely.

  • dom/Document.cpp:

(WebCore::Document::defaultCharset):
Fall back to return "UTF-8" instead of the null string, similarly to
what is done in for Document.characterSet. Note that this attribute
is non-standard and is an IE extension. Firefox never supported it
and Chrome dropped it last year.

  • dom/Document.idl:
  • Drop extended attribute for Document.defaultCharset as the implementation has been updated to never return a null String.
  • Drop extended attribute for Document.readyState. It was useless because the implementation could never return a null String.
  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::getAllResponseHeaders):
Update implementation to return emptyString() instead of "" in case
of error.

  • xml/XMLHttpRequest.idl:

Drop extended attribute from XMLHttpRequest.getAllResponseHeaders().
It was useless because the implementation could never return a
null String.

  • xml/XSLTProcessor.idl:

Drop extended attribute from XSLTProcessor.getParameter(). The
operation is already marked as [Custom] so the extended attribute
had no effect.

LayoutTests:

Add layout test to cover the return value of document.defaultCharset before
and after its frame is detached.

  • fast/frames/detached-frame-document-defaultCharset-expected.txt: Added.
  • fast/frames/detached-frame-document-defaultCharset.html: Added.
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r197138 r197139  
     12016-02-25  Chris Dumez  <cdumez@apple.com>
     2
     3        Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=154662
     5
     6        Reviewed by Darin Adler.
     7
     8        Add layout test to cover the return value of document.defaultCharset before
     9        and after its frame is detached.
     10
     11        * fast/frames/detached-frame-document-defaultCharset-expected.txt: Added.
     12        * fast/frames/detached-frame-document-defaultCharset.html: Added.
     13
    1142016-02-25  Ryan Haddad  <ryanhaddad@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r197132 r197139  
     12016-02-25  Chris Dumez  <cdumez@apple.com>
     2
     3        Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=154662
     5
     6        Reviewed by Darin Adler.
     7
     8        Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute.
     9        This has no standard equivalent and all uses in WebKit are either useless
     10        or wrong.
     11
     12        Test: fast/frames/detached-frame-document-defaultCharset.html
     13
     14        * bindings/scripts/CodeGeneratorJS.pm:
     15        (NativeToJSValue): Deleted.
     16        * bindings/scripts/IDLAttributes.txt:
     17        Drop support for [TreatReturnedNullStringAs=X] entirely.
     18
     19        * dom/Document.cpp:
     20        (WebCore::Document::defaultCharset):
     21        Fall back to return "UTF-8" instead of the null string, similarly to
     22        what is done in for Document.characterSet. Note that this attribute
     23        is non-standard and is an IE extension. Firefox never supported it
     24        and Chrome dropped it last year.
     25
     26        * dom/Document.idl:
     27        - Drop extended attribute for Document.defaultCharset as the
     28          implementation has been updated to never return a null String.
     29        - Drop extended attribute for Document.readyState. It was useless
     30          because the implementation could never return a null String.
     31
     32        * xml/XMLHttpRequest.cpp:
     33        (WebCore::XMLHttpRequest::getAllResponseHeaders):
     34        Update implementation to return emptyString() instead of "" in case
     35        of error.
     36
     37        * xml/XMLHttpRequest.idl:
     38        Drop extended attribute from XMLHttpRequest.getAllResponseHeaders().
     39        It was useless because the implementation could never return a
     40        null String.
     41
     42        * xml/XSLTProcessor.idl:
     43        Drop extended attribute from XSLTProcessor.getParameter(). The
     44        operation is already marked as [Custom] so the extended attribute
     45        had no effect.
     46
    1472016-02-25  Gavin Barraclough  <barraclough@apple.com>
    248
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r197060 r197139  
    42614261    if ($codeGenerator->IsStringType($type)) {
    42624262        AddToImplIncludes("URL.h", $conditional);
    4263         my $conv = $signature->extendedAttributes->{"TreatReturnedNullStringAs"};
    4264         if (defined $conv) {
    4265             return "jsStringOrUndefined(state, $value)" if $conv eq "Undefined";
    4266 
    4267             die "Unknown value for TreatReturnedNullStringAs extended attribute";
    4268         }
    42694263        return "jsStringOrNull(state, $value)" if $signature->isNullable;
    42704264        AddToImplIncludes("<runtime/JSString.h>", $conditional);
  • trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt

    r197060 r197139  
    122122TreatNullAs=NullString
    123123TreatReturnedNaNDateAs=Null|NaN
    124 TreatReturnedNullStringAs=Undefined
    125124TreatUndefinedAs=NullString
    126125TypedArray=*
  • trunk/Source/WebCore/dom/Document.cpp

    r196998 r197139  
    12951295    if (Settings* settings = this->settings())
    12961296        return settings->defaultTextEncodingName();
    1297     return String();
     1297    return UTF8Encoding().domName();
    12981298}
    12991299
  • trunk/Source/WebCore/dom/Document.idl

    r197060 r197139  
    189189
    190190#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT
    191     [TreatReturnedNullStringAs=Undefined, TreatNullAs=NullString] attribute DOMString charset;
     191    attribute DOMString charset;
    192192#else
    193193    [ImplementedAs=characterSetWithUTF8Fallback] readonly attribute DOMString charset;
    194194#endif
    195     [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString defaultCharset;
    196     [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString readyState;
     195    readonly attribute DOMString defaultCharset;
     196    readonly attribute DOMString readyState;
    197197
    198198    Element            elementFromPoint([Default=Undefined] optional long x,
  • trunk/Source/WebCore/xml/XMLHttpRequest.cpp

    r196283 r197139  
    962962{
    963963    if (m_state < HEADERS_RECEIVED || m_error)
    964         return "";
     964        return emptyString();
    965965
    966966    StringBuilder stringBuilder;
  • trunk/Source/WebCore/xml/XMLHttpRequest.idl

    r197060 r197139  
    7070
    7171    // response
    72     [TreatReturnedNullStringAs=Undefined] DOMString getAllResponseHeaders();
     72    DOMString getAllResponseHeaders();
    7373    DOMString? getResponseHeader(DOMString header);
    7474    [GetterRaisesException, CustomGetter] readonly attribute DOMString? responseText;
  • trunk/Source/WebCore/xml/XSLTProcessor.idl

    r165676 r197139  
    4242
    4343    [Custom] void setParameter(DOMString namespaceURI, DOMString localName, DOMString value);
    44     [Custom, TreatReturnedNullStringAs=Undefined] DOMString getParameter(DOMString namespaceURI, DOMString localName);
     44    [Custom] DOMString getParameter(DOMString namespaceURI, DOMString localName);
    4545    [Custom] void removeParameter(DOMString namespaceURI, DOMString localName);
    4646    void clearParameters();
Note: See TracChangeset for help on using the changeset viewer.