#include "third_party/blink/renderer/core/highlight/highlight_style_utils.h"
#include "components/shared_highlighting/core/common/fragment_directives_constants.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/css/style_request.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/node.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/editing/frame_selection.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/layout/layout_theme.h"
#include "third_party/blink/renderer/core/page/focus_controller.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/paint/paint_info.h"
#include "third_party/blink/renderer/core/paint/text_paint_style.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/platform/graphics/color.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
namespace blink {
namespace {
bool NodeIsReplaced(Node* node) { … }
mojom::blink::ColorScheme UsedColorScheme(
const ComputedStyle& originating_style,
const ComputedStyle* pseudo_style) { … }
Color ForcedForegroundColor(PseudoId pseudo,
mojom::blink::ColorScheme color_scheme,
const ui::ColorProvider* color_provider,
bool is_in_web_app_scope) { … }
Color ForcedBackgroundColor(PseudoId pseudo,
mojom::blink::ColorScheme color_scheme,
const ui::ColorProvider* color_provider,
bool is_in_web_app_scope) { … }
Color ForcedColor(const ComputedStyle& originating_style,
const ComputedStyle* pseudo_style,
PseudoId pseudo,
const CSSProperty& property,
const ui::ColorProvider* color_provider,
bool is_in_web_app_scope) { … }
std::optional<Color> DefaultForegroundColor(
const Document& document,
PseudoId pseudo,
mojom::blink::ColorScheme color_scheme) { … }
Color DefaultBackgroundColor(const Document& document,
PseudoId pseudo,
mojom::blink::ColorScheme color_scheme) { … }
std::optional<Color> DefaultHighlightColor(
const Document& document,
const ComputedStyle& originating_style,
const ComputedStyle* pseudo_style,
PseudoId pseudo,
const CSSProperty& property) { … }
const ComputedStyle* HighlightPseudoStyleWithOriginatingInheritance(
Node* node,
PseudoId pseudo,
const AtomicString& pseudo_argument = g_null_atom) { … }
bool UseForcedColors(const Document& document,
const ComputedStyle& originating_style,
const ComputedStyle* pseudo_style) { … }
bool UseDefaultHighlightColors(const ComputedStyle* pseudo_style,
PseudoId pseudo,
const CSSProperty& property) { … }
}
Color HighlightStyleUtils::ResolveColor(const Document& document,
const ComputedStyle& originating_style,
const ComputedStyle* pseudo_style,
PseudoId pseudo,
const CSSProperty& property,
std::optional<Color> current_color) { … }
std::optional<Color> HighlightStyleUtils::MaybeResolveColor(
const Document& document,
const ComputedStyle& originating_style,
const ComputedStyle* pseudo_style,
PseudoId pseudo,
const CSSProperty& property) { … }
const ComputedStyle* HighlightStyleUtils::HighlightPseudoStyle(
Node* node,
const ComputedStyle& style,
PseudoId pseudo,
const AtomicString& pseudo_argument) { … }
Color HighlightStyleUtils::HighlightBackgroundColor(
const Document& document,
const ComputedStyle& style,
Node* node,
std::optional<Color> current_layer_color,
PseudoId pseudo,
const AtomicString& pseudo_argument) { … }
std::optional<AppliedTextDecoration>
HighlightStyleUtils::SelectionTextDecoration(
const Document& document,
const ComputedStyle& style,
const ComputedStyle& pseudo_style) { … }
HighlightStyleUtils::HighlightTextPaintStyle
HighlightStyleUtils::HighlightPaintingStyle(
const Document& document,
const ComputedStyle& style,
Node* node,
PseudoId pseudo,
const TextPaintStyle& previous_layer_text_style,
const PaintInfo& paint_info,
const AtomicString& pseudo_argument) { … }
void HighlightStyleUtils::ResolveColorsFromPreviousLayer(
HighlightTextPaintStyle& text_style,
const HighlightTextPaintStyle& previous_layer_style) { … }
bool HighlightStyleUtils::ShouldInvalidateVisualOverflow(
const Node& node,
DocumentMarker::MarkerType type) { … }
bool HighlightStyleUtils::CustomHighlightHasVisualOverflow(
const Node& node,
const AtomicString& pseudo_argument) { … }
}