Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5d1f5f0b510e37294aad30942d5513c106c452fc
      
https://github.com/WebKit/WebKit/commit/5d1f5f0b510e37294aad30942d5513c106c452fc
  Author: Alan Baradlay <[email protected]>
  Date:   2026-05-05 (Tue, 05 May 2026)

  Changed paths:
    A LayoutTests/fast/block/block-in-inline-max-height-change-expected.html
    A LayoutTests/fast/block/block-in-inline-max-height-change.html
    M Source/WebCore/rendering/RenderBlockFlow.cpp

  Log Message:
  -----------
  [block-in-inline] Container does not expand when max-height is removed
https://bugs.webkit.org/show_bug.cgi?id=314036
<rdar://175799547>

Reviewed by Antti Koivisto.

When a container with block-in-inline content (e.g. a <div> inside a <span>)
has its max-height removed via a style change, the container should re-layout
and grow to fit its content. Instead, it stayed at the old height.

The block-in-inline fast path (layoutSimpleBlockContentInInline) is designed
to skip full inline layout when only the block children need re-layout and the
inline content is unchanged. But it was incorrectly triggered here because of
how preferred-width invalidation interacted with the eligibility check.

When max-height changes, all children get their preferred widths invalidated
(needsPreferredLogicalWidthsUpdate = true) even though none need actual layout
(needsLayout = false). The walker in markInlineContentDirtyForLayout let these
renderers through its guard (which checks both needsLayout and needsPrefWidths),
and then the contentNeedsNormalChildLayoutOnly flag was set to true via
value_or(true) because !needsLayout() was trivially true. This made the fast
path think "only block content needs layout" when in reality nothing needed
layout -only the container itself did (for the max-height change).

The fix: only update contentNeedsNormalChildLayoutOnly when the renderer
actually needs layout, not when it only needs preferred width recomputation.

Note: This is a block-direction-only change on the container with no dirty 
children.
It currently needs full inline layout (wasteful and unneeded) just to update
the block size -which is what the fast path skips.

Tests: fast/block/block-in-inline-max-height-change.html

* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::markInlineContentDirtyForLayout):

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



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

Reply via email to