Skip to content

Commit e7856cf

Browse files
mregochromium-wpt-export-bot
authored andcommitted
Set empty string for reflection of IDREF attributes
This implements the agreement on the following HTML issue: whatwg/html#8306 HTML PR is available at: whatwg/html#8352 It just always set the content attribute to the empty string in Element::SetElementAttribute() and Element::SetElementArrayAttribute(). The WPT test is updated accordingly to the new behavior. Bug: 1370977 Test: external/wpt/html/dom/aria-element-reflection.html Change-Id: I55e64df6ac4c3eb50667c1d0a5ba360a9369c978
1 parent 3872d99 commit e7856cf

File tree

2 files changed

+69
-60
lines changed

2 files changed

+69
-60
lines changed

custom-elements/reactions/AriaMixin-element-attributes.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div id="parentElement"></div>
1717
<script>
1818

19-
function testElementReflectAttribute(jsAttributeName, contentAttributeName, validValue1, contentValue1, validValue2, contentValue2, name, getParentElement) {
19+
function testElementReflectAttribute(jsAttributeName, contentAttributeName, validValue1, validValue2, name, getParentElement) {
2020
test(function () {
2121
let element = define_new_custom_element([contentAttributeName]);
2222
let instance = document.createElement(element.name);
@@ -27,7 +27,7 @@
2727
let logEntries = element.takeLog();
2828
assert_array_equals(logEntries.types(), ['attributeChanged']);
2929

30-
assert_attribute_log_entry(logEntries.last(), {name: contentAttributeName, oldValue: null, newValue: contentValue1, namespace: null});
30+
assert_attribute_log_entry(logEntries.last(), {name: contentAttributeName, oldValue: null, newValue: "", namespace: null});
3131
}, name + ' must enqueue an attributeChanged reaction when adding ' + contentAttributeName + ' content attribute');
3232

3333
test(function () {
@@ -39,7 +39,7 @@
3939
instance[jsAttributeName] = validValue2;
4040
var logEntries = element.takeLog();
4141
assert_array_equals(logEntries.types(), ['attributeChanged']);
42-
assert_attribute_log_entry(logEntries.last(), {name: contentAttributeName, oldValue: contentValue1, newValue: contentValue2, namespace: null});
42+
assert_attribute_log_entry(logEntries.last(), {name: contentAttributeName, oldValue: "", newValue: "", namespace: null});
4343
}, name + ' must enqueue an attributeChanged reaction when replacing an existing attribute');
4444
}
4545

@@ -51,14 +51,14 @@
5151
dummy2.id = 'dummy2';
5252
document.body.appendChild(dummy2);
5353

54-
testElementReflectAttribute('ariaActiveDescendantElement', 'aria-activedescendant', dummy1, 'dummy1', dummy2, 'dummy2', 'ariaActiveDescendantElement in Element');
55-
testElementReflectAttribute('ariaControlsElements', 'aria-controls', [dummy1], 'dummy1', [dummy2], 'dummy2', 'ariaControlsElements in Element');
56-
testElementReflectAttribute('ariaDescribedByElements', 'aria-describedby', [dummy1], 'dummy1', [dummy2], 'dummy2', 'ariaDescribedByElements in Element');
57-
testElementReflectAttribute('ariaDetailsElements', 'aria-details', [dummy1], 'dummy1', [dummy2], 'dummy2', 'ariaDetailsElements in Element');
58-
testElementReflectAttribute('ariaErrorMessageElement', 'aria-errormessage', dummy1, 'dummy1', dummy2, 'dummy2', 'ariaErrorMessageElement in Element');
59-
testElementReflectAttribute('ariaFlowToElements', 'aria-flowto', [dummy1], 'dummy1', [dummy2], 'dummy2', 'ariaFlowToElements in Element');
60-
testElementReflectAttribute('ariaLabelledByElements', 'aria-labelledby', [dummy1], 'dummy1', [dummy2], 'dummy2', 'ariaLabelledByElements in Element')
61-
testElementReflectAttribute('ariaOwnsElements', 'aria-owns', [dummy1], 'dummy1', [dummy2], 'dummy2', 'ariaOwnsElements in Element')
54+
testElementReflectAttribute('ariaActiveDescendantElement', 'aria-activedescendant', dummy1, dummy2, 'ariaActiveDescendantElement in Element');
55+
testElementReflectAttribute('ariaControlsElements', 'aria-controls', [dummy1], [dummy2], 'ariaControlsElements in Element');
56+
testElementReflectAttribute('ariaDescribedByElements', 'aria-describedby', [dummy1], [dummy2], 'ariaDescribedByElements in Element');
57+
testElementReflectAttribute('ariaDetailsElements', 'aria-details', [dummy1], [dummy2], 'ariaDetailsElements in Element');
58+
testElementReflectAttribute('ariaErrorMessageElement', 'aria-errormessage', dummy1, dummy2, 'ariaErrorMessageElement in Element');
59+
testElementReflectAttribute('ariaFlowToElements', 'aria-flowto', [dummy1], [dummy2], 'ariaFlowToElements in Element');
60+
testElementReflectAttribute('ariaLabelledByElements', 'aria-labelledby', [dummy1], [dummy2], 'ariaLabelledByElements in Element')
61+
testElementReflectAttribute('ariaOwnsElements', 'aria-owns', [dummy1], [dummy2], 'ariaOwnsElements in Element')
6262

6363
</script>
6464
</body>

0 commit comments

Comments
 (0)