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

/*
 * Copyright (C) 1999 Lars Knoll ([email protected])
 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
 * All rights reserved.
 * Copyright (C) 2012 Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1.  Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 * 2.  Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 */

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

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

#include "third_party/blink/renderer/core/animation/document_timeline.h"
#include "third_party/blink/renderer/core/css/cascade_layer_map.h"
#include "third_party/blink/renderer/core/css/counter_style_map.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_style_sheet.h"
#include "third_party/blink/renderer/core/css/font_face.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/resolver/match_request.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/css/rule_feature_set.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/css/style_rule.h"
#include "third_party/blink/renderer/core/css/style_scope_data.h"
#include "third_party/blink/renderer/core/css/style_sheet_contents.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/html/html_style_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/svg/svg_style_element.h"

namespace blink {

ScopedStyleResolver* ScopedStyleResolver::Parent() const {}

void ScopedStyleResolver::AddKeyframeRules(const RuleSet& rule_set) {}

CounterStyleMap& ScopedStyleResolver::EnsureCounterStyleMap() {}

void ScopedStyleResolver::AddFontFaceRules(const RuleSet& rule_set) {}

void ScopedStyleResolver::AddCounterStyleRules(const RuleSet& rule_set) {}

void ScopedStyleResolver::AppendActiveStyleSheets(
    unsigned index,
    const ActiveStyleSheetVector& active_sheets) {}

void ScopedStyleResolver::CollectFeaturesTo(
    RuleFeatureSet& features,
    HeapHashSet<Member<const StyleSheetContents>>&
        visited_shared_style_sheet_contents) const {}

void ScopedStyleResolver::ResetStyle() {}

StyleRuleKeyframes* ScopedStyleResolver::KeyframeStylesForAnimation(
    const AtomicString& animation_name) {}

void ScopedStyleResolver::AddKeyframeStyle(StyleRuleKeyframes* rule) {}

bool ScopedStyleResolver::KeyframeStyleShouldOverride(
    const StyleRuleKeyframes* new_rule,
    const StyleRuleKeyframes* existing_rule) const {}

Element& ScopedStyleResolver::InvalidationRootForTreeScope(
    const TreeScope& tree_scope) {}

void ScopedStyleResolver::KeyframesRulesAdded(const TreeScope& tree_scope) {}

namespace {

bool CanRejectRuleSet(ElementRuleCollector& collector,
                      const RuleSet& rule_set) {}

}  // namespace

template <class Func>
void ScopedStyleResolver::ForAllStylesheets(ElementRuleCollector& collector,
                                            const Func& func) {}

void ScopedStyleResolver::CollectMatchingElementScopeRules(
    ElementRuleCollector& collector) {}

void ScopedStyleResolver::CollectMatchingShadowHostRules(
    ElementRuleCollector& collector) {}

void ScopedStyleResolver::CollectMatchingSlottedRules(
    ElementRuleCollector& collector) {}

void ScopedStyleResolver::CollectMatchingPartPseudoRules(
    ElementRuleCollector& collector,
    PartNames* part_names,
    bool for_shadow_pseudo) {}

void ScopedStyleResolver::MatchPageRules(PageRuleCollector& collector) {}

void ScopedStyleResolver::RebuildCascadeLayerMap(
    const ActiveStyleSheetVector& sheets) {}

void ScopedStyleResolver::AddPositionTryRules(const RuleSet& rule_set) {}

void ScopedStyleResolver::AddFunctionRules(const RuleSet& rule_set) {}

void ScopedStyleResolver::AddFontFeatureValuesRules(const RuleSet& rule_set) {}

StyleRulePositionTry* ScopedStyleResolver::PositionTryForName(
    const AtomicString& try_name) {}

StyleRuleFunction* ScopedStyleResolver::FunctionForName(StringView name) {}

const FontFeatureValuesStorage* ScopedStyleResolver::FontFeatureValuesForFamily(
    AtomicString font_family) {}

// When appending/removing stylesheets, we go through all implicit
// StyleScope instances in each stylesheet and store those instances
// in the StyleScopeData (ElementRareData) of the triggering element.
//
// See StyleScopeData for more information.

namespace {

Element* ImplicitScopeTrigger(TreeScope& scope, CSSStyleSheet& sheet) {}

template <typename Func>
void ForEachImplicitScopeTrigger(TreeScope& scope,
                                 CSSStyleSheet& sheet,
                                 const RuleSet& rule_set,
                                 Func func) {}

}  // namespace

void ScopedStyleResolver::AddImplicitScopeTriggers(CSSStyleSheet& sheet,
                                                   const RuleSet& rule_set) {}

void ScopedStyleResolver::AddImplicitScopeTrigger(
    Element& element,
    const StyleScope& style_scope) {}

void ScopedStyleResolver::RemoveImplicitScopeTriggers() {}

void ScopedStyleResolver::RemoveImplicitScopeTriggers(CSSStyleSheet& sheet,
                                                      const RuleSet& rule_set) {}

void ScopedStyleResolver::RemoveImplicitScopeTrigger(
    Element& element,
    const StyleScope& style_scope) {}

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

}  // namespace blink