Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
view-transition: Ensure only-child excludes ::view-transition.
The :only-child pseudo-class is supported for all view transition pseudo elements except ::view-transition. Fix the selector checking code to ensure this. Bug: 1407399 Change-Id: I244b372afd3b418de134a1422b10b203f6d83a43 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4181497 Commit-Queue: Khushal Sagar <khushalsagar@chromium.org> Auto-Submit: Khushal Sagar <khushalsagar@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1096955}
- Loading branch information
1 parent
fe97863
commit d588494
Showing
10 changed files
with
125 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
46 changes: 46 additions & 0 deletions
46
...xternal/wpt/css/css-view-transitions/only-child-on-root-element-with-view-transition.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,46 @@ | ||
<!DOCTYPE html> | ||
<html class="reftest-wait foo"> | ||
<title>View transitions: ensure :only-child is supported on view-transition</title> | ||
<link rel="help" href="https://github.com/WICG/view-transitions"> | ||
<link rel="author" href="mailto:khushalsagar@chromium.org"> | ||
|
||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<style> | ||
::view-transition { | ||
background-color: red; | ||
} | ||
|
||
html:only-child { | ||
background-color: blue; | ||
} | ||
|
||
:root:only-child { | ||
background-color: blue; | ||
} | ||
|
||
:only-child { | ||
background-color: blue; | ||
} | ||
|
||
.foo:only-child { | ||
background-color: blue; | ||
} | ||
</style> | ||
|
||
<script> | ||
promise_test(() => { | ||
return new Promise(async (resolve, reject) => { | ||
let transition = document.startViewTransition(); | ||
transition.ready.then(() => { | ||
let style = getComputedStyle( | ||
document.documentElement, ":view-transition"); | ||
if (style.backgroundColor == "rgb(255, 0, 0)") | ||
resolve(); | ||
else | ||
reject(style.backgroundColor); | ||
}); | ||
}); | ||
}, ":only-child is not supported on view-transition"); | ||
</script> |