Commit 84d77c48 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Form-associated custom elements: Fix the initial value of 'submission value'

According to https://html.spec.whatwg.org/C/#face-submission-value, the
initial value should be null, not an empty string.

Bug: 1051292
Bug: https://github.com/whatwg/html/issues/5263
Change-Id: Ifa92aaca47bfce1e51aa0fd3dc9ebb9ab9b15d91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050148Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741277}
parent b4f65a5c
......@@ -47,7 +47,6 @@ class CustomStatesTokenList : public DOMTokenList {
};
ElementInternals::ElementInternals(HTMLElement& target) : target_(target) {
value_.SetUSVString(String());
}
void ElementInternals::Trace(Visitor* visitor) {
......
......@@ -77,7 +77,7 @@ promise_test(t => {
$('[name=name-usv]').value = USV_INPUT;
$('[name=name-file]').value = new File(['file content'], FILE_NAME);
return submitPromise(t).then(query => {
assert_equals(query, `?name-pd1=value-pd1&name-ce1=&name-usv=${encodeURIComponent(USV_OUTPUT)}&name-file=${FILE_NAME}`);
assert_equals(query, `?name-pd1=value-pd1&name-usv=${encodeURIComponent(USV_OUTPUT)}&name-file=${FILE_NAME}`);
});
}, 'Single value - Non-empty name exists');
......@@ -90,7 +90,7 @@ promise_test(t => {
'<iframe name="if1"></iframe>';
$('my-control').value = null;
return submitPromise(t).then(query => {
assert_equals(query, '?name-pd1=value-pd1&name-ce2=');
assert_equals(query, '?name-pd1=value-pd1');
});
}, 'Null value should submit nothing');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment