Skip to content

fix DPR for iframes - #4723

Merged
elalish merged 1 commit into
masterfrom
metaViewport
Mar 22, 2024
Merged

elalish merged 1 commit into
masterfrom
metaViewport

Conversation

@elalish

@elalish elalish commented Mar 22, 2024

Copy link
Copy Markdown
Contributor

Turns out any <model-viewer> embedded in an <iframe> gets the capped DPR=1 (no high-res render) unless the iframe has a meta viewport tag in its own <head>. That's a bit weird, since meta viewport tags are ignored in iframes and only the top-level document counts. As such, we'll assume the top level document has a meta viewport tag (as that's more common) when the element is inside an iframe and can't query its parent's <head>.

@elalish elalish self-assigned this Mar 22, 2024
@elalish
elalish merged commit 5c23a13 into master Mar 22, 2024
@elalish
elalish deleted the metaViewport branch March 22, 2024 21:46
JL-Vidinoti pushed a commit to vidinoti/model-viewer that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant