Settings a reflected DOMString attribute to null should set it to the "null" string rather than the empty string
https://bugs.webkit.org/show_bug.cgi?id=153504
<rdar://problem/24353072>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Settings a reflected DOMString attribute to null should set it to the "null"
string rather than the empty string:
- https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes
- http://heycam.github.io/webidl/#es-DOMString
- http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring

Firefox and Chrome match the specification here.

This is causing a lot of W3C HTML reflection tests to fail on WebKit, e.g.:
- http://w3c-test.org/html/dom/reflection-text.html

No new tests, already covered by existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
Call toString() instead of valueToStringWithNullCheck() for reflected
attributes. This way, null gets converted to the string "null", as
expected, instead of a null String object.

* html/HTMLInputElement.idl:
Dropping [TreatNullAs=NullString] IDL extended attribute for
input.defaultValue, as this is not present in the specification:
- https://html.spec.whatwg.org/#htmlinputelement

Without this change, assigning null to input.defaultValue would not
set to to the "null" string, as is expected.

* html/HTMLTextAreaElement.idl:
Dropping [TreatNullAs=NullString] IDL extended attribute for
textArea.defaultValue, as this is not present in the specification:
- https://html.spec.whatwg.org/#htmltextareaelement

Without this change, assigning null to textArea.defaultValue would not
set to to the "null" string, as is expected.

* html/HTMLTitleElement.idl:
Dropping [TreatNullAs=NullString] IDL extended attribute for
title.text, as this is not present in the specification:
- https://html.spec.whatwg.org/#htmltitleelement

Without this change, assigning null to title.text would not
set to to the "null" string, as is expected.

LayoutTests:

Update existing tests as a lot of them were expecting that setting
a reflected DOMString attribute to null would set it to the empty
string instead of the string "null".

* fast/dom/domstring-attribute-reflection-expected.txt:
* fast/dom/domstring-attribute-reflection.html:
* fast/dom/element-attribute-js-null-expected.txt:
* fast/dom/element-attribute-js-null.html:
* fast/dom/ping-attribute-dom-binding-expected.txt:
* fast/dom/ping-attribute-dom-binding.html:
* fast/forms/fieldset/fieldset-name-expected.txt:
* fast/forms/fieldset/fieldset-name.html:
* fast/forms/input-minmax-expected.txt:
* fast/forms/input-minmax.html:
* fast/forms/input-pattern-expected.txt:
* fast/forms/input-pattern.html:
* fast/forms/submit-form-attributes-expected.txt:
* fast/forms/submit-form-attributes.html:
* fast/shadow-dom/HTMLSlotElement-interface.html:
* fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html:
* fast/shadow-dom/shadow-layout-after-slot-changes.html:
* svg/dom/svg-element-attribute-js-null-expected.txt:
* svg/dom/svg-element-attribute-js-null.xhtml:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@195700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b3139f5..1f7bae1 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,35 @@
+2016-01-27  Chris Dumez  <cdumez@apple.com>
+
+        Settings a reflected DOMString attribute to null should set it to the "null" string rather than the empty string
+        https://bugs.webkit.org/show_bug.cgi?id=153504
+        <rdar://problem/24353072>
+
+        Reviewed by Ryosuke Niwa.
+
+        Update existing tests as a lot of them were expecting that setting
+        a reflected DOMString attribute to null would set it to the empty
+        string instead of the string "null".
+
+        * fast/dom/domstring-attribute-reflection-expected.txt:
+        * fast/dom/domstring-attribute-reflection.html:
+        * fast/dom/element-attribute-js-null-expected.txt:
+        * fast/dom/element-attribute-js-null.html:
+        * fast/dom/ping-attribute-dom-binding-expected.txt:
+        * fast/dom/ping-attribute-dom-binding.html:
+        * fast/forms/fieldset/fieldset-name-expected.txt:
+        * fast/forms/fieldset/fieldset-name.html:
+        * fast/forms/input-minmax-expected.txt:
+        * fast/forms/input-minmax.html:
+        * fast/forms/input-pattern-expected.txt:
+        * fast/forms/input-pattern.html:
+        * fast/forms/submit-form-attributes-expected.txt:
+        * fast/forms/submit-form-attributes.html:
+        * fast/shadow-dom/HTMLSlotElement-interface.html:
+        * fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html:
+        * fast/shadow-dom/shadow-layout-after-slot-changes.html:
+        * svg/dom/svg-element-attribute-js-null-expected.txt:
+        * svg/dom/svg-element-attribute-js-null.xhtml:
+
 2016-01-27  Simon Fraser  <simon.fraser@apple.com>
 
         Support CSS3 Images values for the image-rendering property
diff --git a/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt b/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt
index 5579ddb..6acf635 100644
--- a/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt
+++ b/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt
@@ -9,8 +9,8 @@
 PASS element.setAttribute("name", " bar\n"); element.name is " bar\n"
 PASS element.getAttribute("name") is " bar\n"
 Setting null via the IDL attribute:
-PASS element.name = null; element.name is ""
-PASS element.getAttribute("name") is null
+PASS element.name = null; element.name is "null"
+PASS element.getAttribute("name") is "null"
 Setting null via the content attribute:
 PASS element.setAttribute("name", null); element.name is "null"
 PASS element.getAttribute("name") is "null"
@@ -39,8 +39,8 @@
 PASS element.setAttribute("name", " bar\n"); element.name is " bar\n"
 PASS element.getAttribute("name") is " bar\n"
 Setting null via the IDL attribute:
-PASS element.name = null; element.name is ""
-PASS element.getAttribute("name") is null
+PASS element.name = null; element.name is "null"
+PASS element.getAttribute("name") is "null"
 Setting null via the content attribute:
 PASS element.setAttribute("name", null); element.name is "null"
 PASS element.getAttribute("name") is "null"
@@ -69,8 +69,8 @@
 PASS element.setAttribute("name", " bar\n"); element.name is " bar\n"
 PASS element.getAttribute("name") is " bar\n"
 Setting null via the IDL attribute:
-PASS element.name = null; element.name is ""
-PASS element.getAttribute("name") is null
+PASS element.name = null; element.name is "null"
+PASS element.getAttribute("name") is "null"
 Setting null via the content attribute:
 PASS element.setAttribute("name", null); element.name is "null"
 PASS element.getAttribute("name") is "null"
@@ -99,8 +99,8 @@
 PASS element.setAttribute("name", " bar\n"); element.name is " bar\n"
 PASS element.getAttribute("name") is " bar\n"
 Setting null via the IDL attribute:
-PASS element.name = null; element.name is ""
-PASS element.getAttribute("name") is null
+PASS element.name = null; element.name is "null"
+PASS element.getAttribute("name") is "null"
 Setting null via the content attribute:
 PASS element.setAttribute("name", null); element.name is "null"
 PASS element.getAttribute("name") is "null"
@@ -129,8 +129,8 @@
 PASS element.setAttribute("step", " bar\n"); element.step is " bar\n"
 PASS element.getAttribute("step") is " bar\n"
 Setting null via the IDL attribute:
-PASS element.step = null; element.step is ""
-PASS element.getAttribute("step") is null
+PASS element.step = null; element.step is "null"
+PASS element.getAttribute("step") is "null"
 Setting null via the content attribute:
 PASS element.setAttribute("step", null); element.step is "null"
 PASS element.getAttribute("step") is "null"
@@ -159,8 +159,8 @@
 PASS element.setAttribute("name", " bar\n"); element.name is " bar\n"
 PASS element.getAttribute("name") is " bar\n"
 Setting null via the IDL attribute:
-PASS element.name = null; element.name is ""
-PASS element.getAttribute("name") is null
+PASS element.name = null; element.name is "null"
+PASS element.getAttribute("name") is "null"
 Setting null via the content attribute:
 PASS element.setAttribute("name", null); element.name is "null"
 PASS element.getAttribute("name") is "null"
@@ -189,8 +189,8 @@
 PASS element.setAttribute("name", " bar\n"); element.name is " bar\n"
 PASS element.getAttribute("name") is " bar\n"
 Setting null via the IDL attribute:
-PASS element.name = null; element.name is ""
-PASS element.getAttribute("name") is null
+PASS element.name = null; element.name is "null"
+PASS element.getAttribute("name") is "null"
 Setting null via the content attribute:
 PASS element.setAttribute("name", null); element.name is "null"
 PASS element.getAttribute("name") is "null"
@@ -219,8 +219,8 @@
 PASS element.setAttribute("name", " bar\n"); element.name is " bar\n"
 PASS element.getAttribute("name") is " bar\n"
 Setting null via the IDL attribute:
-PASS element.name = null; element.name is ""
-PASS element.getAttribute("name") is null
+PASS element.name = null; element.name is "null"
+PASS element.getAttribute("name") is "null"
 Setting null via the content attribute:
 PASS element.setAttribute("name", null); element.name is "null"
 PASS element.getAttribute("name") is "null"
@@ -249,8 +249,8 @@
 PASS element.setAttribute("name", " bar\n"); element.name is " bar\n"
 PASS element.getAttribute("name") is " bar\n"
 Setting null via the IDL attribute:
-PASS element.name = null; element.name is ""
-PASS element.getAttribute("name") is null
+PASS element.name = null; element.name is "null"
+PASS element.getAttribute("name") is "null"
 Setting null via the content attribute:
 PASS element.setAttribute("name", null); element.name is "null"
 PASS element.getAttribute("name") is "null"
@@ -279,8 +279,8 @@
 PASS element.setAttribute("name", " bar\n"); element.name is " bar\n"
 PASS element.getAttribute("name") is " bar\n"
 Setting null via the IDL attribute:
-PASS element.name = null; element.name is ""
-PASS element.getAttribute("name") is null
+PASS element.name = null; element.name is "null"
+PASS element.getAttribute("name") is "null"
 Setting null via the content attribute:
 PASS element.setAttribute("name", null); element.name is "null"
 PASS element.getAttribute("name") is "null"
diff --git a/LayoutTests/fast/dom/domstring-attribute-reflection.html b/LayoutTests/fast/dom/domstring-attribute-reflection.html
index c9eef7d..88dde8e 100644
--- a/LayoutTests/fast/dom/domstring-attribute-reflection.html
+++ b/LayoutTests/fast/dom/domstring-attribute-reflection.html
@@ -22,8 +22,8 @@
     shouldBeEqualToString('element.getAttribute("' + contentAttributeName + '")', ' bar\n');
 
     debug('Setting null via the IDL attribute:');
-    shouldBeEqualToString('element.' + idlAttributeName + ' = null; element.' + idlAttributeName, '');
-    shouldBeNull('element.getAttribute("' + contentAttributeName + '")');
+    shouldBeEqualToString('element.' + idlAttributeName + ' = null; element.' + idlAttributeName, 'null');
+    shouldBeEqualToString('element.getAttribute("' + contentAttributeName + '")', 'null');
 
     debug('Setting null via the content attribute:');
     shouldBeEqualToString('element.setAttribute("' + contentAttributeName + '", null); element.' + idlAttributeName, 'null');
diff --git a/LayoutTests/fast/dom/element-attribute-js-null-expected.txt b/LayoutTests/fast/dom/element-attribute-js-null-expected.txt
index c43f70a..dc49808 100644
--- a/LayoutTests/fast/dom/element-attribute-js-null-expected.txt
+++ b/LayoutTests/fast/dom/element-attribute-js-null-expected.txt
@@ -4,254 +4,235 @@
 TEST SUCCEEDED: The value was null. [tested Node.prefix]
 TEST SUCCEEDED: The value was the empty string. [tested Node.textContent]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLElement.title]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLElement.id]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLElement.lang]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLElement.title]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLElement.id]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLElement.lang]
 TEST SUCCEEDED: The value was the empty string. [tested HTMLElement.dir]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLElement.className]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLElement.className]
 TEST SUCCEEDED: The value was the empty string. [tested HTMLElement.innerHTML]
 TEST SUCCEEDED: The value was the empty string. [tested HTMLElement.innerText]
 TEST SUCCEEDED: Exception (Error: SyntaxError: DOM Exception 12) was thrown as expected. [tested HTMLElement.contentEditable]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.accessKey]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.charset]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.coords]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.href]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.hreflang]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.rel]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.rev]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.shape]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.target]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.type]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAnchorElement.accessKey]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAnchorElement.charset]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAnchorElement.coords]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAnchorElement.hreflang]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAnchorElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAnchorElement.rel]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAnchorElement.rev]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAnchorElement.shape]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAnchorElement.target]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAnchorElement.type]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.alt]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.archive]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.code]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.codeBase]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.height]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.hspace]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.object]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.vspace]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAppletElement.width]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.alt]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.archive]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.code]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.codeBase]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.height]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.hspace]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.object]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.vspace]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAppletElement.width]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAreaElement.accessKey]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAreaElement.alt]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAreaElement.coords]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAreaElement.href]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAreaElement.shape]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLAreaElement.target]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAreaElement.accessKey]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAreaElement.alt]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAreaElement.coords]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAreaElement.shape]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLAreaElement.target]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLBaseElement.target]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBaseElement.target]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLBlockquoteElement.cite]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.aLink]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLBodyElement.background]
-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 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 HTMLBRElement.clear]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLBRElement.clear]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLButtonElement.accessKey]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLButtonElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLButtonElement.value]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLButtonElement.accessKey]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLButtonElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLButtonElement.value]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLDivElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLDivElement.align]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLEmbedElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLEmbedElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLEmbedElement.src]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLEmbedElement.type]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLEmbedElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLEmbedElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLEmbedElement.type]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFontElement.color]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFontElement.face]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFontElement.size]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFontElement.color]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFontElement.face]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFontElement.size]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFormElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFormElement.acceptCharset]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFormElement.action]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFormElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFormElement.acceptCharset]
 TEST SUCCEEDED: The value was the string 'application/x-www-form-urlencoded'. [tested HTMLFormElement.encoding]
 TEST SUCCEEDED: The value was the string 'application/x-www-form-urlencoded'. [tested HTMLFormElement.enctype]
 TEST SUCCEEDED: The value was the string 'get'. [tested HTMLFormElement.method]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFormElement.target]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFormElement.target]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFrameElement.frameBorder]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFrameElement.longDesc]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFrameElement.marginHeight]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFrameElement.marginWidth]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFrameElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFrameElement.scrolling]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFrameElement.src]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFrameElement.location]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFrameElement.frameBorder]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFrameElement.marginHeight]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFrameElement.marginWidth]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFrameElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFrameElement.scrolling]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFrameSetElement.cols]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLFrameSetElement.rows]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFrameSetElement.cols]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLFrameSetElement.rows]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLHeadElement.profile]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLHeadElement.profile]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLHeadingElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLHeadingElement.align]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLHRElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLHRElement.size]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLHRElement.width]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLHRElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLHRElement.size]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLHRElement.width]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLHtmlElement.version]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLHtmlElement.version]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLIFrameElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLIFrameElement.frameBorder]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLIFrameElement.height]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLIFrameElement.longDesc]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLIFrameElement.marginHeight]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLIFrameElement.marginWidth]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLIFrameElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLIFrameElement.scrolling]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLIFrameElement.src]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLIFrameElement.width]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLIFrameElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLIFrameElement.frameBorder]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLIFrameElement.height]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLIFrameElement.marginHeight]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLIFrameElement.marginWidth]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLIFrameElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLIFrameElement.scrolling]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLIFrameElement.width]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLImageElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLImageElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLImageElement.alt]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLImageElement.border]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLImageElement.longDesc]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLImageElement.src]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLImageElement.useMap]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLImageElement.lowsrc]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLImageElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLImageElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLImageElement.alt]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLImageElement.border]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLImageElement.useMap]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.accept]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.accessKey]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.alt]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.defaultValue]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.src]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.accept]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.accessKey]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.alt]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.defaultValue]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.name]
 TEST SUCCEEDED: The value was the string 'text'. [tested HTMLInputElement.type]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.useMap]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLInputElement.useMap]
 TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.value]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLabelElement.accessKey]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLabelElement.htmlFor]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLabelElement.accessKey]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLabelElement.htmlFor]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLegendElement.accessKey]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLegendElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLegendElement.accessKey]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLegendElement.align]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLIElement.type]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLIElement.type]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLinkElement.charset]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLinkElement.href]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLinkElement.hreflang]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLinkElement.media]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLinkElement.rel]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLinkElement.rev]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLinkElement.target]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLLinkElement.type]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLinkElement.charset]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLinkElement.hreflang]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLinkElement.media]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLinkElement.rel]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLinkElement.rev]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLinkElement.target]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLinkElement.type]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLMapElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLMapElement.name]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLMetaElement.content]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLMetaElement.httpEquiv]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLMetaElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLMetaElement.scheme]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLMetaElement.content]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLMetaElement.httpEquiv]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLMetaElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLMetaElement.scheme]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLModElement.cite]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLModElement.dateTime]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLModElement.dateTime]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.code]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.archive]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.border]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.codeBase]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.codeType]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.data]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.height]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.standby]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.type]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.useMap]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLObjectElement.width]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.code]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.archive]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.border]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.codeBase]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.codeType]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.height]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.standby]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.type]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.useMap]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLObjectElement.width]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLOListElement.type]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLOListElement.type]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLOptGroupElement.label]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLOptGroupElement.label]
 
 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLOptionElement.text]
 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLOptionElement.label]
 TEST SUCCEEDED: The value was the string 'null'. [tested HTMLOptionElement.value]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLParagraphElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLParagraphElement.align]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLParamElement.name]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLParamElement.type]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLParamElement.value]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLParamElement.valueType]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLParamElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLParamElement.type]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLParamElement.value]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLParamElement.valueType]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLQuoteElement.cite]
 
 TEST SUCCEEDED: The value was the empty string. [tested HTMLScriptElement.text]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLScriptElement.htmlFor]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLScriptElement.event]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLScriptElement.charset]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLScriptElement.src]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLScriptElement.type]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLScriptElement.htmlFor]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLScriptElement.event]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLScriptElement.charset]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLScriptElement.type]
 
 TEST SUCCEEDED: The value was the empty string. [tested HTMLSelectElement.value]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLSelectElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLSelectElement.name]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLStyleElement.media]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLStyleElement.type]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLStyleElement.media]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLStyleElement.type]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCaptionElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCaptionElement.align]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.abbr]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.axis]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.bgColor]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.ch]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.chOff]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.headers]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.height]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.scope]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.vAlign]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableCellElement.width]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.abbr]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.axis]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.bgColor]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.ch]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.chOff]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.headers]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.height]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.scope]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.vAlign]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableCellElement.width]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableColElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableColElement.ch]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableColElement.chOff]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableColElement.vAlign]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableColElement.width]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableColElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableColElement.ch]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableColElement.chOff]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableColElement.vAlign]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableColElement.width]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.bgColor]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.border]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.cellPadding]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.cellSpacing]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.frame]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.rules]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.summary]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableElement.width]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.bgColor]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.border]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.cellPadding]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.cellSpacing]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.frame]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.rules]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.summary]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableElement.width]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableRowElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableRowElement.bgColor]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableRowElement.ch]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableRowElement.chOff]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableRowElement.vAlign]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableRowElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableRowElement.bgColor]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableRowElement.ch]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableRowElement.chOff]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableRowElement.vAlign]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableSectionElement.align]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableSectionElement.ch]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableSectionElement.chOff]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTableSectionElement.vAlign]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableSectionElement.align]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableSectionElement.ch]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableSectionElement.chOff]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTableSectionElement.vAlign]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTextAreaElement.defaultValue]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTextAreaElement.accessKey]
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTextAreaElement.name]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTextAreaElement.defaultValue]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTextAreaElement.accessKey]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTextAreaElement.name]
 TEST SUCCEEDED: The value was the empty string. [tested HTMLTextAreaElement.value]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLTitleElement.text]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLTitleElement.text]
 
-TEST SUCCEEDED: The value was the empty string. [tested HTMLUListElement.type]
+TEST SUCCEEDED: The value was the string 'null'. [tested HTMLUListElement.type]
 
 
diff --git a/LayoutTests/fast/dom/element-attribute-js-null.html b/LayoutTests/fast/dom/element-attribute-js-null.html
index 8029811..6489559 100644
--- a/LayoutTests/fast/dom/element-attribute-js-null.html
+++ b/LayoutTests/fast/dom/element-attribute-js-null.html
@@ -79,11 +79,11 @@
                     type: 'HTMLElement',
                     elementToUse: document.createElement('div'),
                     attributes: [
-                        {name: 'title', expectedNull: ''},
-                        {name: 'id', expectedNull: ''},
-                        {name: 'lang', expectedNull: ''},
+                        {name: 'title', expectedNull: 'null'},
+                        {name: 'id', expectedNull: 'null'},
+                        {name: 'lang', expectedNull: 'null'},
                         {name: 'dir', expectedNull: ''},
-                        {name: 'className', expectedNull: ''},
+                        {name: 'className', expectedNull: 'null'},
                         {name: 'innerHTML', expectedNull: ''},
                         {name: 'innerText', expectedNull: ''},
                         // FIXME: TEST THESE
@@ -96,95 +96,92 @@
                     type: 'HTMLAnchorElement',
                     elementToUse: document.createElement('a'),
                     attributes: [
-                        {name: 'accessKey', expectedNull: ''},
-                        {name: 'charset', expectedNull: ''},
-                        {name: 'coords', expectedNull: ''},
-                        {name: 'href', expectedNull: ''},
-                        {name: 'hreflang', expectedNull: ''},
-                        {name: 'name', expectedNull: ''},
-                        {name: 'rel', expectedNull: ''},
-                        {name: 'rev', expectedNull: ''},
-                        {name: 'shape', expectedNull: ''},
-                        {name: 'target', expectedNull: ''},
-                        {name: 'type', expectedNull: ''}
+                        {name: 'accessKey', expectedNull: 'null'},
+                        {name: 'charset', expectedNull: 'null'},
+                        {name: 'coords', expectedNull: 'null'},
+                        {name: 'hreflang', expectedNull: 'null'},
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'rel', expectedNull: 'null'},
+                        {name: 'rev', expectedNull: 'null'},
+                        {name: 'shape', expectedNull: 'null'},
+                        {name: 'target', expectedNull: 'null'},
+                        {name: 'type', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLAppletElement',
                     elementToUse: document.createElement('applet'),
                     attributes: [
-                        {name: 'align', expectedNull: ''},
-                        {name: 'alt', expectedNull: ''},
-                        {name: 'archive', expectedNull: ''},
-                        {name: 'code', expectedNull: ''},
-                        {name: 'codeBase', expectedNull: ''},
-                        {name: 'height', expectedNull: ''},
-                        {name: 'hspace', expectedNull: ''},
-                        {name: 'name', expectedNull: ''},
-                        {name: 'object', expectedNull: ''},
-                        {name: 'vspace', expectedNull: ''},
-                        {name: 'width', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'alt', expectedNull: 'null'},
+                        {name: 'archive', expectedNull: 'null'},
+                        {name: 'code', expectedNull: 'null'},
+                        {name: 'codeBase', expectedNull: 'null'},
+                        {name: 'height', expectedNull: 'null'},
+                        {name: 'hspace', expectedNull: 'null'},
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'object', expectedNull: 'null'},
+                        {name: 'vspace', expectedNull: 'null'},
+                        {name: 'width', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLAreaElement',
                     elementToUse: document.createElement('area'),
                     attributes: [
-                        {name: 'accessKey', expectedNull: ''},
-                        {name: 'alt', expectedNull: ''},
-                        {name: 'coords', expectedNull: ''},
-                        {name: 'href', expectedNull: ''},
-                        {name: 'shape', expectedNull: ''},
-                        {name: 'target', expectedNull: ''}
+                        {name: 'accessKey', expectedNull: 'null'},
+                        {name: 'alt', expectedNull: 'null'},
+                        {name: 'coords', expectedNull: 'null'},
+                        {name: 'shape', expectedNull: 'null'},
+                        {name: 'target', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLBaseElement',
                     elementToUse: document.createElement('base'),
                     attributes: [
-                        {name: 'target', expectedNull: ''}
+                        {name: 'target', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLBlockquoteElement',
                     elementToUse: document.createElement('blockquote'),
                     attributes: [
-                        {name: 'cite', expectedNull: ''}
                     ]
                 },
                 {
                     type: 'HTMLBodyElement',
                     elementToUse: document.createElement('body'),
                     attributes: [
-                        {name: 'aLink', expectedNull: ''},
-                        {name: 'background', expectedNull: ''},
-                        {name: 'bgColor', expectedNull: ''},
-                        {name: 'link', expectedNull: ''},
-                        {name: 'text', expectedNull: ''},
-                        {name: 'vLink', expectedNull: ''}
+                        {name: 'aLink', expectedNull: 'null'},
+                        {name: 'background', expectedNull: 'null'},
+                        {name: 'bgColor', expectedNull: 'null'},
+                        {name: 'link', expectedNull: 'null'},
+                        {name: 'text', expectedNull: 'null'},
+                        {name: 'vLink', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLBRElement',
                     elementToUse: document.createElement('br'),
                     attributes: [
-                        {name: 'clear', expectedNull: ''}
+                        {name: 'clear', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLButtonElement',
                     elementToUse: document.createElement('button'),
                     attributes: [
-                        {name: 'accessKey', expectedNull: ''},
-                        {name: 'name', expectedNull: ''},
-                        {name: 'value', expectedNull: ''}
+                        {name: 'accessKey', expectedNull: 'null'},
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'value', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLDivElement',
                     elementToUse: document.createElement('div'),
                     attributes: [
-                        {name: 'align', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'}
                     ]
                 },
 
@@ -195,10 +192,9 @@
                     type: 'HTMLEmbedElement',
                     elementToUse: document.createElement('embed'),
                     attributes: [
-                        {name: 'align', expectedNull: ''},
-                        {name: 'name', expectedNull: ''},
-                        {name: 'src', expectedNull: ''},
-                        {name: 'type', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'type', expectedNull: 'null'}
                     ]
                 },
 
@@ -209,51 +205,47 @@
                     type: 'HTMLFontElement',
                     elementToUse: document.createElement('font'),
                     attributes: [
-                        {name: 'color', expectedNull: ''},
-                        {name: 'face', expectedNull: ''},
-                        {name: 'size', expectedNull: ''}
+                        {name: 'color', expectedNull: 'null'},
+                        {name: 'face', expectedNull: 'null'},
+                        {name: 'size', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLFormElement',
                     elementToUse: document.createElement('form'),
                     attributes: [
-                        {name: 'name', expectedNull: ''},
-                        {name: 'acceptCharset', expectedNull: ''},
-                        {name: 'action', expectedNull: ''},
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'acceptCharset', expectedNull: 'null'},
                         {name: 'encoding', expectedNull: 'application/x-www-form-urlencoded'},
                         {name: 'enctype', expectedNull: 'application/x-www-form-urlencoded'},
                         {name: 'method', expectedNull: 'get'},
-                        {name: 'target', expectedNull: ''}
+                        {name: 'target', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLFrameElement',
                     elementToUse: document.createElement('frame'),
                     attributes: [
-                        {name: 'frameBorder', expectedNull: ''},
-                        {name: 'longDesc', expectedNull: ''},
-                        {name: 'marginHeight', expectedNull: ''},
-                        {name: 'marginWidth', expectedNull: ''},
-                        {name: 'name', expectedNull: ''},
-                        {name: 'scrolling', expectedNull: ''},
-                        {name: 'src', expectedNull: ''},
-                        {name: 'location', expectedNull: ''} // not a documented attribute
+                        {name: 'frameBorder', expectedNull: 'null'},
+                        {name: 'marginHeight', expectedNull: 'null'},
+                        {name: 'marginWidth', expectedNull: 'null'},
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'scrolling', expectedNull: 'null'},
                     ]
                 },
                 {
                     type: 'HTMLFrameSetElement',
                     elementToUse: document.createElement('frameset'),
                     attributes: [
-                        {name: 'cols', expectedNull: ''},
-                        {name: 'rows', expectedNull: ''}
+                        {name: 'cols', expectedNull: 'null'},
+                        {name: 'rows', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLHeadElement',
                     elementToUse: document.createElement('head'),
                     attributes: [
-                        {name: 'profile', expectedNull: ''}
+                        {name: 'profile', expectedNull: 'null'}
                     ]
                 },
                 {
@@ -261,68 +253,62 @@
                     // no need to test h2-h6
                     elementToUse: document.createElement('h1'),
                     attributes: [
-                        {name: 'align', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLHRElement',
                     elementToUse: document.createElement('hr'), // no need to test h2-h6
                     attributes: [
-                        {name: 'align', expectedNull: ''},
-                        {name: 'size', expectedNull: ''},
-                        {name: 'width', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'size', expectedNull: 'null'},
+                        {name: 'width', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLHtmlElement',
                     elementToUse: document.createElement('html'),
                     attributes: [
-                        {name: 'version', expectedNull: ''}
+                        {name: 'version', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLIFrameElement',
                     elementToUse: document.createElement('iframe'),
                     attributes: [
-                        {name: 'align', expectedNull: ''},
-                        {name: 'frameBorder', expectedNull: ''},
-                        {name: 'height', expectedNull: ''},
-                        {name: 'longDesc', expectedNull: ''},
-                        {name: 'marginHeight', expectedNull: ''},
-                        {name: 'marginWidth', expectedNull: ''},
-                        {name: 'name', expectedNull: ''},
-                        {name: 'scrolling', expectedNull: ''},
-                        {name: 'src', expectedNull: ''},
-                        {name: 'width', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'frameBorder', expectedNull: 'null'},
+                        {name: 'height', expectedNull: 'null'},
+                        {name: 'marginHeight', expectedNull: 'null'},
+                        {name: 'marginWidth', expectedNull: 'null'},
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'scrolling', expectedNull: 'null'},
+                        {name: 'width', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLImageElement',
                     elementToUse: document.createElement('img'),
                     attributes: [
-                        {name: 'name', expectedNull: ''},
-                        {name: 'align', expectedNull: ''},
-                        {name: 'alt', expectedNull: ''},
-                        {name: 'border', expectedNull: ''},
-                        {name: 'longDesc', expectedNull: ''},
-                        {name: 'src', expectedNull: ''},
-                        {name: 'useMap', expectedNull: ''},
-                        {name: 'lowsrc', expectedNull: ''}
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'alt', expectedNull: 'null'},
+                        {name: 'border', expectedNull: 'null'},
+                        {name: 'useMap', expectedNull: 'null'},
                     ]
                 },
                 {
                     type: 'HTMLInputElement',
                     elementToUse: document.createElement('input'),
                     attributes: [
-                        {name: 'accept', expectedNull: ''},
-                        {name: 'accessKey', expectedNull: ''},
-                        {name: 'align', expectedNull: ''},
-                        {name: 'alt', expectedNull: ''},
-                        {name: 'defaultValue', expectedNull: ''},
-                        {name: 'name', expectedNull: ''},
-                        {name: 'src', expectedNull: ''},
+                        {name: 'accept', expectedNull: 'null'},
+                        {name: 'accessKey', expectedNull: 'null'},
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'alt', expectedNull: 'null'},
+                        {name: 'defaultValue', expectedNull: 'null'},
+                        {name: 'name', expectedNull: 'null'},
                         {name: 'type', expectedNull: 'text'},
-                        {name: 'useMap', expectedNull: ''},
+                        {name: 'useMap', expectedNull: 'null'},
                         {name: 'value', expectedNull: ''},
                     ]
                 },
@@ -330,44 +316,43 @@
                     type: 'HTMLLabelElement',
                     elementToUse: document.createElement('label'),
                     attributes: [
-                        {name: 'accessKey', expectedNull: ''},
-                        {name: 'htmlFor', expectedNull: ''}
+                        {name: 'accessKey', expectedNull: 'null'},
+                        {name: 'htmlFor', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLLegendElement',
                     elementToUse: document.createElement('legend'),
                     attributes: [
-                        {name: 'accessKey', expectedNull: ''},
-                        {name: 'align', expectedNull: ''}
+                        {name: 'accessKey', expectedNull: 'null'},
+                        {name: 'align', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLLIElement',
                     elementToUse: document.createElement('li'),
                     attributes: [
-                        {name: 'type', expectedNull: ''}
+                        {name: 'type', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLLinkElement',
                     elementToUse: document.createElement('link'),
                     attributes: [
-                        {name: 'charset', expectedNull: ''},
-                        {name: 'href', expectedNull: ''},
-                        {name: 'hreflang', expectedNull: ''},
-                        {name: 'media', expectedNull: ''},
-                        {name: 'rel', expectedNull: ''},
-                        {name: 'rev', expectedNull: ''},
-                        {name: 'target', expectedNull: ''},
-                        {name: 'type', expectedNull: ''}
+                        {name: 'charset', expectedNull: 'null'},
+                        {name: 'hreflang', expectedNull: 'null'},
+                        {name: 'media', expectedNull: 'null'},
+                        {name: 'rel', expectedNull: 'null'},
+                        {name: 'rev', expectedNull: 'null'},
+                        {name: 'target', expectedNull: 'null'},
+                        {name: 'type', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLMapElement',
                     elementToUse: document.createElement('map'),
                     attributes: [
-                        {name: 'name', expectedNull: ''}
+                        {name: 'name', expectedNull: 'null'}
                     ]
                 },
 
@@ -378,51 +363,49 @@
                     type: 'HTMLMetaElement',
                     elementToUse: document.createElement('meta'),
                     attributes: [
-                        {name: 'content', expectedNull: ''},
-                        {name: 'httpEquiv', expectedNull: ''},
-                        {name: 'name', expectedNull: ''},
-                        {name: 'scheme', expectedNull: ''}
+                        {name: 'content', expectedNull: 'null'},
+                        {name: 'httpEquiv', expectedNull: 'null'},
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'scheme', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLModElement',
                     elementToUse: document.createElement('ins'), // same as 'del'
                     attributes: [
-                        {name: 'cite', expectedNull: ''},
-                        {name: 'dateTime', expectedNull: ''}
+                        {name: 'dateTime', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLObjectElement',
                     elementToUse: document.createElement('object'),
                     attributes: [
-                        {name: 'code', expectedNull: ''},
-                        {name: 'align', expectedNull: ''},
-                        {name: 'archive', expectedNull: ''},
-                        {name: 'border', expectedNull: ''},
-                        {name: 'codeBase', expectedNull: ''},
-                        {name: 'codeType', expectedNull: ''},
-                        {name: 'data', expectedNull: ''},
-                        {name: 'height', expectedNull: ''},
-                        {name: 'name', expectedNull: ''},
-                        {name: 'standby', expectedNull: ''},
-                        {name: 'type', expectedNull: ''},
-                        {name: 'useMap', expectedNull: ''},
-                        {name: 'width', expectedNull: ''}
+                        {name: 'code', expectedNull: 'null'},
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'archive', expectedNull: 'null'},
+                        {name: 'border', expectedNull: 'null'},
+                        {name: 'codeBase', expectedNull: 'null'},
+                        {name: 'codeType', expectedNull: 'null'},
+                        {name: 'height', expectedNull: 'null'},
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'standby', expectedNull: 'null'},
+                        {name: 'type', expectedNull: 'null'},
+                        {name: 'useMap', expectedNull: 'null'},
+                        {name: 'width', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLOListElement',
                     elementToUse: document.createElement('ol'),
                     attributes: [
-                        {name: 'type', expectedNull: ''}
+                        {name: 'type', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLOptGroupElement',
                     elementToUse: document.createElement('optgroup'),
                     attributes: [
-                        {name: 'label', expectedNull: ''}
+                        {name: 'label', expectedNull: 'null'}
                     ]
                 },
                 {
@@ -438,17 +421,17 @@
                     type: 'HTMLParagraphElement',
                     elementToUse: document.createElement('p'),
                     attributes: [
-                        {name: 'align', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLParamElement',
                     elementToUse: document.createElement('param'),
                     attributes: [
-                        {name: 'name', expectedNull: ''},
-                        {name: 'type', expectedNull: ''},
-                        {name: 'value', expectedNull: ''},
-                        {name: 'valueType', expectedNull: ''}
+                        {name: 'name', expectedNull: 'null'},
+                        {name: 'type', expectedNull: 'null'},
+                        {name: 'value', expectedNull: 'null'},
+                        {name: 'valueType', expectedNull: 'null'}
                     ]
                 },
 
@@ -459,7 +442,6 @@
                     type: 'HTMLQuoteElement',
                     elementToUse: document.createElement('q'),
                     attributes: [
-                        {name: 'cite', expectedNull: ''}
                     ]
                 },
                 {
@@ -467,11 +449,10 @@
                     elementToUse: document.createElement('script'),
                     attributes: [
                         {name: 'text', expectedNull: ''},
-                        {name: 'htmlFor', expectedNull: ''},
-                        {name: 'event', expectedNull: ''},
-                        {name: 'charset', expectedNull: ''},
-                        {name: 'src', expectedNull: ''},
-                        {name: 'type', expectedNull: ''}
+                        {name: 'htmlFor', expectedNull: 'null'},
+                        {name: 'event', expectedNull: 'null'},
+                        {name: 'charset', expectedNull: 'null'},
+                        {name: 'type', expectedNull: 'null'}
                     ]
                 },
                 {
@@ -479,95 +460,95 @@
                     elementToUse: document.createElement('select'),
                     attributes: [
                         {name: 'value', expectedNull: ''},
-                        {name: 'name', expectedNull: ''}
+                        {name: 'name', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLStyleElement',
                     elementToUse: document.createElement('style'),
                     attributes: [
-                        {name: 'media', expectedNull: ''},
-                        {name: 'type', expectedNull: ''}
+                        {name: 'media', expectedNull: 'null'},
+                        {name: 'type', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLTableCaptionElement',
                     elementToUse: document.createElement('caption'),
                     attributes: [
-                        {name: 'align', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLTableCellElement',
                     elementToUse: document.createElement('td'),
                     attributes: [
-                        {name: 'abbr', expectedNull: ''},
-                        {name: 'align', expectedNull: ''},
-                        {name: 'axis', expectedNull: ''},
-                        {name: 'bgColor', expectedNull: ''},
-                        {name: 'ch', expectedNull: ''},
-                        {name: 'chOff', expectedNull: ''},
-                        {name: 'headers', expectedNull: ''},
-                        {name: 'height', expectedNull: ''},
-                        {name: 'scope', expectedNull: ''},
-                        {name: 'vAlign', expectedNull: ''},
-                        {name: 'width', expectedNull: ''}
+                        {name: 'abbr', expectedNull: 'null'},
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'axis', expectedNull: 'null'},
+                        {name: 'bgColor', expectedNull: 'null'},
+                        {name: 'ch', expectedNull: 'null'},
+                        {name: 'chOff', expectedNull: 'null'},
+                        {name: 'headers', expectedNull: 'null'},
+                        {name: 'height', expectedNull: 'null'},
+                        {name: 'scope', expectedNull: 'null'},
+                        {name: 'vAlign', expectedNull: 'null'},
+                        {name: 'width', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLTableColElement',
                     elementToUse: document.createElement('col'),
                     attributes: [
-                        {name: 'align', expectedNull: ''},
-                        {name: 'ch', expectedNull: ''},
-                        {name: 'chOff', expectedNull: ''},
-                        {name: 'vAlign', expectedNull: ''},
-                        {name: 'width', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'ch', expectedNull: 'null'},
+                        {name: 'chOff', expectedNull: 'null'},
+                        {name: 'vAlign', expectedNull: 'null'},
+                        {name: 'width', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLTableElement',
                     elementToUse: document.createElement('table'),
                     attributes: [
-                        {name: 'align', expectedNull: ''},
-                        {name: 'bgColor', expectedNull: ''},
-                        {name: 'border', expectedNull: ''},
-                        {name: 'cellPadding', expectedNull: ''},
-                        {name: 'cellSpacing', expectedNull: ''},
-                        {name: 'frame', expectedNull: ''},
-                        {name: 'rules', expectedNull: ''},
-                        {name: 'summary', expectedNull: ''},
-                        {name: 'width', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'bgColor', expectedNull: 'null'},
+                        {name: 'border', expectedNull: 'null'},
+                        {name: 'cellPadding', expectedNull: 'null'},
+                        {name: 'cellSpacing', expectedNull: 'null'},
+                        {name: 'frame', expectedNull: 'null'},
+                        {name: 'rules', expectedNull: 'null'},
+                        {name: 'summary', expectedNull: 'null'},
+                        {name: 'width', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLTableRowElement',
                     elementToUse: document.createElement('tr'),
                     attributes: [
-                        {name: 'align', expectedNull: ''},
-                        {name: 'bgColor', expectedNull: ''},
-                        {name: 'ch', expectedNull: ''},
-                        {name: 'chOff', expectedNull: ''},
-                        {name: 'vAlign', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'bgColor', expectedNull: 'null'},
+                        {name: 'ch', expectedNull: 'null'},
+                        {name: 'chOff', expectedNull: 'null'},
+                        {name: 'vAlign', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLTableSectionElement',
                     elementToUse: document.createElement('tbody'),
                     attributes: [
-                        {name: 'align', expectedNull: ''},
-                        {name: 'ch', expectedNull: ''},
-                        {name: 'chOff', expectedNull: ''},
-                        {name: 'vAlign', expectedNull: ''}
+                        {name: 'align', expectedNull: 'null'},
+                        {name: 'ch', expectedNull: 'null'},
+                        {name: 'chOff', expectedNull: 'null'},
+                        {name: 'vAlign', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLTextAreaElement',
                     elementToUse: document.createElement('textarea'),
                     attributes: [
-                        {name: 'defaultValue', expectedNull: ''},
-                        {name: 'accessKey', expectedNull: ''},
-                        {name: 'name', expectedNull: ''},
+                        {name: 'defaultValue', expectedNull: 'null'},
+                        {name: 'accessKey', expectedNull: 'null'},
+                        {name: 'name', expectedNull: 'null'},
                         {name: 'value', expectedNull: ''}
                     ]
                 },
@@ -575,14 +556,14 @@
                     type: 'HTMLTitleElement',
                     elementToUse: document.createElement('title'),
                     attributes: [
-                        {name: 'text', expectedNull: ''}
+                        {name: 'text', expectedNull: 'null'}
                     ]
                 },
                 {
                     type: 'HTMLUListElement',
                     elementToUse: document.createElement('ul'),
                     attributes: [
-                        {name: 'type', expectedNull: ''}
+                        {name: 'type', expectedNull: 'null'}
                     ]
                 }
             ];
diff --git a/LayoutTests/fast/dom/ping-attribute-dom-binding-expected.txt b/LayoutTests/fast/dom/ping-attribute-dom-binding-expected.txt
index 5aad0b2..200ce7b 100644
--- a/LayoutTests/fast/dom/ping-attribute-dom-binding-expected.txt
+++ b/LayoutTests/fast/dom/ping-attribute-dom-binding-expected.txt
@@ -6,13 +6,13 @@
 PASS anchor.ping is ""
 PASS anchor.ping is "p1"
 PASS anchor.getAttribute("ping") is "p2"
-PASS anchor.hasAttribute("ping") is false
-PASS anchor.ping is ""
+PASS anchor.hasAttribute("ping") is true
+PASS anchor.ping is "null"
 PASS area.ping is ""
 PASS area.ping is "p1"
 PASS area.getAttribute("ping") is "p2"
-PASS area.hasAttribute("ping") is false
-PASS area.ping is ""
+PASS area.hasAttribute("ping") is true
+PASS area.ping is "null"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/dom/ping-attribute-dom-binding.html b/LayoutTests/fast/dom/ping-attribute-dom-binding.html
index dc962dd..2d144f8 100644
--- a/LayoutTests/fast/dom/ping-attribute-dom-binding.html
+++ b/LayoutTests/fast/dom/ping-attribute-dom-binding.html
@@ -15,8 +15,8 @@
 anchor.ping = 'p2';
 shouldBeEqualToString('anchor.getAttribute("ping")', 'p2');
 anchor.ping = null;
-shouldBeFalse('anchor.hasAttribute("ping")');
-shouldBeEqualToString('anchor.ping', '');
+shouldBeTrue('anchor.hasAttribute("ping")');
+shouldBeEqualToString('anchor.ping', 'null');
 
 var area = document.createElement('area');
 shouldBeEqualToString('area.ping', '');
@@ -25,8 +25,8 @@
 area.ping = 'p2';
 shouldBeEqualToString('area.getAttribute("ping")', 'p2');
 area.ping = null;
-shouldBeFalse('area.hasAttribute("ping")');
-shouldBeEqualToString('area.ping', '');
+shouldBeTrue('area.hasAttribute("ping")');
+shouldBeEqualToString('area.ping', 'null');
 
 </script>
 <script src="../../resources/js-test-post.js"></script>
diff --git a/LayoutTests/fast/forms/fieldset/fieldset-name-expected.txt b/LayoutTests/fast/forms/fieldset/fieldset-name-expected.txt
index 19a51b3..e07f984 100644
--- a/LayoutTests/fast/forms/fieldset/fieldset-name-expected.txt
+++ b/LayoutTests/fast/forms/fieldset/fieldset-name-expected.txt
@@ -13,9 +13,9 @@
 PASS fs1.name is "1234"
 PASS fs1.getAttribute("name") is "1234"
 fs1.name=null
-PASS fs1.name is ""
-PASS fs1.getAttribute("name") is null
-PASS fs1.hasAttribute("name") is false
+PASS fs1.name is "null"
+PASS fs1.getAttribute("name") is "null"
+PASS fs1.hasAttribute("name") is true
 fs1.name=undefined
 PASS fs1.name is "undefined"
 PASS fs1.getAttribute("name") is "undefined"
diff --git a/LayoutTests/fast/forms/fieldset/fieldset-name.html b/LayoutTests/fast/forms/fieldset/fieldset-name.html
index c5d4d30..6f3af6c 100644
--- a/LayoutTests/fast/forms/fieldset/fieldset-name.html
+++ b/LayoutTests/fast/forms/fieldset/fieldset-name.html
@@ -20,14 +20,14 @@
 // We may need to update below once the specification fixed.
 debug('fs1.name=null');
 fs1.name = null;
-shouldBe('fs1.name', '""');
-shouldBeNull('fs1.getAttribute("name")');
-shouldBeFalse('fs1.hasAttribute("name")');
+shouldBeEqualToString('fs1.name', 'null');
+shouldBeEqualToString('fs1.getAttribute("name")', 'null');
+shouldBeTrue('fs1.hasAttribute("name")');
 
 debug('fs1.name=undefined');
 fs1.name = undefined;
-shouldBe('fs1.name', '"undefined"');
-shouldBe('fs1.getAttribute("name")', '"undefined"');
+shouldBeEqualToString('fs1.name', 'undefined');
+shouldBeEqualToString('fs1.getAttribute("name")', 'undefined');
 shouldBeTrue('fs1.hasAttribute("name")');
 </script>
 <script src="../../../resources/js-test-post.js"></script>
diff --git a/LayoutTests/fast/forms/input-minmax-expected.txt b/LayoutTests/fast/forms/input-minmax-expected.txt
index 6574621..52218dd 100644
--- a/LayoutTests/fast/forms/input-minmax-expected.txt
+++ b/LayoutTests/fast/forms/input-minmax-expected.txt
@@ -14,12 +14,12 @@
 PASS input.getAttribute("min") is ""
 PASS input.getAttribute("max") is ""
 Setting null to min:
-PASS input.min is ""
-PASS input.getAttribute("min") is null
+PASS input.min is "null"
+PASS input.getAttribute("min") is "null"
 PASS input.min is "null"
 Setting null to max:
-PASS input.max is ""
-PASS input.getAttribute("max") is null
+PASS input.max is "null"
+PASS input.getAttribute("max") is "null"
 PASS input.max is "null"
 Setting undefined to min:
 PASS input.min is "undefined"
diff --git a/LayoutTests/fast/forms/input-minmax.html b/LayoutTests/fast/forms/input-minmax.html
index 4507166..682e5de 100644
--- a/LayoutTests/fast/forms/input-minmax.html
+++ b/LayoutTests/fast/forms/input-minmax.html
@@ -36,15 +36,15 @@
 // Null.
 debug('Setting null to min:');
 input.min = null;
-shouldBe('input.min', '""');
-shouldBe('input.getAttribute("min")', 'null');
+shouldBeEqualToString('input.min', 'null');
+shouldBeEqualToString('input.getAttribute("min")', 'null');
 input.setAttribute('min', null);
 shouldBe('input.min', '"null"');
 
 debug('Setting null to max:');
 input.max = null;
-shouldBe('input.max', '""');
-shouldBe('input.getAttribute("max")', 'null');
+shouldBeEqualToString('input.max', 'null');
+shouldBeEqualToString('input.getAttribute("max")', 'null');
 input.setAttribute('max', null);
 shouldBe('input.max', '"null"');
 
diff --git a/LayoutTests/fast/forms/input-pattern-expected.txt b/LayoutTests/fast/forms/input-pattern-expected.txt
index ffecb9e..8ece0cb 100644
--- a/LayoutTests/fast/forms/input-pattern-expected.txt
+++ b/LayoutTests/fast/forms/input-pattern-expected.txt
@@ -6,8 +6,8 @@
 PASS input.pattern is ""
 PASS input.getAttribute("pattern") is "foo"
 PASS input.pattern is "bar"
-PASS input.pattern is ""
-PASS input.getAttribute("pattern") is null
+PASS input.pattern is "null"
+PASS input.getAttribute("pattern") is "null"
 PASS input.pattern is "null"
 PASS input.pattern is "undefined"
 PASS input.getAttribute("pattern") is "undefined"
diff --git a/LayoutTests/fast/forms/input-pattern.html b/LayoutTests/fast/forms/input-pattern.html
index cc088f8..646e6d8 100644
--- a/LayoutTests/fast/forms/input-pattern.html
+++ b/LayoutTests/fast/forms/input-pattern.html
@@ -23,8 +23,8 @@
 
 // Null.
 input.pattern = null;
-shouldBe('input.pattern', '""');
-shouldBe('input.getAttribute("pattern")', 'null');
+shouldBeEqualToString('input.pattern', 'null');
+shouldBeEqualToString('input.getAttribute("pattern")', 'null');
 input.setAttribute('pattern', null);
 shouldBe('input.pattern', '"null"');
 
diff --git a/LayoutTests/fast/forms/submit-form-attributes-expected.txt b/LayoutTests/fast/forms/submit-form-attributes-expected.txt
index efb946c..a37584e 100644
--- a/LayoutTests/fast/forms/submit-form-attributes-expected.txt
+++ b/LayoutTests/fast/forms/submit-form-attributes-expected.txt
@@ -32,8 +32,8 @@
 PASS input.formMethod is ""
 PASS input.getAttribute("formMethod") is null
 PASS input.formMethod is "get"
-PASS input.formTarget is ""
-PASS input.getAttribute("formTarget") is null
+PASS input.formTarget is "null"
+PASS input.getAttribute("formTarget") is "null"
 PASS input.formTarget is "null"
 
 Setting undefined for input:
@@ -87,8 +87,8 @@
 PASS button.formMethod is ""
 PASS button.getAttribute("formMethod") is null
 PASS button.formMethod is "get"
-PASS button.formTarget is ""
-PASS button.getAttribute("formTarget") is null
+PASS button.formTarget is "null"
+PASS button.getAttribute("formTarget") is "null"
 PASS button.formTarget is "null"
 
 Setting undefined for button:
diff --git a/LayoutTests/fast/forms/submit-form-attributes.html b/LayoutTests/fast/forms/submit-form-attributes.html
index 8e6914c..919f5ce 100644
--- a/LayoutTests/fast/forms/submit-form-attributes.html
+++ b/LayoutTests/fast/forms/submit-form-attributes.html
@@ -65,8 +65,8 @@
 input.setAttribute('formMethod', null);
 shouldBeEqualToString('input.formMethod', 'get');
 input.formTarget = null;
-shouldBeEqualToString('input.formTarget', '');
-shouldBe('input.getAttribute("formTarget")', 'null');
+shouldBeEqualToString('input.formTarget', 'null');
+shouldBeEqualToString('input.getAttribute("formTarget")', 'null');
 input.setAttribute('formTarget', null);
 shouldBeEqualToString('input.formTarget', 'null');
 
@@ -162,8 +162,8 @@
 button.setAttribute('formMethod', null);
 shouldBeEqualToString('button.formMethod', 'get');
 button.formTarget = null;
-shouldBeEqualToString('button.formTarget', '');
-shouldBe('button.getAttribute("formTarget")', 'null');
+shouldBeEqualToString('button.formTarget', 'null');
+shouldBeEqualToString('button.getAttribute("formTarget")', 'null');
 button.setAttribute('formTarget', null);
 shouldBeEqualToString('button.formTarget', 'null');
 
diff --git a/LayoutTests/fast/shadow-dom/HTMLSlotElement-interface.html b/LayoutTests/fast/shadow-dom/HTMLSlotElement-interface.html
index 043d024..5e99dce 100644
--- a/LayoutTests/fast/shadow-dom/HTMLSlotElement-interface.html
+++ b/LayoutTests/fast/shadow-dom/HTMLSlotElement-interface.html
@@ -85,7 +85,7 @@
     p.slot = 'foo';
     assert_array_equals(slotElement.getAssignedNodes(), [p, b], 'getAssignedNodes must return the nodes with the matching slot name in the tree order');
 
-    slotElement.name = null;
+    slotElement.removeAttribute('name');
     assert_array_equals(slotElement.getAssignedNodes(), [], 'getAssignedNodes must be empty for a default slot when all elements have "slot" attributes specified');
 
 }, 'getAssignedNodes must update when slot and name attributes are modified');
@@ -102,7 +102,7 @@
 
     assert_array_equals(slotElement.getAssignedNodes(), [], 'getAssignedNodes must be empty when there are no matching elements for the slot name');
 
-    slotElement.name = null;
+    slotElement.removeAttribute('name');
     assert_array_equals(slotElement.getAssignedNodes(), [child], 'getAssignedNodes must be empty when there are no matching elements for the slot name');
 
 }, 'getAssignedNodes must update when a default slot is introduced dynamically by a slot rename');
diff --git a/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html b/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html
index 2dc0508..2add9f2 100644
--- a/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html
+++ b/LayoutTests/fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html
@@ -82,7 +82,7 @@
     childElement.slot = 'foo';
     assert_equals(childElement.assignedSlot, slot, 'assignedSlot on an element must return the re-assigned slot element');
 
-    slot.name = null;
+    slot.removeAttribute('name');
     assert_equals(childTextNode.assignedSlot, slot, 'assignedSlot on a text node must return the re-assigned slot element');
     assert_equals(commentNode.assignedSlot, null, 'assignedSlot on a comment node must always return null');
     assert_equals(processingInstructionNode.assignedSlot, null, 'assignedSlot on a comment node must always return null');
diff --git a/LayoutTests/fast/shadow-dom/shadow-layout-after-slot-changes.html b/LayoutTests/fast/shadow-dom/shadow-layout-after-slot-changes.html
index c1d969e..821c417 100644
--- a/LayoutTests/fast/shadow-dom/shadow-layout-after-slot-changes.html
+++ b/LayoutTests/fast/shadow-dom/shadow-layout-after-slot-changes.html
@@ -51,7 +51,7 @@
     shadow2.firstChild.name = 'bar';
     forceLayout();
 
-    shadow3.firstChild.name = null;
+    shadow3.firstChild.removeAttribute("name");
     forceLayout();
 
     shadow4.insertBefore(document.createElement('slot'), shadow4.firstChild);
diff --git a/LayoutTests/svg/dom/svg-element-attribute-js-null-expected.txt b/LayoutTests/svg/dom/svg-element-attribute-js-null-expected.txt
index f2d0b21..4e54f47 100644
--- a/LayoutTests/svg/dom/svg-element-attribute-js-null-expected.txt
+++ b/LayoutTests/svg/dom/svg-element-attribute-js-null-expected.txt
@@ -1,6 +1,6 @@
 This test setting various attributes of a SVG elements to JavaScript null.
 
-TEST SUCCEEDED: The value was the empty string. [tested SVGElement.id]
+TEST SUCCEEDED: The value was the string 'null'. [tested SVGElement.id]
 TEST SUCCEEDED: The value was the empty string. [tested SVGElement.xmlbase]
 
 TEST SUCCEEDED: The value was the string '0'. [tested SVGAngle.valueAsString]
diff --git a/LayoutTests/svg/dom/svg-element-attribute-js-null.xhtml b/LayoutTests/svg/dom/svg-element-attribute-js-null.xhtml
index 32798d6..7af4bb0 100644
--- a/LayoutTests/svg/dom/svg-element-attribute-js-null.xhtml
+++ b/LayoutTests/svg/dom/svg-element-attribute-js-null.xhtml
@@ -52,7 +52,7 @@
                     type: 'SVGElement',
                     elementToUse: svg,
                     attributes: [
-                        {name: 'id', expectedNull: ''},
+                        {name: 'id', expectedNull: 'null'},
                         {name: 'xmlbase', expectedNull: ''}
                     ]
                 },
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index f958286..a74dabc 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,54 @@
+2016-01-27  Chris Dumez  <cdumez@apple.com>
+
+        Settings a reflected DOMString attribute to null should set it to the "null" string rather than the empty string
+        https://bugs.webkit.org/show_bug.cgi?id=153504
+        <rdar://problem/24353072>
+
+        Reviewed by Ryosuke Niwa.
+
+        Settings a reflected DOMString attribute to null should set it to the "null"
+        string rather than the empty string:
+        - https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes
+        - http://heycam.github.io/webidl/#es-DOMString
+        - http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring
+
+        Firefox and Chrome match the specification here.
+
+        This is causing a lot of W3C HTML reflection tests to fail on WebKit, e.g.:
+        - http://w3c-test.org/html/dom/reflection-text.html
+
+        No new tests, already covered by existing tests.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (JSValueToNative):
+        Call toString() instead of valueToStringWithNullCheck() for reflected
+        attributes. This way, null gets converted to the string "null", as
+        expected, instead of a null String object.
+
+        * html/HTMLInputElement.idl:
+        Dropping [TreatNullAs=NullString] IDL extended attribute for
+        input.defaultValue, as this is not present in the specification:
+        - https://html.spec.whatwg.org/#htmlinputelement
+
+        Without this change, assigning null to input.defaultValue would not
+        set to to the "null" string, as is expected.
+
+        * html/HTMLTextAreaElement.idl:
+        Dropping [TreatNullAs=NullString] IDL extended attribute for
+        textArea.defaultValue, as this is not present in the specification:
+        - https://html.spec.whatwg.org/#htmltextareaelement
+
+        Without this change, assigning null to textArea.defaultValue would not
+        set to to the "null" string, as is expected.
+
+        * html/HTMLTitleElement.idl:
+        Dropping [TreatNullAs=NullString] IDL extended attribute for
+        title.text, as this is not present in the specification:
+        - https://html.spec.whatwg.org/#htmltitleelement
+
+        Without this change, assigning null to title.text would not
+        set to to the "null" string, as is expected.
+
 2016-01-27  Simon Fraser  <simon.fraser@apple.com>
 
         Support CSS3 Images values for the image-rendering property
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
index ef8398e..06b5af5 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -4085,7 +4085,7 @@
         if (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") and ($signature->extendedAttributes->{"TreatUndefinedAs"} and $signature->extendedAttributes->{"TreatUndefinedAs"} eq "NullString")) {
             return "valueToStringWithUndefinedOrNullCheck(state, $value)"
         }
-        if (($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") or $signature->extendedAttributes->{"Reflect"}) {
+        if ($signature->extendedAttributes->{"TreatNullAs"} and $signature->extendedAttributes->{"TreatNullAs"} eq "NullString") {
             return "valueToStringWithNullCheck(state, $value)"
         }
         if ($signature->extendedAttributes->{"AtomicString"}) {
diff --git a/Source/WebCore/html/HTMLInputElement.idl b/Source/WebCore/html/HTMLInputElement.idl
index 5832a6d..6e86cdb 100644
--- a/Source/WebCore/html/HTMLInputElement.idl
+++ b/Source/WebCore/html/HTMLInputElement.idl
@@ -55,7 +55,7 @@
     [Reflect, URL] attribute DOMString src;
     [Reflect] attribute DOMString step;
     attribute DOMString type; // readonly dropped as part of DOM level 2
-    [TreatNullAs=NullString] attribute DOMString defaultValue;
+    attribute DOMString defaultValue;
     // See the discussion in https://bugs.webkit.org/show_bug.cgi?id=100085
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
     [TreatNullAs=NullString, SetterRaisesException] attribute DOMString value;
diff --git a/Source/WebCore/html/HTMLTextAreaElement.idl b/Source/WebCore/html/HTMLTextAreaElement.idl
index 22b8286..33e50e1 100644
--- a/Source/WebCore/html/HTMLTextAreaElement.idl
+++ b/Source/WebCore/html/HTMLTextAreaElement.idl
@@ -34,7 +34,7 @@
     [Reflect] attribute DOMString wrap;
 
     readonly attribute DOMString type;
-    [TreatNullAs=NullString] attribute DOMString defaultValue;
+    attribute DOMString defaultValue;
     [TreatNullAs=NullString] attribute DOMString value;
     readonly attribute unsigned long textLength;
 
diff --git a/Source/WebCore/html/HTMLTitleElement.idl b/Source/WebCore/html/HTMLTitleElement.idl
index 2b312f5..406976d 100644
--- a/Source/WebCore/html/HTMLTitleElement.idl
+++ b/Source/WebCore/html/HTMLTitleElement.idl
@@ -18,6 +18,6 @@
  */
 
 interface HTMLTitleElement : HTMLElement {
-    [TreatNullAs=NullString] attribute DOMString            text;
+    attribute DOMString text;
 };