Skip to content
This repository was archived by the owner on Mar 10, 2023. It is now read-only.

Make fetch priority at least auto if element is render-blocking - #70

Closed
xiaochengh wants to merge 1 commit into
WICG:mainfrom
xiaochengh:renderblocking
Closed

xiaochengh wants to merge 1 commit into
WICG:mainfrom
xiaochengh:renderblocking

Conversation

@xiaochengh

Copy link
Copy Markdown

Fixes #69

The idea is that if an element is render-blocking, it should not be fetched at the low priority. Hence this PR introduces the notion of "computed fetch priority" that bumps the priority to at least auto if the element is render-blocking.

@xiaochengh

Copy link
Copy Markdown
Author

@pmeenan @domenic PTAL!

Comment thread index.bs
<ol>
<li><p>If the element is [=render-blocking=] and the current state of its
[=fetchpriority attribute=] is [=low=], then the [=computed fetch priority=] is the
[=auto=] state;</p>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pmeenan

pmeenan commented Apr 15, 2022

Copy link
Copy Markdown
Collaborator

Noted in the issue but the fetch integration already has internalpriority which is the computed actual priority. I don't think the priority-hints spec needs to adjust for render-blocking, the render-blocking spec just needs to add render-blocking as an additional signal that is used when computing the internalpriority of a given fetch.

@domenic

domenic commented Apr 15, 2022

Copy link
Copy Markdown

The problem is that you need to combine both signals. And the fetchpriority signal only exists in this spec. So this spec is the right place to do the monkeypatch, I think.

@pmeenan

pmeenan commented Apr 15, 2022

Copy link
Copy Markdown
Collaborator

@domenic you combine a lot more signals than just these two. Content type, element position, async/blocking, etc all go into the internal priority calculation.

I'm happy to take a monkeypatch that changes the internalpriority calculation to take render=blocking as an input but I don't think the attribute should directly change the fetchpriority itself.

For example, browser-detected render-blocking scripts and CSS get a higher internalpriority than those that are not render-blocking. The render=blocking attribute is just a direct way of causing a fetch to also be render-blocking and it would get a higher priority as a result.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

blocking=render should override fetch priority

3 participants