diff --git a/testing/web-platform/tests/custom-elements/form-associated/form-disabled-callback.html b/testing/web-platform/tests/custom-elements/form-associated/form-disabled-callback.html index 954c3f3f6eecc..c61a7719fc628 100644 --- a/testing/web-platform/tests/custom-elements/form-associated/form-disabled-callback.html +++ b/testing/web-platform/tests/custom-elements/form-associated/form-disabled-callback.html @@ -110,5 +110,27 @@ container.innerHTML = '
'; assert_array_equals(container.querySelector('my-control').disabledHistory(), [true]); }, 'Upgrading an element with disabled content attribute'); + +test(() => { + const container = document.createElement('div'); + document.body.appendChild(container); + container.innerHTML = '
'; + + const control = container.querySelector('my-control'); + control.setAttribute('disabled', ''); + control.removeAttribute('disabled'); + assert_array_equals(control.disabledHistory(), [true]); +}, 'Toggling "disabled" attribute on a custom element inside disabled
does not trigger a callback'); + +test(() => { + const container = document.createElement('div'); + document.body.appendChild(container); + container.innerHTML = '
'; + + const fieldset = container.firstElementChild; + fieldset.disabled = true; + fieldset.disabled = false; + assert_array_equals(container.querySelector('my-control').disabledHistory(), [true]); +}, 'Toggling "disabled" attribute on a
does not trigger a callback on disabled custom element descendant');