[webkit-reviews] review granted: [Bug 183273] [RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater : [Attachment 334907] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Mar 3 02:46:39 PST 2018
Antti Koivisto <koivisto at iki.fi> has granted zalan <zalan at apple.com>'s request
for review:
Bug 183273: [RenderTreeBuilder] Move styleDidChange mutation logic to
RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=183273
Attachment 334907: Patch
https://bugs.webkit.org/attachment.cgi?id=334907&action=review
--- Comment #7 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 334907
--> https://bugs.webkit.org/attachment.cgi?id=334907
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=334907&action=review
> Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:341
> + auto& parent = *renderer.parent();
> + bool isFloating = renderer.style().isFloating();
> + bool isOutOfFlowPositioned = renderer.style().hasOutOfFlowPosition();
> + bool startsAffectingParent = false;
> + bool noLongerAffectsParent = false;
> +
> + if (is<RenderBlock>(parent))
> + noLongerAffectsParent = (!wasFloating && isFloating) ||
(!wasOufOfFlowPositioned && isOutOfFlowPositioned);
> +
> + if (is<RenderBlockFlow>(parent) || is<RenderInline>(parent)) {
> + startsAffectingParent = (wasFloating || wasOufOfFlowPositioned) &&
!isFloating && !isOutOfFlowPositioned;
> + ASSERT(!startsAffectingParent || !noLongerAffectsParent);
> + }
> +
> + if (startsAffectingParent) {
> + // We have gone from not affecting the inline status of the parent
flow to suddenly
> + // having an impact. See if there is a mismatch between the parent
flow's
> + // childrenInline() state and our state.
> + renderer.setInline(renderer.style().isDisplayInlineType());
> + if (renderer.isInline() != renderer.parent()->childrenInline())
> + m_builder.childFlowStateChangesAndAffectsParentBlock(renderer);
> + return;
> + }
> +
> + if (noLongerAffectsParent) {
> +
m_builder.childFlowStateChangesAndNoLongerAffectsParentBlock(renderer);
> +
> + if (is<RenderBlockFlow>(renderer)) {
> + // Fresh floats need to be reparented if they actually belong to
the previous anonymous block.
> + // It copies the logic of
RenderBlock::addChildIgnoringContinuation
> + if (isFloating && renderer.previousSibling() &&
renderer.previousSibling()->isAnonymousBlock())
> + m_builder.move(downcast<RenderBoxModelObject>(parent),
downcast<RenderBoxModelObject>(*renderer.previousSibling()), renderer,
RenderTreeBuilder::NormalizeAfterInsertion::No);
> + }
> + }
> +}
Maybe this stuff could go to the Builder as mutateTreeAfterStyleChange() or
something?
More information about the webkit-reviews
mailing list