mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:37:43 +00:00
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:
parent
4d356cfca5
commit
0aa375441a
1 changed files with 2 additions and 1 deletions
|
@ -138,11 +138,12 @@ void InspectorWidget::select_default_node()
|
||||||
void InspectorWidget::set_dom_json(StringView json)
|
void InspectorWidget::set_dom_json(StringView json)
|
||||||
{
|
{
|
||||||
m_dom_tree_view->set_model(WebView::DOMTreeModel::create(json, *m_dom_tree_view));
|
m_dom_tree_view->set_model(WebView::DOMTreeModel::create(json, *m_dom_tree_view));
|
||||||
|
m_dom_loaded = true;
|
||||||
|
|
||||||
if (m_pending_selection.has_value())
|
if (m_pending_selection.has_value())
|
||||||
set_selection(m_pending_selection.release_value());
|
set_selection(m_pending_selection.release_value());
|
||||||
else
|
else
|
||||||
select_default_node();
|
select_default_node();
|
||||||
m_dom_loaded = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InspectorWidget::clear_dom_json()
|
void InspectorWidget::clear_dom_json()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue