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

Changeset 203443 in webkit


Ignore:
Timestamp:
Jul 19, 2016, 10:09:51 PM (10 years ago)
Author:
Chris Dumez
Message:

Fix null handling of several HTMLDocument attributes
https://bugs.webkit.org/show_bug.cgi?id=159923

Reviewed by Benjamin Poulain.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

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

Source/WebCore:

Fix null handling of several HTMLDocument attributes:

In particular, null handling was incorrect in WebKit for 'dir',
'bgColor', 'fgColor', 'alinkColor', 'linkColor' and 'vlinkColor'.

Firefox and Chrome match the specification.

Test: fast/dom/HTMLDocument/null-handling.html

  • html/HTMLDocument.idl:

LayoutTests:

Add layout test coverage. I have verified that this test is passing in
both Firefox and Chrome.

  • fast/dom/HTMLDocument/null-handling-expected.txt: Added.
  • fast/dom/HTMLDocument/null-handling.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r203441 r203443  
     12016-07-19  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix null handling of several HTMLDocument attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=159923
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Add layout test coverage. I have verified that this test is passing in
     9        both Firefox and Chrome.
     10
     11        * fast/dom/HTMLDocument/null-handling-expected.txt: Added.
     12        * fast/dom/HTMLDocument/null-handling.html: Added.
     13
    1142016-07-19  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r203441 r203443  
     12016-07-19  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix null handling of several HTMLDocument attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=159923
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Rebaseline now that more checks are passing.
     9
     10        * web-platform-tests/html/dom/reflection-sections-expected.txt:
     11
    1122016-07-19  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-sections-expected.txt

    r202471 r203443  
    1001310013PASS #document.fgColor (<body text>): IDL set to "\0" followed by IDL get
    1001410014PASS #document.fgColor (<body text>): IDL set to null should not throw
    10015 FAIL #document.fgColor (<body text>): IDL set to null followed by getAttribute() assert_equals: expected (string) "" but got (object) null
     10015PASS #document.fgColor (<body text>): IDL set to null followed by getAttribute()
    1001610016PASS #document.fgColor (<body text>): IDL set to null followed by IDL get
    1001710017PASS #document.fgColor (<body text>): IDL set to object "test-toString" should not throw
     
    1009010090PASS #document.linkColor (<body link>): IDL set to "\0" followed by IDL get
    1009110091PASS #document.linkColor (<body link>): IDL set to null should not throw
    10092 FAIL #document.linkColor (<body link>): IDL set to null followed by getAttribute() assert_equals: expected (string) "" but got (object) null
     10092PASS #document.linkColor (<body link>): IDL set to null followed by getAttribute()
    1009310093PASS #document.linkColor (<body link>): IDL set to null followed by IDL get
    1009410094PASS #document.linkColor (<body link>): IDL set to object "test-toString" should not throw
     
    1016710167PASS #document.vlinkColor (<body vlink>): IDL set to "\0" followed by IDL get
    1016810168PASS #document.vlinkColor (<body vlink>): IDL set to null should not throw
    10169 FAIL #document.vlinkColor (<body vlink>): IDL set to null followed by getAttribute() assert_equals: expected (string) "" but got (object) null
     10169PASS #document.vlinkColor (<body vlink>): IDL set to null followed by getAttribute()
    1017010170PASS #document.vlinkColor (<body vlink>): IDL set to null followed by IDL get
    1017110171PASS #document.vlinkColor (<body vlink>): IDL set to object "test-toString" should not throw
     
    1024410244PASS #document.alinkColor (<body alink>): IDL set to "\0" followed by IDL get
    1024510245PASS #document.alinkColor (<body alink>): IDL set to null should not throw
    10246 FAIL #document.alinkColor (<body alink>): IDL set to null followed by getAttribute() assert_equals: expected (string) "" but got (object) null
     10246PASS #document.alinkColor (<body alink>): IDL set to null followed by getAttribute()
    1024710247PASS #document.alinkColor (<body alink>): IDL set to null followed by IDL get
    1024810248PASS #document.alinkColor (<body alink>): IDL set to object "test-toString" should not throw
     
    1032110321PASS #document.bgColor (<body bgcolor>): IDL set to "\0" followed by IDL get
    1032210322PASS #document.bgColor (<body bgcolor>): IDL set to null should not throw
    10323 FAIL #document.bgColor (<body bgcolor>): IDL set to null followed by getAttribute() assert_equals: expected (string) "" but got (object) null
     10323PASS #document.bgColor (<body bgcolor>): IDL set to null followed by getAttribute()
    1032410324PASS #document.bgColor (<body bgcolor>): IDL set to null followed by IDL get
    1032510325PASS #document.bgColor (<body bgcolor>): IDL set to object "test-toString" should not throw
  • trunk/Source/WebCore/ChangeLog

    r203441 r203443  
     12016-07-19  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix null handling of several HTMLDocument attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=159923
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Fix null handling of several HTMLDocument attributes:
     9        - https://html.spec.whatwg.org/multipage/dom.html#document
     10        - https://html.spec.whatwg.org/multipage/obsolete.html#document-partial
     11
     12        In particular, null handling was incorrect in WebKit for 'dir',
     13        'bgColor', 'fgColor', 'alinkColor', 'linkColor' and 'vlinkColor'.
     14
     15        Firefox and Chrome match the specification.
     16
     17        Test: fast/dom/HTMLDocument/null-handling.html
     18
     19        * html/HTMLDocument.idl:
     20
    1212016-07-19  Chris Dumez  <cdumez@apple.com>
    222
  • trunk/Source/WebCore/html/HTMLDocument.idl

    r200934 r203443  
    5252#endif
    5353
    54     // FIXME: This should not have [TreatNullAs=LegacyNullString].
    55     [TreatNullAs=LegacyNullString] attribute DOMString dir;
     54    attribute DOMString dir;
    5655
    5756    attribute DOMString designMode;
     
    5958
    6059    // Deprecated attributes.
    61     // FIXME: These should not have [TreatNullAs=LegacyNullString].
    62     [TreatNullAs=LegacyNullString] attribute DOMString bgColor;
    63     [TreatNullAs=LegacyNullString] attribute DOMString fgColor;
    64     [TreatNullAs=LegacyNullString] attribute DOMString alinkColor;
    65     [TreatNullAs=LegacyNullString] attribute DOMString linkColor;
    66     [TreatNullAs=LegacyNullString] attribute DOMString vlinkColor;
     60    [TreatNullAs=EmptyString] attribute DOMString bgColor;
     61    [TreatNullAs=EmptyString] attribute DOMString fgColor;
     62    [TreatNullAs=EmptyString] attribute DOMString alinkColor;
     63    [TreatNullAs=EmptyString] attribute DOMString linkColor;
     64    [TreatNullAs=EmptyString] attribute DOMString vlinkColor;
    6765};
    6866
Note: See TracChangeset for help on using the changeset viewer.