WebKit Bugzilla
Attachment 372192 Details for
Bug 198889
: [LFC][Floats] Add bottom value to FloatingState::Constraints
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198889-20190615073439.patch (text/plain), 4.08 KB, created by
zalan
on 2019-06-15 07:34:40 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-06-15 07:34:40 PDT
Size:
4.08 KB
patch
obsolete
>Subversion Revision: 246456 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2328bca1c8d4e2dee032d57d5c70b9cd02c4211b..03b6c8f4017c486c8b07cec799abc070138c92f3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-06-15 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC][Floats] Add bottom value to FloatingState::Constraints >+ https://bugs.webkit.org/show_bug.cgi?id=198889 >+ <rdar://problem/51776730> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Constraints::bottom indicates where this particular constrain ends. This is going to be used by inline layout to figure where >+ the next line should go (vertical position). >+ >+ * layout/floats/FloatingState.cpp: >+ (WebCore::Layout::FloatingState::constraints const): >+ * layout/floats/FloatingState.h: >+ > 2019-06-15 Zalan Bujtas <zalan@apple.com> > > [LFC] Add Layout::Box::isContainingBlockDescendantOf >diff --git a/Source/WebCore/layout/floats/FloatingState.cpp b/Source/WebCore/layout/floats/FloatingState.cpp >index 7651ec696c6de27606b4d9916840e33c89c0c611..31ac2abfd04d0690fb67c283cb808d05203f88d1 100644 >--- a/Source/WebCore/layout/floats/FloatingState.cpp >+++ b/Source/WebCore/layout/floats/FloatingState.cpp >@@ -119,9 +119,12 @@ FloatingState::Constraints FloatingState::constraints(PositionInContextRoot vert > // 3. Convert left/right positions back to formattingContextRoot's cooridnate system. > auto coordinateMappingIsRequired = &root() != &formattingContextRoot; > auto adjustedPosition = Point { 0, verticalPosition }; >+ LayoutSize adjustingDelta; > >- if (coordinateMappingIsRequired) >+ if (coordinateMappingIsRequired) { > adjustedPosition = FormattingContext::mapPointToAncestor(m_layoutState, adjustedPosition, downcast<Container>(formattingContextRoot), downcast<Container>(root())); >+ adjustingDelta = { adjustedPosition.x, adjustedPosition.y - verticalPosition }; >+ } > > Constraints constraints; > for (int index = m_floats.size() - 1; index >= 0; --index) { >@@ -141,6 +144,7 @@ FloatingState::Constraints FloatingState::constraints(PositionInContextRoot vert > constraints.left = PositionInContextRoot { rect.right() }; > else > constraints.right = PositionInContextRoot { rect.left() }; >+ constraints.bottom = std::max(PositionInContextRoot { rect.bottom() }, constraints.bottom.valueOr(PositionInContextRoot { })); > > if (constraints.left && constraints.right) > break; >@@ -148,12 +152,16 @@ FloatingState::Constraints FloatingState::constraints(PositionInContextRoot vert > > if (coordinateMappingIsRequired) { > if (constraints.left) >- constraints.left = PositionInContextRoot { *constraints.left - adjustedPosition.x }; >+ constraints.left = PositionInContextRoot { *constraints.left - adjustingDelta.width() }; > > if (constraints.right) >- constraints.right = PositionInContextRoot { *constraints.right - adjustedPosition.x }; >+ constraints.right = PositionInContextRoot { *constraints.right - adjustingDelta.width() }; >+ >+ if (constraints.bottom) >+ constraints.bottom = PositionInContextRoot { *constraints.bottom - adjustingDelta.height() }; > } > >+ ASSERT(!constraints.bottom || (constraints.left || constraints.right)); > return constraints; > } > >diff --git a/Source/WebCore/layout/floats/FloatingState.h b/Source/WebCore/layout/floats/FloatingState.h >index f253f2c3e4d8dece6a52e8c0a563e6a2a4d87f41..4a682fea9fd277a3da1f5fca0b31e85e84bf6d37 100644 >--- a/Source/WebCore/layout/floats/FloatingState.h >+++ b/Source/WebCore/layout/floats/FloatingState.h >@@ -62,6 +62,8 @@ public: > struct Constraints { > Optional<PositionInContextRoot> left; > Optional<PositionInContextRoot> right; >+ // FIXME: consider adding a min/max bottom to be able to tell if this constraint pair gets wider at some vertical position. >+ Optional<PositionInContextRoot> bottom; > }; > Constraints constraints(PositionInContextRoot verticalPosition, const Box& formattingContextRoot) 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 198889
:
372192
|
372193
|
372198