-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Consider improving interoperability of <iframe> throttling margins. #10333
Comments
For reference, here is chromium's logic: Historically, we have also had one or two weird carve-outs for throttling logic that were driven by real-world usage; for example: A tighter spec with WPT would be great. |
Other than the visibility based throttling @szager-chromium mentioned, |
c-v language is in https://www.w3.org/TR/css-contain-2/#cv-notes point number 7, but it's "should" language |
What does margin refer to here? Criteria? |
Distance with the viewport (as in, |
Thanks! This would be reasonable to standardize more. Some relevant WebKit code:
|
I'm wondering if content-visibility is a good concept to build on for this throttling; since the goal is similar: minimize rendering cost of content not relevant to the user (as opposed to just visible). For example, IIUC c-v will force layout for find-in-page. I'm wondering if lifecycle updates should similarly be resumed for offscreen iframes when the user triggers find-in-page, it's possible that a DOM update (which populates the content the user is searching for) is blocked on the next rAF. @vmpstr might have input based on edge cases like this addressed for c-v. |
For I don't think specifying the exact extent of this margin is worthwhile, but specifying more explicitly cases where we don't want throttling is useful. |
IIRC, render throttling already has a carve-out that allows find-in-page to work correctly. I could be wrong. We should be mindful that throttling rendering for off-screen iframes also prevents badly-behaved iframes from sabotaging battery usage and performance of the embedding page. In some situations chromium will throttle |
Also see w3c/IntersectionObserver#508 (comment) What WebKit does there seems better from a privacy POV since it avoids the Text Fragment side-channel using APIs affected by thottling. |
This is still on my list fwiw. I want to make a change to Gecko here to make it more consistent and confirm such a thing is web compatible before proposing it more formally. |
What is the issue with the HTML Standard?
My understanding is that all browsers implement some sort of throttling of offscreen / invisible iframes.
In Firefox, this is kind of messy, and differs between in-process and out-of-process iframes right now.
It seems according to @szager-chromium in Chromium there's no margin at all.
I think some things could probably be specified properly:
visibility: hidden
/display: none
should always be throttled.Are there other cases where UAs throttle iframes? cc @khushalsagar
The text was updated successfully, but these errors were encountered: