Commit ad408dc6 authored by Anders Hartvoll Ruud's avatar Anders Hartvoll Ruud Committed by Commit Bot

[cascade] Use StyleCascade for StyleForPage

Also add DCHECK to verify that nothing uses StyleResolver::
ApplyMatchedProperties when CSSCascade is enabled.

Bug: 947004
Change-Id: I201b2022050ac9df3a59edf7119c4cf3f46db67a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2041619
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740040}
parent 26295ae5
......@@ -1113,16 +1113,23 @@ scoped_refptr<const ComputedStyle> StyleResolver::StyleForPage(int page_index) {
NeedsApplyPass needs_apply_pass;
const MatchResult& result = collector.MatchedResult();
ApplyMatchedProperties<kAnimationPropertyPriority, kUpdateNeedsApplyPass>(
state, result.AllRules(), false, inherited_only, needs_apply_pass);
ApplyMatchedProperties<kHighPropertyPriority, kCheckNeedsApplyPass>(
state, result.AllRules(), false, inherited_only, needs_apply_pass);
// If our font got dirtied, go ahead and update it now.
UpdateFont(state);
if (RuntimeEnabledFeatures::CSSCascadeEnabled()) {
StyleCascade cascade(state);
cascade.Analyze(result, CascadeFilter());
cascade.Apply(result, CascadeFilter());
} else {
ApplyMatchedProperties<kAnimationPropertyPriority, kUpdateNeedsApplyPass>(
state, result.AllRules(), false, inherited_only, needs_apply_pass);
ApplyMatchedProperties<kHighPropertyPriority, kCheckNeedsApplyPass>(
state, result.AllRules(), false, inherited_only, needs_apply_pass);
ApplyMatchedProperties<kLowPropertyPriority, kCheckNeedsApplyPass>(
state, result.AllRules(), false, inherited_only, needs_apply_pass);
// If our font got dirtied, go ahead and update it now.
UpdateFont(state);
ApplyMatchedProperties<kLowPropertyPriority, kCheckNeedsApplyPass>(
state, result.AllRules(), false, inherited_only, needs_apply_pass);
}
LoadPendingResources(state);
......@@ -1557,6 +1564,8 @@ void StyleResolver::ApplyMatchedProperties(StyleResolverState& state,
bool inherited_only,
NeedsApplyPass& needs_apply_pass,
ForcedColorFilter forced_colors) {
DCHECK(!RuntimeEnabledFeatures::CSSCascadeEnabled());
if (range.IsEmpty())
return;
......
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