Title: [281311] trunk
Revision
281311
Author
[email protected]
Date
2021-08-20 06:21:06 -0700 (Fri, 20 Aug 2021)

Log Message

[LFC][Integration] Enable full underline support
https://bugs.webkit.org/show_bug.cgi?id=229322

Reviewed by Alan Bujtas.

Source/WebCore:

We can now paint all underlines.

* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printReason):
(WebCore::LayoutIntegration::canUseForStyle):
* layout/integration/LayoutIntegrationCoverage.h:
* layout/integration/LayoutIntegrationInlineContent.cpp:
(WebCore::LayoutIntegration::InlineContent::iteratorForRun const):
(WebCore::LayoutIntegration::InlineContent::iteratorForTextRun const):
* layout/integration/LayoutIntegrationInlineContent.h:
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::paint):

LayoutTests:

Remove a test that just checks we are forcing legacy for underline-position:under.

* fast/text/simple-line-layout-with-text-underline-position-expected.html: Removed.
* fast/text/simple-line-layout-with-text-underline-position.html: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (281310 => 281311)


--- trunk/LayoutTests/ChangeLog	2021-08-20 13:18:36 UTC (rev 281310)
+++ trunk/LayoutTests/ChangeLog	2021-08-20 13:21:06 UTC (rev 281311)
@@ -1,3 +1,15 @@
+2021-08-20  Antti Koivisto  <[email protected]>
+
+        [LFC][Integration] Enable full underline support
+        https://bugs.webkit.org/show_bug.cgi?id=229322
+
+        Reviewed by Alan Bujtas.
+
+        Remove a test that just checks we are forcing legacy for underline-position:under.
+
+        * fast/text/simple-line-layout-with-text-underline-position-expected.html: Removed.
+        * fast/text/simple-line-layout-with-text-underline-position.html: Removed.
+
 2021-08-20  Alan Bujtas  <[email protected]>
 
         [IFC][Integration] Enable non-auto line-break values

Deleted: trunk/LayoutTests/fast/text/simple-line-layout-with-text-underline-position-expected.html (281310 => 281311)


--- trunk/LayoutTests/fast/text/simple-line-layout-with-text-underline-position-expected.html	2021-08-20 13:18:36 UTC (rev 281310)
+++ trunk/LayoutTests/fast/text/simple-line-layout-with-text-underline-position-expected.html	2021-08-20 13:21:06 UTC (rev 281311)
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>This tests that simple line layout is disabled for text-underline-position: under</title>
-<style>
-div {
-    color: white;
-}
-
-.first {
-    overflow: hidden;
-}
-.second, .first {
-	text-underline-position: under;
-	text-decoration: underline;
-}
-</style>
-<script>
-if (window.internals) {
-    internals.settings.setLegacyLineLayoutVisualCoverageEnabled(true);
-    internals.settings.setSimpleLineLayoutEnabled(false);
-}
-</script>
-</head>
-<body>
-<div class=first>Pass if after selecting these 2 lines</div>
-<div class=second>this line is still visible</div>
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/text/simple-line-layout-with-text-underline-position.html (281310 => 281311)


--- trunk/LayoutTests/fast/text/simple-line-layout-with-text-underline-position.html	2021-08-20 13:18:36 UTC (rev 281310)
+++ trunk/LayoutTests/fast/text/simple-line-layout-with-text-underline-position.html	2021-08-20 13:21:06 UTC (rev 281311)
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>This tests that simple line layout is disabled for text-underline-position: under</title>
-<style>
-div {
-    color: white;
-}
-
-.first {
-    overflow: hidden;
-}
-.second, .first {
-	text-underline-position: under;
-	text-decoration: underline;
-}
-</style>
-<script>
-if (window.internals) {
-    internals.settings.setLegacyLineLayoutVisualCoverageEnabled(true);
-    internals.settings.setSimpleLineLayoutEnabled(true);
-}
-</script>
-</head>
-<body>
-<div class=first>Pass if after selecting these 2 lines</div>
-<div class=second>this line is still visible</div>
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (281310 => 281311)


--- trunk/Source/WebCore/ChangeLog	2021-08-20 13:18:36 UTC (rev 281310)
+++ trunk/Source/WebCore/ChangeLog	2021-08-20 13:21:06 UTC (rev 281311)
@@ -1,3 +1,23 @@
+2021-08-20  Antti Koivisto  <[email protected]>
+
+        [LFC][Integration] Enable full underline support
+        https://bugs.webkit.org/show_bug.cgi?id=229322
+
+        Reviewed by Alan Bujtas.
+
+        We can now paint all underlines.
+
+        * layout/integration/LayoutIntegrationCoverage.cpp:
+        (WebCore::LayoutIntegration::printReason):
+        (WebCore::LayoutIntegration::canUseForStyle):
+        * layout/integration/LayoutIntegrationCoverage.h:
+        * layout/integration/LayoutIntegrationInlineContent.cpp:
+        (WebCore::LayoutIntegration::InlineContent::iteratorForRun const):
+        (WebCore::LayoutIntegration::InlineContent::iteratorForTextRun const):
+        * layout/integration/LayoutIntegrationInlineContent.h:
+        * layout/integration/LayoutIntegrationLineLayout.cpp:
+        (WebCore::LayoutIntegration::LineLayout::paint):
+
 2021-08-20  Alan Bujtas  <[email protected]>
 
         [IFC][Integration] Enable custom hyphen strings

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (281310 => 281311)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2021-08-20 13:18:36 UTC (rev 281310)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2021-08-20 13:21:06 UTC (rev 281311)
@@ -123,9 +123,6 @@
     case AvoidanceReason::FlowHasUnsupportedFloat:
         stream << "complicated float";
         break;
-    case AvoidanceReason::FlowHasUnsupportedUnderlineDecoration:
-        stream << "text-underline-position: under";
-        break;
     case AvoidanceReason::FlowHasJustifiedNonLatinText:
         stream << "text-align: justify with non-latin text";
         break;
@@ -543,8 +540,6 @@
         SET_REASON_AND_RETURN_IF_NEEDED(FlowHasOverflowNotVisible, reasons, includeReasons);
     if (style.textOverflow() == TextOverflow::Ellipsis)
         SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextOverflow, reasons, includeReasons);
-    if (!style.textDecorationsInEffect().isEmpty() && (style.textUnderlinePosition() != TextUnderlinePosition::Auto || !style.textUnderlineOffset().isAuto() || !style.textDecorationThickness().isAuto()))
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedUnderlineDecoration, reasons, includeReasons);
     if (!style.isLeftToRightDirection())
         SET_REASON_AND_RETURN_IF_NEEDED(FlowIsNotLTR, reasons, includeReasons);
     if (!(style.lineBoxContain().contains(LineBoxContain::Block)))

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h (281310 => 281311)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h	2021-08-20 13:18:36 UTC (rev 281310)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h	2021-08-20 13:21:06 UTC (rev 281311)
@@ -48,7 +48,7 @@
     FlowParentIsTextAreaWithWrapping             = 1LLU  << 8,
     FlowHasNonSupportedChild                     = 1LLU  << 9,
     FlowHasUnsupportedFloat                      = 1LLU  << 10,
-    FlowHasUnsupportedUnderlineDecoration        = 1LLU  << 11,
+    // Unused                                    = 1LLU  << 11,
     FlowHasJustifiedNonLatinText                 = 1LLU  << 12,
     FlowHasOverflowNotVisible                    = 1LLU  << 13,
     // Unused                                    = 1LLU  << 14,

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.cpp (281310 => 281311)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.cpp	2021-08-20 13:18:36 UTC (rev 281310)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.cpp	2021-08-20 13:21:06 UTC (rev 281311)
@@ -29,6 +29,7 @@
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 
 #include "LayoutIntegrationLineLayout.h"
+#include "LayoutIntegrationRunIterator.h"
 #include "RuntimeEnabledFeatures.h"
 #include "TextPainter.h"
 
@@ -71,7 +72,18 @@
     return m_lineLayout->flow();
 }
 
+RunIterator InlineContent::iteratorForRun(const Run& run) const
+{
+    return { RunIteratorModernPath { *this, static_cast<size_t>(&run - runs.begin()) } };
 }
+
+TextRunIterator InlineContent::iteratorForTextRun(const Run& run) const
+{
+    ASSERT(run.textContent());
+    return { RunIteratorModernPath { *this, static_cast<size_t>(&run - runs.begin()) } };
 }
 
+}
+}
+
 #endif

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.h (281310 => 281311)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.h	2021-08-20 13:18:36 UTC (rev 281310)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationInlineContent.h	2021-08-20 13:21:06 UTC (rev 281311)
@@ -45,6 +45,8 @@
 namespace LayoutIntegration {
 
 class LineLayout;
+class RunIterator;
+class TextRunIterator;
 
 struct InlineContent : public RefCounted<InlineContent> {
     static Ref<InlineContent> create(const LineLayout& lineLayout) { return adoptRef(*new InlineContent(lineLayout)); }
@@ -67,6 +69,9 @@
     const RenderObject& rendererForLayoutBox(const Layout::Box&) const;
     const RenderBlockFlow& containingBlock() const;
 
+    RunIterator iteratorForRun(const Run&) const;
+    TextRunIterator iteratorForTextRun(const Run&) const;
+
 private:
     InlineContent(const LineLayout&);
 

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (281310 => 281311)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2021-08-20 13:18:36 UTC (rev 281310)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2021-08-20 13:21:06 UTC (rev 281311)
@@ -509,9 +509,10 @@
 
         if (!style.textDecorationsInEffect().isEmpty()) {
             auto& textRenderer = downcast<RenderText>(m_boxTree.rendererForLayoutBox(run.layoutBox()));
-            auto painter = TextDecorationPainter { paintInfo.context(), style.textDecorationsInEffect(), textRenderer, false, fontCascade };
-            painter.setWidth(rect.width());
-            painter.paintTextDecoration(textRun, textOrigin, rect.location() + paintOffset);
+            auto decorationPainter = TextDecorationPainter { paintInfo.context(), style.textDecorationsInEffect(), textRenderer, false, fontCascade };
+            decorationPainter.setTextRunIterator(inlineContent.iteratorForTextRun(run));
+            decorationPainter.setWidth(rect.width());
+            decorationPainter.paintTextDecoration(textRun, textOrigin, rect.location() + paintOffset);
         }
     }
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to