mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:07:45 +00:00
LibWeb: Add Window::browsing_context()
https://html.spec.whatwg.org/multipage/window-object.html#window-bc > The Window object's browsing context is the Window object's associated > Document's browsing context. > NOTE: It is either null or a browsing context.
This commit is contained in:
parent
986bd2e271
commit
2f021e92a5
1 changed files with 7 additions and 0 deletions
|
@ -14,8 +14,10 @@
|
||||||
#include <LibWeb/Bindings/Wrappable.h>
|
#include <LibWeb/Bindings/Wrappable.h>
|
||||||
#include <LibWeb/CSS/MediaQueryList.h>
|
#include <LibWeb/CSS/MediaQueryList.h>
|
||||||
#include <LibWeb/CSS/Screen.h>
|
#include <LibWeb/CSS/Screen.h>
|
||||||
|
#include <LibWeb/DOM/Document.h>
|
||||||
#include <LibWeb/DOM/Event.h>
|
#include <LibWeb/DOM/Event.h>
|
||||||
#include <LibWeb/DOM/EventTarget.h>
|
#include <LibWeb/DOM/EventTarget.h>
|
||||||
|
#include <LibWeb/HTML/BrowsingContext.h>
|
||||||
#include <LibWeb/HTML/GlobalEventHandlers.h>
|
#include <LibWeb/HTML/GlobalEventHandlers.h>
|
||||||
|
|
||||||
namespace Web::DOM {
|
namespace Web::DOM {
|
||||||
|
@ -41,9 +43,14 @@ public:
|
||||||
Page* page();
|
Page* page();
|
||||||
Page const* page() const;
|
Page const* page() const;
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window
|
||||||
Document const& associated_document() const { return *m_associated_document; }
|
Document const& associated_document() const { return *m_associated_document; }
|
||||||
Document& associated_document() { return *m_associated_document; }
|
Document& associated_document() { return *m_associated_document; }
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/window-object.html#window-bc
|
||||||
|
HTML::BrowsingContext const* browsing_context() const { return m_associated_document->browsing_context(); }
|
||||||
|
HTML::BrowsingContext* browsing_context() { return m_associated_document->browsing_context(); }
|
||||||
|
|
||||||
void alert(String const&);
|
void alert(String const&);
|
||||||
bool confirm(String const&);
|
bool confirm(String const&);
|
||||||
String prompt(String const&, String const&);
|
String prompt(String const&, String const&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue