mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
script: Implement scrollIntoView
(#38230)
This is an implementation for `scrollIntoView`. For now, it is called when a certain element gains focus. Testing: Existing WPT tests Fixes: #24059 Signed-off-by: abdelrahman1234567 <abdelrahman.hossameldin.awadalla@huawei.com>
This commit is contained in:
parent
dcb90bb85e
commit
17a269a8ad
34 changed files with 492 additions and 318 deletions
|
@ -102,6 +102,7 @@ partial interface Element {
|
|||
[NewObject]
|
||||
DOMRect getBoundingClientRect();
|
||||
|
||||
undefined scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg = {});
|
||||
undefined scroll(optional ScrollToOptions options = {});
|
||||
undefined scroll(unrestricted double x, unrestricted double y);
|
||||
|
||||
|
@ -134,6 +135,16 @@ dictionary GetHTMLOptions {
|
|||
sequence<ShadowRoot> shadowRoots = [];
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/cssom-view/#dictdef-scrollintoviewoptions
|
||||
dictionary ScrollIntoViewOptions : ScrollOptions {
|
||||
ScrollLogicalPosition block = "start";
|
||||
ScrollLogicalPosition inline = "nearest";
|
||||
ScrollIntoViewContainer container = "all";
|
||||
};
|
||||
|
||||
enum ScrollLogicalPosition { "start", "center", "end", "nearest" };
|
||||
enum ScrollIntoViewContainer { "all", "nearest" };
|
||||
|
||||
// https://fullscreen.spec.whatwg.org/#api
|
||||
partial interface Element {
|
||||
Promise<undefined> requestFullscreen();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue