mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 12:18:25 +00:00
LibWeb: Add stubs for the Screen Orientation API
As defined in: https://w3c.github.io/screen-orientation
This commit is contained in:
committed by
Sam Atkins
parent
7fb09bf95b
commit
ccebc7a905
@@ -8,6 +8,7 @@
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/ScreenPrototype.h>
|
||||
#include <LibWeb/CSS/Screen.h>
|
||||
#include <LibWeb/CSS/ScreenOrientation.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/Page/Page.h>
|
||||
|
||||
@@ -36,6 +37,7 @@ void Screen::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_window);
|
||||
visitor.visit(m_orientation);
|
||||
}
|
||||
|
||||
Gfx::IntRect Screen::screen_rect() const
|
||||
@@ -49,4 +51,11 @@ Gfx::IntRect Screen::screen_rect() const
|
||||
};
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<ScreenOrientation> Screen::orientation()
|
||||
{
|
||||
if (!m_orientation)
|
||||
m_orientation = ScreenOrientation::create(realm());
|
||||
return *m_orientation;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user