summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-09 13:14:32 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-09 21:25:10 +0200
commit84fcf879f98403ae7ac513b611d23d4de31dd845 (patch)
tree2f697763bbd64b96aabec434884a1978e6be0579 /Userland/Services
parentdd82f6832612a03ad51f577b60d289fea4bee169 (diff)
downloadserenity-84fcf879f98403ae7ac513b611d23d4de31dd845.zip
LibWeb: Rename BrowsingContext::document() => active_document()
This better matches the spec nomenclature. Note that we don't yet *retrieve* the active document according to spec.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WebContent/ClientConnection.cpp22
-rw-r--r--Userland/Services/WebContent/PageHost.cpp2
2 files changed, 12 insertions, 12 deletions
diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp
index edc9c05fea..6c3b708d86 100644
--- a/Userland/Services/WebContent/ClientConnection.cpp
+++ b/Userland/Services/WebContent/ClientConnection.cpp
@@ -171,19 +171,19 @@ void ClientConnection::key_down(i32 key, unsigned int modifiers, u32 code_point)
void ClientConnection::debug_request(const String& request, const String& argument)
{
if (request == "dump-dom-tree") {
- if (auto* doc = page().top_level_browsing_context().document())
+ if (auto* doc = page().top_level_browsing_context().active_document())
Web::dump_tree(*doc);
}
if (request == "dump-layout-tree") {
- if (auto* doc = page().top_level_browsing_context().document()) {
+ if (auto* doc = page().top_level_browsing_context().active_document()) {
if (auto* icb = doc->layout_node())
Web::dump_tree(*icb);
}
}
if (request == "dump-style-sheets") {
- if (auto* doc = page().top_level_browsing_context().document()) {
+ if (auto* doc = page().top_level_browsing_context().active_document()) {
for (auto& sheet : doc->style_sheets().sheets()) {
Web::dump_sheet(sheet);
}
@@ -211,21 +211,21 @@ void ClientConnection::debug_request(const String& request, const String& argume
void ClientConnection::get_source()
{
- if (auto* doc = page().top_level_browsing_context().document()) {
+ if (auto* doc = page().top_level_browsing_context().active_document()) {
async_did_get_source(doc->url(), doc->source());
}
}
void ClientConnection::inspect_dom_tree()
{
- if (auto* doc = page().top_level_browsing_context().document()) {
+ if (auto* doc = page().top_level_browsing_context().active_document()) {
async_did_get_dom_tree(doc->dump_dom_tree_as_json());
}
}
Messages::WebContentServer::InspectDomNodeResponse ClientConnection::inspect_dom_node(i32 node_id)
{
- if (auto* doc = page().top_level_browsing_context().document()) {
+ if (auto* doc = page().top_level_browsing_context().active_document()) {
Web::DOM::Node* node = Web::DOM::Node::from_id(node_id);
if (!node || (&node->document() != doc)) {
doc->set_inspected_node(nullptr);
@@ -262,7 +262,7 @@ Messages::WebContentServer::InspectDomNodeResponse ClientConnection::inspect_dom
Messages::WebContentServer::GetHoveredNodeIdResponse ClientConnection::get_hovered_node_id()
{
- if (auto* document = page().top_level_browsing_context().document()) {
+ if (auto* document = page().top_level_browsing_context().active_document()) {
auto hovered_node = document->hovered_node();
if (hovered_node)
return hovered_node->id();
@@ -272,7 +272,7 @@ Messages::WebContentServer::GetHoveredNodeIdResponse ClientConnection::get_hover
void ClientConnection::initialize_js_console(Badge<PageHost>)
{
- auto* document = page().top_level_browsing_context().document();
+ auto* document = page().top_level_browsing_context().active_document();
auto interpreter = document->interpreter().make_weak_ptr();
if (m_interpreter.ptr() == interpreter.ptr())
return;
@@ -290,10 +290,10 @@ void ClientConnection::js_console_input(const String& js_source)
void ClientConnection::run_javascript(String const& js_source)
{
- if (!page().top_level_browsing_context().document())
+ if (!page().top_level_browsing_context().active_document())
return;
- auto& interpreter = page().top_level_browsing_context().document()->interpreter();
+ auto& interpreter = page().top_level_browsing_context().active_document()->interpreter();
auto parser = JS::Parser(JS::Lexer(js_source));
auto program = parser.parse_program();
@@ -323,7 +323,7 @@ void ClientConnection::select_all()
Messages::WebContentServer::DumpLayoutTreeResponse ClientConnection::dump_layout_tree()
{
- auto* document = page().top_level_browsing_context().document();
+ auto* document = page().top_level_browsing_context().active_document();
if (!document)
return String { "(no DOM tree)" };
auto* layout_root = document->layout_node();
diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp
index 90ec128d77..ed24af5e82 100644
--- a/Userland/Services/WebContent/PageHost.cpp
+++ b/Userland/Services/WebContent/PageHost.cpp
@@ -48,7 +48,7 @@ void PageHost::set_palette_impl(const Gfx::PaletteImpl& impl)
Web::Layout::InitialContainingBlock* PageHost::layout_root()
{
- auto* document = page().top_level_browsing_context().document();
+ auto* document = page().top_level_browsing_context().active_document();
if (!document)
return nullptr;
return document->layout_node();