mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:37:45 +00:00
LibWeb/HTML: Port Window.scroll() to IDL
...with various changes required due to ScrollBehavior / ScrollOptions moving from Element.idl to Window.idl.
This commit is contained in:
parent
40b4ee88de
commit
2b6d9cca1a
5 changed files with 126 additions and 79 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <LibWeb/ARIA/ARIAMixin.h>
|
||||
#include <LibWeb/Bindings/ElementPrototype.h>
|
||||
#include <LibWeb/Bindings/ShadowRootPrototype.h>
|
||||
#include <LibWeb/Bindings/WindowGlobalMixin.h>
|
||||
#include <LibWeb/CSS/CSSStyleDeclaration.h>
|
||||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
#include <LibWeb/DOM/Attr.h>
|
||||
|
@ -22,6 +23,7 @@
|
|||
#include <LibWeb/HTML/AttributeNames.h>
|
||||
#include <LibWeb/HTML/EventLoop/Task.h>
|
||||
#include <LibWeb/HTML/TagNames.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
#include <LibWeb/Layout/TreeBuilder.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
@ -33,13 +35,8 @@ struct ShadowRootInit {
|
|||
bool delegates_focus = false;
|
||||
};
|
||||
|
||||
// https://w3c.github.io/csswg-drafts/cssom-view-1/#dictdef-scrolloptions
|
||||
struct ScrollOptions {
|
||||
Bindings::ScrollBehavior behavior { Bindings::ScrollBehavior::Auto };
|
||||
};
|
||||
|
||||
// https://w3c.github.io/csswg-drafts/cssom-view-1/#dictdef-scrollintoviewoptions
|
||||
struct ScrollIntoViewOptions : public ScrollOptions {
|
||||
struct ScrollIntoViewOptions : public HTML::ScrollOptions {
|
||||
Bindings::ScrollLogicalPosition block { Bindings::ScrollLogicalPosition::Start };
|
||||
Bindings::ScrollLogicalPosition inline_ { Bindings::ScrollLogicalPosition::Nearest };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue