mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
LibWeb/DOM: Update spec steps for scrolling into view
Corresponds to dad91f49ef
The spec text doesn't actually require any changes from us, but I
noticed we were incorrectly calling `is_shadow_including_ancestor_of()`
instead of `is_shadow_including_inclusive_ancestor_of()`, so that's
fixed.
This commit is contained in:
parent
1c2b6ae03e
commit
2e2b456009
Notes:
github-actions[bot]
2025-06-24 15:13:50 +00:00
Author: https://github.com/AtkinsSJ
Commit: 2e2b456009
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5194
Reviewed-by: https://github.com/shannonbooth ✅
1 changed files with 6 additions and 4 deletions
|
@ -2343,9 +2343,11 @@ static ErrorOr<void> scroll_an_element_into_view(Element& target, Bindings::Scro
|
|||
}
|
||||
}
|
||||
|
||||
// 4. If container is not null and scrolling box is a shadow-including inclusive ancestor of container,
|
||||
// abort the rest of these steps.
|
||||
if (container != nullptr && scrolling_box.is_shadow_including_ancestor_of(*container))
|
||||
// 4. If container is not null and either scrolling box is a shadow-including inclusive ancestor of container
|
||||
// or is a viewport whose document is a shadow-including inclusive ancestor of container, abort the rest of
|
||||
// these steps.
|
||||
// NB: Our viewports *are* Documents in the DOM, so both checks are equivalent.
|
||||
if (container != nullptr && scrolling_box.is_shadow_including_inclusive_ancestor_of(*container))
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2380,7 +2382,7 @@ ErrorOr<void> Element::scroll_into_view(Optional<Variant<bool, ScrollIntoViewOpt
|
|||
// 3. Set inline to the inline dictionary member of options.
|
||||
inline_ = options.inline_;
|
||||
|
||||
// 4. If the container dictionary member of options is "nearest", set container to this element.
|
||||
// 4. If the container dictionary member of options is "nearest", set container to the element.
|
||||
if (options.container == Bindings::ScrollIntoViewContainer::Nearest)
|
||||
container = this;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue