chromium/third_party/blink/renderer/core/page/scrolling/snap_coordinator.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/page/scrolling/snap_coordinator.h"

#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/layout/geometry/box_strut.h"
#include "third_party/blink/renderer/core/layout/layout_block.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/platform/geometry/length_functions.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"

namespace blink {
namespace {
// This is experimentally determined and corresponds to the UA decided
// parameter as mentioned in spec.
// If changing this, consider modifying
// web_tests/fast/scrolling/area-at-exact-proximity-range-doesnt-crash.html
// accordingly.
constexpr float kProximityRatio =;

cc::SnapAlignment AdjustForRtlWritingMode(cc::SnapAlignment align) {}

// Snap types are categorized according to the spec
// https://drafts.csswg.org/css-scroll-snap-1/#snap-axis
cc::ScrollSnapType GetPhysicalSnapType(const LayoutBox& snap_container) {}

}  // namespace
// TODO(sunyunjia): Move the static functions to an anonymous namespace.

// static
bool SnapCoordinator::UpdateSnapContainerData(LayoutBox& snap_container) {}

// https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align
// After normalization:
//   * inline corresponds to x, and block corresponds to y
//   * start corresponds to left or top
//   * end corresponds to right or bottom
// In other words, the adjusted logical properties map to a physical layout
// as if the writing mode were horizontal left to right and top to bottom.
static cc::ScrollSnapAlign GetPhysicalAlignment(
    const ComputedStyle& area_style,
    const ComputedStyle& container_style,
    const PhysicalRect& area_rect,
    const PhysicalRect& container_rect) {}

// static
cc::SnapAreaData SnapCoordinator::CalculateSnapAreaData(
    const LayoutBox& snap_area,
    const LayoutBox& snap_container) {}

}  // namespace blink