#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_SCROLL_SCROLL_INTO_VIEW_UTIL_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_SCROLL_SCROLL_INTO_VIEW_UTIL_H_
#include "third_party/blink/public/mojom/scroll/scroll_into_view_params.mojom-blink.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_offset.h"
#include "third_party/blink/renderer/core/layout/geometry/physical_rect.h"
#include "third_party/blink/renderer/core/scroll/scroll_alignment.h"
#include "third_party/blink/renderer/core/scroll/scroll_types.h"
namespace gfx {
class RectF;
}
namespace blink {
class LayoutBox;
class LayoutObject;
class LayoutView;
struct PhysicalRect;
class ScrollableArea;
class ComputedStyle;
class ScrollIntoViewOptions;
namespace scroll_into_view_util {
void CORE_EXPORT ScrollRectToVisible(const LayoutObject&,
const PhysicalRect&,
mojom::blink::ScrollIntoViewParamsPtr,
bool from_remote_frame = false);
gfx::RectF FocusedEditableBoundsFromParams(
const gfx::RectF& caret_rect,
const mojom::blink::ScrollIntoViewParamsPtr& params);
void ConvertParamsToParentFrame(mojom::blink::ScrollIntoViewParamsPtr& params,
const gfx::RectF& caret_rect_in_src,
const LayoutObject& src_frame,
const LayoutView& dest_frame);
ScrollOffset GetScrollOffsetToExpose(
const ScrollableArea& scrollable_area,
const PhysicalRect& local_expose_rect,
const PhysicalBoxStrut& expose_scroll_margin,
const mojom::blink::ScrollAlignment& align_x,
const mojom::blink::ScrollAlignment& align_y);
CORE_EXPORT mojom::blink::ScrollIntoViewParamsPtr CreateScrollIntoViewParams(
const mojom::blink::ScrollAlignment& align_x =
ScrollAlignment::CenterIfNeeded(),
const mojom::blink::ScrollAlignment& align_y =
ScrollAlignment::CenterIfNeeded(),
mojom::blink::ScrollType scroll_type =
mojom::blink::ScrollType::kProgrammatic,
bool make_visible_in_visual_viewport = true,
mojom::blink::ScrollBehavior scroll_behavior =
mojom::blink::ScrollBehavior::kAuto,
bool is_for_scroll_sequence = false,
bool cross_origin_boundaries = true);
mojom::blink::ScrollIntoViewParamsPtr CreateScrollIntoViewParams(
const ScrollIntoViewOptions& options,
const ComputedStyle& computed_style);
mojom::blink::ScrollIntoViewParamsPtr CreateScrollIntoViewParams(
const ComputedStyle& computed_style);
mojom::blink::ScrollAlignment PhysicalAlignmentFromSnapAlignStyle(
const LayoutBox& box,
ScrollOrientation axis);
}
}
#endif