mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
script: Check for render-blocking documents before continuing (#43150)
The spec expects us to check for render blocking (among some other state) before we start procesing a document. Therefore, add those checks and also check in the stylesheet loader that we should only do so when we are allowed to do so. Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
committed by
GitHub
parent
5fec1395c9
commit
af256bd6e5
@@ -1135,10 +1135,6 @@ impl ScriptThread {
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: The specification says to filter out non-renderable documents,
|
||||
// as well as those for which a rendering update would be unnecessary,
|
||||
// but this isn't happening here.
|
||||
|
||||
// TODO(#31242): the filtering of docs is extended to not exclude the ones that
|
||||
// has pending initial observation targets
|
||||
// https://w3c.github.io/IntersectionObserver/#pending-initial-observation
|
||||
@@ -1179,6 +1175,25 @@ impl ScriptThread {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Step 3. Filter non-renderable documents:
|
||||
// Remove from docs any Document object doc for which any of the following are true:
|
||||
if
|
||||
// doc is render-blocked;
|
||||
document.is_render_blocked()
|
||||
// doc's visibility state is "hidden";
|
||||
// TODO: Currently, this would mean that the script thread does nothing, since
|
||||
// documents aren't currently correctly set to the visible state when navigating
|
||||
|
||||
// doc's rendering is suppressed for view transitions; or
|
||||
// TODO
|
||||
|
||||
// doc's node navigable doesn't currently have a rendering opportunity.
|
||||
//
|
||||
// This is implicitly the case when we call this method
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Clear this as early as possible so that any callbacks that
|
||||
// trigger new reasons for updating the rendering don't get lost.
|
||||
document.clear_rendering_update_reasons();
|
||||
|
||||
Reference in New Issue
Block a user