-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebKit export: [view-transitions] Context menu is broken when view tr…
…ansition is running (#46823) https://bugs.webkit.org/show_bug.cgi?id=275556
- Loading branch information
Showing
2 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
css/css-view-transitions/hit-test-pseudo-element-element-from-point.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<!DOCTYPE html> | ||
<title>View transitions: hit testing the pseudo-elements should always return the document element</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> | ||
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> | ||
|
||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<style> | ||
html { view-transition-name: none; } | ||
|
||
body { margin: 0; } | ||
|
||
#target { | ||
width: 100px; | ||
height: 100vh; | ||
view-transition-name: target; | ||
} | ||
|
||
::view-transition { | ||
background-color: green; | ||
} | ||
|
||
::view-transition, | ||
::view-transition-group(target), | ||
::view-transition-image-pair(target) { | ||
height: 100%; | ||
padding-left: 100px; | ||
} | ||
|
||
::view-transition-group(target) { | ||
animation-duration: 30s; | ||
background-color: lightgreen; | ||
} | ||
|
||
::view-transition-image-pair(target) { | ||
height: 100%; | ||
background-color: skyblue; | ||
animation: none; | ||
margin-left: 100px; | ||
} | ||
|
||
::view-transition-old(target) { | ||
height: 100%; | ||
width: 100px; | ||
animation: none; | ||
background-color: navy; | ||
} | ||
::view-transition-new(target) { | ||
height: 100%; | ||
width: 100px; | ||
margin-left: 100px; | ||
animation: none; | ||
background-color: purple; | ||
} | ||
</style> | ||
|
||
<div id=target></div> | ||
|
||
<script> | ||
async_test(t => { | ||
assert_implements(document.startViewTransition, "Missing document.startViewTransition"); | ||
document.startViewTransition(() => { | ||
requestAnimationFrame(async () => { | ||
// ::view-transition-group | ||
t.step(() => assert_equals(document.elementFromPoint(20, 20), document.documentElement)); | ||
// ::view-transition-image-pair | ||
t.step(() => assert_equals(document.elementFromPoint(120, 20), document.documentElement)); | ||
// ::view-transition-old | ||
t.step(() => assert_equals(document.elementFromPoint(220, 20), document.documentElement)); | ||
// ::view-transition-new | ||
t.step(() => assert_equals(document.elementFromPoint(320, 20), document.documentElement)); | ||
// ::view-transition | ||
t.step(() => assert_equals(document.elementFromPoint(420, 20), document.documentElement)); | ||
t.done(); | ||
}); | ||
}); | ||
}, "Hit-testing view transition pseudo-elements should always return the document element"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters