Changeset 267587 in webkit
- Timestamp:
- Sep 25, 2020, 12:03:37 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/layoutformattingcontext/quirk-margin-not-collapse-when-floating-expected.html (added)
-
LayoutTests/fast/layoutformattingcontext/quirk-margin-not-collapse-when-floating.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r267578 r267587 1 2020-09-25 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][MarginCollapsing] Only inflow boxes collapse their quirk margins with their parents 4 https://bugs.webkit.org/show_bug.cgi?id=216981 5 6 Reviewed by Antti Koivisto. 7 8 * fast/layoutformattingcontext/quirk-margin-not-collapse-when-floating-expected.html: Added. 9 * fast/layoutformattingcontext/quirk-margin-not-collapse-when-floating.html: Added. 10 1 11 2020-09-25 Frederic Wang <fwang@igalia.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r267578 r267587 1 2020-09-25 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][MarginCollapsing] Only inflow boxes collapse their quirk margins with their parents 4 https://bugs.webkit.org/show_bug.cgi?id=216981 5 6 Reviewed by Antti Koivisto. 7 8 Test: fast/layoutformattingcontext/quirk-margin-not-collapse-when-floating.html 9 10 * layout/blockformatting/BlockFormattingContextQuirks.cpp: 11 (WebCore::Layout::BlockFormattingContext::Quirks::shouldCollapseMarginBeforeWithParentMarginBefore const): 12 1 13 2020-09-25 Frederic Wang <fwang@igalia.com> 2 14 -
trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp
r267076 r267587 105 105 } 106 106 107 enum class VerticalMargin { Before, After }; 108 static inline bool hasQuirkMarginToCollapse(const Box& layoutBox, VerticalMargin verticalMargin) 109 { 110 if (!layoutBox.isInFlow()) 111 return false; 112 auto& style = layoutBox.style(); 113 return (verticalMargin == VerticalMargin::Before && style.hasMarginBeforeQuirk()) || (verticalMargin == VerticalMargin::After && style.hasMarginAfterQuirk()); 114 } 115 107 116 bool BlockFormattingContext::Quirks::shouldCollapseMarginBeforeWithParentMarginBefore(const Box& layoutBox) const 108 117 { 109 return layoutState().inQuirksMode() && layoutBox.style().hasMarginBeforeQuirk() && isQuirkContainer(layoutBox.containingBlock());118 return layoutState().inQuirksMode() && hasQuirkMarginToCollapse(layoutBox, VerticalMargin::Before) && isQuirkContainer(layoutBox.containingBlock()); 110 119 } 111 120 112 121 bool BlockFormattingContext::Quirks::shouldCollapseMarginAfterWithParentMarginAfter(const Box& layoutBox) const 113 122 { 114 return layoutState().inQuirksMode() && layoutBox.style().hasMarginAfterQuirk() && isQuirkContainer(layoutBox.containingBlock());123 return layoutState().inQuirksMode() && hasQuirkMarginToCollapse(layoutBox, VerticalMargin::After) && isQuirkContainer(layoutBox.containingBlock()); 115 124 } 116 125
Note:
See TracChangeset
for help on using the changeset viewer.