LibWeb: Update layout in dump_dom_tree_as_json()
Ensure layout is up to date before serializing the DOM tree as JSON for the inspector, so that layout information is accurate.
This commit is contained in:
parent
e3b55e2642
commit
4a2d80b493
2 changed files with 3 additions and 0 deletions
|
|
@ -3526,6 +3526,8 @@ void Document::set_bg_color(String const& value)
|
|||
|
||||
String Document::dump_dom_tree_as_json() const
|
||||
{
|
||||
const_cast<Document&>(*this).update_layout(UpdateLayoutReason::InspectDOMTree);
|
||||
|
||||
StringBuilder builder;
|
||||
auto json = MUST(JsonObjectSerializer<>::try_create(builder));
|
||||
serialize_tree_as_json(json);
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ enum class InvalidateLayoutTreeReason {
|
|||
X(HTMLImageElementY) \
|
||||
X(HTMLInputElementHeight) \
|
||||
X(HTMLInputElementWidth) \
|
||||
X(InspectDOMTree) \
|
||||
X(InternalsHitTest) \
|
||||
X(MediaQueryListMatches) \
|
||||
X(NavigableSelectedText) \
|
||||
|
|
|
|||
Loading…
Reference in a new issue