LibWeb: Move "needs layout update" flag from DOM to layout tree

This is in preparation for allowing anonymous boxes to retain their
intrinsic size cache across layouts.
This commit is contained in:
Andreas Kling 2025-04-18 20:40:14 +02:00 committed by Andreas Kling
parent a122685896
commit 3c15fec303
Notes: github-actions[bot] 2025-04-20 22:32:22 +00:00
11 changed files with 51 additions and 44 deletions

View file

@ -112,7 +112,8 @@ u32 HTMLVideoElement::video_height() const
void HTMLVideoElement::set_video_track(GC::Ptr<HTML::VideoTrack> video_track)
{
set_needs_style_update(true);
set_needs_layout_update(DOM::SetNeedsLayoutReason::HTMLVideoElementSetVideoTrack);
if (auto layout_node = this->layout_node())
layout_node->set_needs_layout_update(DOM::SetNeedsLayoutReason::HTMLVideoElementSetVideoTrack);
if (m_video_track)
m_video_track->pause_video({});