- Revision
- 203525
- Author
- [email protected]
- Date
- 2016-07-21 14:11:06 -0700 (Thu, 21 Jul 2016)
Log 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:
- https://html.spec.whatwg.org/#HTMLBodyElement-partial
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:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (203524 => 203525)
--- trunk/LayoutTests/ChangeLog 2016-07-21 21:10:35 UTC (rev 203524)
+++ trunk/LayoutTests/ChangeLog 2016-07-21 21:11:06 UTC (rev 203525)
@@ -1,5 +1,17 @@
2016-07-21 Chris Dumez <[email protected]>
+ Fix null handling for several HTMLBodyElement attributes
+ https://bugs.webkit.org/show_bug.cgi?id=160044
+
+ Reviewed by Ryosuke Niwa.
+
+ Update existing test to reflect the behavior change.
+
+ * fast/dom/element-attribute-js-null-expected.txt:
+ * fast/dom/element-attribute-js-null.html:
+
+2016-07-21 Chris Dumez <[email protected]>
+
Fix null handling for HTMLIFrameElement.marginWidth / marginHeight
https://bugs.webkit.org/show_bug.cgi?id=160037
Modified: trunk/LayoutTests/fast/dom/element-attribute-js-null-expected.txt (203524 => 203525)
--- trunk/LayoutTests/fast/dom/element-attribute-js-null-expected.txt 2016-07-21 21:10:35 UTC (rev 203524)
+++ trunk/LayoutTests/fast/dom/element-attribute-js-null-expected.txt 2016-07-21 21:11:06 UTC (rev 203525)
@@ -45,12 +45,12 @@
TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBaseElement.target]
-TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.aLink]
+TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.aLink]
TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.background]
-TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.bgColor]
-TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.link]
-TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.text]
-TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBodyElement.vLink]
+TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.bgColor]
+TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.link]
+TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.text]
+TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.vLink]
TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBRElement.clear]
Modified: trunk/LayoutTests/fast/dom/element-attribute-js-null.html (203524 => 203525)
--- trunk/LayoutTests/fast/dom/element-attribute-js-null.html 2016-07-21 21:10:35 UTC (rev 203524)
+++ trunk/LayoutTests/fast/dom/element-attribute-js-null.html 2016-07-21 21:11:06 UTC (rev 203525)
@@ -153,12 +153,12 @@
type: 'HTMLBodyElement',
elementToUse: document.createElement('body'),
attributes: [
- {name: 'aLink', expectedNull: 'null'},
+ {name: 'aLink', expectedNull: ''},
{name: 'background', expectedNull: 'null'},
- {name: 'bgColor', expectedNull: 'null'},
- {name: 'link', expectedNull: 'null'},
- {name: 'text', expectedNull: 'null'},
- {name: 'vLink', expectedNull: 'null'}
+ {name: 'bgColor', expectedNull: ''},
+ {name: 'link', expectedNull: ''},
+ {name: 'text', expectedNull: ''},
+ {name: 'vLink', expectedNull: ''}
]
},
{
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203524 => 203525)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-07-21 21:10:35 UTC (rev 203524)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-07-21 21:11:06 UTC (rev 203525)
@@ -1,5 +1,16 @@
2016-07-21 Chris Dumez <[email protected]>
+ Fix null handling for several HTMLBodyElement attributes
+ https://bugs.webkit.org/show_bug.cgi?id=160044
+
+ Reviewed by Ryosuke Niwa.
+
+ Rebaseline W3C test now that more checks are passing.
+
+ * web-platform-tests/html/dom/reflection-sections-expected.txt:
+
+2016-07-21 Chris Dumez <[email protected]>
+
Fix null handling for HTMLIFrameElement.marginWidth / marginHeight
https://bugs.webkit.org/show_bug.cgi?id=160037
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-sections-expected.txt (203524 => 203525)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-sections-expected.txt 2016-07-21 21:10:35 UTC (rev 203524)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-sections-expected.txt 2016-07-21 21:11:06 UTC (rev 203525)
@@ -663,8 +663,8 @@
PASS body.text: IDL set to "\0" followed by getAttribute()
PASS body.text: IDL set to "\0" followed by IDL get
PASS body.text: IDL set to null should not throw
-FAIL body.text: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
-FAIL body.text: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
+PASS body.text: IDL set to null followed by getAttribute()
+PASS body.text: IDL set to null followed by IDL get
PASS body.text: IDL set to object "test-toString" should not throw
PASS body.text: IDL set to object "test-toString" followed by getAttribute()
PASS body.text: IDL set to object "test-toString" followed by IDL get
@@ -740,8 +740,8 @@
PASS body.link: IDL set to "\0" followed by getAttribute()
PASS body.link: IDL set to "\0" followed by IDL get
PASS body.link: IDL set to null should not throw
-FAIL body.link: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
-FAIL body.link: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
+PASS body.link: IDL set to null followed by getAttribute()
+PASS body.link: IDL set to null followed by IDL get
PASS body.link: IDL set to object "test-toString" should not throw
PASS body.link: IDL set to object "test-toString" followed by getAttribute()
PASS body.link: IDL set to object "test-toString" followed by IDL get
@@ -817,8 +817,8 @@
PASS body.vLink: IDL set to "\0" followed by getAttribute()
PASS body.vLink: IDL set to "\0" followed by IDL get
PASS body.vLink: IDL set to null should not throw
-FAIL body.vLink: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
-FAIL body.vLink: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
+PASS body.vLink: IDL set to null followed by getAttribute()
+PASS body.vLink: IDL set to null followed by IDL get
PASS body.vLink: IDL set to object "test-toString" should not throw
PASS body.vLink: IDL set to object "test-toString" followed by getAttribute()
PASS body.vLink: IDL set to object "test-toString" followed by IDL get
@@ -894,8 +894,8 @@
PASS body.aLink: IDL set to "\0" followed by getAttribute()
PASS body.aLink: IDL set to "\0" followed by IDL get
PASS body.aLink: IDL set to null should not throw
-FAIL body.aLink: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
-FAIL body.aLink: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
+PASS body.aLink: IDL set to null followed by getAttribute()
+PASS body.aLink: IDL set to null followed by IDL get
PASS body.aLink: IDL set to object "test-toString" should not throw
PASS body.aLink: IDL set to object "test-toString" followed by getAttribute()
PASS body.aLink: IDL set to object "test-toString" followed by IDL get
@@ -971,8 +971,8 @@
PASS body.bgColor: IDL set to "\0" followed by getAttribute()
PASS body.bgColor: IDL set to "\0" followed by IDL get
PASS body.bgColor: IDL set to null should not throw
-FAIL body.bgColor: IDL set to null followed by getAttribute() assert_equals: expected "" but got "null"
-FAIL body.bgColor: IDL set to null followed by IDL get assert_equals: expected "" but got "null"
+PASS body.bgColor: IDL set to null followed by getAttribute()
+PASS body.bgColor: IDL set to null followed by IDL get
PASS body.bgColor: IDL set to object "test-toString" should not throw
PASS body.bgColor: IDL set to object "test-toString" followed by getAttribute()
PASS body.bgColor: IDL set to object "test-toString" followed by IDL get
Modified: trunk/Source/WebCore/ChangeLog (203524 => 203525)
--- trunk/Source/WebCore/ChangeLog 2016-07-21 21:10:35 UTC (rev 203524)
+++ trunk/Source/WebCore/ChangeLog 2016-07-21 21:11:06 UTC (rev 203525)
@@ -1,5 +1,27 @@
2016-07-21 Chris Dumez <[email protected]>
+ Fix null handling for several HTMLBodyElement attributes
+ https://bugs.webkit.org/show_bug.cgi?id=160044
+
+ Reviewed by Ryosuke Niwa.
+
+ Fix null handling for several HTMLBodyElement attributes to match the
+ specification:
+ - https://html.spec.whatwg.org/#HTMLBodyElement-partial
+
+ 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:
+
+2016-07-21 Chris Dumez <[email protected]>
+
Fix null handling for HTMLIFrameElement.marginWidth / marginHeight
https://bugs.webkit.org/show_bug.cgi?id=160037
Modified: trunk/Source/WebCore/html/HTMLBodyElement.idl (203524 => 203525)
--- trunk/Source/WebCore/html/HTMLBodyElement.idl 2016-07-21 21:10:35 UTC (rev 203524)
+++ trunk/Source/WebCore/html/HTMLBodyElement.idl 2016-07-21 21:11:06 UTC (rev 203525)
@@ -19,12 +19,12 @@
*/
interface HTMLBodyElement : HTMLElement {
- [Reflect] attribute DOMString aLink;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString aLink;
[Reflect] attribute DOMString background;
- [Reflect] attribute DOMString bgColor;
- [Reflect] attribute DOMString link;
- [Reflect] attribute DOMString text;
- [Reflect] attribute DOMString vLink;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString link;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString text;
+ [Reflect, TreatNullAs=EmptyString] attribute DOMString vLink;
[NotEnumerable, WindowEventHandler] attribute EventHandler onblur;
[NotEnumerable, WindowEventHandler] attribute EventHandler onerror;