diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-16 11:45:35 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-17 08:59:23 +0000 |
commit | 552906b0f222c5d5dd11b9fd73829d510980461a (patch) | |
tree | 3a11e6ed0538a81dd83b20cf3a4783e297f26d91 /chromium/third_party/blink/renderer/core/css/style_engine.h | |
parent | 1b05827804eaf047779b597718c03e7d38344261 (diff) | |
download | qtwebengine-chromium-552906b0f222c5d5dd11b9fd73829d510980461a.tar.gz |
BASELINE: Update Chromium to 83.0.4103.122
Change-Id: Ie3a82f5bb0076eec2a7c6a6162326b4301ee291e
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/css/style_engine.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/css/style_engine.h | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/chromium/third_party/blink/renderer/core/css/style_engine.h b/chromium/third_party/blink/renderer/core/css/style_engine.h index 44e3046e90c..e33a320f61a 100644 --- a/chromium/third_party/blink/renderer/core/css/style_engine.h +++ b/chromium/third_party/blink/renderer/core/css/style_engine.h @@ -48,9 +48,11 @@ #include "third_party/blink/renderer/core/css/style_engine_context.h" #include "third_party/blink/renderer/core/css/style_invalidation_root.h" #include "third_party/blink/renderer/core/css/style_recalc_root.h" +#include "third_party/blink/renderer/core/css/vision_deficiency.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/tree_ordered_list.h" #include "third_party/blink/renderer/core/html/track/text_track.h" +#include "third_party/blink/renderer/core/style/filter_operations.h" #include "third_party/blink/renderer/platform/bindings/name_client.h" #include "third_party/blink/renderer/platform/fonts/font_selector_client.h" #include "third_party/blink/renderer/platform/heap/handle.h" @@ -80,7 +82,7 @@ using StyleSheetKey = AtomicString; // The StyleEngine class manages style-related state for the document. There is // a 1-1 relationship of Document to StyleEngine. The document calls the -// StyleEngine when the the document is updated in a way that impacts styles. +// StyleEngine when the document is updated in a way that impacts styles. class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, public FontSelectorClient, public NameClient { @@ -154,7 +156,7 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, } RuleSet* RuleSetForSheet(CSSStyleSheet&); - void MediaQueryAffectingValueChanged(); + void MediaQueryAffectingValueChanged(MediaValueChange change); void UpdateActiveStyleSheetsInImport( StyleEngine& master_engine, DocumentStyleSheetCollector& parent_collector); @@ -243,7 +245,6 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, void UpdateLayoutTreeRebuildRoot(ContainerNode* ancestor, Node* dirty_node); CSSFontSelector* GetFontSelector() { return font_selector_; } - void SetFontSelector(CSSFontSelector*); void RemoveFontFaceRules(const HeapVector<Member<const StyleRuleFontFace>>&); // updateGenericFontFamilySettings is used from WebSettingsImpl. @@ -268,6 +269,7 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, } void EnsureUAStyleForFullscreen(); + void EnsureUAStyleForXrOverlay(); void EnsureUAStyleForElement(const Element&); void PlatformColorsChanged(); @@ -323,6 +325,10 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, void ApplyUserRuleSetChanges(const ActiveStyleSheetVector& old_style_sheets, const ActiveStyleSheetVector& new_style_sheets); + void VisionDeficiencyChanged(); + void ApplyVisionDeficiencyStyle( + scoped_refptr<ComputedStyle> layout_view_style); + void CollectMatchingUserRules(ElementRuleCollector&) const; void CustomPropertyRegistered(); @@ -344,6 +350,9 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, void MarkViewportStyleDirty(); bool IsViewportStyleDirty() const { return viewport_style_dirty_; } + void MarkFontsNeedUpdate(); + void InvalidateStyleAndLayoutForFontUpdates(); + StyleRuleKeyframes* KeyframeStylesForAnimation( const AtomicString& animation_name); @@ -375,13 +384,15 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, ForcedColors GetForcedColors() const { return forced_colors_; } void UpdateColorSchemeBackground(); - void Trace(blink::Visitor*) override; + void Trace(Visitor*) override; const char* NameInHeapSnapshot() const override { return "StyleEngine"; } private: // FontSelectorClient implementation. void FontsNeedUpdate(FontSelector*) override; + void LoadVisionDeficiencyFilter(); + private: bool NeedsActiveStyleSheetUpdate() const { return all_tree_scopes_dirty_ || tree_scopes_removed_ || @@ -404,8 +415,14 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, typedef HeapHashSet<Member<TreeScope>> UnorderedTreeScopeSet; - void MediaQueryAffectingValueChanged(UnorderedTreeScopeSet&); - void MediaQueryAffectingValueChanged(HeapHashSet<Member<TextTrack>>&); + bool MediaQueryAffectingValueChanged(const ActiveStyleSheetVector&, + MediaValueChange); + void MediaQueryAffectingValueChanged(TreeScope&, MediaValueChange); + void MediaQueryAffectingValueChanged(UnorderedTreeScopeSet&, + MediaValueChange); + void MediaQueryAffectingValueChanged(HeapHashSet<Member<TextTrack>>&, + MediaValueChange); + const RuleFeatureSet& GetRuleFeatureSet() const { DCHECK(IsMaster()); DCHECK(global_rule_set_); @@ -447,7 +464,8 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, TreeScope& tree_scope, const HeapHashSet<Member<RuleSet>>& changed_rule_sets, unsigned changed_rule_flags, - InvalidationScope invalidation_scope); + InvalidationScope invalidation_scope, + bool rebuild_font_cache); void InvalidateInitialData(); void UpdateViewport(); @@ -461,11 +479,14 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, const MediaQueryEvaluator& EnsureMediaQueryEvaluator(); void UpdateStyleSheetList(TreeScope&); - void ClearFontCacheAndAddUserFonts(); + // Returns true if any @font-face rules are added or removed. + bool ClearFontCacheAndAddUserFonts(); + void ClearKeyframeRules() { keyframes_rule_map_.clear(); } void ClearPropertyRules(); - void AddUserFontFaceRules(const RuleSet&); + // Returns true if any @font-face rules are added. + bool AddUserFontFaceRules(const RuleSet&); void AddUserKeyframeRules(const RuleSet&); void AddUserKeyframeStyle(StyleRuleKeyframes*); void AddPropertyRules(const RuleSet&); @@ -528,6 +549,10 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, bool in_layout_tree_rebuild_ = false; bool in_dom_removal_ = false; bool viewport_style_dirty_ = false; + bool fonts_need_update_ = false; + + VisionDeficiency vision_deficiency_ = VisionDeficiency::kNoVisionDeficiency; + Member<ReferenceFilterOperation> vision_deficiency_filter_; Member<StyleResolver> resolver_; Member<ViewportStyleResolver> viewport_resolver_; @@ -577,9 +602,9 @@ class CORE_EXPORT StyleEngine final : public GarbageCollected<StyleEngine>, // scheme is used to opt-out of forced darkening. Member<const CSSValue> meta_color_scheme_; - // The preferred color scheme is set in WebThemeEngine, but may be overridden - // by the ForceDarkMode setting where the preferred_color_scheme_ will be set - // to kNoPreference to avoid dark styling to be applied before auto darkening. + // The preferred color scheme is set in settings, but may be overridden by the + // ForceDarkMode setting where the preferred_color_scheme_ will be set to + // kNoPreference to avoid dark styling to be applied before auto darkening. PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kNoPreference; |