mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02:00
LibWeb: Apply scroll margin in IntersectionObserver compute_intersection
Per the spec, the observer's [[scrollMargin]] should be applied to each scroll container's scrollport when walking the containing block chain. This expands the effective clip rect, allowing targets to be detected as intersecting before they actually enter the visible area of the scroll container. Add a scroll_margin_values() accessor to IntersectionObserver so the raw LengthPercentage values can be used during intersection computation. The scroll margin is applied by inflating the scroll container's padding box rect before clipping the intersection rect against it.
This commit is contained in:
committed by
Andreas Kling
parent
c871c56178
commit
9abb7e4517
Notes:
github-actions[bot]
2026-03-22 19:10:54 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/9abb7e4517e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8574
@@ -45,6 +45,7 @@ public:
|
||||
Variant<GC::Root<DOM::Element>, GC::Root<DOM::Document>, Empty> root() const;
|
||||
String root_margin() const;
|
||||
String scroll_margin() const;
|
||||
Vector<CSS::LengthPercentage> const& scroll_margin_values() const { return m_scroll_margin; }
|
||||
Vector<double> const& thresholds() const { return m_thresholds; }
|
||||
long delay() const { return m_delay; }
|
||||
bool track_visibility() const { return m_track_visibility; }
|
||||
|
||||
Reference in New Issue
Block a user