#include "third_party/blink/renderer/core/paint/highlight_overlay.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/editing/markers/custom_highlight_marker.h"
#include "third_party/blink/renderer/core/highlight/highlight_registry.h"
#include "third_party/blink/renderer/core/layout/layout_text.h"
#include "third_party/blink/renderer/core/paint/marker_range_mapping_context.h"
#include "third_party/blink/renderer/platform/fonts/text_fragment_paint_info.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
namespace blink {
namespace {
HighlightLayerType;
HighlightLayer;
HighlightRange;
HighlightEdge;
HighlightDecoration;
HighlightBackground;
HighlightTextShadow;
HighlightPart;
unsigned ClampOffset(unsigned offset, const TextFragmentPaintInfo& fragment) { … }
String HighlightTypeToString(HighlightLayerType type) { … }
uint16_t HighlightLayerIndex(const HeapVector<HighlightLayer>& layers,
HighlightLayerType type,
const AtomicString& name = g_null_atom) { … }
}
HighlightLayer::HighlightLayer(HighlightLayerType type,
const AtomicString& name)
: … { … }
String HighlightLayer::ToString() const { … }
enum PseudoId HighlightLayer::PseudoId() const { … }
const AtomicString& HighlightLayer::PseudoArgument() const { … }
bool HighlightLayer::operator==(const HighlightLayer& other) const { … }
bool HighlightLayer::operator!=(const HighlightLayer& other) const { … }
int8_t HighlightLayer::ComparePaintOrder(
const HighlightLayer& other,
const HighlightRegistry* registry) const { … }
HighlightRange::HighlightRange(unsigned from, unsigned to)
: … { … }
bool HighlightRange::operator==(const HighlightRange& other) const { … }
bool HighlightRange::operator!=(const HighlightRange& other) const { … }
String HighlightRange::ToString() const { … }
String HighlightEdge::ToString() const { … }
unsigned HighlightEdge::Offset() const { … }
bool HighlightEdge::LessThan(const HighlightEdge& other,
const HeapVector<HighlightLayer>& layers,
const HighlightRegistry* registry) const { … }
bool HighlightEdge::operator==(const HighlightEdge& other) const { … }
bool HighlightEdge::operator!=(const HighlightEdge& other) const { … }
HighlightDecoration::HighlightDecoration(HighlightLayerType type,
uint16_t layer_index,
HighlightRange range,
Color override_color)
: … { … }
String HighlightDecoration::ToString() const { … }
bool HighlightDecoration::operator==(const HighlightDecoration& other) const { … }
bool HighlightDecoration::operator!=(const HighlightDecoration& other) const { … }
String HighlightBackground::ToString() const { … }
bool HighlightBackground::operator==(const HighlightBackground& other) const { … }
bool HighlightBackground::operator!=(const HighlightBackground& other) const { … }
String HighlightTextShadow::ToString() const { … }
bool HighlightTextShadow::operator==(const HighlightTextShadow& other) const { … }
bool HighlightTextShadow::operator!=(const HighlightTextShadow& other) const { … }
HighlightPart::HighlightPart(HighlightLayerType type,
uint16_t layer_index,
HighlightRange range,
TextPaintStyle style,
float stroke_width,
Vector<HighlightDecoration> decorations,
Vector<HighlightBackground> backgrounds,
Vector<HighlightTextShadow> text_shadows)
: … { … }
HighlightPart::HighlightPart(HighlightLayerType type,
uint16_t layer_index,
HighlightRange range,
TextPaintStyle style,
float stroke_width,
Vector<HighlightDecoration> decorations)
: … { … }
String HighlightPart::ToString() const { … }
bool HighlightPart::operator==(const HighlightPart& other) const { … }
bool HighlightPart::operator!=(const HighlightPart& other) const { … }
HeapVector<HighlightLayer> HighlightOverlay::ComputeLayers(
const Document& document,
Node* node,
const ComputedStyle& originating_style,
const TextPaintStyle& originating_text_style,
const PaintInfo& paint_info,
const LayoutSelectionStatus* selection,
const DocumentMarkerVector& custom,
const DocumentMarkerVector& grammar,
const DocumentMarkerVector& spelling,
const DocumentMarkerVector& target) { … }
Vector<HighlightEdge> HighlightOverlay::ComputeEdges(
const Node* node,
bool is_generated_text_fragment,
std::optional<TextOffsetRange> dom_offsets,
const HeapVector<HighlightLayer>& layers,
const LayoutSelectionStatus* selection,
const DocumentMarkerVector& custom,
const DocumentMarkerVector& grammar,
const DocumentMarkerVector& spelling,
const DocumentMarkerVector& target) { … }
HeapVector<HighlightPart> HighlightOverlay::ComputeParts(
const TextFragmentPaintInfo& content_offsets,
const HeapVector<HighlightLayer>& layers,
const Vector<HighlightEdge>& edges) { … }
std::ostream& operator<<(std::ostream& result,
const HighlightOverlay::HighlightLayer& layer) { … }
std::ostream& operator<<(std::ostream& result,
const HighlightOverlay::HighlightEdge& edge) { … }
std::ostream& operator<<(std::ostream& result,
const HighlightOverlay::HighlightPart& part) { … }
}