WebKit Bugzilla
Attachment 346257 Details for
Bug 188214
: [LFC][Floating] FloatingState should take the formatting root box.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188214-20180731211342.patch (text/plain), 5.51 KB, created by
zalan
on 2018-07-31 21:13:43 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-07-31 21:13:43 PDT
Size:
5.51 KB
patch
obsolete
>Subversion Revision: 234439 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9ad8a32841897586bc5d5c8296fed381069e8e95..bd850fb461166171ccccca0feb3340a702732827 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2018-07-31 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][Floating] FloatingState should take the formatting root box. >+ https://bugs.webkit.org/show_bug.cgi?id=188214 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This will be taken into use when FormattingContext takes all boxes in the coordinate system of the formatting root. >+ >+ * layout/FloatingState.cpp: >+ (WebCore::Layout::FloatingState::FloatingState): >+ (WebCore::Layout::belongsToThisFloatingContext): >+ (WebCore::Layout::FloatingState::append): >+ * layout/FloatingState.h: >+ (WebCore::Layout::FloatingState::create): >+ * layout/LayoutContext.cpp: >+ (WebCore::Layout::LayoutContext::establishedFormattingState): >+ > 2018-07-31 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in >diff --git a/Source/WebCore/layout/FloatingState.cpp b/Source/WebCore/layout/FloatingState.cpp >index 39725907a43d3d5d5afff55c1e1447d03f005223..bc6303624f0aff4bb4dc31bafd9003c8be672c5f 100644 >--- a/Source/WebCore/layout/FloatingState.cpp >+++ b/Source/WebCore/layout/FloatingState.cpp >@@ -37,13 +37,32 @@ namespace Layout { > > WTF_MAKE_ISO_ALLOCATED_IMPL(FloatingState); > >-FloatingState::FloatingState(LayoutContext& layoutContext) >+FloatingState::FloatingState(LayoutContext& layoutContext, const Box& formattingContextRoot) > : m_layoutContext(layoutContext) >+ , m_formattingContextRoot(makeWeakPtr(const_cast<Box&>(formattingContextRoot))) > { > } > >+#ifndef NDEBUG >+static bool belongsToThisFloatingContext(const Box& layoutBox, const Box& floatingStateRoot) >+{ >+ auto& formattingContextRoot = layoutBox.formattingContextRoot(); >+ if (&formattingContextRoot == &floatingStateRoot) >+ return true; >+ >+ // Maybe the layout box belongs to an inline formatting context that inherits the floating state from the parent (block) formatting context. >+ if (!formattingContextRoot.establishesInlineFormattingContext()) >+ return false; >+ >+ return &formattingContextRoot.formattingContextRoot() == &floatingStateRoot; >+} >+#endif >+ > void FloatingState::append(const Box& layoutBox) > { >+ ASSERT(is<Container>(*m_formattingContextRoot)); >+ ASSERT(belongsToThisFloatingContext(layoutBox, *m_formattingContextRoot)); >+ > // Floating state should hold boxes with computed position/size. > ASSERT(m_layoutContext.displayBoxForLayoutBox(layoutBox)); > m_last = makeWeakPtr(const_cast<Box&>(layoutBox)); >diff --git a/Source/WebCore/layout/FloatingState.h b/Source/WebCore/layout/FloatingState.h >index 96f8873ef9d126ad13648568027cebff8c9b41f0..79f98247587164c651a15e8f36fae1f0b45b4aed 100644 >--- a/Source/WebCore/layout/FloatingState.h >+++ b/Source/WebCore/layout/FloatingState.h >@@ -43,7 +43,7 @@ class LayoutContext; > class FloatingState : public RefCounted<FloatingState> { > WTF_MAKE_ISO_ALLOCATED(FloatingState); > public: >- static Ref<FloatingState> create(LayoutContext& layoutContext) { return adoptRef(*new FloatingState(layoutContext)); } >+ static Ref<FloatingState> create(LayoutContext& layoutContext, const Box& formattingContextRoot) { return adoptRef(*new FloatingState(layoutContext, formattingContextRoot)); } > > void append(const Box& layoutBox); > >@@ -59,11 +59,12 @@ public: > > private: > friend class FloatingContext; >- FloatingState(LayoutContext&); >+ FloatingState(LayoutContext&, const Box& formattingContextRoot); > > LayoutContext& layoutContext() const { return m_layoutContext; } > > LayoutContext& m_layoutContext; >+ WeakPtr<Box> m_formattingContextRoot; > > FloatingList m_leftFloatings; > FloatingList m_rightFloatings; >diff --git a/Source/WebCore/layout/LayoutContext.cpp b/Source/WebCore/layout/LayoutContext.cpp >index 482a47f009755e0dbe60f16f22a75662da9387d9..3cb6f9d5fca6e661945504670528ce67ab4273f8 100644 >--- a/Source/WebCore/layout/LayoutContext.cpp >+++ b/Source/WebCore/layout/LayoutContext.cpp >@@ -127,7 +127,7 @@ FormattingState& LayoutContext::establishedFormattingState(const Box& formatting > // should not interfere with the content inside. > // <div style="float: left"></div><div style="overflow: hidden"> <- is a non-intrusive float, because overflow: hidden triggers new block formatting context.</div> > if (formattingRoot.establishesBlockFormattingContext()) >- return std::make_unique<InlineFormattingState>(FloatingState::create(*this), *this); >+ return std::make_unique<InlineFormattingState>(FloatingState::create(*this, formattingRoot), *this); > > // Otherwise, the formatting context inherits the floats from the parent formatting context. > // Find the formatting state in which this formatting root lives, not the one it creates and use its floating state. >@@ -139,7 +139,7 @@ FormattingState& LayoutContext::establishedFormattingState(const Box& formatting > return *m_formattingStates.ensure(&formattingRoot, [&] { > > // Block formatting context always establishes a new floating state. >- return std::make_unique<BlockFormattingState>(FloatingState::create(*this), *this); >+ return std::make_unique<BlockFormattingState>(FloatingState::create(*this, formattingRoot), *this); > }).iterator->value; > } > CRASH();
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 188214
: 346257 |
346267