Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Unified Diff: LayoutTests/fast/dom/domstring-attribute-reflection.html

Issue 371833004: Use [TreatNullAs=EmptyString] for DOMString attributes with [Reflect] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: the fix Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/domstring-attribute-reflection.html
diff --git a/LayoutTests/fast/dom/domstring-attribute-reflection.html b/LayoutTests/fast/dom/domstring-attribute-reflection.html
index afc1d97d235b17a1df87c53964047c8760121591..c8d9bfa0223ad5511db38a886508b35157761809 100644
--- a/LayoutTests/fast/dom/domstring-attribute-reflection.html
+++ b/LayoutTests/fast/dom/domstring-attribute-reflection.html
@@ -5,7 +5,7 @@
<script>
var element;
-function testDOMStringReflection(elementName, contentAttributeName, idlAttributeName) {
+function testDOMStringReflection(elementName, contentAttributeName, idlAttributeName, treatNullAsEmptyString) {
idlAttributeName = idlAttributeName || contentAttributeName;
element = document.createElement(elementName);
debug('Reflected DOMString attribute test for ' + elementName + '/@' + contentAttributeName);
@@ -22,8 +22,13 @@ function testDOMStringReflection(elementName, contentAttributeName, idlAttribute
shouldBeEqualToString('element.getAttribute("' + contentAttributeName + '")', ' bar\n');
debug('Setting null via the IDL attribute:');
- shouldBeEqualToString('element.' + idlAttributeName + ' = null; element.' + idlAttributeName, 'null');
- shouldBeEqualToString('element.getAttribute("' + contentAttributeName + '")', 'null');
+ if (treatNullAsEmptyString) {
+ shouldBeEqualToString('element.' + idlAttributeName + ' = null; element.' + idlAttributeName, '');
+ shouldBeEqualToString('element.getAttribute("' + contentAttributeName + '")', '');
+ } else {
+ 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');
@@ -59,6 +64,27 @@ testDOMStringReflection('output', 'name');
testDOMStringReflection('select', 'name');
testDOMStringReflection('textarea', 'name');
+// [TreatNullAs=EmptyString]
+testDOMStringReflection('frame', 'marginheight', 'marginHeight', true);
+testDOMStringReflection('frame', 'marginwidth', 'marginWidth', true);
+testDOMStringReflection('iframe', 'marginheight', 'marginHeight', true);
+testDOMStringReflection('iframe', 'marginwidth', 'marginWidth', true);
+testDOMStringReflection('body', 'text', 'text', true);
+testDOMStringReflection('body', 'link', 'link', true);
+testDOMStringReflection('body', 'alink', 'aLink', true);
+testDOMStringReflection('body', 'vlink', 'vLink', true);
+testDOMStringReflection('body', 'bgcolor', 'bgColor', true);
+testDOMStringReflection('font', 'color', 'color', true);
+testDOMStringReflection('img', 'border', 'border', true);
+testDOMStringReflection('object', 'border', 'border', true);
+testDOMStringReflection('table', 'bgcolor', 'bgColor', true);
+testDOMStringReflection('table', 'cellpadding', 'cellPadding', true);
+testDOMStringReflection('table', 'cellspacing', 'cellSpacing', true);
+testDOMStringReflection('td', 'bgcolor', 'bgColor', true);
+testDOMStringReflection('th', 'bgcolor', 'bgColor', true);
+testDOMStringReflection('tr', 'bgcolor', 'bgColor', true);
+
+
// Add more DOMString attributes!
</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698