WebKit Bugzilla
Attachment 359351 Details for
Bug 193528
: [LFC][BFC][Quirk] Take body padding and border into account when stretching height.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193528-20190116221436.patch (text/plain), 6.30 KB, created by
zalan
on 2019-01-16 22:14:53 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-01-16 22:14:53 PST
Size:
6.30 KB
patch
obsolete
>Subversion Revision: 240094 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fb20d47d0281f345cc872017513599b5f3a70376..9f066123883a0e7eda8abfc66e8f056594163d11 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2019-01-16 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][Quirk] Take body padding and border into account when stretching height. >+ https://bugs.webkit.org/show_bug.cgi?id=193528 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/blockformatting/BlockFormattingContextQuirks.cpp: >+ (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): >+ * layout/displaytree/DisplayBox.h: >+ (WebCore::Display::Box::verticalBorder const): >+ (WebCore::Display::Box::horizontalBorder const): >+ (WebCore::Display::Box::verticalPadding const): >+ (WebCore::Display::Box::horizontalPadding const): >+ * page/FrameViewLayoutContext.cpp: >+ (WebCore::layoutUsingFormattingContext): >+ > 2019-01-16 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Inflow non-replaced used width should not be negative. >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >index 71a1a79de6fe05079d50a3ae9931946282fbf051..cffe722e9485b30b12f0baa3e4c8c700b5de7b91 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp >@@ -72,11 +72,9 @@ HeightAndMargin BlockFormattingContext::Quirks::stretchedInFlowHeight(const Layo > > auto& documentBox = layoutBox.isDocumentBox() ? layoutBox : *layoutBox.parent(); > auto& documentBoxDisplayBox = layoutState.displayBoxForLayoutBox(documentBox); >- auto documentBoxVerticalBorders = documentBoxDisplayBox.borderTop() + documentBoxDisplayBox.borderBottom(); >- auto documentBoxVerticalPaddings = documentBoxDisplayBox.paddingTop().valueOr(0) + documentBoxDisplayBox.paddingBottom().valueOr(0); > > auto strechedHeight = layoutState.displayBoxForLayoutBox(initialContainingBlock(layoutBox)).contentBoxHeight(); >- strechedHeight -= documentBoxVerticalBorders + documentBoxVerticalPaddings; >+ strechedHeight -= documentBoxDisplayBox.verticalBorder() + documentBoxDisplayBox.verticalPadding().valueOr(0); > > LayoutUnit totalVerticalMargin; > if (layoutBox.isDocumentBox()) { >@@ -90,6 +88,9 @@ HeightAndMargin BlockFormattingContext::Quirks::stretchedInFlowHeight(const Layo > auto documentBoxVerticalMargin = Geometry::computedVerticalMargin(layoutState, documentBox); > strechedHeight -= (documentBoxVerticalMargin.before.valueOr(0) + documentBoxVerticalMargin.after.valueOr(0)); > >+ auto& bodyBoxDisplayBox = layoutState.displayBoxForLayoutBox(layoutBox); >+ strechedHeight -= bodyBoxDisplayBox.verticalBorder() + bodyBoxDisplayBox.verticalPadding().valueOr(0); >+ > auto nonCollapsedMargin = heightAndMargin.nonCollapsedMargin; > auto collapsedMargin = MarginCollapse::collapsedVerticalValues(layoutState, layoutBox, nonCollapsedMargin); > totalVerticalMargin = collapsedMargin.before.valueOr(nonCollapsedMargin.before) + collapsedMargin.after.valueOr(nonCollapsedMargin.after); >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.h b/Source/WebCore/layout/displaytree/DisplayBox.h >index 1d45aa3dfb6909b84fdb39091ad4f621bf171c9a..b7549f1fc40a662807ebf0b9001cf99eef90579f 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.h >+++ b/Source/WebCore/layout/displaytree/DisplayBox.h >@@ -154,11 +154,15 @@ public: > LayoutUnit borderLeft() const; > LayoutUnit borderBottom() const; > LayoutUnit borderRight() const; >+ LayoutUnit verticalBorder() const { return borderTop() + borderBottom(); } >+ LayoutUnit horizontalBorder() const { return borderLeft() + borderRight(); } > > Optional<LayoutUnit> paddingTop() const; > Optional<LayoutUnit> paddingLeft() const; > Optional<LayoutUnit> paddingBottom() const; > Optional<LayoutUnit> paddingRight() const; >+ Optional<LayoutUnit> verticalPadding() const; >+ Optional<LayoutUnit> horizontalPadding() const; > > LayoutUnit contentBoxTop() const { return paddingBoxTop() + paddingTop().valueOr(0); } > LayoutUnit contentBoxLeft() const { return paddingBoxLeft() + paddingLeft().valueOr(0); } >@@ -655,6 +659,24 @@ inline Optional<LayoutUnit> Box::paddingRight() const > return m_padding->horizontal.right; > } > >+inline Optional<LayoutUnit> Box::verticalPadding() const >+{ >+ auto paddingTop = this->paddingTop(); >+ auto paddingBottom = this->paddingBottom(); >+ if (!paddingTop && !paddingBottom) >+ return { }; >+ return paddingTop.valueOr(0) + paddingBottom.valueOr(0); >+} >+ >+inline Optional<LayoutUnit> Box::horizontalPadding() const >+{ >+ auto paddingLeft = this->paddingLeft(); >+ auto paddingRight = this->paddingRight(); >+ if (!paddingLeft && !paddingRight) >+ return { }; >+ return paddingLeft.valueOr(0) + paddingRight.valueOr(0); >+} >+ > inline LayoutUnit Box::borderTop() const > { > ASSERT(m_hasValidBorder); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index e0875b087f9723eab3833eeade8b7abf4d475f8a..92e00659122e2d203bc57adc86a39d99fbf40f08 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-01-16 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][BFC][Quirk] Take body padding and border into account when stretching height. >+ https://bugs.webkit.org/show_bug.cgi?id=193528 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2019-01-16 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Inflow non-replaced used width should not be negative. >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index 4695f112c9cde690222b8c6b1ad5b20a8d72a086..bbe4a9dbaede9729fda323e0a1d95d16ccddeda1 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -90,6 +90,7 @@ fast/block/basic/007.html > fast/block/basic/008.html > fast/block/basic/009.html > fast/block/basic/012.html >+fast/block/basic/quirk-height.html > fast/block/basic/child-block-level-box-with-height-percent.html > fast/block/basic/height-percentage-simple.html > fast/block/basic/inline-content-with-floating-image.html
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+
commit-queue
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193528
: 359351