mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +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
|
@ -402,7 +402,7 @@ void SourceSet::normalize_source_densities(DOM::Element const& element)
|
|||
|
||||
// HACK: Flush any pending layouts here so we get an up-to-date length resolution context.
|
||||
// FIXME: We should have a way to build a LengthResolutionContext for any DOM node without going through the layout tree.
|
||||
const_cast<DOM::Document&>(element.document()).update_layout();
|
||||
const_cast<DOM::Document&>(element.document()).update_layout(DOM::UpdateLayoutReason::SourceSetNormalizeSourceDensities);
|
||||
if (element.layout_node()) {
|
||||
CSS::CalculationResolutionContext context { .length_resolution_context = CSS::Length::ResolutionContext::for_layout_node(*element.layout_node()) };
|
||||
return m_source_size.resolved(context).value_or(CSS::Length::make_auto());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue