WebKit Bugzilla
Attachment 343807 Details for
Bug 187140
: [LFC] Add Display::Box::nonCollapsedMarginBox for verification purposes.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-187140-20180628080330.patch (text/plain), 6.39 KB, created by
zalan
on 2018-06-28 08:03:31 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-06-28 08:03:31 PDT
Size:
6.39 KB
patch
obsolete
>Subversion Revision: 233304 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index da74f300b36ff189071304bb1fc9d683f0b25725..0b2ca4c70606d6d6937d07a6479454ea1312c645 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2018-06-28 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Add Display::Box::nonCollapsedMarginBox for verification purposes. >+ https://bugs.webkit.org/show_bug.cgi?id=187140 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const): >+ (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): >+ * layout/Verification.cpp: >+ (WebCore::Layout::outputMismatchingBoxInformationIfNeeded): >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const): >+ * layout/displaytree/DisplayBox.cpp: >+ (WebCore::Display::Box::nonCollapsedMarginBox const): >+ * layout/displaytree/DisplayBox.h: >+ (WebCore::Display::Box::setVerticalNonCollapsedMargin): >+ > 2018-06-28 Zalan Bujtas <zalan@apple.com> > > [LFC] The margin bottom of the document element does not collapse with its last inflow child's bottom margin. >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 08f35d974b97ba5b8bc41358c6a5cf3e07f76add..d81885906013e17cfb999f441bc9980c6f5e91b4 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -55,7 +55,8 @@ void FormattingContext::computeFloatingHeightAndMargin(LayoutContext& layoutCont > { > auto heightAndMargin = Geometry::floatingHeightAndMargin(layoutContext, layoutBox); > displayBox.setContentBoxHeight(heightAndMargin.height); >- displayBox.moveVertically(heightAndMargin.collapsedMargin.value_or(heightAndMargin.margin).top); >+ displayBox.moveVertically(heightAndMargin.margin.top); >+ ASSERT(!heightAndMargin.collapsedMargin); > displayBox.setVerticalMargin(heightAndMargin.margin); > } > >diff --git a/Source/WebCore/layout/Verification.cpp b/Source/WebCore/layout/Verification.cpp >index c7fd79079cbae4275d3488d635ce4170fc552de3..6697ea82c5747fbb32b5b1373a547668e7949d14 100644 >--- a/Source/WebCore/layout/Verification.cpp >+++ b/Source/WebCore/layout/Verification.cpp >@@ -67,10 +67,19 @@ static bool outputMismatchingBoxInformationIfNeeded(TextStream& stream, const La > return true; > } > >- if (renderer.marginBoxRect() != displayBox->marginBox()) { >+#ifndef NDEBUG >+ if (renderer.marginBoxRect() != displayBox->nonCollapsedMarginBox()) { >+ outputRect("marginBox", renderer.marginBoxRect(), displayBox->nonCollapsedMarginBox()); >+ return true; >+ } >+#else >+ // For now in non-debug builds, verify the horizontal margin only >+ if (renderer.marginBoxRect().left() != displayBox->marginBox().left() >+ || renderer.marginBoxRect().right() != displayBox->marginBox().right() ) { > outputRect("marginBox", renderer.marginBoxRect(), displayBox->marginBox()); > return true; > } >+#endif > > if (renderer.borderBoxRect() != displayBox->borderBox()) { > outputRect("borderBox", renderer.borderBoxRect(), displayBox->borderBox()); >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index 4357735cb9831e9efe51af244053ba3007c55a9f..c9c8275751d4fa3d86f5aedbf739806d088a342f 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -193,7 +193,10 @@ void BlockFormattingContext::computeInFlowHeightAndMargin(LayoutContext& layoutC > auto heightAndMargin = Geometry::inFlowHeightAndMargin(layoutContext, layoutBox); > displayBox.setContentBoxHeight(heightAndMargin.height); > displayBox.moveVertically(heightAndMargin.collapsedMargin.value_or(heightAndMargin.margin).top); >- displayBox.setVerticalMargin(heightAndMargin.margin); >+ displayBox.setVerticalMargin(heightAndMargin.collapsedMargin.value_or(heightAndMargin.margin)); >+#ifndef NDEBUG >+ displayBox.setVerticalNonCollapsedMargin(heightAndMargin.margin); >+#endif > } > > void BlockFormattingContext::computeInFlowWidthAndMargin(LayoutContext& layoutContext, const Box& layoutBox, Display::Box& displayBox) const >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.cpp b/Source/WebCore/layout/displaytree/DisplayBox.cpp >index 2bcc6f4aece7712b9a54ea94ede50a3f3fa61019..dc1f31bb00d29d438c156621d9bd875a4a8fb14f 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.cpp >+++ b/Source/WebCore/layout/displaytree/DisplayBox.cpp >@@ -62,6 +62,20 @@ Box::Rect Box::marginBox() const > return marginBox; > } > >+#ifndef NDEBUG >+Box::Rect Box::nonCollapsedMarginBox() const >+{ >+ auto borderBox = this->borderBox(); >+ >+ Rect marginBox; >+ marginBox.setTop(borderBox.top() - m_nonCollapsedVertivalMargin.top); >+ marginBox.setLeft(borderBox.left() - marginLeft()); >+ marginBox.setHeight(borderBox.height() + m_nonCollapsedVertivalMargin.top + m_nonCollapsedVertivalMargin.bottom); >+ marginBox.setWidth(borderBox.width() + marginLeft() + marginRight()); >+ return marginBox; >+} >+#endif >+ > Box::Rect Box::borderBox() const > { > Rect borderBox; >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.h b/Source/WebCore/layout/displaytree/DisplayBox.h >index ba2d866a1a21be4b54acaf9ba64428c631838788..52bd9aa4778d7cb87403a4c42eea02a81f86ede7 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.h >+++ b/Source/WebCore/layout/displaytree/DisplayBox.h >@@ -147,6 +147,9 @@ public: > LayoutUnit contentBoxWidth() const; > > Rect marginBox() const; >+#ifndef NDEBUG >+ Rect nonCollapsedMarginBox() const; >+#endif > Rect borderBox() const; > Rect paddingBox() const; > Rect contentBox() const; >@@ -186,6 +189,9 @@ private: > > void setHorizontalMargin(HorizontalEdges); > void setVerticalMargin(VerticalEdges); >+#ifndef NDEBUG >+ void setVerticalNonCollapsedMargin(VerticalEdges margin) { m_nonCollapsedVertivalMargin = margin; } >+#endif > void setBorder(Edges); > void setPadding(Edges); > >@@ -211,6 +217,9 @@ private: > LayoutUnit m_contentHeight; > > Edges m_margin; >+#ifndef NDEBUG >+ VerticalEdges m_nonCollapsedVertivalMargin; >+#endif > Edges m_border; > Edges m_padding; >
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
Flags:
koivisto
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 187140
: 343807