WebKit Bugzilla
Attachment 341386 Details for
Bug 186008
: [LFC] Implement margin computation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186008-20180525214927.patch (text/plain), 21.26 KB, created by
zalan
on 2018-05-25 21:49:28 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-05-25 21:49:28 PDT
Size:
21.26 KB
patch
obsolete
>Subversion Revision: 232188 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f1ee6fc4351efc493a26502ebb3f7dc799819a43..0cc888f0e0d01561dccc2badfe42449b9321fc78 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,40 @@ >+2018-05-25 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Implement margin computation >+ https://bugs.webkit.org/show_bug.cgi?id=186008 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::computeMargin const): >+ (WebCore::Layout::FormattingContext::marginTop const): Deleted. >+ (WebCore::Layout::FormattingContext::marginLeft const): Deleted. >+ (WebCore::Layout::FormattingContext::marginBottom const): Deleted. >+ (WebCore::Layout::FormattingContext::marginRight const): Deleted. >+ * layout/FormattingContext.h: >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::layout const): >+ (WebCore::Layout::BlockFormattingContext::computeMargin const): >+ (WebCore::Layout::BlockFormattingContext::marginTop const): Deleted. >+ (WebCore::Layout::BlockFormattingContext::marginBottom const): Deleted. >+ * layout/blockformatting/BlockFormattingContext.h: >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): >+ (WebCore::Layout::BlockFormattingContext::Geometry::computedMargin): >+ * layout/blockformatting/BlockMarginCollapse.cpp: >+ (WebCore::Layout::_isMarginBottomCollapsedWithParent): >+ (WebCore::Layout::collapsedMarginBottomFromLastChild): >+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop): >+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom): >+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): >+ (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): >+ (WebCore::Layout::BlockMarginCollapse::marginTop): Deleted. >+ (WebCore::Layout::BlockMarginCollapse::marginBottom): Deleted. >+ (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent): Deleted. >+ (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted. >+ * layout/blockformatting/BlockMarginCollapse.h: Removed. >+ > 2018-05-25 Zalan Bujtas <zalan@apple.com> > > [LFC] Implement border and padding computation >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 2fb724ccb3f2bfa566267bbbdf93fb8ab4b0907c..d373e9909e66e893d07cb0a85b40f649d7fa7e04 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -400,7 +400,6 @@ > 115CFA7E208B8E10001E6991 /* InlineFormattingState.h in Headers */ = {isa = PBXBuildFile; fileRef = 115CFA7C208B8E10001E6991 /* InlineFormattingState.h */; }; > 115CFA82208B8EDA001E6991 /* FloatingState.h in Headers */ = {isa = PBXBuildFile; fileRef = 115CFA80208B8EDA001E6991 /* FloatingState.h */; }; > 115CFA86208B9066001E6991 /* FloatingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 115CFA84208B9066001E6991 /* FloatingContext.h */; }; >- 115CFA8A208B921A001E6991 /* BlockMarginCollapse.h in Headers */ = {isa = PBXBuildFile; fileRef = 115CFA88208B921A001E6991 /* BlockMarginCollapse.h */; }; > 115CFA97208B952B001E6991 /* LayoutBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 115CFA95208B952B001E6991 /* LayoutBox.h */; }; > 119340791FE8B92300935F1E /* RenderTreeBuilderTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 119340771FE8B92300935F1E /* RenderTreeBuilderTable.h */; }; > 1193408A1FEB355D00935F1E /* RenderTreeBuilderRuby.h in Headers */ = {isa = PBXBuildFile; fileRef = 119340881FEB355D00935F1E /* RenderTreeBuilderRuby.h */; }; >@@ -5754,7 +5753,6 @@ > 115CFA81208B8EDA001E6991 /* FloatingState.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FloatingState.cpp; sourceTree = "<group>"; }; > 115CFA84208B9066001E6991 /* FloatingContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FloatingContext.h; sourceTree = "<group>"; }; > 115CFA85208B9066001E6991 /* FloatingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FloatingContext.cpp; sourceTree = "<group>"; }; >- 115CFA88208B921A001E6991 /* BlockMarginCollapse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BlockMarginCollapse.h; sourceTree = "<group>"; }; > 115CFA89208B921A001E6991 /* BlockMarginCollapse.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BlockMarginCollapse.cpp; sourceTree = "<group>"; }; > 115CFA95208B952B001E6991 /* LayoutBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutBox.h; sourceTree = "<group>"; }; > 115CFA96208B952B001E6991 /* LayoutBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutBox.cpp; sourceTree = "<group>"; }; >@@ -15727,7 +15725,6 @@ > 1123AFDA209ABB2000736ACC /* BlockInvalidation.cpp */, > 1123AFD9209ABB2000736ACC /* BlockInvalidation.h */, > 115CFA89208B921A001E6991 /* BlockMarginCollapse.cpp */, >- 115CFA88208B921A001E6991 /* BlockMarginCollapse.h */, > ); > path = blockformatting; > sourceTree = "<group>"; >@@ -27168,7 +27165,6 @@ > 976D6C7F122B8A3D001FD1F7 /* BlobURL.h in Headers */, > 115CFA6E208AFAB7001E6991 /* BlockFormattingContext.h in Headers */, > 115CFA7A208B8D9D001E6991 /* BlockFormattingState.h in Headers */, >- 115CFA8A208B921A001E6991 /* BlockMarginCollapse.h in Headers */, > BC5EB5E10E81BE8700B25965 /* BorderData.h in Headers */, > 589556ED18D4A44000764B03 /* BorderEdge.h in Headers */, > BC5EB5DB0E81B7EA00B25965 /* BorderValue.h in Headers */, >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 65dd98aab142c231bbc7244709a2a31a00b5783f..e235a33f1bcf48875bd642a0cbc30acafea76917 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -135,24 +135,9 @@ void FormattingContext::computeFloatingHeight(LayoutContext& layoutContext, cons > displayBox.setHeight(computedHeight); > } > >-LayoutUnit FormattingContext::marginTop(const Box&) const >+void FormattingContext::computeMargin(LayoutContext&, const Box&, Display::Box& displayBox) const > { >- return 0; >-} >- >-LayoutUnit FormattingContext::marginLeft(const Box&) const >-{ >- return 0; >-} >- >-LayoutUnit FormattingContext::marginBottom(const Box&) const >-{ >- return 0; >-} >- >-LayoutUnit FormattingContext::marginRight(const Box&) const >-{ >- return 0; >+ displayBox.setMargin({ 0, 0, 0, 0 }); > } > > void FormattingContext::computeBorderAndPadding(LayoutContext& layoutContext, const Box& layoutBox, Display::Box& displayBox) const >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index c5868579782fe38d54bedf0e2dfddbeaefda300a..143292b4bb23b3d8928065f809a786f6ed1053a8 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -78,11 +78,7 @@ protected: > virtual void computeFloatingHeight(LayoutContext&, const Box&, Display::Box&) const; > virtual void computeInFlowHeight(LayoutContext&, const Box&, Display::Box&) const = 0; > >- virtual LayoutUnit marginTop(const Box&) const; >- virtual LayoutUnit marginLeft(const Box&) const; >- virtual LayoutUnit marginBottom(const Box&) const; >- virtual LayoutUnit marginRight(const Box&) const; >- >+ virtual void computeMargin(LayoutContext&, const Box&, Display::Box&) const; > void computeBorderAndPadding(LayoutContext&, const Box&, Display::Box&) const; > > void placeInFlowPositionedChildren(LayoutContext&, const Container&) const; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index 1526820d2425967471c99e5a826c2fcaf6dfa54e..bdea3ab0926d508ff6be166d4a99e0428bb47e37 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -29,7 +29,6 @@ > #if ENABLE(LAYOUT_FORMATTING_CONTEXT) > > #include "BlockFormattingState.h" >-#include "BlockMarginCollapse.h" > #include "DisplayBox.h" > #include "FloatingContext.h" > #include "FloatingState.h" >@@ -75,6 +74,7 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat > auto& displayBox = layoutPair.displayBox; > > computeWidth(layoutContext, layoutBox, displayBox); >+ computeMargin(layoutContext, layoutBox, displayBox); > computeBorderAndPadding(layoutContext, layoutBox, displayBox); > computeStaticPosition(layoutContext, layoutBox, displayBox); > if (layoutBox.establishesFormattingContext()) { >@@ -169,14 +169,9 @@ void BlockFormattingContext::computeInFlowWidth(LayoutContext& layoutContext, co > displayBox.setWidth(computedWidth); > } > >-LayoutUnit BlockFormattingContext::marginTop(const Box& layoutBox) const >+void BlockFormattingContext::computeMargin(LayoutContext& layoutContext, const Box& layoutBox, Display::Box& displayBox) const > { >- return BlockMarginCollapse::marginTop(layoutBox); >-} >- >-LayoutUnit BlockFormattingContext::marginBottom(const Box& layoutBox) const >-{ >- return BlockMarginCollapse::marginBottom(layoutBox); >+ displayBox.setMargin(Geometry::computedMargin(layoutContext, layoutBox)); > } > > } >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index 397828cd131e8b86a4f529acc31b4ab122bc5085..7111d26d05cd96edc7fc10d47f9f5e8e855d2a06 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -55,10 +55,8 @@ private: > void computeInFlowPositionedPosition(LayoutContext&, const Box&, Display::Box&) const override; > void computeInFlowWidth(LayoutContext&, const Box&, Display::Box&) const override; > void computeInFlowHeight(LayoutContext&, const Box&, Display::Box&) const override; >+ void computeMargin(LayoutContext&, const Box&, Display::Box&) const override; > >- LayoutUnit marginTop(const Box&) const override; >- LayoutUnit marginBottom(const Box&) const override; >- > // This class implements positioning and sizing for boxes participating in a block formatting context. > class Geometry { > public: >@@ -67,6 +65,22 @@ private: > > static LayoutPoint staticPosition(LayoutContext&, const Box&); > static LayoutPoint inFlowPositionedPosition(LayoutContext&, const Box&); >+ >+ static Display::Box::Edges computedMargin(LayoutContext&, const Box&); >+ }; >+ >+ // This class implements margin collapsing for block formatting context. >+ class MarginCollapse { >+ public: >+ static LayoutUnit marginTop(const Box&); >+ static LayoutUnit marginBottom(const Box&); >+ >+ static bool isMarginBottomCollapsedWithParent(const Box&); >+ static bool isMarginTopCollapsedWithParentMarginBottom(const Box&); >+ >+ private: >+ static LayoutUnit collapsedMarginBottomFromLastChild(const Box&); >+ static LayoutUnit nonCollapsedMarginBottom(const Box&); > }; > }; > >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index c671c66b42034d05c05a648312997717a20a2384..d5be6ddb9c1a699cf4b7e35a3c0c5d94246265db 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -64,7 +64,7 @@ LayoutUnit BlockFormattingContext::Geometry::inFlowNonReplacedHeight(LayoutConte > // 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 (!BlockMarginCollapse::isMarginBottomCollapsedWithParent(*lastInFlowChild)) { >+ if (!BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent(*lastInFlowChild)) { > auto* lastInFlowDisplayBox = layoutContext.displayBoxForLayoutBox(*lastInFlowChild); > ASSERT(lastInFlowDisplayBox); > return lastInFlowDisplayBox->bottom() + lastInFlowDisplayBox->marginBottom(); >@@ -72,7 +72,7 @@ LayoutUnit BlockFormattingContext::Geometry::inFlowNonReplacedHeight(LayoutConte > > // 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 && BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom(*inFlowChild)) >+ while (inFlowChild && BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom(*inFlowChild)) > inFlowChild = inFlowChild->previousInFlowSibling(); > if (inFlowChild) { > auto* inFlowDisplayBox = layoutContext.displayBoxForLayoutBox(*inFlowChild); >@@ -199,6 +199,19 @@ LayoutPoint BlockFormattingContext::Geometry::inFlowPositionedPosition(LayoutCon > return { displayBox.left() + leftDelta, displayBox.top() + topDelta }; > } > >+Display::Box::Edges BlockFormattingContext::Geometry::computedMargin(LayoutContext& layoutContext, const Box& layoutBox) >+{ >+ auto& style = layoutBox.style(); >+ auto containingBlockWidth = layoutContext.displayBoxForLayoutBox(*layoutBox.containingBlock())->width(); >+ >+ return Display::Box::Edges( >+ BlockFormattingContext::MarginCollapse::marginTop(layoutBox), >+ valueForLength(style.marginLeft(), containingBlockWidth), >+ BlockFormattingContext::MarginCollapse::marginBottom(layoutBox), >+ valueForLength(style.marginRight(), containingBlockWidth) >+ ); >+} >+ > } > } > >diff --git a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >index 584f43af8afec7f52d19fca745b169272dd73e9c..acf5a9ea409f37c8bf0f47180b7c6be0e368b9ca 100644 >--- a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp >@@ -24,7 +24,7 @@ > */ > > #include "config.h" >-#include "BlockMarginCollapse.h" >+#include "BlockFormattingContext.h" > > #if ENABLE(LAYOUT_FORMATTING_CONTEXT) > >@@ -32,13 +32,10 @@ > #include "LayoutContainer.h" > #include "LayoutUnit.h" > #include "RenderStyle.h" >-#include <wtf/IsoMallocInlines.h> > > namespace WebCore { > namespace Layout { > >-WTF_MAKE_ISO_ALLOCATED_IMPL(BlockMarginCollapse); >- > static LayoutUnit marginValue(LayoutUnit currentMarginValue, LayoutUnit candidateMarginValue) > { > if (!candidateMarginValue) >@@ -128,32 +125,12 @@ static LayoutUnit collapsedMarginTopFromFirstChild(const Box& layoutBox) > return marginValue(firstInFlowChild.style().marginTop().value(), collapsedMarginTopFromFirstChild(firstInFlowChild)); > } > >-static LayoutUnit collapsedMarginBottomFromLastChild(const Box& layoutBox) >-{ >- // Check if the last child propagates its margin bottom. >- if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowChild()) >- return 0; >- >- auto& lastInFlowChild = *downcast<Container>(layoutBox).lastInFlowChild(); >- if (!BlockMarginCollapse::isMarginBottomCollapsedWithParent(lastInFlowChild)) >- return 0; >- >- // Collect collapsed margin bottom recursively. >- return marginValue(lastInFlowChild.style().marginBottom().value(), collapsedMarginBottomFromLastChild(lastInFlowChild)); >-} >- > static LayoutUnit nonCollapsedMarginTop(const Box& layoutBox) > { > // Non collapsed margin top includes collapsed margin from inflow first child. > return marginValue(layoutBox.style().marginTop().value(), collapsedMarginTopFromFirstChild(layoutBox)); > } > >-static LayoutUnit nonCollapsedMarginBottom(const Box& layoutBox) >-{ >- // Non collapsed margin bottom includes collapsed margin from inflow last child. >- return marginValue(layoutBox.style().marginBottom().value(), collapsedMarginBottomFromLastChild(layoutBox)); >-} >- > /*static bool hasAdjoiningMarginTopAndBottom(const Box&) > { > // Two margins are adjoining if and only if: >@@ -169,7 +146,7 @@ static LayoutUnit nonCollapsedMarginBottom(const Box& layoutBox) > return false; > }*/ > >-LayoutUnit BlockMarginCollapse::marginTop(const Box& layoutBox) >+LayoutUnit BlockFormattingContext::MarginCollapse::marginTop(const Box& layoutBox) > { > if (layoutBox.isAnonymous()) > return 0; >@@ -193,13 +170,13 @@ LayoutUnit BlockMarginCollapse::marginTop(const Box& layoutBox) > return marginValue(marginTop, previousSiblingMarginBottom); > } > >-LayoutUnit BlockMarginCollapse::marginBottom(const Box& layoutBox) >+LayoutUnit BlockFormattingContext::MarginCollapse::marginBottom(const Box& layoutBox) > { > if (layoutBox.isAnonymous()) > return 0; > > // TODO: take _hasAdjoiningMarginTopAndBottom() into account. >- if (isMarginBottomCollapsedWithParent(layoutBox)) >+ if (BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent(layoutBox)) > return 0; > > // Floats and out of flow positioned boxes do not collapse their margins. >@@ -213,7 +190,7 @@ LayoutUnit BlockMarginCollapse::marginBottom(const Box& layoutBox) > return nonCollapsedMarginBottom(layoutBox); > } > >-bool BlockMarginCollapse::isMarginBottomCollapsedWithParent(const Box& layoutBox) >+bool BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent(const Box& layoutBox) > { > // last inflow box to parent. > // https://www.w3.org/TR/CSS21/box.html#collapsing-margins >@@ -249,11 +226,31 @@ bool BlockMarginCollapse::isMarginBottomCollapsedWithParent(const Box& layoutBox > return true; > } > >-bool BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom(const Box&) >+bool BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom(const Box&) > { > return false; > } > >+LayoutUnit BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild(const Box& layoutBox) >+{ >+ // Check if the last child propagates its margin bottom. >+ if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowChild()) >+ return 0; >+ >+ auto& lastInFlowChild = *downcast<Container>(layoutBox).lastInFlowChild(); >+ if (!isMarginBottomCollapsedWithParent(lastInFlowChild)) >+ return 0; >+ >+ // Collect collapsed margin bottom recursively. >+ return marginValue(lastInFlowChild.style().marginBottom().value(), collapsedMarginBottomFromLastChild(lastInFlowChild)); >+} >+ >+LayoutUnit BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom(const Box& layoutBox) >+{ >+ // Non collapsed margin bottom includes collapsed margin from inflow last child. >+ return marginValue(layoutBox.style().marginBottom().value(), collapsedMarginBottomFromLastChild(layoutBox)); >+} >+ > } > } > #endif >diff --git a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.h b/Source/WebCore/layout/blockformatting/BlockMarginCollapse.h >deleted file mode 100644 >index 9de8b2d6ead368e20904b7799382d5a8cd594134..0000000000000000000000000000000000000000 >--- a/Source/WebCore/layout/blockformatting/BlockMarginCollapse.h >+++ /dev/null >@@ -1,52 +0,0 @@ >-/* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#if ENABLE(LAYOUT_FORMATTING_CONTEXT) >- >-#include "LayoutUnit.h" >-#include <wtf/IsoMalloc.h> >- >-namespace WebCore { >- >-namespace Layout { >- >-class Box; >- >-// This class implements margin collapsing for block formatting context. >-class BlockMarginCollapse { >- WTF_MAKE_ISO_ALLOCATED(BlockMarginCollapse); >-public: >- static LayoutUnit marginTop(const Box&); >- static LayoutUnit marginBottom(const Box&); >- >- static bool isMarginBottomCollapsedWithParent(const Box&); >- static bool isMarginTopCollapsedWithParentMarginBottom(const Box&); >-}; >- >-} >-} >-#endif
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 186008
: 341386