chromium/third_party/blink/renderer/core/css/resolver/style_resolver.cc

/*
 * Copyright (C) 1999 Lars Knoll ([email protected])
 *           (C) 2004-2005 Allan Sandfeld Jensen ([email protected])
 * Copyright (C) 2006, 2007 Nicholas Shanks ([email protected])
 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
 * All rights reserved.
 * Copyright (C) 2007 Alexey Proskuryakov <[email protected]>
 * Copyright (C) 2007, 2008 Eric Seidel <[email protected]>
 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
 * (http://www.torchmobile.com/)
 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
 * Copyright (C) 2012 Google Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"

#include "base/containers/adapters.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-blink.h"
#include "third_party/blink/public/web/web_print_page_description.h"
#include "third_party/blink/public/web/web_print_params.h"
#include "third_party/blink/renderer/core/animation/css/compositor_keyframe_value_factory.h"
#include "third_party/blink/renderer/core/animation/css/css_animations.h"
#include "third_party/blink/renderer/core/animation/document_animations.h"
#include "third_party/blink/renderer/core/animation/element_animations.h"
#include "third_party/blink/renderer/core/animation/invalidatable_interpolation.h"
#include "third_party/blink/renderer/core/css/anchor_evaluator.h"
#include "third_party/blink/renderer/core/css/cascade_layer_map.h"
#include "third_party/blink/renderer/core/css/container_query_evaluator.h"
#include "third_party/blink/renderer/core/css/css_custom_ident_value.h"
#include "third_party/blink/renderer/core/css/css_default_style_sheets.h"
#include "third_party/blink/renderer/core/css/css_font_selector.h"
#include "third_party/blink/renderer/core/css/css_identifier_value.h"
#include "third_party/blink/renderer/core/css/css_inherited_value.h"
#include "third_party/blink/renderer/core/css/css_initial_color_value.h"
#include "third_party/blink/renderer/core/css/css_keyframe_rule.h"
#include "third_party/blink/renderer/core/css/css_keyframes_rule.h"
#include "third_party/blink/renderer/core/css/css_position_try_rule.h"
#include "third_party/blink/renderer/core/css/css_property_names.h"
#include "third_party/blink/renderer/core/css/css_rule_list.h"
#include "third_party/blink/renderer/core/css/css_selector.h"
#include "third_party/blink/renderer/core/css/css_selector_watch.h"
#include "third_party/blink/renderer/core/css/css_style_declaration.h"
#include "third_party/blink/renderer/core/css/css_style_rule.h"
#include "third_party/blink/renderer/core/css/css_value_list.h"
#include "third_party/blink/renderer/core/css/element_rule_collector.h"
#include "third_party/blink/renderer/core/css/font_face.h"
#include "third_party/blink/renderer/core/css/out_of_flow_data.h"
#include "third_party/blink/renderer/core/css/page_margins_style.h"
#include "third_party/blink/renderer/core/css/page_rule_collector.h"
#include "third_party/blink/renderer/core/css/part_names.h"
#include "third_party/blink/renderer/core/css/post_style_update_scope.h"
#include "third_party/blink/renderer/core/css/properties/computed_style_utils.h"
#include "third_party/blink/renderer/core/css/properties/css_property.h"
#include "third_party/blink/renderer/core/css/properties/css_property_ref.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/css/resolver/cascade_filter.h"
#include "third_party/blink/renderer/core/css/resolver/match_result.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_adjuster.h"
#include "third_party/blink/renderer/core/css/resolver/style_builder_converter.h"
#include "third_party/blink/renderer/core/css/resolver/style_cascade.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver_state.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/style_engine.h"
#include "third_party/blink/renderer/core/css/style_rule_import.h"
#include "third_party/blink/renderer/core/css/style_sheet_contents.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/first_letter_pseudo_element.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/dom/space_split_string.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.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_iframe_element.h"
#include "third_party/blink/renderer/core/html/html_image_element.h"
#include "third_party/blink/renderer/core/html/html_slot_element.h"
#include "third_party/blink/renderer/core/html/shadow/shadow_element_names.h"
#include "third_party/blink/renderer/core/html/track/text_track.h"
#include "third_party/blink/renderer/core/html/track/text_track_cue.h"
#include "third_party/blink/renderer/core/html/track/vtt/vtt_cue.h"
#include "third_party/blink/renderer/core/html/track/vtt/vtt_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/mathml/mathml_fraction_element.h"
#include "third_party/blink/renderer/core/mathml/mathml_operator_element.h"
#include "third_party/blink/renderer/core/mathml/mathml_padded_element.h"
#include "third_party/blink/renderer/core/mathml/mathml_space_element.h"
#include "third_party/blink/renderer/core/mathml_names.h"
#include "third_party/blink/renderer/core/media_type_names.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/page/scrolling/snap_coordinator.h"
#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/core/style/computed_style_constants.h"
#include "third_party/blink/renderer/core/style/style_initial_data.h"
#include "third_party/blink/renderer/core/style_property_shorthand.h"
#include "third_party/blink/renderer/core/svg/svg_element.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string_hash.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"

namespace blink {

namespace {

bool ShouldStoreOldStyle(const StyleRecalcContext& style_recalc_context,
                         StyleResolverState& state) {}

bool ShouldSetPendingUpdate(StyleResolverState& state, Element& element) {}

void SetAnimationUpdateIfNeeded(const StyleRecalcContext& style_recalc_context,
                                StyleResolverState& state,
                                Element& element) {}

ElementAnimations* GetElementAnimations(const StyleResolverState& state) {}

bool HasAnimationsOrTransitions(const StyleResolverState& state) {}

bool HasTimelines(const StyleResolverState& state) {}

bool IsAnimationStyleChange(Element& element) {}

#if DCHECK_IS_ON()
// Compare the base computed style with the one we compute to validate that the
// optimization is sound. A return value of g_null_atom means the diff was
// empty (which is what we want).
String ComputeBaseComputedStyleDiff(const ComputedStyle* base_computed_style,
                                    const ComputedStyle& computed_style) {}
#endif  // DCHECK_IS_ON()

// When force-computing the base computed style for validation purposes,
// we need to reset the StyleCascade when the base computed style optimization
// is used. This is because we don't want the computation of the base to
// populate the cascade, as they are supposed to be empty when the optimization
// is in use. This is to match the behavior of non-DCHECK builds.
void MaybeResetCascade(StyleCascade& cascade) {}

bool TextAutosizingMultiplierChanged(const StyleResolverState& state,
                                     const ComputedStyle& base_computed_style) {}

PseudoId GetPseudoId(const Element& element, ElementRuleCollector* collector) {}

void UseCountLegacyOverlapping(Document& document,
                               const ComputedStyle& a,
                               const ComputedStyleBuilder& b) {}

void ApplyLengthConversionFlags(StyleResolverState& state) {}

}  // namespace

static CSSPropertyValueSet* LeftToRightDeclaration() {}

static CSSPropertyValueSet* RightToLeftDeclaration() {}

static CSSPropertyValueSet* DocumentElementUserAgentDeclarations() {}

// The 'color' property conditionally inherits from the *used* value of its
// parent, and we rely on an explicit value in the cascade to implement this.
// https://drafts.csswg.org/css-color-adjust-1/#propdef-forced-color-adjust
static CSSPropertyValueSet* ForcedColorsUserAgentDeclarations() {}

// UA rule: * { overlay: none !important }
static CSSPropertyValueSet* UniversalOverlayUserAgentDeclaration() {}

// UA rule: ::scroll-marker-group { contain: layout size !important; }
// The generation of ::scroll-marker pseudo-elements
// cannot invalidate layout outside of this pseudo-element.
static CSSPropertyValueSet* ScrollMarkerGroupUserAgentDeclaration() {}

static void CollectScopedResolversForHostedShadowTrees(
    const Element& element,
    HeapVector<Member<ScopedStyleResolver>, 8>& resolvers) {}

StyleResolver::StyleResolver(Document& document)
    :{}

StyleResolver::~StyleResolver() = default;

void StyleResolver::Dispose() {}

void StyleResolver::SetRuleUsageTracker(StyleRuleUsageTracker* tracker) {}

static inline ScopedStyleResolver* ScopedResolverFor(const Element& element) {}

static inline ScopedStyleResolver* ParentScopedResolverFor(
    const Element& element,
    bool* parent_scope_contains_style_attribute) {}

// Matches :host and :host-context rules if the element is a shadow host.
// It matches rules from the ShadowHostRules of the ScopedStyleResolver
// of the attached shadow root.
static void MatchHostRules(const Element& element,
                           ElementRuleCollector& collector,
                           StyleRuleUsageTracker* tracker) {}

static void MatchSlottedRules(const Element&,
                              ElementRuleCollector&,
                              StyleRuleUsageTracker* tracker);
static void MatchSlottedRulesForUAHost(const Element& element,
                                       ElementRuleCollector& collector,
                                       StyleRuleUsageTracker* tracker) {}

// Matches `::slotted` selectors. It matches rules in the element's slot's
// scope. If that slot is itself slotted it will match rules in the slot's
// slot's scope and so on. The result is that it considers a chain of scopes
// descending from the element's own scope.
static void MatchSlottedRules(const Element& element,
                              ElementRuleCollector& collector,
                              StyleRuleUsageTracker* tracker) {}

const static TextTrack* GetTextTrackFromElement(const Element& element) {}

static void MatchVTTRules(const Element& element,
                          ElementRuleCollector& collector,
                          StyleRuleUsageTracker* tracker) {}

// Matches rules from the element's scope. The selectors may cross shadow
// boundaries during matching, like for :host-context.
static void MatchElementScopeRules(const Element& element,
                                   ElementRuleCollector& collector,
                                   StyleRuleUsageTracker* tracker) {}

void StyleResolver::MatchPseudoPartRulesForUAHost(
    const Element& element,
    ElementRuleCollector& collector) {}

void StyleResolver::MatchPseudoPartRules(const Element& part_matching_element,
                                         ElementRuleCollector& collector,
                                         bool for_shadow_pseudo) {}

void StyleResolver::MatchPositionTryRules(ElementRuleCollector& collector) {}

void StyleResolver::MatchAuthorRules(const Element& element,
                                     ElementRuleCollector& collector) {}

void StyleResolver::MatchUserRules(ElementRuleCollector& collector) {}

namespace {

bool IsInMediaUAShadow(const Element& element) {}

}  // namespace

template <typename Functor>
void StyleResolver::ForEachUARulesForElement(const Element& element,
                                             ElementRuleCollector* collector,
                                             Functor& func) const {}

void StyleResolver::MatchUARules(const Element& element,
                                 ElementRuleCollector& collector) {}

void StyleResolver::MatchPresentationalHints(StyleResolverState& state,
                                             ElementRuleCollector& collector) {}

DISABLE_CFI_PERF
void StyleResolver::MatchAllRules(StyleResolverState& state,
                                  ElementRuleCollector& collector,
                                  bool include_smil_properties) {}

const ComputedStyle* StyleResolver::StyleForViewport() {}

static StyleBaseData* GetBaseData(const StyleResolverState& state) {}

static const ComputedStyle* CachedAnimationBaseComputedStyle(
    StyleResolverState& state) {}

static void IncrementResolvedStyleCounters(const StyleRequest& style_request,
                                           Document& document) {}

// This is the core of computing style for a given element, ie., first compute
// base style and then apply animation style. (Not all elements needing style
// recalc ever hit ResolveStyle(); e.g., the “independent inherited properties
// optimization” can cause it to be skipped.)
//
// Generally, when an element is marked for style recalc, we do not reuse any
// style from previous computations, but re-compute from scratch every time.
// However: If possible, we compute base style only once and cache it, and then
// just apply animation style on top of the cached base style. This is because
// it's a common situation that elements have an unchanging base and then some
// independent animation properties that change every frame and don't affect
// any other properties or elements. (The exceptions can be found in
// CanReuseBaseComputedStyle().) This is known as the “base computed style
// optimization”.
const ComputedStyle* StyleResolver::ResolveStyle(
    Element* element,
    const StyleRecalcContext& style_recalc_context,
    const StyleRequest& style_request) {}

void StyleResolver::InitStyle(Element& element,
                              const StyleRequest& style_request,
                              const ComputedStyle& source_for_noninherited,
                              const ComputedStyle* parent_style,
                              StyleResolverState& state) {}

void StyleResolver::ApplyMathMLCustomStyleProperties(
    Element* element,
    StyleResolverState& state) {}

bool CanApplyInlineStyleIncrementally(Element* element,
                                      const StyleResolverState& state,
                                      const StyleRequest& style_request) {}

// This is the core of computing base style for a given element, ie., the style
// that does not depend on animations. For our purposes, style consists of three
// parts:
//
//  A. Properties inherited from the parent (parent style).
//  B. Properties that come from the defaults (initial style).
//  C. Properties from CSS rules that apply from this element
//     (matched properties).
//
// The typical flow (barring special rules for pseudo-elements and similar) is:
//
//   1. Collect all CSS rules that apply to this element
//      (MatchAllRules(), into ElementRuleCollector).
//   2. Figure out where we should get parent style (A) from, and where we
//      should get initial style (B) from; typically the parent element and
//      the global initial style, respectively.
//   3. Construct a new ComputedStyle, merging the two sources (InitStyle()).
//   4. Apply all the found properties (C) in the correct order
//      (ApplyPropertiesFromCascade(), using StyleCascade).
//
// However, the MatchedPropertiesCache can often give us A with the correct
// parts of C pre-applied, or similar for B+C, or simply A+B+C (a full MPC hit).
// Thus, after step 1, we look up the set of properties we've collected in the
// MPC, and if we have a full MPC hit, we stop after step 1. (This is the reason
// why step 1 needs to be first.) If we have a partial hit (we can use A+C
// but not B+C, or the other way around), we use that as one of our sources
// in step 3, and can skip the relevant properties in step 4.
//
// The base style is cached by the caller if possible (see ResolveStyle() on
// the “base computed style optimization”).
void StyleResolver::ApplyBaseStyleNoCache(
    Element* element,
    const StyleRecalcContext& style_recalc_context,
    const StyleRequest& style_request,
    StyleResolverState& state,
    StyleCascade& cascade) {}

// In the normal case, just a forwarder to ApplyBaseStyleNoCache(); see that
// function for the meat of the computation. However, this is where the
// “computed base style optimization” is applied if possible, and also
// incremental inline style updates:
//
// If we have an existing computed style, and the only changes have been
// mutations of independent properties on the element's inline style
// (see CanApplyInlineStyleIncrementally() for the precise conditions),
// we may reuse the old computed style and just reapply the element's
// inline style on top of it. This allows us to skip collecting elements
// and computing the full cascade, which can be a significant win when
// animating elements via inline style from JavaScript.
void StyleResolver::ApplyBaseStyle(
    Element* element,
    const StyleRecalcContext& style_recalc_context,
    const StyleRequest& style_request,
    StyleResolverState& state,
    StyleCascade& cascade) {}

CompositorKeyframeValue* StyleResolver::CreateCompositorKeyframeValueSnapshot(
    Element& element,
    const ComputedStyle& base_style,
    const ComputedStyle* parent_style,
    const PropertyHandle& property,
    const CSSValue* value,
    double offset) {}

const ComputedStyle* StyleResolver::StyleForPage(uint32_t page_index,
                                                 const AtomicString& page_name,
                                                 float page_fitting_scale,
                                                 bool ignore_author_style) {}

void StyleResolver::StyleForPageMargins(const ComputedStyle& page_style,
                                        uint32_t page_index,
                                        const AtomicString& page_name,
                                        PageMarginsStyle* margins_style) {}

void StyleResolver::LoadPaginationResources() {}

const ComputedStyle& StyleResolver::InitialStyle() const {}

ComputedStyleBuilder StyleResolver::CreateComputedStyleBuilder() const {}

ComputedStyleBuilder StyleResolver::CreateComputedStyleBuilderInheritingFrom(
    const ComputedStyle& parent_style) const {}

float StyleResolver::InitialZoom() const {}

ComputedStyleBuilder StyleResolver::InitialStyleBuilderForElement() const {}

const ComputedStyle* StyleResolver::InitialStyleForElement() const {}

const ComputedStyle* StyleResolver::StyleForText(Text* text_node) {}

void StyleResolver::AddMatchedRulesToTracker(
    const ElementRuleCollector& collector) {}

StyleRuleList* StyleResolver::StyleRulesForElement(Element* element,
                                                   unsigned rules_to_include) {}

HeapHashMap<CSSPropertyName, Member<const CSSValue>>
StyleResolver::CascadedValuesForElement(Element* element, PseudoId pseudo_id) {}

Element* StyleResolver::FindContainerForElement(
    Element* element,
    const ContainerSelector& container_selector,
    const TreeScope* selector_tree_scope) {}

RuleIndexList* StyleResolver::PseudoCSSRulesForElement(
    Element* element,
    PseudoId pseudo_id,
    const AtomicString& view_transition_name,
    unsigned rules_to_include) {}

RuleIndexList* StyleResolver::CssRulesForElement(Element* element,
                                                 unsigned rules_to_include) {}

void StyleResolver::CollectPseudoRulesForElement(
    const Element& element,
    ElementRuleCollector& collector,
    PseudoId pseudo_id,
    const AtomicString& view_transition_name,
    unsigned rules_to_include) {}

bool StyleResolver::ApplyAnimatedStyle(StyleResolverState& state,
                                       StyleCascade& cascade) {}

void StyleResolver::ApplyAnchorData(StyleResolverState& state) {}

StyleResolver::FindKeyframesRuleResult StyleResolver::FindKeyframesRule(
    const Element* element,
    const Element* animating_element,
    const AtomicString& animation_name) {}

void StyleResolver::InvalidateMatchedPropertiesCache() {}

void StyleResolver::SetResizedForViewportUnits() {}

void StyleResolver::ClearResizedForViewportUnits() {}

bool StyleResolver::CacheSuccess::EffectiveZoomChanged(
    const ComputedStyleBuilder& builder) const {}

bool StyleResolver::CacheSuccess::FontChanged(
    const ComputedStyleBuilder& builder) const {}

bool StyleResolver::CacheSuccess::InheritedVariablesChanged(
    const ComputedStyleBuilder& builder) const {}

bool StyleResolver::CacheSuccess::LineHeightChanged(
    const ComputedStyleBuilder& builder) const {}

bool StyleResolver::CacheSuccess::IsUsableAfterApplyInheritedOnly(
    const ComputedStyleBuilder& builder) const {}

StyleResolver::CacheSuccess StyleResolver::ApplyMatchedCache(
    StyleResolverState& state,
    const StyleRequest& style_request,
    const MatchResult& match_result) {}

void StyleResolver::MaybeAddToMatchedPropertiesCache(
    StyleResolverState& state,
    const CacheSuccess& cache_success) {}

bool StyleResolver::CanReuseBaseComputedStyle(const StyleResolverState& state) {}

const CSSValue* StyleResolver::ComputeValue(
    Element* element,
    const CSSPropertyName& property_name,
    const CSSValue& value) {}

const CSSValue* StyleResolver::ResolveValue(
    Element& element,
    const ComputedStyle& style,
    const CSSPropertyName& property_name,
    const CSSValue& value) {}

FilterOperations StyleResolver::ComputeFilterOperations(
    Element* element,
    const Font& font,
    const CSSValue& filter_value) {}

const ComputedStyle* StyleResolver::StyleForInterpolations(
    Element& element,
    ActiveInterpolationsMap& interpolations) {}

void StyleResolver::ApplyInterpolations(
    StyleResolverState& state,
    StyleCascade& cascade,
    ActiveInterpolationsMap& interpolations) {}

const ComputedStyle* StyleResolver::BeforeChangeStyleForTransitionUpdate(
    Element& element,
    const ComputedStyle& base_style,
    ActiveInterpolationsMap& transition_interpolations) {}

void StyleResolver::ApplyPropertiesFromCascade(StyleResolverState& state,
                                               StyleCascade& cascade,
                                               CacheSuccess cache_success) {}

void StyleResolver::ApplyCallbackSelectors(StyleResolverState& state) {}

void StyleResolver::ApplyDocumentRulesSelectors(StyleResolverState& state,
                                                ContainerNode* scope) {}

StyleRuleList* StyleResolver::CollectMatchingRulesFromUnconnectedRuleSet(
    StyleResolverState& state,
    RuleSet* rule_set,
    ContainerNode* scope) {}

// Font properties are also handled by FontStyleResolver outside the main
// thread. If you add/remove properties here, make sure they are also properly
// handled by FontStyleResolver.
Font StyleResolver::ComputeFont(Element& element,
                                const ComputedStyle& style,
                                const CSSPropertyValueSet& property_set) {}

void StyleResolver::UpdateMediaType() {}

void StyleResolver::Trace(Visitor* visitor) const {}

bool StyleResolver::IsForcedColorsModeEnabled() const {}

ComputedStyleBuilder StyleResolver::CreateAnonymousStyleBuilderWithDisplay(
    const ComputedStyle& parent_style,
    EDisplay display) {}

const ComputedStyle* StyleResolver::CreateAnonymousStyleWithDisplay(
    const ComputedStyle& parent_style,
    EDisplay display) {}

const ComputedStyle* StyleResolver::CreateInheritedDisplayContentsStyleIfNeeded(
    const ComputedStyle& parent_style,
    const ComputedStyle& layout_parent_style) {}

#define PROPAGATE_FROM

#define PROPAGATE_VALUE

namespace {

bool PropagateScrollSnapStyleToViewport(
    Document& document,
    const ComputedStyle* document_element_style,
    ComputedStyleBuilder& new_viewport_style_builder) {}

}  // namespace

bool StyleResolver::ShouldStopBodyPropagation(const Element& body_or_html) {}

void StyleResolver::PropagateStyleToViewport() {}
#undef PROPAGATE_VALUE
#undef PROPAGATE_FROM

static Font ComputeInitialLetterFont(const ComputedStyle& style,
                                     const ComputedStyle& paragraph_style) {}

// https://drafts.csswg.org/css-inline/#initial-letter-layout
// 7.5.1. Properties Applying to Initial Letters
// All properties that apply to an inline box also apply to an inline initial
// letter except for
//  * vertical-align and its sub-properties
//  * font-size,
//  * line-height,
//  * text-edge
//  * inline-sizing.
// Additionally, all of the sizing properties and box-sizing also apply to
// initial letters (see [css-sizing-3]).
const ComputedStyle* StyleResolver::StyleForInitialLetterText(
    const ComputedStyle& initial_letter_box_style,
    const ComputedStyle& paragraph_style) {}

StyleRulePositionTry* StyleResolver::ResolvePositionTryRule(
    const TreeScope* tree_scope,
    AtomicString position_try_name) {}

}  // namespace blink