mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03: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
Notes:
sideshowbarker
2024-07-17 22:41:14 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/2f021e92a5 Pull-request: https://github.com/SerenityOS/serenity/pull/12879
@ -14,8 +14,10 @@
|
||||
#include <LibWeb/Bindings/Wrappable.h>
|
||||
#include <LibWeb/CSS/MediaQueryList.h>
|
||||
#include <LibWeb/CSS/Screen.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
#include <LibWeb/HTML/BrowsingContext.h>
|
||||
#include <LibWeb/HTML/GlobalEventHandlers.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
@ -41,9 +43,14 @@ public:
|
||||
Page* page();
|
||||
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& 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&);
|
||||
bool confirm(String const&);
|
||||
String prompt(String const&, String const&);
|
||||
|
Loading…
Reference in New Issue
Block a user