https://bugs.webkit.org/show_bug.cgi?id=189193
Reviewed by Antti Koivisto.
Source/WebCore:
Use the non-computed margin values to verify correctness.
This patch also fixes a margin collapsing issue when the inflow box has a float sibling. The float
sibling does not prevent collapsing with the parent's top/bottom margin.
Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border.html
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
Tools:
* LayoutReloaded/misc/LFC-passing-tests.txt:
LayoutTests:
* fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border-expected.txt: Added.
* fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235561
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-08-31 Zalan Bujtas <zalan@apple.com>
+
+ [LFC] Add margin box verification back now that Display::Box has non-computed horizontal margin.
+ https://bugs.webkit.org/show_bug.cgi?id=189193
+
+ Reviewed by Antti Koivisto.
+
+ * fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border-expected.txt: Added.
+ * fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border.html: Added.
+
2018-08-31 Per Arne Vollan <pvollan@apple.com>
[Win] Some tests are failing on ews200 after upgrading iTunes.
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x128
+ RenderBlock {HTML} at (0,0) size 800x128
+ RenderBody {BODY} at (8,20) size 784x100
+ RenderBlock {DIV} at (0,0) size 100x100
+ RenderBlock (floating) {DIV} at (0,0) size 10x10
+ RenderBlock {DIV} at (0,0) size 10x10
+ RenderBlock {DIV} at (0,10) size 10x10
+ RenderBlock (floating) {DIV} at (0,40) size 10x10
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+div {
+ outline: 1px solid black;
+ width: 10px;
+ height: 10px;
+}
+</style>
+</head>
+<body>
+<div style="width: 100px; height: 100px;">
+ <div style="float: left;"></div>
+ <div style="margin-top: 20px;"></div>
+ <div style="margin-bottom: 20px;"></div>
+ <div style="float: left;"></div>
+</div>
+</body>
+</html>
+2018-08-31 Zalan Bujtas <zalan@apple.com>
+
+ [LFC] Add margin box verification back now that Display::Box has non-computed horizontal margin.
+ https://bugs.webkit.org/show_bug.cgi?id=189193
+
+ Reviewed by Antti Koivisto.
+
+ Use the non-computed margin values to verify correctness.
+ This patch also fixes a margin collapsing issue when the inflow box has a float sibling. The float
+ sibling does not prevent collapsing with the parent's top/bottom margin.
+
+ Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border.html
+
+ * layout/Verification.cpp:
+ (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
+ (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
+ * layout/blockformatting/BlockMarginCollapse.cpp:
+ (WebCore::Layout::isMarginTopCollapsedWithParent):
+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
+
2018-08-31 Antti Koivisto <antti@apple.com>
Replace OptionSet |= and -= operators with add() and remove() functions
stream.nextLine();
};
+ auto renderBoxLikeMarginBox = [](auto& displayBox) {
+ // Produce a RenderBox matching margin box.
+ auto borderBox = displayBox.borderBox();
+
+ return Display::Box::Rect {
+ borderBox.top() - displayBox.nonCollapsedMarginTop(),
+ borderBox.left() - displayBox.nonComputedMarginLeft(),
+ displayBox.nonComputedMarginLeft() + borderBox.width() + displayBox.nonComputedMarginRight(),
+ displayBox.nonCollapsedMarginTop() + borderBox.height() + displayBox.nonCollapsedMarginBottom()
+ };
+ };
+
auto* displayBox = context.displayBoxForLayoutBox(layoutBox);
ASSERT(displayBox);
return true;
}
+ if (renderer.marginBoxRect() != renderBoxLikeMarginBox(*displayBox)) {
+ outputRect("marginBox", renderer.marginBoxRect(), renderBoxLikeMarginBox(*displayBox));
+ return true;
+ }
+
if (renderer.borderBoxRect() != displayBox->borderBox()) {
outputRect("borderBox", renderer.borderBoxRect(), displayBox->borderBox());
return true;
return true;
}
- // TODO: The RenderBox::marginBox() does not follow the spec and ignores certain constraints. Skip them for now.
return false;
}
// We never margin collapse the initial containing block.
ASSERT(layoutBox.parent());
auto& parent = *layoutBox.parent();
- // Only the first inlflow child collapses with parent (floating sibling also prevents collapsing).
- if (layoutBox.previousInFlowOrFloatingSibling())
+ // Only the first inlflow child collapses with parent.
+ if (layoutBox.previousInFlowSibling())
return false;
if (parent.establishesBlockFormattingContext())
// We never margin collapse the initial containing block.
ASSERT(layoutBox.parent());
auto& parent = *layoutBox.parent();
- // Only the last inlflow child collapses with parent (floating sibling also prevents collapsing).
- if (layoutBox.nextInFlowOrFloatingSibling())
+ // Only the last inlflow child collapses with parent.
+ if (layoutBox.nextInFlowSibling())
return false;
if (parent.establishesBlockFormattingContext())
+2018-08-31 Zalan Bujtas <zalan@apple.com>
+
+ [LFC] Add margin box verification back now that Display::Box has non-computed horizontal margin.
+ https://bugs.webkit.org/show_bug.cgi?id=189193
+
+ Reviewed by Antti Koivisto.
+
+ * LayoutReloaded/misc/LFC-passing-tests.txt:
+
2018-08-31 Antti Koivisto <antti@apple.com>
Replace OptionSet |= and -= operators with add() and remove() functions
fast/block/block-only/floating-multiple-lefts-multiple-lines.html
fast/block/block-only/floating-multiple-lefts.html
fast/block/block-only/floating-and-next-previous-inflow-with-margin.html
+fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border.html
fast/block/block-only/floating-left-and-right-with-clearance.html
fast/block/block-only/float-and-siblings-with-margins.html
fast/block/block-only/margin-collapse-with-clearance.html