Bug 192078 - [LFC][Quirk] Use non-collapsed vertical margin values when the container is stretched to the size of the ICB.
Summary: [LFC][Quirk] Use non-collapsed vertical margin values when the container is s...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
Keywords: InRadar
Depends on:
Reported: 2018-11-28 08:58 PST by zalan
Modified: 2018-11-28 09:18 PST (History)
5 users (show)

See Also:

Patch (5.71 KB, patch)
2018-11-28 09:01 PST, zalan
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2018-11-28 08:58:38 PST
Comment 1 zalan 2018-11-28 09:01:55 PST
Created attachment 355877 [details]
Comment 2 Antti Koivisto 2018-11-28 09:08:13 PST
Comment on attachment 355877 [details]

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

> Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp:67
>  static HeightAndMargin stretchHeightToInitialContainingBlock(HeightAndMargin heightAndMargin, LayoutUnit initialContainingBlockHeight)
>  {
> -    auto verticalMargins = heightAndMargin.margin.top + heightAndMargin.margin.bottom;
> +    // This quirk happens when the body height is 0 which means its vertical margins collapse through (top and bottom margins are adjoining).
> +    // However now that we stretch the body they don't collapse through anymore, so we need to use the non-collapsed values instead.
> +    ASSERT(initialContainingBlockHeight);
> +    auto verticalMargins = heightAndMargin.height ? heightAndMargin.usedMarginValues() : heightAndMargin.margin;
> +    auto totalVerticalMargins = verticalMargins.top + verticalMargins.bottom;

Could we factor all quirk mode code to a class or namespace or something that says "quirk"?
Comment 3 zalan 2018-11-28 09:17:35 PST
Committed r238613: <https://trac.webkit.org/changeset/238613>
Comment 4 Radar WebKit Bug Importer 2018-11-28 09:18:45 PST