#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "base/auto_reset.h"
#include "base/containers/adapters.h"
#include "base/hash/hash.h"
#include "base/ranges/algorithm.h"
#include "third_party/blink/public/mojom/timing/resource_timing.mojom-blink.h"
#include "third_party/blink/renderer/core/css/cascade_layer_map.h"
#include "third_party/blink/renderer/core/css/check_pseudo_has_cache_scope.h"
#include "third_party/blink/renderer/core/css/container_query_data.h"
#include "third_party/blink/renderer/core/css/container_query_evaluator.h"
#include "third_party/blink/renderer/core/css/counter_style_map.h"
#include "third_party/blink/renderer/core/css/css_default_style_sheets.h"
#include "third_party/blink/renderer/core/css/css_font_family_value.h"
#include "third_party/blink/renderer/core/css/css_font_selector.h"
#include "third_party/blink/renderer/core/css/css_style_sheet.h"
#include "third_party/blink/renderer/core/css/css_uri_value.h"
#include "third_party/blink/renderer/core/css/css_value_list.h"
#include "third_party/blink/renderer/core/css/document_style_environment_variables.h"
#include "third_party/blink/renderer/core/css/document_style_sheet_collection.h"
#include "third_party/blink/renderer/core/css/font_face_cache.h"
#include "third_party/blink/renderer/core/css/invalidation/invalidation_set.h"
#include "third_party/blink/renderer/core/css/media_feature_overrides.h"
#include "third_party/blink/renderer/core/css/media_values.h"
#include "third_party/blink/renderer/core/css/out_of_flow_data.h"
#include "third_party/blink/renderer/core/css/property_registration.h"
#include "third_party/blink/renderer/core/css/property_registry.h"
#include "third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h"
#include "third_party/blink/renderer/core/css/resolver/selector_filter_parent_scope.h"
#include "third_party/blink/renderer/core/css/resolver/style_builder_converter.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver_stats.h"
#include "third_party/blink/renderer/core/css/resolver/style_rule_usage_tracker.h"
#include "third_party/blink/renderer/core/css/resolver/viewport_style_resolver.h"
#include "third_party/blink/renderer/core/css/shadow_tree_style_sheet_collection.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/css/style_containment_scope_tree.h"
#include "third_party/blink/renderer/core/css/style_environment_variables.h"
#include "third_party/blink/renderer/core/css/style_rule_font_feature_values.h"
#include "third_party/blink/renderer/core/css/style_sheet_contents.h"
#include "third_party/blink/renderer/core/css/vision_deficiency.h"
#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h"
#include "third_party/blink/renderer/core/dom/document_lifecycle.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/flat_tree_traversal.h"
#include "third_party/blink/renderer/core/dom/layout_tree_builder_traversal.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/nth_index_cache.h"
#include "third_party/blink/renderer/core/dom/processing_instruction.h"
#include "third_party/blink/renderer/core/dom/scriptable_document_parser.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/frame/frame_owner.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/html/forms/html_field_set_element.h"
#include "third_party/blink/renderer/core/html/forms/html_select_element.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/html/html_html_element.h"
#include "third_party/blink/renderer/core/html/html_slot_element.h"
#include "third_party/blink/renderer/core/html/track/text_track.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/inspector/invalidation_set_to_selector_map.h"
#include "third_party/blink/renderer/core/layout/adjust_for_absolute_zoom.h"
#include "third_party/blink/renderer/core/layout/geometry/logical_size.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_size.h"
#include "third_party/blink/renderer/core/layout/layout_counter.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/layout/layout_theme.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/layout/list/layout_inline_list_item.h"
#include "third_party/blink/renderer/core/layout/list/layout_list_item.h"
#include "third_party/blink/renderer/core/loader/render_blocking_resource_manager.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/page/page_popup_controller.h"
#include "third_party/blink/renderer/core/preferences/preference_overrides.h"
#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/style/filter_operations.h"
#include "third_party/blink/renderer/core/style/style_initial_data.h"
#include "third_party/blink/renderer/core/svg/svg_resource.h"
#include "third_party/blink/renderer/core/view_transition/view_transition.h"
#include "third_party/blink/renderer/core/view_transition/view_transition_supplement.h"
#include "third_party/blink/renderer/core/view_transition/view_transition_utils.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include "third_party/blink/renderer/platform/fonts/font_selector.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#include "third_party/blink/renderer/platform/wtf/wtf_size_t.h"
namespace blink {
namespace {
CSSFontSelector* CreateCSSFontSelectorFor(Document& document) { … }
enum RuleSetFlags { … };
const unsigned kRuleSetFlagsAll = …;
unsigned GetRuleSetFlags(const HeapHashSet<Member<RuleSet>> rule_sets) { … }
const Vector<AtomicString> ConvertFontFamilyToVector(const CSSValue* value) { … }
}
StyleEngine::StyleEngine(Document& document)
: … { … }
StyleEngine::~StyleEngine() = default;
TreeScopeStyleSheetCollection& StyleEngine::EnsureStyleSheetCollectionFor(
TreeScope& tree_scope) { … }
TreeScopeStyleSheetCollection* StyleEngine::StyleSheetCollectionFor(
TreeScope& tree_scope) { … }
const HeapVector<Member<StyleSheet>>& StyleEngine::StyleSheetsForStyleSheetList(
TreeScope& tree_scope) { … }
void StyleEngine::InjectSheet(const StyleSheetKey& key,
StyleSheetContents* sheet,
WebCssOrigin origin) { … }
void StyleEngine::RemoveInjectedSheet(const StyleSheetKey& key,
WebCssOrigin origin) { … }
CSSStyleSheet& StyleEngine::EnsureInspectorStyleSheet() { … }
void StyleEngine::AddPendingBlockingSheet(Node& style_sheet_candidate_node,
PendingSheetType type) { … }
void StyleEngine::RemovePendingBlockingSheet(Node& style_sheet_candidate_node,
PendingSheetType type) { … }
void StyleEngine::SetNeedsActiveStyleUpdate(TreeScope& tree_scope) { … }
void StyleEngine::AddStyleSheetCandidateNode(Node& node) { … }
void StyleEngine::RemoveStyleSheetCandidateNode(
Node& node,
ContainerNode& insertion_point) { … }
void StyleEngine::ModifiedStyleSheetCandidateNode(Node& node) { … }
void StyleEngine::AdoptedStyleSheetAdded(TreeScope& tree_scope,
CSSStyleSheet* sheet) { … }
void StyleEngine::AdoptedStyleSheetRemoved(TreeScope& tree_scope,
CSSStyleSheet* sheet) { … }
void StyleEngine::MediaQueryAffectingValueChanged(TreeScope& tree_scope,
MediaValueChange change) { … }
void StyleEngine::WatchedSelectorsChanged() { … }
void StyleEngine::DocumentRulesSelectorsChanged() { … }
bool StyleEngine::ShouldUpdateDocumentStyleSheetCollection() const { … }
bool StyleEngine::ShouldUpdateShadowTreeStyleSheetCollection() const { … }
void StyleEngine::MediaQueryAffectingValueChanged(
UnorderedTreeScopeSet& tree_scopes,
MediaValueChange change) { … }
void StyleEngine::AddTextTrack(TextTrack* text_track) { … }
void StyleEngine::RemoveTextTrack(TextTrack* text_track) { … }
Element* StyleEngine::EnsureVTTOriginatingElement() { … }
void StyleEngine::MediaQueryAffectingValueChanged(
HeapHashSet<Member<TextTrack>>& text_tracks,
MediaValueChange change) { … }
void StyleEngine::MediaQueryAffectingValueChanged(MediaValueChange change) { … }
void StyleEngine::UpdateActiveStyleSheetsInShadow(
TreeScope* tree_scope,
UnorderedTreeScopeSet& tree_scopes_removed) { … }
void StyleEngine::UpdateActiveUserStyleSheets() { … }
void StyleEngine::UpdateActiveStyleSheets() { … }
void StyleEngine::UpdateCounterStyles() { … }
void StyleEngine::MarkPositionTryStylesDirty(
const HeapHashSet<Member<RuleSet>>& changed_rule_sets) { … }
void StyleEngine::InvalidatePositionTryStyles() { … }
void StyleEngine::UpdateViewport() { … }
bool StyleEngine::NeedsActiveStyleUpdate() const { … }
void StyleEngine::UpdateActiveStyle() { … }
const ActiveStyleSheetVector StyleEngine::ActiveStyleSheetsForInspector() { … }
void StyleEngine::UpdateCounters() { … }
void StyleEngine::UpdateLayoutCounters(const Element& element,
const LayoutObject& layout_object,
CountersAttachmentContext& context) { … }
void StyleEngine::UpdateCounters(const Element& element,
CountersAttachmentContext& context) { … }
void StyleEngine::ShadowRootInsertedToDocument(ShadowRoot& shadow_root) { … }
void StyleEngine::ShadowRootRemovedFromDocument(ShadowRoot* shadow_root) { … }
void StyleEngine::ResetAuthorStyle(TreeScope& tree_scope) { … }
StyleContainmentScopeTree& StyleEngine::EnsureStyleContainmentScopeTree() { … }
void StyleEngine::SetRuleUsageTracker(StyleRuleUsageTracker* tracker) { … }
Font StyleEngine::ComputeFont(Element& element,
const ComputedStyle& font_style,
const CSSPropertyValueSet& font_properties) { … }
RuleSet* StyleEngine::RuleSetForSheet(CSSStyleSheet& sheet) { … }
RuleSet* StyleEngine::RuleSetScope::RuleSetForSheet(StyleEngine& engine,
CSSStyleSheet* css_sheet) { … }
void StyleEngine::ClearResolvers() { … }
void StyleEngine::DidDetach() { … }
bool StyleEngine::ClearFontFaceCacheAndAddUserFonts(
const ActiveStyleSheetVector& user_sheets) { … }
void StyleEngine::UpdateGenericFontFamilySettings() { … }
void StyleEngine::RemoveFontFaceRules(
const HeapVector<Member<const StyleRuleFontFace>>& font_face_rules) { … }
void StyleEngine::MarkTreeScopeDirty(TreeScope& scope) { … }
void StyleEngine::MarkDocumentDirty() { … }
void StyleEngine::MarkUserStyleDirty() { … }
void StyleEngine::MarkViewportStyleDirty() { … }
CSSStyleSheet* StyleEngine::CreateSheet(
Element& element,
const String& text,
TextPosition start_position,
PendingSheetType type,
RenderBlockingBehavior render_blocking_behavior) { … }
CSSStyleSheet* StyleEngine::ParseSheet(
Element& element,
const String& text,
TextPosition start_position,
RenderBlockingBehavior render_blocking_behavior) { … }
void StyleEngine::CollectUserStyleFeaturesTo(RuleFeatureSet& features) const { … }
void StyleEngine::CollectScopedStyleFeaturesTo(RuleFeatureSet& features) const { … }
void StyleEngine::MarkViewportUnitDirty(ViewportUnitFlag flag) { … }
namespace {
void SetNeedsStyleRecalcForViewportUnits(TreeScope& tree_scope,
unsigned dirty_flags) { … }
}
void StyleEngine::InvalidateViewportUnitStylesIfNeeded() { … }
void StyleEngine::InvalidateStyleAndLayoutForFontUpdates() { … }
void StyleEngine::MarkFontsNeedUpdate() { … }
void StyleEngine::MarkCounterStylesNeedUpdate() { … }
void StyleEngine::FontsNeedUpdate(FontSelector*, FontInvalidationReason) { … }
void StyleEngine::PlatformColorsChanged() { … }
bool StyleEngine::ShouldSkipInvalidationFor(const Element& element) const { … }
bool StyleEngine::IsSubtreeAndSiblingsStyleDirty(const Element& element) const { … }
namespace {
bool PossiblyAffectingHasState(Element& element) { … }
bool InsertionOrRemovalPossiblyAffectHasStateOfAncestorsOrAncestorSiblings(
Element* parent) { … }
bool InsertionOrRemovalPossiblyAffectHasStateOfPreviousSiblings(
Element* previous_sibling) { … }
inline Element* SelfOrPreviousSibling(Node* node) { … }
}
void PossiblyScheduleNthPseudoInvalidations(Node& node) { … }
void StyleEngine::InvalidateElementAffectedByHas(
Element& element,
bool for_element_affected_by_pseudo_in_has) { … }
class StyleEngine::PseudoHasInvalidationTraversalContext { … };
void StyleEngine::InvalidateAncestorsOrSiblingsAffectedByHas(
const PseudoHasInvalidationTraversalContext& traversal_context) { … }
void StyleEngine::InvalidateChangedElementAffectedByLogicalCombinationsInHas(
Element& changed_element,
bool for_element_affected_by_pseudo_in_has) { … }
void StyleEngine::ClassChangedForElement(
const SpaceSplitString& changed_classes,
Element& element) { … }
void StyleEngine::ClassChangedForElement(const SpaceSplitString& old_classes,
const SpaceSplitString& new_classes,
Element& element) { … }
namespace {
bool HasAttributeDependentGeneratedContent(const Element& element) { … }
bool HasAttributeDependentStyle(const Element& element) { … }
}
void StyleEngine::AttributeChangedForElement(
const QualifiedName& attribute_name,
Element& element) { … }
void StyleEngine::IdChangedForElement(const AtomicString& old_id,
const AtomicString& new_id,
Element& element) { … }
void StyleEngine::PseudoStateChangedForElement(
CSSSelector::PseudoType pseudo_type,
Element& element,
bool invalidate_descendants_or_siblings,
bool invalidate_ancestors_or_siblings) { … }
void StyleEngine::PartChangedForElement(Element& element) { … }
void StyleEngine::ExportpartsChangedForElement(Element& element) { … }
void StyleEngine::ScheduleSiblingInvalidationsForElement(
Element& element,
ContainerNode& scheduling_parent,
unsigned min_direct_adjacent) { … }
void StyleEngine::ScheduleInvalidationsForInsertedSibling(
Element* before_element,
Element& inserted_element) { … }
void StyleEngine::ScheduleInvalidationsForRemovedSibling(
Element* before_element,
Element& removed_element,
Element& after_element) { … }
void StyleEngine::ScheduleNthPseudoInvalidations(ContainerNode& nth_parent) { … }
static bool FlagsCauseInvalidation(const MatchResult& result) { … }
static bool AnyRuleCausesInvalidation(const MatchRequest& match_request,
ElementRuleCollector& collector,
bool is_shadow_host) { … }
namespace {
bool CanRejectRuleSet(ElementRuleCollector& collector,
const RuleSet& rule_set) { … }
}
void StyleEngine::ApplyRuleSetInvalidationForElement(
const TreeScope& tree_scope,
Element& element,
SelectorFilter& selector_filter,
StyleScopeFrame& style_scope_frame,
const HeapHashSet<Member<RuleSet>>& rule_sets,
unsigned changed_rule_flags,
bool is_shadow_host) { … }
void StyleEngine::ScheduleCustomElementInvalidations(
HashSet<AtomicString> tag_names) { … }
void StyleEngine::ScheduleInvalidationsForHasPseudoAffectedByInsertion(
Element* parent,
Node* node_before_change,
Element& inserted_element) { … }
void StyleEngine::ScheduleInvalidationsForHasPseudoAffectedByRemoval(
Element* parent,
Node* node_before_change,
Element& removed_element) { … }
void StyleEngine::ScheduleInvalidationsForHasPseudoWhenAllChildrenRemoved(
Element& parent) { … }
void StyleEngine::InvalidateStyle() { … }
void StyleEngine::InvalidateSlottedElements(
HTMLSlotElement& slot,
const StyleChangeReasonForTracing& reason) { … }
bool StyleEngine::HasViewportDependentPropertyRegistrations() { … }
void StyleEngine::ApplyRuleSetInvalidationForTreeScope(
TreeScope& tree_scope,
ContainerNode& node,
SelectorFilter& selector_filter,
StyleScopeFrame& style_scope_frame,
const HeapHashSet<Member<RuleSet>>& rule_sets,
unsigned changed_rule_flags,
InvalidationScope invalidation_scope) { … }
void StyleEngine::ApplyRuleSetInvalidationForSubtree(
TreeScope& tree_scope,
Element& element,
SelectorFilter& selector_filter,
StyleScopeFrame& parent_style_scope_frame,
const HeapHashSet<Member<RuleSet>>& rule_sets,
unsigned changed_rule_flags,
InvalidationScope invalidation_scope,
bool invalidate_slotted,
bool invalidate_part) { … }
void StyleEngine::SetStatsEnabled(bool enabled) { … }
void StyleEngine::SetPreferredStylesheetSetNameIfNotSet(const String& name) { … }
void StyleEngine::SetHttpDefaultStyle(const String& content) { … }
void StyleEngine::CollectFeaturesTo(RuleFeatureSet& features) { … }
void StyleEngine::EnsureUAStyleForFullscreen(const Element& element) { … }
void StyleEngine::EnsureUAStyleForElement(const Element& element) { … }
void StyleEngine::EnsureUAStyleForPseudoElement(PseudoId pseudo_id) { … }
void StyleEngine::EnsureUAStyleForForcedColors() { … }
RuleSet* StyleEngine::DefaultViewTransitionStyle() const { … }
void StyleEngine::UpdateViewTransitionOptIn() { … }
bool StyleEngine::HasRulesForId(const AtomicString& id) const { … }
void StyleEngine::InitialStyleChanged() { … }
void StyleEngine::ViewportStyleSettingChanged() { … }
void StyleEngine::InvalidateForRuleSetChanges(
TreeScope& tree_scope,
const HeapHashSet<Member<RuleSet>>& changed_rule_sets,
unsigned changed_rule_flags,
InvalidationScope invalidation_scope) { … }
void StyleEngine::InvalidateInitialData() { … }
class StyleEngine::AtRuleCascadeMap { … };
void StyleEngine::ApplyUserRuleSetChanges(
const ActiveStyleSheetVector& old_style_sheets,
const ActiveStyleSheetVector& new_style_sheets) { … }
void StyleEngine::ApplyRuleSetChanges(
TreeScope& tree_scope,
const ActiveStyleSheetVector& old_style_sheets,
const ActiveStyleSheetVector& new_style_sheets,
const HeapVector<Member<RuleSetDiff>>& diffs) { … }
void StyleEngine::LoadVisionDeficiencyFilter() { … }
void StyleEngine::VisionDeficiencyChanged() { … }
void StyleEngine::ApplyVisionDeficiencyStyle(
ComputedStyleBuilder& layout_view_style_builder) { … }
const MediaQueryEvaluator& StyleEngine::EnsureMediaQueryEvaluator() { … }
bool StyleEngine::StyleMaybeAffectedByLayout(const Node& node) { … }
bool StyleEngine::UpdateRootFontRelativeUnits(
const ComputedStyle* old_root_style,
const ComputedStyle* new_root_style) { … }
void StyleEngine::PropertyRegistryChanged() { … }
void StyleEngine::EnvironmentVariableChanged() { … }
void StyleEngine::NodeWillBeRemoved(Node& node) { … }
void StyleEngine::ChildrenRemoved(ContainerNode& parent) { … }
void StyleEngine::CollectMatchingUserRules(
ElementRuleCollector& collector) const { … }
void StyleEngine::ClearKeyframeRules() { … }
void StyleEngine::ClearPropertyRules() { … }
void StyleEngine::AddPropertyRulesFromSheets(
AtRuleCascadeMap& cascade_map,
const ActiveStyleSheetVector& sheets,
bool is_user_style) { … }
void StyleEngine::AddFontPaletteValuesRulesFromSheets(
const ActiveStyleSheetVector& sheets) { … }
bool StyleEngine::AddUserFontFaceRules(const RuleSet& rule_set) { … }
void StyleEngine::AddUserKeyframeRules(const RuleSet& rule_set) { … }
void StyleEngine::AddUserKeyframeStyle(StyleRuleKeyframes* rule) { … }
bool StyleEngine::UserKeyframeStyleShouldOverride(
const StyleRuleKeyframes* new_rule,
const StyleRuleKeyframes* existing_rule) const { … }
void StyleEngine::AddViewTransitionRules(const ActiveStyleSheetVector& sheets) { … }
void StyleEngine::AddFontPaletteValuesRules(const RuleSet& rule_set) { … }
void StyleEngine::AddPropertyRules(AtRuleCascadeMap& cascade_map,
const RuleSet& rule_set,
bool is_user_style) { … }
StyleRuleKeyframes* StyleEngine::KeyframeStylesForAnimation(
const AtomicString& animation_name) { … }
StyleRuleFontPaletteValues* StyleEngine::FontPaletteValuesForNameAndFamily(
AtomicString palette_name,
AtomicString family_name) { … }
DocumentStyleEnvironmentVariables& StyleEngine::EnsureEnvironmentVariables() { … }
StyleInitialData* StyleEngine::MaybeCreateAndGetInitialData() { … }
bool StyleEngine::RecalcHighlightStylesForContainer(Element& container) { … }
#if DCHECK_IS_ON()
namespace {
bool ContainerStyleChangesAllowed(Element& container,
const ComputedStyle* old_element_style,
const ComputedStyle* old_layout_style) { … }
}
#endif
void StyleEngine::RecalcStyleForContainer(Element& container,
StyleRecalcChange change) { … }
void StyleEngine::UpdateStyleForNonEligibleContainer(Element& container) { … }
void StyleEngine::UpdateStyleAndLayoutTreeForContainer(
Element& container,
const LogicalSize& logical_size,
LogicalAxes contained_axes) { … }
void StyleEngine::UpdateStyleForOutOfFlow(Element& element,
const CSSPropertyValueSet* try_set,
const TryTacticList& tactic_list,
AnchorEvaluator* anchor_evaluator) { … }
StyleRulePositionTry* StyleEngine::GetPositionTryRule(
const ScopedCSSName& scoped_name) { … }
void StyleEngine::RecalcStyle(StyleRecalcChange change,
const StyleRecalcContext& style_recalc_context) { … }
void StyleEngine::RecalcPositionTryStyleForPseudoElement(
PseudoElement& pseudo_element,
const StyleRecalcChange style_recalc_change,
const StyleRecalcContext& style_recalc_context) { … }
void StyleEngine::RecalcTransitionPseudoStyle() { … }
void StyleEngine::RecalcStyle() { … }
void StyleEngine::ClearEnsuredDescendantStyles(Element& root) { … }
void StyleEngine::RebuildLayoutTreeForTraversalRootAncestors(
Element* parent,
Element* container_parent) { … }
void StyleEngine::RebuildLayoutTree(Element* size_container) { … }
void StyleEngine::ReattachContainerSubtree(Element& container) { … }
void StyleEngine::UpdateStyleAndLayoutTree() { … }
void StyleEngine::ViewportDefiningElementDidChange() { … }
void StyleEngine::FirstBodyElementChanged(HTMLBodyElement* body) { … }
void StyleEngine::UpdateStyleInvalidationRoot(ContainerNode* ancestor,
Node* dirty_node) { … }
void StyleEngine::UpdateStyleRecalcRoot(ContainerNode* ancestor,
Node* dirty_node) { … }
void StyleEngine::UpdateLayoutTreeRebuildRoot(ContainerNode* ancestor,
Node* dirty_node) { … }
namespace {
Node* AnalysisParent(const Node& node) { … }
bool IsRootOrSibling(const Node* root, const Node& node) { … }
}
StyleEngine::AncestorAnalysis StyleEngine::AnalyzeInclusiveAncestor(
const Node& node) { … }
StyleEngine::AncestorAnalysis StyleEngine::AnalyzeExclusiveAncestor(
const Node& node) { … }
StyleEngine::AncestorAnalysis StyleEngine::AnalyzeAncestors(const Node& node) { … }
bool StyleEngine::MarkReattachAllowed() const { … }
bool StyleEngine::MarkStyleDirtyAllowed() const { … }
bool StyleEngine::SupportsDarkColorScheme() { … }
void StyleEngine::UpdateColorScheme() { … }
void StyleEngine::UpdateColorSchemeMetrics() { … }
void StyleEngine::ColorSchemeChanged() { … }
void StyleEngine::SetPageColorSchemes(const CSSValue* color_scheme) { … }
void StyleEngine::UpdateColorSchemeBackground(bool color_scheme_changed) { … }
void StyleEngine::SetOwnerColorScheme(
mojom::blink::ColorScheme color_scheme,
mojom::blink::PreferredColorScheme preferred_color_scheme) { … }
mojom::blink::PreferredColorScheme StyleEngine::ResolveColorSchemeForEmbedding(
const ComputedStyle* embedder_style) const { … }
void StyleEngine::UpdateForcedBackgroundColor() { … }
Color StyleEngine::ColorAdjustBackgroundColor() const { … }
void StyleEngine::MarkAllElementsForStyleRecalc(
const StyleChangeReasonForTracing& reason) { … }
void StyleEngine::UpdateViewportStyle() { … }
bool StyleEngine::NeedsFullStyleUpdate() const { … }
void StyleEngine::PropagateWritingModeAndDirectionToHTMLRoot() { … }
CounterStyleMap& StyleEngine::EnsureUserCounterStyleMap() { … }
const CounterStyle& StyleEngine::FindCounterStyleAcrossScopes(
const AtomicString& name,
const TreeScope* scope) const { … }
void StyleEngine::Trace(Visitor* visitor) const { … }
namespace {
inline bool MayHaveFlatTreeChildren(const Element& element) { … }
}
void StyleEngine::MarkForLayoutTreeChangesAfterDetach() { … }
void StyleEngine::InvalidateSVGResourcesAfterDetach() { … }
bool StyleEngine::AllowSkipStyleRecalcForScope() const { … }
void StyleEngine::AddCachedFillOrClipPathURIValue(const AtomicString& string,
const CSSValue& value) { … }
const CSSValue* StyleEngine::GetCachedFillOrClipPathURIValue(
const AtomicString& string) { … }
void StyleEngine::BaseURLChanged() { … }
void StyleEngine::UpdateViewportSize() { … }
namespace {
bool UpdateLastSuccessfulPositionFallback(Element& element) { … }
bool InvalidatePositionTryNames(Element* root,
const HashSet<AtomicString>& try_names) { … }
}
bool StyleEngine::UpdateLastSuccessfulPositionFallbacks() { … }
void StyleEngine::RevisitActiveStyleSheetsForInspector() { … }
void StyleEngine::RevisitStyleRulesForInspector(
const RuleFeatureSet& features,
const HeapVector<Member<StyleRuleBase>>& rules) { … }
}