mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWebView: Inspect <frameset> elements the same as <body> elements
We track this node ID to navigate to a default element when opening the Inspector. So for all intents and purposes, <frameset> and <body> should be treated the same.
This commit is contained in:
parent
50a31f9728
commit
27a678322f
|
|
@ -313,7 +313,7 @@ void InspectorClient::reset()
|
|||
static constexpr auto script = "inspector.reset();"sv;
|
||||
m_inspector_web_view.run_javascript(script);
|
||||
|
||||
m_body_node_id.clear();
|
||||
m_body_or_frameset_node_id.clear();
|
||||
m_pending_selection.clear();
|
||||
m_dom_tree_loaded = false;
|
||||
|
||||
|
|
@ -331,8 +331,8 @@ void InspectorClient::select_hovered_node()
|
|||
|
||||
void InspectorClient::select_default_node()
|
||||
{
|
||||
if (m_body_node_id.has_value())
|
||||
select_node(*m_body_node_id);
|
||||
if (m_body_or_frameset_node_id.has_value())
|
||||
select_node(*m_body_or_frameset_node_id);
|
||||
}
|
||||
|
||||
void InspectorClient::clear_selection()
|
||||
|
|
@ -633,8 +633,8 @@ String InspectorClient::generate_dom_tree(JsonObject const& dom_tree)
|
|||
return;
|
||||
}
|
||||
|
||||
if (name.equals_ignoring_ascii_case("BODY"sv))
|
||||
m_body_node_id = node_id;
|
||||
if (name.equals_ignoring_ascii_case("BODY"sv) || name.equals_ignoring_ascii_case("FRAMESET"sv))
|
||||
m_body_or_frameset_node_id = node_id;
|
||||
|
||||
auto tag = name.to_lowercase();
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ private:
|
|||
ViewImplementation& m_content_web_view;
|
||||
ViewImplementation& m_inspector_web_view;
|
||||
|
||||
Optional<Web::UniqueNodeID> m_body_node_id;
|
||||
Optional<Web::UniqueNodeID> m_body_or_frameset_node_id;
|
||||
Optional<Web::UniqueNodeID> m_pending_selection;
|
||||
|
||||
bool m_inspector_loaded { false };
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user