Comments (10)
Distance with the viewport (as in, IntersectionObserver
margins etc).
from html.
For content-visibility
, it's not a comprehensive list but selection, focus, and accessibility (find in page specifically) are all things that cause us to do rendering. FWIW, content-visibility: auto
also has a user-agent defined margin for visibility that causes it to be relevant, which is similar to the iframe one if I understand correctly.
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.
from html.
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.
from html.
Other than the visibility based throttling @szager-chromium mentioned, content-visibility
is the other reason I could find for it (@vmpstr for it). The throttling done for view transitions is already carved out separately.
from html.
c-v language is in https://www.w3.org/TR/css-contain-2/#cv-notes point number 7, but it's "should" language
from html.
What does margin refer to here? Criteria?
from html.
Thanks! This would be reasonable to standardize more. Some relevant WebKit code:
- LocalFrameView::viewportContentsChanged
- LocalFrameView::updateScriptedAnimationsAndTimersThrottlingState (we currently do not throttle
display:none
, but if everyone else does this seems reasonable to change) - Page::preferredRenderingUpdateFramesPerSecond
- DOMTimer::updateThrottlingStateIfNecessary
from html.
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.
from html.
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 setTimeout
and setInterval
timers to 1s, and I wouldn't want requestAnimationFrame
to become an escape hatch that allows an iframe to run lots of code at high frequency.
from html.
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.
from html.
Related Issues (20)
- Confusion between the visual effect and the dropEffect attribute in drag-n-drop events in spec
- Spec allows multiple values for dropEffect in some effectAllowed cases which might cause different browsers to behave differently
- Spec allows multiple values for dropEffect in some current selection case which might cause different browsers to behave differently
- If a web author sets dropEffect to something that is not allowed according to spec, should UA respect their choice by updating dropEffect attribute?
- template.content has unusable value HOT 1
- Clean up HTML <-> DOM hooks HOT 2
- The dropEffect column in the Drag and Drop events summary table should clarify it represents default values.
- Drag and drop spec allows multiple values for dropEffect which might cause browsers to behave differently.
- How should UAs handle web authors setting dropEffect values?
- Proposal for event ordering when inserting replacement text such as text prediction, spell checker, etc
- It's unclear how shadows should be drawn across various compositing operators HOT 2
- Should custom validity error message treat \r as newline? HOT 3
- Upcoming WHATNOT meeting on 5/16/2024 HOT 5
- Date Picker popup doesn't propagate shadow DOM events into the light DOM HOT 2
- Clarify `detail` value of synthetic click event HOT 3
- Consider making "gamepadconnected" part of “activation triggering user event”? HOT 1
- Meeting 2 for joint OpenUI-WHATWG/HTML-CSSWG task force on styleable form controls HOT 4
- Upcoming WHATNOT meeting on 5/23/2024 HOT 6
- [Proposal]: Enable `HTMLElement` attributes to be toggled without JavaScript HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.