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

Changeset 203529 in webkit


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

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

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

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

Source/WebCore:

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

The attributes in question are 'bicolor', 'cellSpacing' and
'cellPadding'. 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/HTMLTableElement.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

    r203528 r203529  
     12016-07-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix null handling for several HTMLTableElement attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=160041
     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

    r203528 r203529  
    207207
    208208TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.align]
    209 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.bgColor]
     209TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.bgColor]
    210210TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.border]
    211 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.cellPadding]
    212 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.cellSpacing]
     211TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.cellPadding]
     212TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.cellSpacing]
    213213TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.frame]
    214214TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.rules]
  • trunk/LayoutTests/fast/dom/element-attribute-js-null.html

    r203528 r203529  
    512512                    attributes: [
    513513                        {name: 'align', expectedNull: 'null'},
    514                         {name: 'bgColor', expectedNull: 'null'},
     514                        {name: 'bgColor', expectedNull: ''},
    515515                        {name: 'border', expectedNull: 'null'},
    516                         {name: 'cellPadding', expectedNull: 'null'},
    517                         {name: 'cellSpacing', expectedNull: 'null'},
     516                        {name: 'cellPadding', expectedNull: ''},
     517                        {name: 'cellSpacing', expectedNull: ''},
    518518                        {name: 'frame', expectedNull: 'null'},
    519519                        {name: 'rules', expectedNull: 'null'},
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r203528 r203529  
     12016-07-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix null handling for several HTMLTableElement attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=160041
     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-tabular-expected.txt:
     11
    1122016-07-21  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-tabular-expected.txt

    r203527 r203529  
    12051205PASS table.bgColor: IDL set to "\0" followed by IDL get
    12061206PASS table.bgColor: IDL set to null should not throw
    1207 FAIL table.bgColor: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
    1208 FAIL table.bgColor: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
     1207PASS table.bgColor: IDL set to null followed by getAttribute()
     1208PASS table.bgColor: IDL set to null followed by IDL get
    12091209PASS table.bgColor: IDL set to object "test-toString" should not throw
    12101210PASS table.bgColor: IDL set to object "test-toString" followed by getAttribute()
    … …  
    12821282PASS table.cellPadding: IDL set to "\0" followed by IDL get
    12831283PASS table.cellPadding: IDL set to null should not throw
    1284 FAIL table.cellPadding: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
    1285 FAIL table.cellPadding: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
     1284PASS table.cellPadding: IDL set to null followed by getAttribute()
     1285PASS table.cellPadding: IDL set to null followed by IDL get
    12861286PASS table.cellPadding: IDL set to object "test-toString" should not throw
    12871287PASS table.cellPadding: IDL set to object "test-toString" followed by getAttribute()
    … …  
    13591359PASS table.cellSpacing: IDL set to "\0" followed by IDL get
    13601360PASS table.cellSpacing: IDL set to null should not throw
    1361 FAIL table.cellSpacing: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
    1362 FAIL table.cellSpacing: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
     1361PASS table.cellSpacing: IDL set to null followed by getAttribute()
     1362PASS table.cellSpacing: IDL set to null followed by IDL get
    13631363PASS table.cellSpacing: IDL set to object "test-toString" should not throw
    13641364PASS table.cellSpacing: IDL set to object "test-toString" followed by getAttribute()
  • trunk/Source/WebCore/ChangeLog

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

    r200316 r203529  
    2727    readonly attribute HTMLCollection tBodies;
    2828    [Reflect] attribute DOMString align;
    29     [Reflect] attribute DOMString bgColor;
     29    [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
    3030    [Reflect] attribute DOMString border;
    31     [Reflect] attribute DOMString cellPadding;
    32     [Reflect] attribute DOMString cellSpacing;
     31    [Reflect, TreatNullAs=EmptyString] attribute DOMString cellPadding;
     32    [Reflect, TreatNullAs=EmptyString] attribute DOMString cellSpacing;
    3333
    3434    [Reflect] attribute DOMString frame;
Note: See TracChangeset for help on using the changeset viewer.