[LFC][Integration] line-clamp is an unsupported CSS property
https://bugs.webkit.org/show_bug.cgi?id=228794

Reviewed by Simon Fraser.

Let's bail out on -webkit-line-clamp instead of the presence of a deprecated flex box. While line clamping requires legacy line layout, regular flex item content is fine with either line layout codepaths.

* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printReason):
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
* layout/integration/LayoutIntegrationCoverage.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@281308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index 1fc78c4..d8ec87d 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -42,6 +42,7 @@
 #include "LegacyLineLayout.h"
 #include "Logging.h"
 #include "RenderCombineText.h"
+#include "RenderDeprecatedFlexibleBox.h"
 #include "RenderFlexibleBox.h"
 #include "RenderInline.h"
 #include "RenderIterator.h"
@@ -3802,7 +3803,32 @@
     } else
         legacyLineLayout.layoutLineBoxes(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
 
-    updateLogicalHeight();
+    {
+        struct DeprecatedBoxStrechingScope {
+            DeprecatedBoxStrechingScope(RenderElement& parent)
+            {
+                if (is<RenderDeprecatedFlexibleBox>(parent) && parent.style().boxAlign() == BoxAlignment::Stretch) {
+                    // While modern flex box's uses override height to stretch its children, deprecated flex box
+                    // uses a flag which is consulted at updateLogicalHeight().
+                    // This scope class ensures that we don't collapse flex items while swapping the line structures.
+                    // see RenderBox::computeLogicalHeight where isStretchingChildren() is consulted.
+                    strechingRenderer = makeWeakPtr(downcast<RenderDeprecatedFlexibleBox>(parent));
+                    strechingRenderer->setIsStretchingChildren(true);
+                }
+            }
+
+            ~DeprecatedBoxStrechingScope()
+            {
+                if (strechingRenderer)
+                    strechingRenderer->setIsStretchingChildren(false);
+            }
+
+            WeakPtr<RenderDeprecatedFlexibleBox> strechingRenderer;
+
+        };
+        auto deprecatedBoxStrechingScope = DeprecatedBoxStrechingScope(*parent());
+        updateLogicalHeight();
+    }
     ASSERT(didNeedLayout || ceilf(logicalHeight()) == ceilf(oldHeight));
 
     if (!didNeedLayout)