LibWeb: Add opt-in tracing of update_layout() calls with reason

This commit is contained in:
Andreas Kling 2025-03-05 20:50:05 +01:00 committed by Alexander Kalenik
parent c4b1d2382a
commit c333042e63
Notes: github-actions[bot] 2025-03-08 02:39:13 +00:00
21 changed files with 137 additions and 52 deletions

View file

@ -2029,7 +2029,7 @@ WebIDL::ExceptionOr<void> HTMLInputElement::set_size(WebIDL::UnsignedLong value)
// https://html.spec.whatwg.org/multipage/input.html#dom-input-height
WebIDL::UnsignedLong HTMLInputElement::height() const
{
const_cast<DOM::Document&>(document()).update_layout();
const_cast<DOM::Document&>(document()).update_layout(DOM::UpdateLayoutReason::HTMLInputElementHeight);
// When the input element's type attribute is not in the Image Button state, then no image is available.
if (type_state() != TypeAttributeState::ImageButton)
@ -2064,7 +2064,7 @@ WebIDL::ExceptionOr<void> HTMLInputElement::set_height(WebIDL::UnsignedLong valu
// https://html.spec.whatwg.org/multipage/input.html#dom-input-width
WebIDL::UnsignedLong HTMLInputElement::width() const
{
const_cast<DOM::Document&>(document()).update_layout();
const_cast<DOM::Document&>(document()).update_layout(DOM::UpdateLayoutReason::HTMLInputElementWidth);
// When the input element's type attribute is not in the Image Button state, then no image is available.
if (type_state() != TypeAttributeState::ImageButton)