mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1648157 - Add parameter to not iterate subdocs on media change. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D92807
This commit is contained in:
parent
b855fa6877
commit
b1029e4f28
@ -1542,7 +1542,8 @@ void nsPresContext::PostRebuildAllStyleDataEvent(
|
||||
}
|
||||
|
||||
void nsPresContext::MediaFeatureValuesChangedAllDocuments(
|
||||
const MediaFeatureChange& aChange) {
|
||||
const MediaFeatureChange& aChange,
|
||||
RecurseIntoInProcessSubDocuments aRecurseSubDocuments) {
|
||||
// Handle the media feature value change in this document.
|
||||
MediaFeatureValuesChanged(aChange);
|
||||
|
||||
@ -1550,14 +1551,17 @@ void nsPresContext::MediaFeatureValuesChangedAllDocuments(
|
||||
// document is using.
|
||||
mDocument->ImageTracker()->MediaFeatureValuesChangedAllDocuments(aChange);
|
||||
|
||||
// And then into any subdocuments.
|
||||
auto recurse = [&aChange](dom::Document& aSubDoc) {
|
||||
if (nsPresContext* pc = aSubDoc.GetPresContext()) {
|
||||
pc->MediaFeatureValuesChangedAllDocuments(aChange);
|
||||
}
|
||||
return CallState::Continue;
|
||||
};
|
||||
mDocument->EnumerateSubDocuments(recurse);
|
||||
if (aRecurseSubDocuments == RecurseIntoInProcessSubDocuments::Yes) {
|
||||
// And then into any subdocuments.
|
||||
auto recurse = [&aChange, aRecurseSubDocuments](dom::Document& aSubDoc) {
|
||||
if (nsPresContext* pc = aSubDoc.GetPresContext()) {
|
||||
pc->MediaFeatureValuesChangedAllDocuments(aChange,
|
||||
aRecurseSubDocuments);
|
||||
}
|
||||
return CallState::Continue;
|
||||
};
|
||||
mDocument->EnumerateSubDocuments(recurse);
|
||||
}
|
||||
}
|
||||
|
||||
void nsPresContext::FlushPendingMediaFeatureValuesChanged() {
|
||||
|
@ -283,6 +283,8 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
|
||||
|
||||
void ContentLanguageChanged();
|
||||
|
||||
enum class RecurseIntoInProcessSubDocuments : bool { No, Yes };
|
||||
|
||||
/**
|
||||
* Handle changes in the values of media features (used in media queries).
|
||||
*/
|
||||
@ -296,7 +298,8 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
|
||||
* features that must be updated in all subdocuments e.g. display-mode.
|
||||
*/
|
||||
void MediaFeatureValuesChangedAllDocuments(
|
||||
const mozilla::MediaFeatureChange&);
|
||||
const mozilla::MediaFeatureChange&,
|
||||
RecurseIntoInProcessSubDocuments = RecurseIntoInProcessSubDocuments::Yes);
|
||||
|
||||
/**
|
||||
* Updates the size mode on all remote children and recursively notifies this
|
||||
|
Loading…
Reference in New Issue
Block a user