-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1861547 [wpt PR 42797] - [document pip] Allow resizeTo()/resizeBy…
…() via user gesture, a=testonly Automatic update from web-platform-tests [document pip] Allow resizeTo()/resizeBy() via user gesture Currently, we don't allow picture-in-picture windows to use the resizeTo() and resizeBy() APIs to prevent abuse. This CL adds a user gesture requirement to those APIs for document picture-in-picture windows to allow them to use those APIs while limiting the potential for abuse. Specification: WICG/document-picture-in-picture#104 Bug: 1354325 Change-Id: I6eabb2e9b8923ec1fc395cb44e3cc00ad674f5da Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4980802 Reviewed-by: Daniel Cheng <dchengchromium.org> Reviewed-by: Fr <beaufort.francoisgmail.com> Reviewed-by: Frank Liberato <liberatochromium.org> Reviewed-by: Scott Violet <skychromium.org> Commit-Queue: Tommy Steimel <steimelchromium.org> Cr-Commit-Position: refs/heads/main{#1230725} -- wpt-commits: 7007ee235ed368079546dd0a8ef45a7dfa88305a wpt-pr: 42797 UltraBlame original commit: 224ecf406e0698fdabef03cb95b70595b5657bb6
- Loading branch information
Showing
1 changed file
with
237 additions
and
0 deletions.
There are no files selected for viewing
237 changes: 237 additions & 0 deletions
237
...ng/web-platform/tests/document-picture-in-picture/resize-requires-user-gesture.https.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,237 @@ | ||
< | ||
! | ||
DOCTYPE | ||
html | ||
> | ||
< | ||
title | ||
> | ||
Test | ||
that | ||
calling | ||
resizeTo | ||
( | ||
) | ||
or | ||
resizeBy | ||
( | ||
) | ||
on | ||
a | ||
document | ||
picture | ||
- | ||
in | ||
- | ||
picture | ||
window | ||
requires | ||
user | ||
gesture | ||
< | ||
/ | ||
title | ||
> | ||
< | ||
script | ||
src | ||
= | ||
" | ||
/ | ||
resources | ||
/ | ||
testharness | ||
. | ||
js | ||
" | ||
> | ||
< | ||
/ | ||
script | ||
> | ||
< | ||
script | ||
src | ||
= | ||
" | ||
/ | ||
resources | ||
/ | ||
testharnessreport | ||
. | ||
js | ||
" | ||
> | ||
< | ||
/ | ||
script | ||
> | ||
< | ||
script | ||
src | ||
= | ||
" | ||
/ | ||
resources | ||
/ | ||
testdriver | ||
. | ||
js | ||
" | ||
> | ||
< | ||
/ | ||
script | ||
> | ||
< | ||
script | ||
src | ||
= | ||
" | ||
/ | ||
resources | ||
/ | ||
testdriver | ||
- | ||
vendor | ||
. | ||
js | ||
" | ||
> | ||
< | ||
/ | ||
script | ||
> | ||
< | ||
body | ||
> | ||
< | ||
script | ||
> | ||
promise_test | ||
( | ||
async | ||
( | ||
t | ||
) | ||
= | ||
> | ||
{ | ||
await | ||
test_driver | ||
. | ||
bless | ||
( | ||
' | ||
request | ||
PiP | ||
window | ||
from | ||
top | ||
window | ||
' | ||
) | ||
; | ||
const | ||
pipWindow | ||
= | ||
await | ||
documentPictureInPicture | ||
. | ||
requestWindow | ||
( | ||
) | ||
; | ||
await | ||
assert_throws_dom | ||
( | ||
' | ||
NotAllowedError | ||
' | ||
pipWindow | ||
. | ||
DOMException | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
pipWindow | ||
. | ||
resizeBy | ||
( | ||
10 | ||
10 | ||
) | ||
; | ||
} | ||
' | ||
resizeBy | ||
( | ||
) | ||
requires | ||
a | ||
user | ||
gesture | ||
for | ||
document | ||
picture | ||
- | ||
in | ||
- | ||
picture | ||
' | ||
) | ||
; | ||
await | ||
assert_throws_dom | ||
( | ||
' | ||
NotAllowedError | ||
' | ||
pipWindow | ||
. | ||
DOMException | ||
( | ||
) | ||
= | ||
> | ||
{ | ||
pipWindow | ||
. | ||
resizeTo | ||
( | ||
400 | ||
400 | ||
) | ||
; | ||
} | ||
' | ||
resizeTo | ||
( | ||
) | ||
requires | ||
a | ||
user | ||
gesture | ||
for | ||
document | ||
picture | ||
- | ||
in | ||
- | ||
picture | ||
' | ||
) | ||
; | ||
} | ||
) | ||
; | ||
< | ||
/ | ||
script | ||
> | ||
< | ||
/ | ||
body | ||
> |