WebKit Bugzilla
Attachment 359447 Details for
Bug 193562
: [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193562-20190117220016.patch (text/plain), 5.37 KB, created by
zalan
on 2019-01-17 22:00:17 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-01-17 22:00:17 PST
Size:
5.37 KB
patch
obsolete
>Subversion Revision: 240111 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 408b1b473d375e4eb7b20376e9f84e21059926ca..da32d88213209cab82682c6b8e328173f20f0798 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2019-01-17 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom. >+ https://bugs.webkit.org/show_bug.cgi?id=193562 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The current floating context's (float) boxes could belong to descendant formatting contexts. >+ We need to include them as well when computing height (bottom) (we essentially need to skip ancestor floats only). >+ >+ <div id=container style="overflow: hidden"><div>foo<div style="float: left">bar</div></div></div> >+ While computing the height for "container", the float box needs to be taken into account even though >+ it is part of another (descendant) formatting context (the inline formatting context established by its parent div). >+ >+ * layout/floats/FloatingState.cpp: >+ (WebCore::Layout::FloatingState::bottom const): >+ * layout/floats/FloatingState.h: >+ (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const): >+ (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const): Deleted. >+ > 2019-01-17 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] An element with transform is a containing block for positioned descendants. >diff --git a/Source/WebCore/layout/floats/FloatingState.cpp b/Source/WebCore/layout/floats/FloatingState.cpp >index ba63588ec8eb1dccbffd07b4fc343a67e7b96749..67ac5d40781cb7a95bde8580158f61f0c427f596 100644 >--- a/Source/WebCore/layout/floats/FloatingState.cpp >+++ b/Source/WebCore/layout/floats/FloatingState.cpp >@@ -143,8 +143,8 @@ Optional<PositionInContextRoot> FloatingState::bottom(const Box& formattingConte > // Cache the value if we end up calling it more frequently (and update it at append/remove). > Optional<PositionInContextRoot> bottom; > for (auto& floatItem : m_floats) { >- // Ignore floats from other formatting contexts when the floating state is inherited. >- if (!floatItem.inFormattingContext(formattingContextRoot)) >+ // Ignore floats from ancestor formatting contexts when the floating state is inherited. >+ if (!floatItem.isDescendantOfFormattingRoot(formattingContextRoot)) > continue; > > if ((type == Clear::Left && !floatItem.isLeftPositioned()) >diff --git a/Source/WebCore/layout/floats/FloatingState.h b/Source/WebCore/layout/floats/FloatingState.h >index 0335e05bfe5b7bb530a39dd4d046e5f3fc893391..023d04f15f3da54e62c6040131643555a7953adb 100644 >--- a/Source/WebCore/layout/floats/FloatingState.h >+++ b/Source/WebCore/layout/floats/FloatingState.h >@@ -71,7 +71,7 @@ public: > bool operator==(const Box& layoutBox) const { return m_layoutBox.get() == &layoutBox; } > > bool isLeftPositioned() const { return m_layoutBox->isLeftFloatingPositioned(); } >- bool inFormattingContext(const Box&) const; >+ bool isDescendantOfFormattingRoot(const Box&) const; > > Display::Box::Rect rectWithMargin() const { return m_absoluteDisplayBox.rectWithMargin(); } > PositionInContextRoot bottom() const { return { m_absoluteDisplayBox.bottom() }; } >@@ -115,10 +115,12 @@ inline Optional<PositionInContextRoot> FloatingState::bottom(const Box& formatti > return bottom(formattingContextRoot, Clear::Both); > } > >-inline bool FloatingState::FloatItem::inFormattingContext(const Box& formattingContextRoot) const >+inline bool FloatingState::FloatItem::isDescendantOfFormattingRoot(const Box& formattingContextRoot) const > { > ASSERT(formattingContextRoot.establishesFormattingContext()); >- return &m_layoutBox->formattingContextRoot() == &formattingContextRoot; >+ if (!is<Container>(formattingContextRoot)) >+ return false; >+ return m_layoutBox->isDescendantOf(downcast<Container>(formattingContextRoot)); > } > > } >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index abbe4c1dc148c60b967d182f84d36a791a88bd91..a828ef5aa0d1e8c0f1c6596576500bd32278e349 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-01-17 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom. >+ https://bugs.webkit.org/show_bug.cgi?id=193562 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * LayoutReloaded/misc/LFC-passing-tests.txt: >+ > 2019-01-17 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] An element with transform is a containing block for positioned descendants. >diff --git a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >index a8b8e0755ff3c7d503d1b9e12d770cfb386ebe36..dc893db946ef28e0c7b90936b415ae993a6689d2 100644 >--- a/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >+++ b/Tools/LayoutReloaded/misc/LFC-passing-tests.txt >@@ -118,6 +118,7 @@ fast/block/float/float-on-zero-height-line.html > fast/block/float/float-overhangs-root.html > fast/block/float/float-with-anonymous-previous-sibling.html > fast/block/float/floats-not-cleared-crash.html >+fast/block/float/crash-when-intruding-float-has-anonymous-parent-and-detach.html > fast/block/margin-collapse/002.html > fast/block/margin-collapse/003.html > fast/block/margin-collapse/026.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+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193562
: 359447 |
359454