[webkit-changes] [WebKit/WebKit] cc5d15: Change shouldChildInlineMarginContributeToContaine...

Sammy Gill noreply at github.com
Sun Feb 26 08:18:06 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cc5d15ac506bd6300226cbeb0482216544a08788
      https://github.com/WebKit/WebKit/commit/cc5d15ac506bd6300226cbeb0482216544a08788
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2023-02-26 (Sun, 26 Feb 2023)

  Changed paths:
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderBlock.h
    M Source/WebCore/rendering/RenderBlockFlow.h

  Log Message:
  -----------
  Change shouldChildInlineMarginContributeToContainerIntrinsicSize to be a virtual method on RenderBlock with RenderBlockFlow overriding it.
https://bugs.webkit.org/show_bug.cgi?id=252323
rdar://105502226

Reviewed by Alan Baradlay.

The current interface with this method was a little awkward when trying
to use it. To improve it we can make it a virtual method on RenderBlock
and have RenderBlockFlow override it. There should be no functional
changes introduced here.

Since this type of logic only applies to elements inside a block
container that have margins trimmed, we can maintain the behavior
before the patch by simply returning true in RenderBlock. If similar
type of logic is needed later, the appropriate classes can override it
for their specific purposes.

* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
* Source/WebCore/rendering/RenderBlock.h:
(WebCore::RenderBlock::shouldChildInlineMarginContributeToContainerIntrinsicSize const):
* Source/WebCore/rendering/RenderBlockFlow.h:

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




More information about the webkit-changes mailing list