WebKit Bugzilla
Attachment 340374 Details for
Bug 185633
: [LFC] FormattingContext:computeOutOfFlowNonReplacedHeight/Width should use the computed margins/paddings/borders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185633-20180514161831.patch (text/plain), 6.81 KB, created by
zalan
on 2018-05-14 16:18:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-05-14 16:18:33 PDT
Size:
6.81 KB
patch
obsolete
>Subversion Revision: 231758 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index decbd80d0199d8d6cbef1dd40c535746a13e05d6..84ceb8b910328e2ac5eeb99489675e306698329a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-05-14 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] FormattingContext:computeOutOfFlowNonReplacedHeight/Width should use the computed margins/paddings/borders >+ https://bugs.webkit.org/show_bug.cgi?id=185633 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ By the time we start computing height and width, DisplayBox should already have the computed values for margin/padding/border. >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const): >+ (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const): >+ * layout/displaytree/DisplayBox.h: >+ (WebCore::Display::Box::paddingTop const): >+ (WebCore::Display::Box::paddingLeft const): >+ (WebCore::Display::Box::paddingBottom const): >+ (WebCore::Display::Box::paddingRight const): >+ (WebCore::Display::Box::borderTop const): >+ (WebCore::Display::Box::borderLeft const): >+ (WebCore::Display::Box::borderBottom const): >+ (WebCore::Display::Box::borderRight const): >+ > 2018-05-14 Zalan Bujtas <zalan@apple.com> > > [LFC] Implement height computation for non-replaced out of flow elements. >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 8da70dee8e08a67ffe281fcf08f438dacb39154a..fe1069a18c7b3ba77cd973f98c0103ffb86e3829 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -185,17 +185,16 @@ void FormattingContext::computeOutOfFlowNonReplacedHeight(LayoutContext& layoutC > computedHeightValue = contentHeightForFormattingContextRoot(layoutContext, layoutBox); > } else if (!top.isAuto() && height.isAuto() && !bottom.isAuto()) { > // #5 >- auto marginTop = style.marginTop().isAuto() ? LayoutUnit() : valueForLength(style.marginTop(), containingBlockHeight); >- auto marginBottom = style.marginBottom().isAuto() ? LayoutUnit() : valueForLength(style.marginBottom(), containingBlockHeight); >+ auto marginTop = displayBox.marginTop(); >+ auto marginBottom = displayBox.marginBottom(); > >- auto containingBlockWidth = layoutContext.displayBoxForLayoutBox(*layoutBox.containingBlock())->width(); >- auto paddingTop = valueForLength(style.paddingTop(), containingBlockWidth); >- auto paddingBottom = valueForLength(style.paddingBottom(), containingBlockWidth); >+ auto paddingTop = displayBox.paddingTop(); >+ auto paddingBottom = displayBox.paddingBottom(); > >- auto borderTopWidth = style.borderBeforeWidth(); >- auto borderBottomWidth = style.borderAfterWidth(); >+ auto borderTop = displayBox.borderTop(); >+ auto borderBottom = displayBox.borderBottom(); > >- computedHeightValue = containingBlockHeight - (top.value() + marginTop + borderTopWidth + paddingTop + paddingBottom + borderBottomWidth + marginBottom + bottom.value()); >+ computedHeightValue = containingBlockHeight - (top.value() + marginTop + borderTop + paddingTop + paddingBottom + borderBottom + marginBottom + bottom.value()); > } else if (!height.isAuto()) > computedHeightValue = valueForLength(height, containingBlockHeight); > else >@@ -264,16 +263,16 @@ void FormattingContext::computeOutOfFlowNonReplacedWidth(LayoutContext& layoutCo > computedWidthValue = shrinkToFitWidth(layoutContext, layoutBox); > } else if (!left.isAuto() && width.isAuto() && !right.isAuto()) { > // #5 >- auto marginLeft = style.marginLeft().isAuto() ? LayoutUnit() : valueForLength(style.marginLeft(), containingBlockWidth); >- auto marginRight = style.marginRight().isAuto() ? LayoutUnit() : valueForLength(style.marginRight(), containingBlockWidth); >+ auto marginLeft = displayBox.marginLeft(); >+ auto marginRight = displayBox.marginRight(); > >- auto paddingLeft = valueForLength(style.paddingTop(), containingBlockWidth); >- auto paddingRight = valueForLength(style.paddingBottom(), containingBlockWidth); >+ auto paddingLeft = displayBox.paddingLeft(); >+ auto paddingRight = displayBox.paddingRight(); > >- auto borderLeftWidth = style.borderStartWidth(); >- auto borderRightWidth = style.borderEndWidth(); >+ auto borderLeft = displayBox.borderLeft(); >+ auto borderRight = displayBox.borderRight(); > >- computedWidthValue = containingBlockWidth - (left.value() + marginLeft + borderLeftWidth + paddingLeft + paddingRight + borderRightWidth + marginRight + right.value()); >+ computedWidthValue = containingBlockWidth - (left.value() + marginLeft + borderLeft + paddingLeft + paddingRight + borderRight + marginRight + right.value()); > } else if (!width.isAuto()) > computedWidthValue = valueForLength(width, containingBlockWidth); > else >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.h b/Source/WebCore/layout/displaytree/DisplayBox.h >index 49a1d10541fe73d2200d302fd2a08d2e4f2a5326..368fdaf0eb85b4d2acaf684f24128ed2068b5e8d 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.h >+++ b/Source/WebCore/layout/displaytree/DisplayBox.h >@@ -70,6 +70,16 @@ public: > LayoutUnit marginBottom() const; > LayoutUnit marginRight() const; > >+ LayoutUnit borderTop() const; >+ LayoutUnit borderLeft() const; >+ LayoutUnit borderBottom() const; >+ LayoutUnit borderRight() const; >+ >+ LayoutUnit paddingTop() const; >+ LayoutUnit paddingLeft() const; >+ LayoutUnit paddingBottom() const; >+ LayoutUnit paddingRight() const; >+ > LayoutRect marginBox() const; > LayoutRect borderBox() const; > LayoutRect paddingBox() const; >@@ -347,6 +357,54 @@ inline LayoutUnit Box::marginRight() const > return m_marginRight; > } > >+inline LayoutUnit Box::paddingTop() const >+{ >+ ASSERT(m_hasValidPadding); >+ return m_paddingTop; >+} >+ >+inline LayoutUnit Box::paddingLeft() const >+{ >+ ASSERT(m_hasValidPadding); >+ return m_paddingLeft; >+} >+ >+inline LayoutUnit Box::paddingBottom() const >+{ >+ ASSERT(m_hasValidPadding); >+ return m_paddingBottom; >+} >+ >+inline LayoutUnit Box::paddingRight() const >+{ >+ ASSERT(m_hasValidPadding); >+ return m_paddingRight; >+} >+ >+inline LayoutUnit Box::borderTop() const >+{ >+ ASSERT(m_hasValidBorder); >+ return m_borderTop; >+} >+ >+inline LayoutUnit Box::borderLeft() const >+{ >+ ASSERT(m_hasValidBorder); >+ return m_borderLeft; >+} >+ >+inline LayoutUnit Box::borderBottom() const >+{ >+ ASSERT(m_hasValidBorder); >+ return m_borderBottom; >+} >+ >+inline LayoutUnit Box::borderRight() const >+{ >+ ASSERT(m_hasValidBorder); >+ return m_borderRight; >+} >+ > } > } > #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 185633
: 340374