WebKit Bugzilla
Attachment 348855 Details for
Bug 189276
: [LFC] Rename LayoutPair to BoxPair
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189276-20180904151307.patch (text/plain), 6.01 KB, created by
zalan
on 2018-09-04 15:13:09 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-09-04 15:13:09 PDT
Size:
6.01 KB
patch
obsolete
>Subversion Revision: 235639 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 131a91de408ba50f03681c248a98cf275296bb79..4a69e530091f9889977e9ede904d879541fdaff1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,14 @@ >+2018-09-04 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Rename LayoutPair to BoxPair >+ https://bugs.webkit.org/show_bug.cgi?id=189276 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * layout/FormattingContext.h: >+ * layout/blockformatting/BlockFormattingContext.cpp: >+ (WebCore::Layout::BlockFormattingContext::layout const): >+ > 2018-09-04 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Merge computeInFlowWidth(Height)AndMargin and computeFloatingWidth(Height)AndMargin. >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index 2d652063ef21a6dcb6247f7788447dd8fe75f746..11c7717d119dedadd7475e2e104c5c4ed92837b6 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -64,11 +64,11 @@ public: > static Position mapCoordinateToAncestor(const LayoutContext&, Position, const Container& containingBlock, const Container& ancestor); > > protected: >- struct LayoutPair { >- const Box& layoutBox; >- Display::Box& displayBox; >+ struct BoxPair { >+ const Box& layout; >+ Display::Box& display; > }; >- using LayoutQueue = Vector<std::unique_ptr<LayoutPair>>; >+ using LayoutQueue = Vector<std::unique_ptr<BoxPair>>; > > const Box& root() const { return *m_root; } > >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >index a9cfca91da86ee0295188f21d20d81938939cd97..0f120cd1d322c010a07307871ca495d453237145 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp >@@ -66,7 +66,7 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat > // This is a post-order tree traversal layout. > // The root container layout is done in the formatting context it lives in, not that one it creates, so let's start with the first child. > if (auto* firstChild = formattingRoot.firstInFlowOrFloatingChild()) >- layoutQueue.append(std::make_unique<LayoutPair>(LayoutPair {*firstChild, layoutContext.createDisplayBox(*firstChild)})); >+ layoutQueue.append(std::make_unique<BoxPair>(BoxPair {*firstChild, layoutContext.createDisplayBox(*firstChild)})); > // 1. Go all the way down to the leaf node > // 2. Compute static position and width as we traverse down > // 3. As we climb back on the tree, compute height and finialize position >@@ -74,9 +74,9 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat > while (!layoutQueue.isEmpty()) { > // Traverse down on the descendants and compute width/static position until we find a leaf node. > while (true) { >- auto& layoutPair = *layoutQueue.last(); >- auto& layoutBox = layoutPair.layoutBox; >- auto& displayBox = layoutPair.displayBox; >+ auto& boxPair = *layoutQueue.last(); >+ auto& layoutBox = boxPair.layout; >+ auto& displayBox = boxPair.display; > > if (layoutBox.establishesFormattingContext()) { > layoutFormattingContextRoot(layoutContext, floatingContext, formattingState, layoutBox, displayBox); >@@ -86,7 +86,7 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat > if (!layoutBox.nextInFlowOrFloatingSibling()) > break; > auto* nextSibling = layoutBox.nextInFlowOrFloatingSibling(); >- layoutQueue.append(std::make_unique<LayoutPair>(LayoutPair {*nextSibling, layoutContext.createDisplayBox(*nextSibling)})); >+ layoutQueue.append(std::make_unique<BoxPair>(BoxPair {*nextSibling, layoutContext.createDisplayBox(*nextSibling)})); > continue; > } > >@@ -97,15 +97,15 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat > if (!is<Container>(layoutBox) || !downcast<Container>(layoutBox).hasInFlowOrFloatingChild()) > break; > auto& firstChild = *downcast<Container>(layoutBox).firstInFlowOrFloatingChild(); >- layoutQueue.append(std::make_unique<LayoutPair>(LayoutPair {firstChild, layoutContext.createDisplayBox(firstChild)})); >+ layoutQueue.append(std::make_unique<BoxPair>(BoxPair {firstChild, layoutContext.createDisplayBox(firstChild)})); > } > > // Climb back on the ancestors and compute height/final position. > while (!layoutQueue.isEmpty()) { > // All inflow descendants (if there are any) are laid out by now. Let's compute the box's height. >- auto layoutPair = layoutQueue.takeLast(); >- auto& layoutBox = layoutPair->layoutBox; >- auto& displayBox = layoutPair->displayBox; >+ auto boxPair = layoutQueue.takeLast(); >+ auto& layoutBox = boxPair->layout; >+ auto& displayBox = boxPair->display; > > LOG_WITH_STREAM(FormattingContextLayout, stream << "[Compute] -> [Height][Margin] -> for layoutBox(" << &layoutBox << ")"); > // Formatting root boxes are special-cased and they don't come here. >@@ -120,7 +120,7 @@ void BlockFormattingContext::layout(LayoutContext& layoutContext, FormattingStat > // Move in-flow positioned children to their final position. > placeInFlowPositionedChildren(layoutContext, container); > if (auto* nextSibling = container.nextInFlowOrFloatingSibling()) { >- layoutQueue.append(std::make_unique<LayoutPair>(LayoutPair {*nextSibling, layoutContext.createDisplayBox(*nextSibling)})); >+ layoutQueue.append(std::make_unique<BoxPair>(BoxPair {*nextSibling, layoutContext.createDisplayBox(*nextSibling)})); > break; > } > }
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 189276
: 348855