Title: [267039] trunk/Source/WebCore
Revision
267039
Author
[email protected]
Date
2020-09-14 14:00:54 -0700 (Mon, 14 Sep 2020)

Log Message

[LFC][FFC] Each in-flow child of a flex container becomes a flex item.
https://bugs.webkit.org/show_bug.cgi?id=216494

Reviewed by Simon Fraser.

...and flex items form independent formatting contexts for their content.

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::establishesIndependentFormattingContext const):
(WebCore::Layout::Box::isFlexItem const):
* layout/layouttree/LayoutBox.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (267038 => 267039)


--- trunk/Source/WebCore/ChangeLog	2020-09-14 20:51:40 UTC (rev 267038)
+++ trunk/Source/WebCore/ChangeLog	2020-09-14 21:00:54 UTC (rev 267039)
@@ -1,3 +1,17 @@
+2020-09-14  Zalan Bujtas  <[email protected]>
+
+        [LFC][FFC] Each in-flow child of a flex container becomes a flex item.
+        https://bugs.webkit.org/show_bug.cgi?id=216494
+
+        Reviewed by Simon Fraser.
+
+        ...and flex items form independent formatting contexts for their content.
+
+        * layout/layouttree/LayoutBox.cpp:
+        (WebCore::Layout::Box::establishesIndependentFormattingContext const):
+        (WebCore::Layout::Box::isFlexItem const):
+        * layout/layouttree/LayoutBox.h:
+
 2020-09-14  Chris Dumez  <[email protected]>
 
         AudioDestinationCocoa should stop hardcoding the number of output channels to 2

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (267038 => 267039)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2020-09-14 20:51:40 UTC (rev 267038)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2020-09-14 21:00:54 UTC (rev 267039)
@@ -131,7 +131,7 @@
 bool Box::establishesIndependentFormattingContext() const
 {
     // FIXME: This is where we would check for 'contain' property.
-    return isAbsolutelyPositioned();
+    return isAbsolutelyPositioned() || isFlexItem();
 }
 
 bool Box::isRelativelyPositioned() const
@@ -315,6 +315,12 @@
     return isInlineLevelBox() && !isInlineBox();
 }
 
+bool Box::isFlexItem() const
+{
+    // Each in-flow child of a flex container becomes a flex item (https://www.w3.org/TR/css-flexbox-1/#flex-items).
+    return isInFlow() && parent().isFlexBox();
+}
+
 bool Box::isBlockContainerBox() const
 {
     auto display = m_style.display();

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.h (267038 => 267039)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.h	2020-09-14 20:51:40 UTC (rev 267038)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.h	2020-09-14 21:00:54 UTC (rev 267039)
@@ -126,6 +126,7 @@
     bool isTableColumn() const { return style().display() == DisplayType::TableColumn; }
     bool isTableCell() const { return style().display() == DisplayType::TableCell; }
     bool isFlexBox() const { return style().display() == DisplayType::Flex; }
+    bool isFlexItem() const;
     bool isIFrame() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::IFrame; }
     bool isImage() const { return m_elementAttributes && m_elementAttributes.value().elementType == ElementType::Image; }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to