Skip to content

Fix/flex skip pending layout update check#911

Open
LeoXiao99 wants to merge 3 commits intomainfrom
fix/flex-skip-pending-layout-update-check
Open

Fix/flex skip pending layout update check#911
LeoXiao99 wants to merge 3 commits intomainfrom
fix/flex-skip-pending-layout-update-check

Conversation

@LeoXiao99
Copy link
Copy Markdown
Collaborator

No description provided.

andycall and others added 3 commits April 3, 2026 03:01
The performance optimization commits introduced three flex layout fast
paths that skip child layout when constraints are unchanged:
  - _hasReusableStableLayoutChain (box_model.dart)
  - _canSkipAdjustedFlexChildLayout (flex.dart)
  - _tryNoFlexNoStretchNoBaselineFastPath (flex.dart)
  - _trySingleFlexibleRunFastPath (flex.dart)

All four checked needsRelayout and hasPendingSubtreeIntrinsicMeasurement-
Invalidation but omitted hasPendingLayoutUpdate. This flag is set by
markNeedsLayout() and cleared only after doLayout() completes. When a
DOM mutation (data refresh, tab switch, app backgrounding) triggers
markNeedsLayout() on a child whose flex constraints happen not to change,
the child was incorrectly skipped — causing it to render stale or blank
content until a subsequent layout pass with different constraints forced
a full re-layout.

Fix: add hasPendingLayoutUpdate guards to all four fast-path sites so
that any child dirtied via markNeedsLayout() is always fully laid out,
regardless of whether its constraints changed.

Also defer display:none→visible widget rebuild notifications that fire
while the parent element is temporarily disconnected (tab switch / page
refresh), replaying them in connectedCallback() to prevent elements from
remaining stuck as SizedBox.shrink().
@LeoXiao99 LeoXiao99 self-assigned this Apr 13, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
use-case Ready Ready Preview, Comment Apr 13, 2026 3:28pm
vue_usecase Ready Ready Preview, Comment Apr 13, 2026 3:28pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants