Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 428365d538396bd73d446fa27beb62b3768b83ca
https://github.com/WebKit/WebKit/commit/428365d538396bd73d446fa27beb62b3768b83ca
Author: Ahmad Saleem <[email protected]>
Date: 2026-06-30 (Tue, 30 Jun 2026)
Changed paths:
M Source/WebCore/rendering/RenderFlexibleBox.cpp
Log Message:
-----------
RenderFlexibleBox::LineState constructor copies FlexLayoutItems instead of
moving it
https://bugs.webkit.org/show_bug.cgi?id=318189
rdar://180998972
Reviewed by Alan Baradlay.
LineState's constructor takes `FlexLayoutItems&& flexLayoutItems` (an
rvalue reference), signaling intent to move. However, inside the member
initializer list a named rvalue-reference parameter is an lvalue, so
`flexLayoutItems(flexLayoutItems)` selected the Vector copy constructor
and deep-copied the whole Vector<FlexLayoutItem,
s_flexLayoutItemsInitialCapacity>
on every flex line.
The caller already passes WTF::move(lineItems), so the intended behavior
was always a move. Wrap the parameter in WTF::move() to elide the
per-line copy.
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::LineState::LineState):
Canonical link: https://commits.webkit.org/316196@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications