diff options
author | Linus Groh <mail@linusgroh.de> | 2022-10-12 23:49:23 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-10-13 11:14:45 +0200 |
commit | 3f24a444f9abe528f2fb0b4e7ab231bfda4db048 (patch) | |
tree | ff5dbd6179ced70afcf0e6ee170a83521e789ba1 /Userland/Services/WebContent | |
parent | 4c6f830a356bd8f502264d83822e1e65df6bbc7c (diff) | |
download | serenity-3f24a444f9abe528f2fb0b4e7ab231bfda4db048.zip |
LibWeb+WebContent: Add plumbing for 'webdriver-active flag'
Diffstat (limited to 'Userland/Services/WebContent')
-rw-r--r-- | Userland/Services/WebContent/ConnectionFromClient.cpp | 6 | ||||
-rw-r--r-- | Userland/Services/WebContent/ConnectionFromClient.h | 2 | ||||
-rw-r--r-- | Userland/Services/WebContent/PageHost.cpp | 6 | ||||
-rw-r--r-- | Userland/Services/WebContent/PageHost.h | 3 | ||||
-rw-r--r-- | Userland/Services/WebContent/WebContentServer.ipc | 1 |
5 files changed, 17 insertions, 1 deletions
diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index 5f54a26340..852a54150a 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -1,6 +1,7 @@ /* * Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org> + * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -498,6 +499,11 @@ void ConnectionFromClient::set_is_scripting_enabled(bool is_scripting_enabled) m_page_host->set_is_scripting_enabled(is_scripting_enabled); } +void ConnectionFromClient::set_is_webdriver_active(bool is_webdriver_active) +{ + m_page_host->set_is_webdriver_active(is_webdriver_active); +} + Messages::WebContentServer::GetLocalStorageEntriesResponse ConnectionFromClient::get_local_storage_entries() { auto* document = page().top_level_browsing_context().active_document(); diff --git a/Userland/Services/WebContent/ConnectionFromClient.h b/Userland/Services/WebContent/ConnectionFromClient.h index 63e40feb6c..206b06aecc 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.h +++ b/Userland/Services/WebContent/ConnectionFromClient.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -70,6 +71,7 @@ private: virtual void set_preferred_color_scheme(Web::CSS::PreferredColorScheme const&) override; virtual void set_has_focus(bool) override; virtual void set_is_scripting_enabled(bool) override; + virtual void set_is_webdriver_active(bool) override; virtual void handle_file_return(i32 error, Optional<IPC::File> const& file, i32 request_id) override; virtual void set_system_visibility_state(bool visible) override; diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp index 910fb4197e..30c820dab2 100644 --- a/Userland/Services/WebContent/PageHost.cpp +++ b/Userland/Services/WebContent/PageHost.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -70,6 +71,11 @@ void PageHost::set_is_scripting_enabled(bool is_scripting_enabled) page().set_is_scripting_enabled(is_scripting_enabled); } +void PageHost::set_is_webdriver_active(bool is_webdriver_active) +{ + page().set_is_webdriver_active(is_webdriver_active); +} + Web::Layout::InitialContainingBlock* PageHost::layout_root() { auto* document = page().top_level_browsing_context().active_document(); diff --git a/Userland/Services/WebContent/PageHost.h b/Userland/Services/WebContent/PageHost.h index 83b2bb3864..b145675379 100644 --- a/Userland/Services/WebContent/PageHost.h +++ b/Userland/Services/WebContent/PageHost.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -30,10 +31,10 @@ public: void set_viewport_rect(Gfx::IntRect const&); void set_screen_rects(Vector<Gfx::IntRect, 4> const& rects, size_t main_screen_index) { m_screen_rect = rects[main_screen_index]; }; void set_preferred_color_scheme(Web::CSS::PreferredColorScheme); - void set_should_show_line_box_borders(bool b) { m_should_show_line_box_borders = b; } void set_has_focus(bool); void set_is_scripting_enabled(bool); + void set_is_webdriver_active(bool); private: // ^PageClient diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc index 8eb8e8277b..7c7fb44cc3 100644 --- a/Userland/Services/WebContent/WebContentServer.ipc +++ b/Userland/Services/WebContent/WebContentServer.ipc @@ -49,6 +49,7 @@ endpoint WebContentServer set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme) =| set_has_focus(bool has_focus) =| set_is_scripting_enabled(bool is_scripting_enabled) =| + set_is_webdriver_active(bool is_webdriver_active) =| get_local_storage_entries() => (OrderedHashMap<String,String> entries) get_session_storage_entries() => (OrderedHashMap<String,String> entries) |