WebKit Bugzilla
Attachment 340695 Details for
Bug 185767
: [LFC] Implement height computation for non-replaced floating elements.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185767-20180518074856.patch (text/plain), 4.94 KB, created by
zalan
on 2018-05-18 07:48:57 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-05-18 07:48:57 PDT
Size:
4.94 KB
patch
obsolete
>Subversion Revision: 231953 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a1436ce64f3c27850ca0e5ad58db34c4dd623446..ded9e40c050ba7afe579e78b53b647ed18a13ad6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2018-05-18 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Implement height computation for non-replaced floating elements. >+ https://bugs.webkit.org/show_bug.cgi?id=185767 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::computeFloatingHeight const): >+ (WebCore::Layout::FormattingContext::computeFloatingNonReplacedHeight const): >+ (WebCore::Layout::FormattingContext::contentHeightForFormattingContextRoot const): >+ * layout/FormattingContext.h: >+ > 2018-05-18 Zalan Bujtas <zalan@apple.com> > > [LFC] Implement height computation for replaced elements. >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index f73e5dcd50bf2f7629cfbf637fb15e11823b6eec..b197ea56318e4ae450bbb403c42620054ad5cb4b 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -108,7 +108,7 @@ void FormattingContext::computeOutOfFlowHeight(LayoutContext& layoutContext, con > void FormattingContext::computeFloatingHeight(LayoutContext& layoutContext, const Box& layoutBox, Display::Box& displayBox) const > { > if (!layoutBox.replaced()) { >- ASSERT_NOT_IMPLEMENTED_YET(); >+ computeFloatingNonReplacedHeight(layoutContext, layoutBox, displayBox); > return; > } > computeReplacedHeight(layoutContext, layoutBox, displayBox); >@@ -217,6 +217,18 @@ void FormattingContext::computeOutOfFlowNonReplacedHeight(LayoutContext& layoutC > displayBox.setHeight(computedHeightValue); > } > >+void FormattingContext::computeFloatingNonReplacedHeight(LayoutContext& layoutContext, const Box& layoutBox, Display::Box& displayBox) const >+{ >+ ASSERT(layoutBox.isFloatingPositioned() && !layoutBox.replaced()); >+ // 10.6.6 Complicated cases >+ // >+ // Floating, non-replaced elements. >+ // >+ // If 'height' is 'auto', the height depends on the element's descendants per 10.6.7. >+ auto height = layoutBox.style().logicalHeight(); >+ displayBox.setHeight(height.isAuto() ? contentHeightForFormattingContextRoot(layoutContext, layoutBox) : LayoutUnit(height.value())); >+} >+ > void FormattingContext::computeReplacedHeight(LayoutContext&, const Box& layoutBox, Display::Box& displayBox) const > { > ASSERT((layoutBox.isOutOfFlowPositioned() || layoutBox.isFloatingPositioned() || layoutBox.isInFlow()) && layoutBox.replaced()); >@@ -317,12 +329,7 @@ void FormattingContext::computeReplacedWidth(LayoutContext&, const Box& layoutBo > > LayoutUnit FormattingContext::contentHeightForFormattingContextRoot(LayoutContext& layoutContext, const Box& layoutBox) const > { >- ASSERT(layoutBox.style().logicalHeight().isAuto()); >- >- if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) >- return 0; >- >- auto& formattingRootContainer = downcast<Container>(layoutBox); >+ ASSERT(layoutBox.style().logicalHeight().isAuto() && layoutBox.establishesFormattingContext()); > // 10.6.7 'Auto' heights for block formatting context roots > > // If it only has inline-level children, the height is the distance between the top of the topmost line box and the bottom of the bottommost line box. >@@ -332,6 +339,10 @@ LayoutUnit FormattingContext::contentHeightForFormattingContextRoot(LayoutContex > // In addition, if the element has any floating descendants whose bottom margin edge is below the element's bottom content edge, > // then the height is increased to include those edges. Only floats that participate in this block formatting context are taken > // into account, e.g., floats inside absolutely positioned descendants or other floats are not. >+ if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) >+ return 0; >+ >+ auto& formattingRootContainer = downcast<Container>(layoutBox); > if (formattingRootContainer.establishesInlineFormattingContext()) > return 0; > >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index c9a7cbf9f94a7c831428227b3221faf446aa0f31..ee0ed554b6b84f138fc904c47fd66959eb7137ca 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -96,6 +96,7 @@ private: > void computeOutOfFlowReplacedHeight(LayoutContext&, const Box&, Display::Box&) const; > void computeOutOfFlowReplacedWidth(LayoutContext&, const Box&, Display::Box&) const; > >+ void computeFloatingNonReplacedHeight(LayoutContext&, const Box&, Display::Box&) const; > void computeFloatingNonReplacedWidth(LayoutContext&, const Box&, Display::Box&) const; > > LayoutUnit contentHeightForFormattingContextRoot(LayoutContext&, const Box&) const;
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 185767
: 340695