mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09: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
Notes:
github-actions[bot]
2024-11-04 09:55:35 +00:00
Author: https://github.com/trflynn89
Commit: 27a678322f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2152
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 6 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue