#include "third_party/blink/renderer/core/animation/view_timeline.h"
#include <optional>
#include "third_party/blink/renderer/bindings/core/v8/v8_union_cssnumericvalue_string.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_cssnumericvalueorstringsequence_string.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_view_timeline.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_view_timeline_options.h"
#include "third_party/blink/renderer/core/animation/keyframe_effect.h"
#include "third_party/blink/renderer/core/css/css_identifier_value.h"
#include "third_party/blink/renderer/core/css/css_to_length_conversion_data.h"
#include "third_party/blink/renderer/core/css/css_value_list.h"
#include "third_party/blink/renderer/core/css/css_value_pair.h"
#include "third_party/blink/renderer/core/css/cssom/css_unit_value.h"
#include "third_party/blink/renderer/core/css/cssom/css_unit_values.h"
#include "third_party/blink/renderer/core/css/parser/css_parser.h"
#include "third_party/blink/renderer/core/css/resolver/element_resolve_context.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/node_computed_style.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/layout_inline.h"
#include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h"
#include "third_party/blink/renderer/core/page/scrolling/sticky_position_scrolling_constraints.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/platform/geometry/calculation_value.h"
namespace blink {
InsetValueSequence;
namespace {
bool IsBlockDirection(ViewTimeline::ScrollAxis axis, WritingMode writing_mode) { … }
TimelineInset ResolveAuto(const TimelineInset& inset,
Element& source,
ViewTimeline::ScrollAxis axis) { … }
LayoutUnit ComputeInset(const Length& inset, LayoutUnit viewport_size) { … }
const CSSValue* ParseInset(const InsetValueSequence& array,
wtf_size_t index,
ExceptionState& exception_state) { … }
const CSSValuePair* ParseInsetPair(Document& document, const String str_value) { … }
bool IsStyleDependent(const CSSValue* value) { … }
Length InsetValueToLength(const CSSValue* inset_value,
Element* subject,
Length default_value) { … }
enum class StickinessRange { … };
StickinessRange ComputeStickinessRange(
LayoutUnit sticky_box_stuck_pos_in_viewport,
LayoutUnit sticky_box_static_pos,
double viewport_size,
double target_size,
double target_pos) { … }
}
ViewTimeline* ViewTimeline::Create(Document& document,
ViewTimelineOptions* options,
ExceptionState& exception_state) { … }
ViewTimeline::ViewTimeline(Document* document,
Element* subject,
ScrollAxis axis,
TimelineInset inset)
: … { … }
void ViewTimeline::CalculateOffsets(PaintLayerScrollableArea* scrollable_area,
ScrollOrientation physical_orientation,
TimelineState* state) const { … }
void ViewTimeline::ApplyStickyAdjustments(ScrollOffsets& scroll_offsets,
ViewOffsets& view_offsets,
double viewport_size,
double target_size,
double target_offset,
ScrollOrientation orientation,
LayoutBox* scroll_container) const { … }
std::optional<gfx::SizeF> ViewTimeline::SubjectSize() const { … }
std::optional<gfx::PointF> ViewTimeline::SubjectPosition(
LayoutBox* scroll_container) const { … }
CSSNumericValue* ViewTimeline::getCurrentTime(const String& rangeName) { … }
Element* ViewTimeline::subject() const { … }
bool ViewTimeline::Matches(Element* subject,
ScrollAxis axis,
const TimelineInset& inset) const { … }
const TimelineInset& ViewTimeline::GetInset() const { … }
double ViewTimeline::ToFractionalOffset(
const TimelineOffset& timeline_offset) const { … }
CSSNumericValue* ViewTimeline::startOffset() const { … }
CSSNumericValue* ViewTimeline::endOffset() const { … }
void ViewTimeline::Trace(Visitor* visitor) const { … }
}