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

Changeset 203525 in webkit


Ignore:
Timestamp:
Jul 21, 2016, 2:11:06 PM (10 years ago)
Author:
Chris Dumez
Message:

Fix null handling for several HTMLBodyElement attributes
​https://bugs.webkit.org/show_bug.cgi?id=160044

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

  • web-platform-tests/html/dom/reflection-sections-expected.txt:

Source/WebCore:

Fix null handling for several HTMLBodyElement attributes to match the
specification:

The attributes in question are: 'text', 'link', 'vlink', 'alink' and
'bgcolor'.

We are supposed to treat null as the empty string for these attributes.

Firefox and Chrome both agree with the specification.

No new tests, rebaselined existing tests.

  • html/HTMLBodyElement.idl:

LayoutTests:

Update existing test to reflect the behavior change.

  • fast/dom/element-attribute-js-null-expected.txt:
  • fast/dom/element-attribute-js-null.html:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r203524 r203525  
     12016-07-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix null handling for several HTMLBodyElement attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=160044
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Update existing test to reflect the behavior change.
     9
     10        * fast/dom/element-attribute-js-null-expected.txt:
     11        * fast/dom/element-attribute-js-null.html:
     12
    1132016-07-21  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/fast/dom/element-attribute-js-null-expected.txt

    r203524 r203525  
    4646
    4747
    48 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.aLink]
     48TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.aLink]
    4949TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.background]
    50 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.bgColor]
    51 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.link]
    52 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.text]
    53 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.vLink]
     50TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.bgColor]
     51TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.link]
     52TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.text]
     53TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.vLink]
    5454
    5555TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBRElement.clear]
  • trunk/LayoutTests/fast/dom/element-attribute-js-null.html

    r203524 r203525  
    154154                    elementToUse: document.createElement('body'),
    155155                    attributes: [
    156                         {name: 'aLink', expectedNull: 'null'},
     156                        {name: 'aLink', expectedNull: ''},
    157157                        {name: 'background', expectedNull: 'null'},
    158                         {name: 'bgColor', expectedNull: 'null'},
    159                         {name: 'link', expectedNull: 'null'},
    160                         {name: 'text', expectedNull: 'null'},
    161                         {name: 'vLink', expectedNull: 'null'}
     158                        {name: 'bgColor', expectedNull: ''},
     159                        {name: 'link', expectedNull: ''},
     160                        {name: 'text', expectedNull: ''},
     161                        {name: 'vLink', expectedNull: ''}
    162162                    ]
    163163                },
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r203524 r203525  
     12016-07-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix null handling for several HTMLBodyElement attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=160044
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Rebaseline W3C test now that more checks are passing.
     9
     10        * web-platform-tests/html/dom/reflection-sections-expected.txt:
     11
    1122016-07-21  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-sections-expected.txt

    r203443 r203525  
    664664PASS body.text: IDL set to "\0" followed by IDL get
    665665PASS body.text: IDL set to null should not throw
    666 FAIL body.text: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
    667 FAIL body.text: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
     666PASS body.text: IDL set to null followed by getAttribute()
     667PASS body.text: IDL set to null followed by IDL get
    668668PASS body.text: IDL set to object "test-toString" should not throw
    669669PASS body.text: IDL set to object "test-toString" followed by getAttribute()
    … …  
    741741PASS body.link: IDL set to "\0" followed by IDL get
    742742PASS body.link: IDL set to null should not throw
    743 FAIL body.link: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
    744 FAIL body.link: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
     743PASS body.link: IDL set to null followed by getAttribute()
     744PASS body.link: IDL set to null followed by IDL get
    745745PASS body.link: IDL set to object "test-toString" should not throw
    746746PASS body.link: IDL set to object "test-toString" followed by getAttribute()
    … …  
    818818PASS body.vLink: IDL set to "\0" followed by IDL get
    819819PASS body.vLink: IDL set to null should not throw
    820 FAIL body.vLink: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
    821 FAIL body.vLink: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
     820PASS body.vLink: IDL set to null followed by getAttribute()
     821PASS body.vLink: IDL set to null followed by IDL get
    822822PASS body.vLink: IDL set to object "test-toString" should not throw
    823823PASS body.vLink: IDL set to object "test-toString" followed by getAttribute()
    … …  
    895895PASS body.aLink: IDL set to "\0" followed by IDL get
    896896PASS body.aLink: IDL set to null should not throw
    897 FAIL body.aLink: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
    898 FAIL body.aLink: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
     897PASS body.aLink: IDL set to null followed by getAttribute()
     898PASS body.aLink: IDL set to null followed by IDL get
    899899PASS body.aLink: IDL set to object "test-toString" should not throw
    900900PASS body.aLink: IDL set to object "test-toString" followed by getAttribute()
    … …  
    972972PASS body.bgColor: IDL set to "\0" followed by IDL get
    973973PASS body.bgColor: IDL set to null should not throw
    974 FAIL body.bgColor: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
    975 FAIL body.bgColor: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
     974PASS body.bgColor: IDL set to null followed by getAttribute()
     975PASS body.bgColor: IDL set to null followed by IDL get
    976976PASS body.bgColor: IDL set to object "test-toString" should not throw
    977977PASS body.bgColor: IDL set to object "test-toString" followed by getAttribute()
  • trunk/Source/WebCore/ChangeLog

    r203524 r203525  
     12016-07-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix null handling for several HTMLBodyElement attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=160044
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Fix null handling for several HTMLBodyElement attributes to match the
     9        specification:
     10        - https://html.spec.whatwg.org/#HTMLBodyElement-partial
     11
     12        The attributes in question are: 'text', 'link', 'vlink', 'alink' and
     13        'bgcolor'.
     14
     15        We are supposed to treat null as the empty string for these attributes.
     16
     17        Firefox and Chrome both agree with the specification.
     18
     19        No new tests, rebaselined existing tests.
     20
     21        * html/HTMLBodyElement.idl:
     22
    1232016-07-21  Chris Dumez  <cdumez@apple.com>
    224
  • trunk/Source/WebCore/html/HTMLBodyElement.idl

    r184616 r203525  
    2020
    2121interface HTMLBodyElement : HTMLElement {
    22     [Reflect] attribute DOMString aLink;
     22    [Reflect, TreatNullAs=EmptyString] attribute DOMString aLink;
    2323    [Reflect] attribute DOMString background;
    24     [Reflect] attribute DOMString bgColor;
    25     [Reflect] attribute DOMString link;
    26     [Reflect] attribute DOMString text;
    27     [Reflect] attribute DOMString vLink;
     24    [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
     25    [Reflect, TreatNullAs=EmptyString] attribute DOMString link;
     26    [Reflect, TreatNullAs=EmptyString] attribute DOMString text;
     27    [Reflect, TreatNullAs=EmptyString] attribute DOMString vLink;
    2828
    2929    [NotEnumerable, WindowEventHandler] attribute EventHandler onblur;
Note: See TracChangeset for help on using the changeset viewer.