Files
sousa-gecko/testing/web-platform/tests/css/css-ui/inert-attribute-overriding.html
T
Mason Freed 241f485d04 Bug 1989290 [wpt PR 54919] - Add !important to [inert] interactivity UA stylesheet rule, a=testonly
Automatic update from web-platform-tests
Add !important to [inert] interactivity UA stylesheet rule

See this CSSWG resolution:

- https://github.com/w3c/csswg-drafts/issues/12049#issuecomment-3303716541

This adds a killswitch for the new behavior, which is to add
!important to that rule.

Bug: 408241037
Change-Id: I19fc847977f87251c4210ca1c404ac1898a0b8f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6961205
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1517089}

--

wpt-commits: 7872fc185cbf6d1ef583108802469ab7fa8cef97
wpt-pr: 54919
2025-09-24 11:03:36 +00:00

40 lines
1.7 KiB
HTML

<!DOCTYPE html>
<link rel="author" href="mailto:masonf@chromium.org">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/12049">
<link rel="help" href="https://github.com/whatwg/html/pull/10956">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<div id="buttons">
<button data-expect="normal">normal button</button>
<button data-expect="inert" inert>just inert</button>
<button data-expect="inert" inert style="interactivity: auto">interactivity: auto</button>
<button data-expect="inert" inert style="all: initial">all: initial</button>
</div>
<script>
async function clickOn(element) {
// Because the button is disabled, we need to click at its coordinates.
let rect = element.getBoundingClientRect();
let actions = new test_driver.Actions();
await actions
.pointerMove(Math.round(rect.x + rect.width / 2), Math.round(rect.y + rect.height / 2), {})
.pointerDown({button: actions.ButtonType.LEFT})
.pointerUp({button: actions.ButtonType.LEFT})
.send();
}
document.querySelectorAll('#buttons>*').forEach(button => {
const expectInert = button.dataset.expect === 'inert';
button.removeAttribute('data-expect');
promise_test(async (t) => {
let clicked = false;
button.addEventListener('click',() => (clicked = true),{signal: t.get_signal()});
await clickOn(button);
assert_equals(clicked, !expectInert);
}, `Expect ${button.outerHTML} to be ${expectInert ? 'inert' : 'non-inert'}`);
});
</script>