mirror of
https://github.com/RGBCube/serenity
synced 2025-07-22 13:07:40 +00:00
LibWeb: Convert DOM::Window to east-const style
This commit is contained in:
parent
d392349b6e
commit
8f72729f0e
2 changed files with 14 additions and 14 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -40,20 +40,20 @@ void Window::set_wrapper(Badge<Bindings::WindowObject>, Bindings::WindowObject&
|
||||||
m_wrapper = wrapper.make_weak_ptr();
|
m_wrapper = wrapper.make_weak_ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::alert(const String& message)
|
void Window::alert(String const& message)
|
||||||
{
|
{
|
||||||
if (auto* page = this->page())
|
if (auto* page = this->page())
|
||||||
page->client().page_did_request_alert(message);
|
page->client().page_did_request_alert(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Window::confirm(const String& message)
|
bool Window::confirm(String const& message)
|
||||||
{
|
{
|
||||||
if (auto* page = this->page())
|
if (auto* page = this->page())
|
||||||
return page->client().page_did_request_confirm(message);
|
return page->client().page_did_request_confirm(message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String Window::prompt(const String& message, const String& default_)
|
String Window::prompt(String const& message, String const& default_)
|
||||||
{
|
{
|
||||||
if (auto* page = this->page())
|
if (auto* page = this->page())
|
||||||
return page->client().page_did_request_prompt(message, default_);
|
return page->client().page_did_request_prompt(message, default_);
|
||||||
|
@ -118,7 +118,7 @@ i32 Window::request_animation_frame(JS::FunctionObject& callback)
|
||||||
static double fake_timestamp = 0;
|
static double fake_timestamp = 0;
|
||||||
|
|
||||||
i32 link_id = GUI::DisplayLink::register_callback([handle = make_handle(&callback)](i32 link_id) {
|
i32 link_id = GUI::DisplayLink::register_callback([handle = make_handle(&callback)](i32 link_id) {
|
||||||
auto& function = const_cast<JS::FunctionObject&>(static_cast<const JS::FunctionObject&>(*handle.cell()));
|
auto& function = const_cast<JS::FunctionObject&>(static_cast<JS::FunctionObject const&>(*handle.cell()));
|
||||||
auto& vm = function.vm();
|
auto& vm = function.vm();
|
||||||
fake_timestamp += 10;
|
fake_timestamp += 10;
|
||||||
[[maybe_unused]] auto rc = vm.call(function, JS::js_undefined(), JS::Value(fake_timestamp));
|
[[maybe_unused]] auto rc = vm.call(function, JS::js_undefined(), JS::Value(fake_timestamp));
|
||||||
|
@ -137,7 +137,7 @@ void Window::cancel_animation_frame(i32 id)
|
||||||
GUI::DisplayLink::unregister_callback(id);
|
GUI::DisplayLink::unregister_callback(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::did_set_location_href(Badge<Bindings::LocationObject>, const URL& new_href)
|
void Window::did_set_location_href(Badge<Bindings::LocationObject>, URL const& new_href)
|
||||||
{
|
{
|
||||||
auto* frame = document().browsing_context();
|
auto* frame = document().browsing_context();
|
||||||
if (!frame)
|
if (!frame)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -36,12 +36,12 @@ public:
|
||||||
Page* page();
|
Page* page();
|
||||||
Page const* page() const;
|
Page const* page() const;
|
||||||
|
|
||||||
const Document& document() const { return m_document; }
|
Document const& document() const { return m_document; }
|
||||||
Document& document() { return m_document; }
|
Document& document() { return m_document; }
|
||||||
|
|
||||||
void alert(const String&);
|
void alert(String const&);
|
||||||
bool confirm(const String&);
|
bool confirm(String const&);
|
||||||
String prompt(const String&, const String&);
|
String prompt(String const&, String const&);
|
||||||
i32 request_animation_frame(JS::FunctionObject&);
|
i32 request_animation_frame(JS::FunctionObject&);
|
||||||
void cancel_animation_frame(i32);
|
void cancel_animation_frame(i32);
|
||||||
|
|
||||||
|
@ -53,11 +53,11 @@ public:
|
||||||
int inner_width() const;
|
int inner_width() const;
|
||||||
int inner_height() const;
|
int inner_height() const;
|
||||||
|
|
||||||
void did_set_location_href(Badge<Bindings::LocationObject>, const URL& new_href);
|
void did_set_location_href(Badge<Bindings::LocationObject>, URL const& new_href);
|
||||||
void did_call_location_reload(Badge<Bindings::LocationObject>);
|
void did_call_location_reload(Badge<Bindings::LocationObject>);
|
||||||
|
|
||||||
Bindings::WindowObject* wrapper() { return m_wrapper; }
|
Bindings::WindowObject* wrapper() { return m_wrapper; }
|
||||||
const Bindings::WindowObject* wrapper() const { return m_wrapper; }
|
Bindings::WindowObject const* wrapper() const { return m_wrapper; }
|
||||||
|
|
||||||
void set_wrapper(Badge<Bindings::WindowObject>, Bindings::WindowObject&);
|
void set_wrapper(Badge<Bindings::WindowObject>, Bindings::WindowObject&);
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ public:
|
||||||
|
|
||||||
CSS::Screen& screen() { return *m_screen; }
|
CSS::Screen& screen() { return *m_screen; }
|
||||||
|
|
||||||
const Event* current_event() const { return m_current_event; }
|
Event const* current_event() const { return m_current_event; }
|
||||||
void set_current_event(Event* event) { m_current_event = event; }
|
void set_current_event(Event* event) { m_current_event = event; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue