From 354ce909e85bbdf363d3125886e9942341b69dfe Mon Sep 17 00:00:00 2001 From: Alexey Shvayka Date: Fri, 27 Jan 2023 15:29:51 +0000 Subject: [PATCH] Bug 1812374 [wpt PR 38174] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=251097, a=testonly Automatic update from web-platform-tests WebKit export of https://bugs.webkit.org/show_bug.cgi?id=251097 (#38174) -- wpt-commits: 98b366f4fb8550615367ee22358108738c6bdf0a wpt-pr: 38174 --- .../form-disabled-callback.html | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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');