WebKit Bugzilla
Attachment 346253 Details for
Bug 188213
: [LFC][Floating] Align new floating with the bottom of the existing floatings.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188213-20180731205028.patch (text/plain), 3.28 KB, created by
zalan
on 2018-07-31 20:50:29 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-07-31 20:50:29 PDT
Size:
3.28 KB
patch
obsolete
>Subversion Revision: 234439 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9ad8a32841897586bc5d5c8296fed381069e8e95..3a4c91127d524d942ed1e8ef11815950c1808819 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2018-07-31 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][Floating] Align new floating with the bottom of the existing floatings. >+ https://bugs.webkit.org/show_bug.cgi?id=188213 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When the incoming floating does not fit at all, align its top with the bottom of the existing floatings. >+ >+ * layout/FloatingContext.cpp: >+ (WebCore::Layout::FloatingContext::floatingPosition const): >+ (WebCore::Layout::FloatingPair::bottom const): >+ > 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/FloatingContext.cpp b/Source/WebCore/layout/FloatingContext.cpp >index 1859d92395f44cf2bef2a4a071b7802a5a891268..5f831864660c194fe8e9673d81625b3360751250 100644 >--- a/Source/WebCore/layout/FloatingContext.cpp >+++ b/Source/WebCore/layout/FloatingContext.cpp >@@ -66,6 +66,7 @@ public: > const Display::Box* right() const; > bool intersects(const Display::Box::Rect&) const; > LayoutUnit verticalPosition() const { return m_verticalPosition; } >+ LayoutUnit bottom() const; > bool operator==(const FloatingPair&) const; > > private: >@@ -132,6 +133,7 @@ Position FloatingContext::floatingPosition(const Box& layoutBox) const > > auto end = Layout::end(layoutContext(), m_floatingState); > auto top = initialVerticalPosition; >+ auto bottomMost = top; > for (auto iterator = begin(layoutContext(), m_floatingState, initialVerticalPosition); iterator != end; ++iterator) { > ASSERT(!(*iterator).isEmpty()); > >@@ -144,11 +146,12 @@ Position FloatingContext::floatingPosition(const Box& layoutBox) const > if (!floatings.intersects({ top, left, boxSize.width(), boxSize.height() })) > return { left, top }; > >+ bottomMost = floatings.bottom(); > // Move to the next floating pair. > } > > // Passed all the floatings and still does not fit? >- return { alignWithContainingBlock(layoutBox), top }; >+ return { alignWithContainingBlock(layoutBox), bottomMost }; > } > > LayoutUnit FloatingContext::initialVerticalPosition(const Box& layoutBox) const >@@ -264,6 +267,24 @@ bool FloatingPair::operator ==(const FloatingPair& other) const > return m_leftIndex == other.m_leftIndex && m_rightIndex == other.m_rightIndex; > } > >+LayoutUnit FloatingPair::bottom() const >+{ >+ auto* left = this->left(); >+ auto* right = this->right(); >+ ASSERT(left || right); >+ >+ auto leftBottom = left ? std::optional<LayoutUnit>(left->bottom()) : std::nullopt; >+ auto rightBottom = right ? std::optional<LayoutUnit>(right->bottom()) : std::nullopt; >+ >+ if (leftBottom && rightBottom) >+ return std::max(*leftBottom, *rightBottom); >+ >+ if (leftBottom) >+ return *leftBottom; >+ >+ return *rightBottom; >+} >+ > Iterator::Iterator(const LayoutContext& layoutContext, const FloatingState& floatingState, std::optional<LayoutUnit> verticalPosition) > : m_layoutContext(layoutContext) > , m_floatingState(floatingState)
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 188213
: 346253 |
346266