mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:17:36 +00:00
LibWeb/HTML: Port Window.scroll{X,Y} / Window.page{X,Y}Offset to IDL
This commit is contained in:
parent
25f53a577d
commit
40b4ee88de
4 changed files with 33 additions and 44 deletions
|
@ -977,7 +977,7 @@ void Element::set_scroll_left(double x)
|
|||
if (document.document_element() == this) {
|
||||
// FIXME: Implement this in terms of invoking scroll() on window.
|
||||
if (auto* page = document.page())
|
||||
page->client().page_did_request_scroll_to({ static_cast<float>(x), window->scroll_y() });
|
||||
page->client().page_did_request_scroll_to({ static_cast<float>(x), static_cast<float>(window->scroll_y()) });
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -986,7 +986,7 @@ void Element::set_scroll_left(double x)
|
|||
if (document.body() == this && document.in_quirks_mode() && !is_potentially_scrollable()) {
|
||||
// FIXME: Implement this in terms of invoking scroll() on window.
|
||||
if (auto* page = document.page())
|
||||
page->client().page_did_request_scroll_to({ static_cast<float>(x), window->scroll_y() });
|
||||
page->client().page_did_request_scroll_to({ static_cast<float>(x), static_cast<float>(window->scroll_y()) });
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -1041,7 +1041,7 @@ void Element::set_scroll_top(double y)
|
|||
if (document.document_element() == this) {
|
||||
// FIXME: Implement this in terms of invoking scroll() on window.
|
||||
if (auto* page = document.page())
|
||||
page->client().page_did_request_scroll_to({ window->scroll_x(), static_cast<float>(y) });
|
||||
page->client().page_did_request_scroll_to({ static_cast<float>(window->scroll_x()), static_cast<float>(y) });
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -1050,7 +1050,7 @@ void Element::set_scroll_top(double y)
|
|||
if (document.body() == this && document.in_quirks_mode() && !is_potentially_scrollable()) {
|
||||
// FIXME: Implement this in terms of invoking scroll() on window.
|
||||
if (auto* page = document.page())
|
||||
page->client().page_did_request_scroll_to({ window->scroll_x(), static_cast<float>(y) });
|
||||
page->client().page_did_request_scroll_to({ static_cast<float>(window->scroll_x()), static_cast<float>(y) });
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue