WebKit Bugzilla
Attachment 342378 Details for
Bug 186469
: [LFC] Add vertical margin computation for inflow non-replaced box and for the (10.6.6) complicated cases.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186469-20180609193900.patch (text/plain), 5.60 KB, created by
zalan
on 2018-06-09 19:39:01 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-06-09 19:39:01 PDT
Size:
5.60 KB
patch
obsolete
>Subversion Revision: 232661 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e744f9b27e8f6051078c157cef823c5b8bfe23fa..6c792599d80b5d3e3ca131be3ddb87d79b0a3dbe 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2018-06-09 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Add vertical margin computation for inflow non-replaced box and for the (10.6.6) complicated cases. >+ https://bugs.webkit.org/show_bug.cgi?id=186469 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/FormattingContextGeometry.cpp: >+ (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin): >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): >+ > 2018-06-09 Zalan Bujtas <zalan@apple.com> > > [LFC] MarginCollapse functions should be able to resolve non-fixed margin values >diff --git a/Source/WebCore/layout/FormattingContextGeometry.cpp b/Source/WebCore/layout/FormattingContextGeometry.cpp >index a40c43d07b23aeadd755079fc1ac022c2f63efd0..f0a2beed696f708964cb111b060e25769beb9c8d 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -211,10 +211,11 @@ FormattingContext::Geometry::HeightAndMargin FormattingContext::Geometry::floati > // > // Floating, non-replaced elements. > // >+ // If 'margin-top', or 'margin-bottom' are 'auto', their used value is 0. > // If 'height' is 'auto', the height depends on the element's descendants per 10.6.7. > auto height = layoutBox.style().logicalHeight(); > auto computedHeightValue = height.isAuto() ? contentHeightForFormattingContextRoot(layoutContext, layoutBox) : LayoutUnit { height.value() }; >- return FormattingContext::Geometry::HeightAndMargin { computedHeightValue, { } }; >+ return FormattingContext::Geometry::HeightAndMargin { computedHeightValue, computedNonCollapsedVerticalMarginValue(layoutContext, layoutBox) }; > } > > FormattingContext::Geometry::WidthAndMargin FormattingContext::Geometry::floatingNonReplacedWidthAndMargin(LayoutContext& layoutContext, const Box& layoutBox) >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index a83fe8c225efe48e676bb43cb1846251ee412689..1c6b4c214819c3eb140ed34f9ce12d87430388ac 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -59,7 +59,9 @@ FormattingContext::Geometry::HeightAndMargin BlockFormattingContext::Geometry::i > ASSERT(layoutBox.isInFlow() && !layoutBox.replaced()); > > auto compute = [&]() -> LayoutUnit { >- // https://www.w3.org/TR/CSS22/visudet.html >+ // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' >+ // >+ // If 'margin-top', or 'margin-bottom' are 'auto', their used value is 0. > // If 'height' is 'auto', the height depends on whether the element has any block-level children and whether it has padding or borders: > // The element's height is the distance from its top content edge to the first applicable of the following: > // 1. the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines >@@ -86,7 +88,7 @@ FormattingContext::Geometry::HeightAndMargin BlockFormattingContext::Geometry::i > // 2. the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom margin... > auto* lastInFlowChild = downcast<Container>(layoutBox).lastInFlowChild(); > ASSERT(lastInFlowChild); >- if (!BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent(*lastInFlowChild)) { >+ if (!MarginCollapse::isMarginBottomCollapsedWithParent(*lastInFlowChild)) { > auto* lastInFlowDisplayBox = layoutContext.displayBoxForLayoutBox(*lastInFlowChild); > ASSERT(lastInFlowDisplayBox); > return lastInFlowDisplayBox->bottom() + lastInFlowDisplayBox->marginBottom(); >@@ -94,7 +96,7 @@ FormattingContext::Geometry::HeightAndMargin BlockFormattingContext::Geometry::i > > // 3. the bottom border edge of the last in-flow child whose top margin doesn't collapse with the element's bottom margin > auto* inFlowChild = lastInFlowChild; >- while (inFlowChild && BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom(*inFlowChild)) >+ while (inFlowChild && MarginCollapse::isMarginTopCollapsedWithParentMarginBottom(*inFlowChild)) > inFlowChild = inFlowChild->previousInFlowSibling(); > if (inFlowChild) { > auto* inFlowDisplayBox = layoutContext.displayBoxForLayoutBox(*inFlowChild); >@@ -110,7 +112,7 @@ FormattingContext::Geometry::HeightAndMargin BlockFormattingContext::Geometry::i > if (!isStretchedToViewport(layoutContext, layoutBox)) > return { computedHeight, { } }; > auto initialContainingBlockHeight = layoutContext.displayBoxForLayoutBox(initialContainingBlock(layoutBox))->contentBox().height(); >- return { std::max(computedHeight, initialContainingBlockHeight), { } }; >+ return { std::max(computedHeight, initialContainingBlockHeight), { MarginCollapse::marginTop(layoutContext, layoutBox), MarginCollapse::marginBottom(layoutContext, layoutBox) } }; > } > > FormattingContext::Geometry::WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin(LayoutContext& layoutContext, const Box& layoutBox,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186469
:
342378
|
342515
|
342521