Skip to content

Commit f23e15a

Browse files
mregomoz-wptsync-bot
authored andcommitted
Bug 1769789 [wpt PR 34095] - Add checks for the caching invariant of element reflection, a=testonly
Automatic update from web-platform-tests Add checks for the caching invariant of element reflection (#34095) -- wpt-commits: adc2cb4c34638cf78a5450ac8100a9acedf43a98 wpt-pr: 34095
1 parent 5bc2149 commit f23e15a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

testing/web-platform/tests/dom/nodes/aria-element-reflection.tentative.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424
// Element reference should be set if the content attribute was included.
2525
assert_equals(parentListbox.getAttribute("aria-activedescendant"), "i1", "check content attribute after parsing.");
2626
assert_equals(parentListbox.ariaActiveDescendantElement, i1, "check idl attribute after parsing.");
27+
assert_equals(parentListbox.ariaActiveDescendantElement, parentListbox.ariaActiveDescendantElement, "check idl attribute caching after parsing.");
2728

2829
// If we set the content attribute, the element reference should reflect this.
2930
parentListbox.setAttribute("aria-activedescendant", "i2");
3031
assert_equals(parentListbox.ariaActiveDescendantElement, i2, "setting the content attribute updates the element reference.");
32+
assert_equals(parentListbox.ariaActiveDescendantElement, parentListbox.ariaActiveDescendantElement, "check idl attribute caching after update.");
3133

3234
// Setting the element reference should be reflected in the content attribute.
3335
parentListbox.ariaActiveDescendantElement = i1;
@@ -342,10 +344,12 @@
342344
test(function(t) {
343345
const billingElement = document.getElementById("billingElement")
344346
assert_array_equals(input1.ariaLabelledByElements, [billingElement, nameElement], "parsed content attribute sets element references.");
347+
assert_equals(input1.ariaLabelledByElements, input1.ariaLabelledByElements, "check idl attribute caching after parsing");
345348
assert_equals(input2.ariaLabelledByElements, null, "Testing missing content attribute after parsing.");
346349

347350
input2.ariaLabelledByElements = [billingElement, addressElement];
348351
assert_array_equals(input2.ariaLabelledByElements, [billingElement, addressElement], "Testing IDL setter/getter.");
352+
assert_equals(input1.ariaLabelledByElements, input1.ariaLabelledByElements, "check idl attribute caching after update");
349353
assert_equals(input2.getAttribute("aria-labelledby"), "billingElement addressElement");
350354

351355
// Remove the billingElement from the DOM.

0 commit comments

Comments
 (0)