Repository navigation
Conversation
eXpl0it3r
force-pushed
the
feature/load-then-build
branch
from
November 26, 2026 20:49
9fa176a to
14524c6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When an
@mediaoutcome flips on a resize,PerformLayoutcalledRefreshMediaDependentCascade, which ran the wholeSetHtmlAsyncagain and blocked on it withGetAwaiter().GetResult(). That's sync-over-async in the middle of a layout, usually on the UI thread, and it downloaded every<link>stylesheet and@font-faceagain, only to re-run the cascade.As such
DomParsernow separates loading from building:LoadAsyncparses the document and does all the I/O, i.e. the stylesheets and the@font-facerulesBuildCssTreeis synchronous and does the rest: the cascade for the current media, counters and the box tree fix-upsSetHtmlAsyncruns both, a media change only parses the cached HTML again and builds the tree from the already loadedCssData, without touching the network.How to test this PR?
CI should succeed.
MediaRefreshTestsresizes across a breakpoint back and forth, checks that the matching rules apply each time, and that a linked stylesheet is only requested once. The second test fails without this change.