Commit 374b0e9f authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Re-collecting active sheets should work for media query changes

Forcing re-adding all sheets should not be necessary. I probably was at
some point. Now, the active style update process should handle all.

TEST=StyleEngine.StyleMediaAttributeStyleChange
TEST=StyleEngine.StyleMediaAttributeNoStyleChange

Change-Id: Ie5af77ca90768b8fe5a39c3e07ddd5025f1c1056
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2563469Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831826}
parent 404b384d
...@@ -432,12 +432,6 @@ void StyleEngine::MediaQueryAffectingValueChanged(TreeScope& tree_scope, ...@@ -432,12 +432,6 @@ void StyleEngine::MediaQueryAffectingValueChanged(TreeScope& tree_scope,
} }
} }
void StyleEngine::MediaQueriesChangedInScope(TreeScope& tree_scope) {
if (ScopedStyleResolver* resolver = tree_scope.GetScopedStyleResolver())
resolver->SetNeedsAppendAllSheets();
SetNeedsActiveStyleUpdate(tree_scope);
}
void StyleEngine::WatchedSelectorsChanged() { void StyleEngine::WatchedSelectorsChanged() {
DCHECK(!IsHTMLImport()); DCHECK(!IsHTMLImport());
DCHECK(global_rule_set_); DCHECK(global_rule_set_);
......
...@@ -154,7 +154,6 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, ...@@ -154,7 +154,6 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>,
const HeapVector<Member<CSSStyleSheet>>& new_sheets); const HeapVector<Member<CSSStyleSheet>>& new_sheets);
void AddedCustomElementDefaultStyles( void AddedCustomElementDefaultStyles(
const HeapVector<Member<CSSStyleSheet>>& default_styles); const HeapVector<Member<CSSStyleSheet>>& default_styles);
void MediaQueriesChangedInScope(TreeScope&);
void WatchedSelectorsChanged(); void WatchedSelectorsChanged();
void InitialStyleChanged(); void InitialStyleChanged();
void ColorSchemeChanged(); void ColorSchemeChanged();
......
...@@ -49,7 +49,7 @@ void HTMLStyleElement::ParseAttribute( ...@@ -49,7 +49,7 @@ void HTMLStyleElement::ParseAttribute(
GetDocument().IsActive() && sheet_) { GetDocument().IsActive() && sheet_) {
sheet_->SetMediaQueries( sheet_->SetMediaQueries(
MediaQuerySet::Create(params.new_value, GetExecutionContext())); MediaQuerySet::Create(params.new_value, GetExecutionContext()));
GetDocument().GetStyleEngine().MediaQueriesChangedInScope(GetTreeScope()); GetDocument().GetStyleEngine().SetNeedsActiveStyleUpdate(GetTreeScope());
} else if (params.name == html_names::kTypeAttr) { } else if (params.name == html_names::kTypeAttr) {
HTMLElement::ParseAttribute(params); HTMLElement::ParseAttribute(params);
StyleElement::ChildrenChanged(*this); StyleElement::ChildrenChanged(*this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment