mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-05 08:31:51 +00:00
LibWeb: Add opt-in tracing of update_layout() calls with reason
This commit is contained in:
parent
c4b1d2382a
commit
c333042e63
Notes:
github-actions[bot]
2025-03-08 02:39:13 +00:00
Author: https://github.com/awesomekling
Commit: c333042e63
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3852
21 changed files with 137 additions and 52 deletions
|
@ -204,7 +204,7 @@ void HTMLImageElement::set_visible_in_viewport(bool)
|
|||
// https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-width
|
||||
WebIDL::UnsignedLong HTMLImageElement::width() const
|
||||
{
|
||||
const_cast<DOM::Document&>(document()).update_layout();
|
||||
const_cast<DOM::Document&>(document()).update_layout(DOM::UpdateLayoutReason::HTMLImageElementWidth);
|
||||
|
||||
// Return the rendered width of the image, in CSS pixels, if the image is being rendered.
|
||||
if (auto* paintable_box = this->paintable_box())
|
||||
|
@ -235,7 +235,7 @@ WebIDL::ExceptionOr<void> HTMLImageElement::set_width(WebIDL::UnsignedLong width
|
|||
// https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-height
|
||||
WebIDL::UnsignedLong HTMLImageElement::height() const
|
||||
{
|
||||
const_cast<DOM::Document&>(document()).update_layout();
|
||||
const_cast<DOM::Document&>(document()).update_layout(DOM::UpdateLayoutReason::HTMLImageElementHeight);
|
||||
|
||||
// Return the rendered height of the image, in CSS pixels, if the image is being rendered.
|
||||
if (auto* paintable_box = this->paintable_box())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue