Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctype missing #127

Closed
alin1771 opened this issue Sep 28, 2024 · 2 comments · Fixed by #128
Closed

doctype missing #127

alin1771 opened this issue Sep 28, 2024 · 2 comments · Fixed by #128
Labels
chrome-bug Bug with Chrome's implementation of Document Picture-in-Picture

Comments

@alin1771
Copy link

alin1771 commented Sep 28, 2024

the PiP document is using quirks mode by default because HTML5 doctype is missing
please add <!DOCTYPE html>
or an option for it in DocumentPictureInPictureOptions

@steimelchrome steimelchrome added the chrome-bug Bug with Chrome's implementation of Document Picture-in-Picture label Sep 30, 2024
@steimelchrome
Copy link
Collaborator

steimelchrome commented Oct 1, 2024

Thanks for bringing this up! I've updated the spec to copy the compatibility mode of the opener document.

The actual Chrome code change is here: https://crrev.com/c/5900737. Assuming it lands soon, it'll be released in Chrome 131

@yume-chan
Copy link

I just ran into this issue.

Before it gets fixed, I found https://stackoverflow.com/a/4494144 works:

const pipWindow = await documentPictureInPicture.requestWindow({
  width,
  height,
});

console.log(pipWindow.document.compatMode); // BackCompat

pipWindow.document.open();
pipWindow.document.write("<!doctype html>");
pipWindow.document.close();

console.log(pipWindow.document.compatMode); // CSS1Compat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chrome-bug Bug with Chrome's implementation of Document Picture-in-Picture
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants