mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 06:15:07 +00:00
LibWeb: Implement basic version of CSSOM View's VisualViewport
We got some errors while loading https://twinings.co.uk/ about this interface missing, and it looked fairly simple so I sketched it out. Note that I did leave some FIXMEs where it's not clear exactly which metrics we should be returning.
This commit is contained in:
parent
2a914a7a59
commit
9f6ceff7cf
13 changed files with 257 additions and 2 deletions
|
@ -1085,6 +1085,17 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<CSS::Screen>> Window::screen()
|
|||
return JS::NonnullGCPtr { *m_screen };
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::GCPtr<CSS::VisualViewport>> Window::visual_viewport()
|
||||
{
|
||||
// If the associated document is fully active, the visualViewport attribute must return
|
||||
// the VisualViewport object associated with the Window object’s associated document.
|
||||
if (associated_document().is_fully_active())
|
||||
return associated_document().visual_viewport();
|
||||
|
||||
// Otherwise, it must return null.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// https://w3c.github.io/csswg-drafts/cssom-view/#dom-window-innerwidth
|
||||
i32 Window::inner_width() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue