Browser: Mark the DOM tree as loaded before selecting any DOM node

The first thing that `set_selection` does is return early if the DOM-
loaded flag is false. Set it to true so it can actually do something.
This fixes inspecting a DOM node from the context menu.
This commit is contained in:
Timothy Flynn 2023-11-04 16:35:05 -04:00 committed by Andreas Kling
parent 4d356cfca5
commit 0aa375441a
Notes: sideshowbarker 2024-07-17 02:29:45 +09:00

View File

@ -138,11 +138,12 @@ void InspectorWidget::select_default_node()
void InspectorWidget::set_dom_json(StringView json)
{
m_dom_tree_view->set_model(WebView::DOMTreeModel::create(json, *m_dom_tree_view));
m_dom_loaded = true;
if (m_pending_selection.has_value())
set_selection(m_pending_selection.release_value());
else
select_default_node();
m_dom_loaded = true;
}
void InspectorWidget::clear_dom_json()