WebKit Bugzilla
Attachment 343422 Details for
Bug 186962
: [LFC] Miscellaneous fixes to fix simple absolute positioning.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186962-20180622221644.patch (text/plain), 6.71 KB, created by
zalan
on 2018-06-22 22:16:45 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-06-22 22:16:45 PDT
Size:
6.71 KB
patch
obsolete
>Subversion Revision: 233112 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a976634885d98bf31d9f880af0f4f937cb509d1f..a18c362fdf248690afc0964171a53f46c7d7e4b8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,26 @@ >+2018-06-22 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Miscellaneous fixes to fix simple absolute positioning. >+ https://bugs.webkit.org/show_bug.cgi?id=186962 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 1. Collect out-of-flow formatting root descendants. >+ 2. Remove invalid and redundant ASSERTs >+ invalid because the assertion is missing border, padding etc. >+ redundant becasue we assert on geometry correctness in validateGeometryConstraintsAfterLayout. >+ >+ * layout/FormattingContext.cpp: >+ (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): >+ (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): >+ (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): >+ * layout/layouttree/LayoutContainer.cpp: >+ (WebCore::Layout::Container::addOutOfFlowDescendant): >+ (WebCore::Layout::Container::setOutOfFlowDescendants): Deleted. >+ * layout/layouttree/LayoutContainer.h: >+ * layout/layouttree/LayoutTreeBuilder.cpp: >+ (WebCore::Layout::TreeBuilder::createSubTree): >+ > 2018-06-22 Jer Noble <jer.noble@apple.com> > > [Fullscreen] Restore ASSERT_NOT_REACHED() checks in exit fullscreen handler after r231924 >diff --git a/Source/WebCore/layout/FormattingContext.cpp b/Source/WebCore/layout/FormattingContext.cpp >index 43ba27a5bef45d2cc38b5874754998a65b7a0bf8..0747af33ce362d5e6931ac9587fc0fb4caa1b7ba 100644 >--- a/Source/WebCore/layout/FormattingContext.cpp >+++ b/Source/WebCore/layout/FormattingContext.cpp >@@ -72,7 +72,6 @@ void FormattingContext::computeOutOfFlowHorizontalGeometry(LayoutContext& layout > auto horizontalGeometry = Geometry::outOfFlowHorizontalGeometry(layoutContext, layoutBox); > displayBox.setLeft(horizontalGeometry.left); > displayBox.setContentBoxWidth(horizontalGeometry.widthAndMargin.width); >- ASSERT(horizontalGeometry.left + horizontalGeometry.widthAndMargin.width == horizontalGeometry.right); > displayBox.setHorizontalMargin(horizontalGeometry.widthAndMargin.margin); > } > >@@ -81,7 +80,6 @@ void FormattingContext::computeOutOfFlowVerticalGeometry(LayoutContext& layoutCo > auto verticalGeometry = Geometry::outOfFlowVerticalGeometry(layoutContext, layoutBox); > displayBox.setTop(verticalGeometry.top); > displayBox.setContentBoxHeight(verticalGeometry.heightAndMargin.height); >- ASSERT(verticalGeometry.top + verticalGeometry.heightAndMargin.height == verticalGeometry.bottom); > displayBox.setVerticalMargin(verticalGeometry.heightAndMargin.margin); > } > >@@ -123,6 +121,7 @@ void FormattingContext::layoutOutOfFlowDescendants(LayoutContext& layoutContext) > // of a hypothetical box that would have been the first box of the element if its specified 'position' value had been 'static' and > // its specified 'float' had been 'none' and its specified 'clear' had been 'none'. > computeStaticPosition(layoutContext, layoutBox, displayBox); >+ computeBorderAndPadding(layoutContext, layoutBox, displayBox); > computeOutOfFlowHorizontalGeometry(layoutContext, layoutBox, displayBox); > > ASSERT(layoutBox.establishesFormattingContext()); >diff --git a/Source/WebCore/layout/layouttree/LayoutContainer.cpp b/Source/WebCore/layout/layouttree/LayoutContainer.cpp >index 9b62ee7daa4debe2dbbd902ce37e0359a24d475f..b973a991d175aa886aeed61c298054b07768f790 100644 >--- a/Source/WebCore/layout/layouttree/LayoutContainer.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutContainer.cpp >@@ -91,9 +91,12 @@ void Container::setLastChild(Box& childBox) > m_lastChild = &childBox; > } > >-void Container::setOutOfFlowDescendants(Vector<WeakPtr<Box>>&& descendantList) >+void Container::addOutOfFlowDescendant(const Box& outOfFlowBox) > { >- m_outOfFlowDescendants = WTFMove(descendantList); >+ // Since we layout the out-of-flow boxes at the end of the formatting context layout, >+ // it's okay to store them at the formatting context root level -as opposed to the containing block level. >+ ASSERT(establishesFormattingContext()); >+ m_outOfFlowDescendants.append(makeWeakPtr(const_cast<Box&>(outOfFlowBox))); > } > > } >diff --git a/Source/WebCore/layout/layouttree/LayoutContainer.h b/Source/WebCore/layout/layouttree/LayoutContainer.h >index 5cb7313a620fb6ca1ef1e54da6e6103d7cdc240a..ed04cfec0e152112b00ec76988c51f2d9df4a85f 100644 >--- a/Source/WebCore/layout/layouttree/LayoutContainer.h >+++ b/Source/WebCore/layout/layouttree/LayoutContainer.h >@@ -61,7 +61,7 @@ protected: > private: > void setFirstChild(Box&); > void setLastChild(Box&); >- void setOutOfFlowDescendants(Vector<WeakPtr<Box>>&&); >+ void addOutOfFlowDescendant(const Box&); > > Box* m_firstChild { nullptr }; > Box* m_lastChild { nullptr }; >diff --git a/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp b/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp >index b874b57a7510a55c286586152e916d969225dd0d..0f24d5b5c6e9c40cf793d11ad0ede61204be34ab 100644 >--- a/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp >@@ -85,13 +85,11 @@ void TreeBuilder::createSubTree(const RenderElement& rootRenderer, Container& ro > for (auto& child : childrenOfType<RenderElement>(rootRenderer)) { > Box* box = nullptr; > >- if (is<RenderBlock>(child)) { >+ if (is<RenderBlock>(child)) > box = new BlockContainer(elementAttributes(child), RenderStyle::clone(child.style())); >- createSubTree(child, downcast<Container>(*box)); >- } else if (is<RenderInline>(child)) { >+ else if (is<RenderInline>(child)) > box = new InlineContainer(elementAttributes(child), RenderStyle::clone(child.style())); >- createSubTree(child, downcast<Container>(*box)); >- } else >+ else > ASSERT_NOT_IMPLEMENTED_YET(); > > if (!rootContainer.hasChild()) { >@@ -104,6 +102,13 @@ void TreeBuilder::createSubTree(const RenderElement& rootRenderer, Container& ro > rootContainer.setLastChild(*box); > } > box->setParent(rootContainer); >+ >+ if (box->isOutOfFlowPositioned()) { >+ // Not efficient, but this is temporary anyway. >+ // Collect the out-of-flow descendants at the formatting root lever (as opposed to at the containing block level, though they might be the same). >+ const_cast<Container&>(box->formattingContextRoot()).addOutOfFlowDescendant(*box); >+ } >+ createSubTree(child, downcast<Container>(*box)); > } > } >
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 186962
: 343422