-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VTTypes: Add the IDL syntax to support the VT types feature.
This patch does several things: - Loosens the restriction in IDL checker to allow distinguishing between callback types and dictionary like types. This implements the following PR: whatwg/webidl#1353 - Uses the loosened restriction to add a behind-the-flag overload of startViewTransition that takes a dictionary - Adds a smoke test for the new syntax Bug: 1466251 Change-Id: I7b82b49e993e8ad907804d772b4f2c6e0f1ab3e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4973315 Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1216984}
- Loading branch information
Showing
12 changed files
with
161 additions
and
4 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
7 changes: 7 additions & 0 deletions
7
third_party/blink/renderer/core/view_transition/view_transition_options.idl
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,7 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
dictionary ViewTransitionOptions { | ||
ViewTransitionCallback? update = null; | ||
sequence<DOMString>? type = null; | ||
}; |
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
1 change: 1 addition & 0 deletions
1
third_party/blink/web_tests/virtual/view-transition-types/README.md
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 @@ | ||
Tests for the ViewTransitionTypes syntax. |
1 change: 1 addition & 0 deletions
1
...ink/web_tests/virtual/view-transition-types/wpt_internal/view-transition-types/README.txt
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 @@ | ||
Tests for the ViewTransitionsTypes syntax. |
28 changes: 28 additions & 0 deletions
28
...y/blink/web_tests/wpt_internal/view-transition-types/shared-element-types-syntax-ref.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,28 @@ | ||
<!DOCTYPE html> | ||
<title>View transitions: use dictionary syntax smoketest (ref)</title> | ||
<link rel="help" href="https://github.com/WICG/view-transitions"> | ||
<link rel="author" href="mailto:vmpstr@chromium.org"> | ||
|
||
<style> | ||
div { contain: paint; } | ||
#left { | ||
background: blue; | ||
width: 100px; | ||
height: 100px; | ||
position: absolute; | ||
top: 50px; | ||
left: 50px; | ||
} | ||
#right { | ||
width: 50px; | ||
height: 50px; | ||
background: green; | ||
position: absolute; | ||
top: 50px; | ||
left: 250px; | ||
} | ||
body { background: lightpink; } | ||
</style> | ||
|
||
<div id=left></div> | ||
<div id=right></div> |
81 changes: 81 additions & 0 deletions
81
...party/blink/web_tests/wpt_internal/view-transition-types/shared-element-types-syntax.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,81 @@ | ||
<!DOCTYPE html> | ||
<html class=reftest-wait> | ||
<title>View transitions: use dictionary syntax smoketest</title> | ||
<link rel="help" href="https://github.com/WICG/view-transitions"> | ||
<link rel="author" href="mailto:vmpstr@chromium.org"> | ||
<link rel="match" href="shared-element-types-syntax-ref.html"> | ||
|
||
<script src="/common/reftest-wait.js"></script> | ||
<style> | ||
div { contain: paint; } | ||
#left { | ||
background: green; | ||
width: 100px; | ||
height: 100px; | ||
position: absolute; | ||
top: 50px; | ||
left: 50px; | ||
} | ||
#right { | ||
width: 50px; | ||
height: 50px; | ||
background: blue; | ||
position: absolute; | ||
top: 50px; | ||
left: 250px; | ||
} | ||
.left-tag { | ||
view-transition-name: left-element; | ||
} | ||
.right-tag { | ||
view-transition-name: right-element; | ||
} | ||
|
||
.hidden { | ||
background: pink; | ||
width: 10px; | ||
height: 10px; | ||
view-transition-name: hidden; | ||
} | ||
|
||
html::view-transition-group(hidden) { animation-duration: 300s; } | ||
html::view-transition-image-pair(hidden) { animation: unset; opacity: 0; } | ||
|
||
html::view-transition-group(left-element), | ||
html::view-transition-group(right-element) { animation-duration: 0s; } | ||
|
||
html::view-transition-new(left-element), | ||
html::view-transition-new(right-element) { animation: unset; opacity: 0; } | ||
|
||
html::view-transition-old(left-element), | ||
html::view-transition-old(right-element) { animation: unset; opacity: 1; } | ||
|
||
html::view-transition-group(root) { animation: unset; opacity: 0; } | ||
html::view-transition { background: lightpink; } | ||
|
||
</style> | ||
|
||
<div id=left class="left-tag"></div> | ||
<div id=right class="right-tag"></div> | ||
|
||
<div id=hidden class=hidden></div> | ||
|
||
<script> | ||
failIfNot(document.startViewTransition, "Missing document.startViewTransition"); | ||
|
||
async function runTest() { | ||
document.startViewTransition({ | ||
update: () => { | ||
left.classList.remove("left-tag"); | ||
left.classList.add("right-tag"); | ||
|
||
right.classList.remove("right-tag"); | ||
right.classList.add("left-tag"); | ||
|
||
requestAnimationFrame(() => requestAnimationFrame(takeScreenshot)) | ||
} | ||
}); | ||
} | ||
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest)); | ||
</script> | ||
|