summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@gmail.com>2021-08-27 12:47:30 +0100
committerAndreas Kling <kling@serenityos.org>2021-09-02 22:16:41 +0200
commit3b07f49d48de28e9fade90e953343e19d16ffe41 (patch)
tree4b0943eee06f9845cd8ee42e8896dab908b570ca /Userland/Applications/Browser
parent1da07734bb046d6540831e73af87dac867afe308 (diff)
downloadserenity-3b07f49d48de28e9fade90e953343e19d16ffe41.zip
LibWeb+WebContent: Implement asynchronous DOM Node properties call
This lets us "push" a new style-properties list to the DOM Inspector, for example when JS changes the style of the inspected node.
Diffstat (limited to 'Userland/Applications/Browser')
-rw-r--r--Userland/Applications/Browser/Tab.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp
index 960e3b371b..8f28ad04c7 100644
--- a/Userland/Applications/Browser/Tab.cpp
+++ b/Userland/Applications/Browser/Tab.cpp
@@ -281,6 +281,10 @@ Tab::Tab(BrowserWindow& window)
m_dom_inspector_widget->set_dom_json(dom_tree);
};
+ hooks().on_get_dom_node_properties = [this](auto node_id, auto& specified, auto& computed) {
+ m_dom_inspector_widget->set_dom_node_properties_json(node_id, specified, computed);
+ };
+
hooks().on_js_console_output = [this](auto& method, auto& line) {
if (m_console_window) {
auto* console_widget = static_cast<ConsoleWidget*>(m_console_window->main_widget());