Title: [266722] trunk/Source/WebCore
Revision
266722
Author
[email protected]
Date
2020-09-08 06:26:25 -0700 (Tue, 08 Sep 2020)

Log Message

[LFC][IFC] Remove redundant FormattingContext::Quirks::lineDescentNeedsCollapsing
https://bugs.webkit.org/show_bug.cgi?id=216259

Reviewed by Antti Koivisto.

This function is not needed anymore. InlineBoxes start collapsed by default and they get stretched when they gain content
(and the root inline box has no imaginary strut in non-standard mode).

* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextQuirks.cpp:
(WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (266721 => 266722)


--- trunk/Source/WebCore/ChangeLog	2020-09-08 13:18:46 UTC (rev 266721)
+++ trunk/Source/WebCore/ChangeLog	2020-09-08 13:26:25 UTC (rev 266722)
@@ -1,3 +1,17 @@
+2020-09-08  Zalan Bujtas  <[email protected]>
+
+        [LFC][IFC] Remove redundant FormattingContext::Quirks::lineDescentNeedsCollapsing
+        https://bugs.webkit.org/show_bug.cgi?id=216259
+
+        Reviewed by Antti Koivisto.
+
+        This function is not needed anymore. InlineBoxes start collapsed by default and they get stretched when they gain content
+        (and the root inline box has no imaginary strut in non-standard mode).
+
+        * layout/inlineformatting/InlineFormattingContext.h:
+        * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
+        (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const): Deleted.
+
 2020-09-08  Víctor Manuel Jáquez Leal  <[email protected]>
 
         [GStreamer] Follow-up of "Convert custom GObject subclasses to WEBKIT_DEFINE_TYPE"

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h (266721 => 266722)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h	2020-09-08 13:18:46 UTC (rev 266721)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h	2020-09-08 13:26:25 UTC (rev 266722)
@@ -48,7 +48,6 @@
 
     class Quirks : public FormattingContext::Quirks {
     public:
-        bool lineDescentNeedsCollapsing(const Line::RunList&) const;
         InlineLayoutUnit initialLineHeight() const;
 
     private:

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextQuirks.cpp (266721 => 266722)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextQuirks.cpp	2020-09-08 13:18:46 UTC (rev 266721)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextQuirks.cpp	2020-09-08 13:26:25 UTC (rev 266722)
@@ -24,9 +24,7 @@
  */
 
 #include "config.h"
-#include "DisplayBox.h"
 #include "InlineFormattingContext.h"
-#include "InlineLineBox.h"
 
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 
@@ -33,43 +31,6 @@
 namespace WebCore {
 namespace Layout {
 
-bool InlineFormattingContext::Quirks::lineDescentNeedsCollapsing(const Line::RunList& runList) const
-{
-    // Collapse line descent in limited and full quirk mode when there's no baseline aligned content or
-    // the baseline aligned content has no descent.
-    auto& layoutState = this->layoutState();
-    if (!layoutState.inQuirksMode() && !layoutState.inLimitedQuirksMode())
-        return false;
-
-    for (auto& run : runList) {
-        auto& layoutBox = run.layoutBox();
-        if (run.isContainerEnd() || layoutBox.style().verticalAlign() != VerticalAlign::Baseline)
-            continue;
-
-        if (run.isLineBreak())
-            return false;
-        if (run.isText())
-            return false;
-        if (run.isContainerStart()) {
-            auto& boxGeometry = formattingContext().geometryForBox(layoutBox);
-            if (boxGeometry.horizontalBorder() || (boxGeometry.horizontalPadding() && boxGeometry.horizontalPadding().value()))
-                return false;
-            continue;
-        }
-        if (run.isBox()) {
-            if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) {
-                auto& formattingState = layoutState.establishedInlineFormattingState(downcast<ContainerBox>(layoutBox));
-                auto lastLine = formattingState.displayInlineContent()->lines.last();
-                if (lastLine.height() > lastLine.baseline())
-                    return false;
-            }
-            continue;
-        }
-        ASSERT_NOT_REACHED();
-    }
-    return true;
-}
-
 InlineLayoutUnit InlineFormattingContext::Quirks::initialLineHeight() const
 {
     // Negative lineHeight value means the line-height is not set
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to