Bug 206570

Summary: [LFC] Do not create a FormattingContext unless there's content to layout.
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description zalan 2020-01-21 21:12:56 PST
ssia
Comment 1 Radar WebKit Bug Importer 2020-01-21 21:13:21 PST
<rdar://problem/58785735>
Comment 2 zalan 2020-01-21 21:15:54 PST
Created attachment 388396 [details]
Patch
Comment 3 Antti Koivisto 2020-01-22 07:02:54 PST
Comment on attachment 388396 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=388396&action=review

> Source/WebCore/layout/FormattingContext.cpp:171
>              auto formattingContext = LayoutContext::createFormattingContext(outOfFlowRootContainer, layoutState());
> -            formattingContext->layoutInFlowContent(invalidationState, Geometry::horizontalConstraintsForInFlow(outOfFlowRootDisplayBox), Geometry::verticalConstraintsForInFlow(outOfFlowRootDisplayBox));
> +            if (outOfFlowRootContainer.hasInFlowOrFloatingChild())
> +                formattingContext->layoutInFlowContent(invalidationState, Geometry::horizontalConstraintsForInFlow(outOfFlowRootDisplayBox), Geometry::verticalConstraintsForInFlow(outOfFlowRootDisplayBox));

You are still creating the formatting context.
Comment 4 zalan 2020-01-22 07:26:31 PST
Comment on attachment 388396 [details]
Patch

Oops
Comment 5 zalan 2020-01-22 07:59:51 PST
Created attachment 388421 [details]
Patch
Comment 6 Antti Koivisto 2020-01-22 08:02:32 PST
Comment on attachment 388421 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=388421&action=review

> Source/WebCore/ChangeLog:9
> +        We still construct "no-op" FormattingContexts through the computeIntrinsicWidth* codepath.

But why?
Comment 7 zalan 2020-01-22 08:09:19 PST
Created attachment 388422 [details]
Patch
Comment 8 zalan 2020-01-22 08:10:00 PST
(In reply to Antti Koivisto from comment #6)
> Comment on attachment 388421 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=388421&action=review
> 
> > Source/WebCore/ChangeLog:9
> > +        We still construct "no-op" FormattingContexts through the computeIntrinsicWidth* codepath.
> 
> But why?
bug 206581. -and updated the changelog.
Comment 9 WebKit Commit Bot 2020-01-22 09:06:59 PST
The commit-queue encountered the following flaky tests while processing attachment 388422 [details]:

editing/spelling/spellcheck-async-remove-frame.html bug 158401 (authors: morrita@google.com, rniwa@webkit.org, and tony@chromium.org)
The commit-queue is continuing to process your patch.
Comment 10 WebKit Commit Bot 2020-01-22 09:07:32 PST
Comment on attachment 388422 [details]
Patch

Clearing flags on attachment: 388422

Committed r254927: <https://trac.webkit.org/changeset/254927>
Comment 11 WebKit Commit Bot 2020-01-22 09:07:33 PST
All reviewed patches have been landed.  Closing bug.