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

[renderblocking] Implement render-blocking on preload and modulepreload links #33195

Merged
merged 1 commit into from Mar 19, 2022

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Mar 15, 2022

This patch blocks rendering on render-blocking preload and modulepreload
links, and also unifies that with the existing short render-blocking on
font preloads.

The previous attempt (crrev.com/c/3514642) uses Resource and
ResourceFinishObserver to listen to the loading progress of render-blocking
preloads. However, this approach does not extend to modulepreload links
as PreloadHelper::ModulePreloadIfNeeded() does not expose a
ScriptResource to callers.

This patch uses a different approach. It uses LinkLoaderClient to listen
to the loading progress, which works on both preload and modulepreload
links. This is also closer to the spec compared to the previous one.

Bug: 1271296
Change-Id: I4923e81362180aad3de8c3352241c228515e7ffe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3527422
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#982964}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-3527422 branch 2 times, most recently from 29e380a to 9772cb0 Compare March 17, 2022 21:34
…ad links

This patch blocks rendering on render-blocking preload and modulepreload
links, and also unifies that with the existing short render-blocking on
font preloads.

The previous attempt (crrev.com/c/3514642) uses Resource and
ResourceFinishObserver to listen to the loading progress of render-blocking
preloads. However, this approach does not extend to modulepreload links
as PreloadHelper::ModulePreloadIfNeeded() does not expose a
ScriptResource to callers.

This patch uses a different approach. It uses LinkLoaderClient to listen
to the loading progress, which works on both preload and modulepreload
links. This is also closer to the spec compared to the previous one.

Bug: 1271296
Change-Id: I4923e81362180aad3de8c3352241c228515e7ffe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3527422
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#982964}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants