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

[css-viewport] [css-zoom] Should zoom affect iframes? #9644

Closed
chrishtr opened this issue Nov 28, 2023 · 3 comments · Fixed by #9699
Closed

[css-viewport] [css-zoom] Should zoom affect iframes? #9644

chrishtr opened this issue Nov 28, 2023 · 3 comments · Fixed by #9699

Comments

@chrishtr
Copy link
Contributor

chrishtr commented Nov 28, 2023

Issue #9442 is about replaced element intrinsic dimensions, but what about zoom of iframe contents?

Right now, the CSS implementation in Blink at least does not affect iframes. I think we should have zoom affect at least same-origin iframes, since I predict developers would want that behavior for ease of styling. For cross-origin iframes, we could not do it if it's judged to be a privacy issue? (Or the developer could opt-in via something like #1771).

@emilio @zcorpan

@zcorpan
Copy link
Member

zcorpan commented Nov 28, 2023

It also doesn't zoom the child document in WebKit. (demo)

A stackoverflow search suggests this is something that does come up: https://stackoverflow.com/search?tab=relevance&q=zoom%20iframe&searchOn=3

e.g.

Maybe there's some compat risk with double-zooming if sites use both zoom (for IE) and transforms (for other browsers)?

@chrishtr
Copy link
Contributor Author

chrishtr commented Dec 6, 2023

I propose that zoom be applied to all sub-frames (including cross-origin), and be observable to developers via an adjusted window.devicePixelRatio (e.g. an "inherited" zoom of 2 for a frame would double its window.devicePixelRatio). This aligns with how browser zoom and screen density work.

It is also analogous to how color-scheme propagates to sub-frames (including cross-origin ones).

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-viewport] [css-zoom] Should zoom affect iframes?, and agreed to the following:

  • RESOLVED: iframes will be effected by zoom, device pixel ratio will reflect it
The full IRC log of that discussion <frances_> chris h: issues are related
<khush> q+
<frances_> PROPOSAL: Create iframe to improve zoom and note that pixel width has changed in the same way that zooming imposes constraint on ancestor element
<astearns> ack khush
<frances_> khush: any concerns on backwards compatibility issues to change behavior?
<frances_> chris h: will change behavior on web based browsers because they do not change, research does not involve iframes, want to ship in chrome
<fantasai> s/Create iframe to improve zoom and note that pixel width has changed/Have iframes be affected by zoom by affecting devicePixelRatio
<frances_> Alan: did the research use css zoom?
<frances_> chris h: yes, looked at office 365, none use an iframe in zoom to recollection.
<frances_> florian: very reasonable, is there a side effect in shipping?
<florian> s/is there a side effect in shipping?/if there is a side effect, we'll probably discover it by shipping?
<frances_> chris h: this aligns with other issue in objects to embed and make the zoom factor larger
<frances_> Alan: any other comments on zoom and iframes?
<frances_> PROPOSAL: iframes will be effected by zoom, device pixel ratio will reflect it
<frances_> Alan: any objections?
<frances_> RESOLVED: iframes will be effected by zoom, device pixel ratio will reflect it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants