mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:57:44 +00:00
LibWeb: Add Window.innerWidth and Window.innerHeight
This commit is contained in:
parent
72501775a7
commit
906cccbf7f
4 changed files with 39 additions and 0 deletions
|
@ -33,6 +33,7 @@
|
|||
#include <LibWeb/DOM/Window.h>
|
||||
#include <LibWeb/HighResolutionTime/Performance.h>
|
||||
#include <LibWeb/InProcessWebView.h>
|
||||
#include <LibWeb/Layout/InitialContainingBlockBox.h>
|
||||
#include <LibWeb/Page/Frame.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
@ -181,4 +182,18 @@ JS::Object* Window::create_wrapper(JS::GlobalObject& global_object)
|
|||
return &global_object;
|
||||
}
|
||||
|
||||
int Window::inner_width() const
|
||||
{
|
||||
if (!document().layout_node())
|
||||
return 0;
|
||||
return document().layout_node()->width();
|
||||
}
|
||||
|
||||
int Window::inner_height() const
|
||||
{
|
||||
if (!document().layout_node())
|
||||
return 0;
|
||||
return document().layout_node()->height();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue