Repository navigation
perf(core): mounting a scene no longer restyles it to look for raster hints #6300
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
Merged
+204
−24
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0a679fb
perf(core): mounting a scene no longer restyles it to look for raster…
miguel-heygen db53e23
perf(core): raster hints read inline hints directly instead of matchi…
miguel-heygen 50ae37e
perf(core): raster hints read the stylesheets once per page check, no…
miguel-heygen ea0238d
perf(core): raster hints watch no attributes while nothing is marked …
miguel-heygen 32984da
fix(core): a copied or re-attached marked layer keeps being followed
miguel-heygen 87c82d4
chore(producer): raise the packed size budget by the 336 bytes the ra…
miguel-heygen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blocker: a marked layer that is detached and re-attached in a later batch keeps
data-hf-preview-rasterbut is no longer inmarked, so nothing restores its hint when it stops qualifying.forgetRemovedMarksdrops it from the Set while the attribute stays on the node. On re-attach,fitsseesisMarked = false, readswill-change: autothrough our own!importantrule, and returns false, andwriteMark(false)is a no-op because the Set already says unmarked. From then on,followStyleskips the layer, and if this was the only mark,watch()stops observing attributes altogether. Result: a laterposition: fixedchild, or the layer's ownz-indexgoing back toauto, paints without the containing block or stacking context the hint provides. Main and b228a7e read the attribute, so they re-check the layer.Repro (fails on 7f8eb9c, passes on b228a7e):
Fix: re-adopt the attribute when an element is followed, e.g. at the top of the
followTreeloop:if (element.hasAttribute(PREVIEW_RASTER_ATTR)) marked.add(element);.watch()then re-arms attributes as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 935faf2, as you suggested:
followTreeadopts any element it visits that already carriesdata-hf-preview-rasterback intomarked(adoptCopiedMark), sofitsreads it as marked,followStylefollows it andwatch()re-arms attributes. Your repro is now a test ("gives the hint back to a marked layer re-attached after removal once a child needs it"). The same gap existed for acloneNode(true)copy of a marked layer added after the original is removed, so that has a test too. Both fail without the adoption. Core runtime suite 2,431 green,test:browser-raster3/3.