Skip to content

Commit

Permalink
[document pip] Use the same compatibility mode as the opener
Browse files Browse the repository at this point in the history
Currently, document picture-in-picture windows use quirks mode by
default, since they're just about:blank windows. This CL makes the pip
document match the opener document's compatibility mode instead.

WICG/document-picture-in-picture#128

https://groups.google.com/a/chromium.org/g/blink-dev/c/IR7qdNj4Zyw

Bug: 370423046
Change-Id: Ib1a84947b2408ae0be236afc2173fbcb0f77b598
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5900737
Reviewed-by: Frank Liberato <[email protected]>
Commit-Queue: Tommy Steimel <[email protected]>
Reviewed-by: Nate Chapin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1363338}
  • Loading branch information
steimelchrome authored and chromium-wpt-export-bot committed Oct 2, 2024
1 parent 5e053f0 commit 187ceed
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions document-picture-in-picture/copy-document-mode-quirks.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<title>Test document picture-in-picture copies Document mode when it's quirks mode</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) => {
assert_equals(document.compatMode, "BackCompat", "The opener document should be on quirks mode");
await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();
assert_equals(pipWindow.document.compatMode, "BackCompat", "The picture-in-picture document should be on quirks mode");
});
</script>
</body>
16 changes: 16 additions & 0 deletions document-picture-in-picture/copy-document-mode.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<title>Test document picture-in-picture copies Document mode</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) => {
assert_equals(document.compatMode, "CSS1Compat", "The opener document should not be on quirks mode");
await test_driver.bless('request PiP window');
const pipWindow = await documentPictureInPicture.requestWindow();
assert_equals(pipWindow.document.compatMode, "CSS1Compat", "The picture-in-picture document should not be on quirks mode");
});
</script>
</body>

0 comments on commit 187ceed

Please sign in to comment.