Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 449c37a36b7d45202d279c6526075364f695f14f
      
https://github.com/WebKit/WebKit/commit/449c37a36b7d45202d279c6526075364f695f14f
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp

  Log Message:
  -----------
  [Grid] oppositeAxisConstraintForTrackSizing() copies the track-sizes Vector 
for every grid item
https://bugs.webkit.org/show_bug.cgi?id=319701
rdar://182543349

Reviewed by Sammy Gill.

oppositeAxisConstraintForTrackSizing() took its Vector<LayoutUnit>
parameter by value, so it copied the entire opposite-axis track-sizes
vector on every call. It is called once per grid item from within the
placedGridItems.map() lambdas in sizeColumnTracks() and sizeRowTracks(),
turning what should be a read-only lookup into an O(items x tracks)
allocation-and-copy during track sizing.

The function only reads from the vector, so take it by const reference.
Both call sites pass lvalues, so binding is safe.

No change in behavior, so no new tests.

* Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp:
(WebCore::Layout::oppositeAxisConstraintForTrackSizing):

Canonical link: https://commits.webkit.org/317452@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to