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
Bug 1332969: stylo: Synchronously do a style update when the device changes #15157
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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
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.
Why do we need to mark the stylesheets as having changed if the device changes? It seems like we need to recascade the DOM and reevaluate media queries, but stylesheets_changed does more work, no?
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.
We need to reconstruct the style data because different rules may match.
We can definitely be more granular in the future, but that mechanism isn't there right now.
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.
s/may match/may apply/
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.
Oh ok. So We should put a RESTYLE_SELF | RESTYLE_DESCENDANTS hint on the root then.
My understanding is that the servo architecture already differentiates between "stylesheets changed" and "device changed". What machinery is missing?
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.
I didn't want to do the restyle stuff after I've finished all the medialist work, because gecko has its own control about which media queries have matched and not, and can provide us with an adequate restyle hint if we do the right thing.
Servo does indeed have the concept of "setting a new device", but there are fundamental differences between a servo device and a Gecko device that don't allow us to do that for gecko.
Concretely, in gecko right now the device is represented by the pres context and effectively unique. There's no easy way to compare against a previous state of the pres context (and I think its not bad, but we can't just reuse that piece of code so easily)
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.
Ok - Just add a comment indicating that Gecko doesn't use that machinery?
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.
Oh, and just so that I understand - if Gecko does provide us with such a restyle hint, will it avoid invoke RebuildAllStyleData? Because otherwise we're still going to dirty everything.
I guess I'm probably enough context here that it makes sense for heycam to review it, since he reviewed the media query stuff.
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.
Nope,
RebuildAllStyleData
receives a hint and a change hint.