Title: [234554] trunk/Source/WebCore
- Revision
- 234554
- Author
- [email protected]
- Date
- 2018-08-03 11:00:23 -0700 (Fri, 03 Aug 2018)
Log Message
[LFC][BFC] Special case the document renderer when computing the height and margin
https://bugs.webkit.org/show_bug.cgi?id=188313
Reviewed by Antti Koivisto.
The document renderer is certainly special and its geometry is likely to be computed as part of "10.6.6 Complicated cases" (spec is unclear) but probably not by
making the it a formatting root. Let's just special case it at contentHeightForFormattingContextRoot(), since having the document renderer as a context root has unwanted side effect.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::establishesBlockFormattingContext const):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (234553 => 234554)
--- trunk/Source/WebCore/ChangeLog 2018-08-03 17:57:35 UTC (rev 234553)
+++ trunk/Source/WebCore/ChangeLog 2018-08-03 18:00:23 UTC (rev 234554)
@@ -1,5 +1,20 @@
2018-08-03 Zalan Bujtas <[email protected]>
+ [LFC][BFC] Special case the document renderer when computing the height and margin
+ https://bugs.webkit.org/show_bug.cgi?id=188313
+
+ Reviewed by Antti Koivisto.
+
+ The document renderer is certainly special and its geometry is likely to be computed as part of "10.6.6 Complicated cases" (spec is unclear) but probably not by
+ making the it a formatting root. Let's just special case it at contentHeightForFormattingContextRoot(), since having the document renderer as a context root has unwanted side effect.
+
+ * layout/FormattingContextGeometry.cpp:
+ (WebCore::Layout::contentHeightForFormattingContextRoot):
+ * layout/layouttree/LayoutBox.cpp:
+ (WebCore::Layout::Box::establishesBlockFormattingContext const):
+
+2018-08-03 Zalan Bujtas <[email protected]>
+
[LFC][BFC] Layout out-of-flow descendants only on the formatting context root.
https://bugs.webkit.org/show_bug.cgi?id=188312
Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (234553 => 234554)
--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp 2018-08-03 17:57:35 UTC (rev 234553)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp 2018-08-03 18:00:23 UTC (rev 234554)
@@ -35,7 +35,7 @@
static LayoutUnit contentHeightForFormattingContextRoot(LayoutContext& layoutContext, const Box& layoutBox)
{
- ASSERT(layoutBox.style().logicalHeight().isAuto() && layoutBox.establishesFormattingContext());
+ ASSERT(layoutBox.style().logicalHeight().isAuto() && (layoutBox.establishesFormattingContext() || layoutBox.isDocumentBox()));
// 10.6.7 'Auto' heights for block formatting context roots
@@ -55,7 +55,13 @@
auto* firstDisplayBox = layoutContext.displayBoxForLayoutBox(*formattingRootContainer.firstInFlowChild());
auto* lastDisplayBox = layoutContext.displayBoxForLayoutBox(*formattingRootContainer.lastInFlowChild());
- auto floatsBottom = layoutContext.establishedFormattingState(layoutBox).floatingState().bottom(layoutBox);
+ auto* formattingContextRoot = &layoutBox;
+ // TODO: The document renderer is not a formatting context root by default at all. Need to find out what it is.
+ if (!layoutBox.establishesFormattingContext()) {
+ ASSERT(layoutBox.isDocumentBox());
+ formattingContextRoot = &layoutBox.formattingContextRoot();
+ }
+ auto floatsBottom = layoutContext.establishedFormattingState(*formattingContextRoot).floatingState().bottom(*formattingContextRoot);
auto top = firstDisplayBox->marginBox().top();
auto bottom = lastDisplayBox->marginBox().bottom();
Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (234553 => 234554)
--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp 2018-08-03 17:57:35 UTC (rev 234553)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp 2018-08-03 18:00:23 UTC (rev 234554)
@@ -71,9 +71,6 @@
if (isBlockLevelBox() && !isOverflowVisible())
return true;
- if (isDocumentBox())
- return true;
-
return false;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes