Automatic update from web-platform-tests Fix crash in MouseEventManager when removing pseudo element under mouse Guard original_element_under_mouse_removed_ with feature flag in HandlePseudoElementRemoval. Fixed: 507117702 Change-Id: Idcf9d2e7bcce6c9e378cb366c36c4a156fe6ec8a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7800334 Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1623343} -- wpt-commits: ad1158b1f28ffc365f02f990ab2b73e85c13cbb6 wpt-pr: 59583
50 lines
1.5 KiB
HTML
50 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>CSS Pseudos Test: Removing pseudo element under mouse</title>
|
|
<link rel="help" href="https://crbug.com/507117702">
|
|
<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>
|
|
<style>
|
|
#target {
|
|
width: 100px;
|
|
height: 100px;
|
|
background: green;
|
|
}
|
|
#target.has-pseudo::before {
|
|
content: "PSEUDO";
|
|
display: block;
|
|
width: 100px;
|
|
height: 100px;
|
|
background: red;
|
|
}
|
|
</style>
|
|
<div id="target" class="has-pseudo"></div>
|
|
<script>
|
|
promise_test(async t => {
|
|
const target = document.getElementById("target");
|
|
|
|
// Move mouse to the pseudo element (top-left of #target).
|
|
await new test_driver.Actions()
|
|
.pointerMove(10, 10, {origin: target})
|
|
.send();
|
|
|
|
// Remove the pseudo element.
|
|
target.classList.remove("has-pseudo");
|
|
|
|
// Force layout/reflow to ensure the pseudo element is removed.
|
|
document.body.offsetTop;
|
|
|
|
// Move mouse again to set new element under the mouse.
|
|
await new test_driver.Actions()
|
|
.pointerMove(20, 20, {origin: target})
|
|
.send();
|
|
|
|
const rect = target.getBoundingClientRect();
|
|
const elementAtPoint = document.elementFromPoint(rect.left + 10, rect.top + 10);
|
|
assert_equals(elementAtPoint, target, 'Target element should be under the mouse');
|
|
}, "Removing pseudo element under mouse should not crash");
|
|
</script>
|