[SimpleLineLayout] Disable SLL when text-underline-position is not auto.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Mar 2019 16:02:24 +0000 (16:02 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Mar 2019 16:02:24 +0000 (16:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196338
<rdar://problem/47975167>

Reviewed by Daniel Bates.

Source/WebCore:

Disable simple line layout unconditionally on non-auto text-underline-position content. We don't support it yet.

Test: fast/text/simple-line-layout-with-text-underline-position.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):

LayoutTests:

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243605 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/text/simple-line-layout-with-text-underline-position-expected.html [new file with mode: 0644]
LayoutTests/fast/text/simple-line-layout-with-text-underline-position.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/SimpleLineLayout.cpp

index 3d51e33..b7e9d0e 100644 (file)
@@ -1,3 +1,14 @@
+2019-03-28  Zalan Bujtas  <zalan@apple.com>
+
+        [SimpleLineLayout] Disable SLL when text-underline-position is not auto.
+        https://bugs.webkit.org/show_bug.cgi?id=196338
+        <rdar://problem/47975167>
+
+        Reviewed by Daniel Bates.
+
+        * fast/text/simple-line-layout-with-text-underline-position-expected.html: Added.
+        * fast/text/simple-line-layout-with-text-underline-position.html: Added.
+
 2019-03-28  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [FreeType] Incorrect application of glyph positioning in the Y direction
diff --git a/LayoutTests/fast/text/simple-line-layout-with-text-underline-position-expected.html b/LayoutTests/fast/text/simple-line-layout-with-text-underline-position-expected.html
new file mode 100644 (file)
index 0000000..f3b2b8a
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that simple line layout is disabled for text-underline-position: under</title>
+</head>
+<body></body>
+</html>
diff --git a/LayoutTests/fast/text/simple-line-layout-with-text-underline-position.html b/LayoutTests/fast/text/simple-line-layout-with-text-underline-position.html
new file mode 100644 (file)
index 0000000..3cee439
--- /dev/null
@@ -0,0 +1,28 @@
+<!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;
+}
+</style>
+<script>
+if (window.internals) {
+    internals.settings.setSimpleLineLayoutDebugBordersEnabled(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>
index 48ea659..8790618 100644 (file)
@@ -1,3 +1,18 @@
+2019-03-28  Zalan Bujtas  <zalan@apple.com>
+
+        [SimpleLineLayout] Disable SLL when text-underline-position is not auto.
+        https://bugs.webkit.org/show_bug.cgi?id=196338
+        <rdar://problem/47975167>
+
+        Reviewed by Daniel Bates.
+
+        Disable simple line layout unconditionally on non-auto text-underline-position content. We don't support it yet.
+
+        Test: fast/text/simple-line-layout-with-text-underline-position.html
+
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::canUseForStyle):
+
 2019-03-28  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
 
         Silence lot of warnings when compiling with clang
index a95a115..85fac4c 100644 (file)
@@ -201,7 +201,7 @@ static AvoidanceReasonFlags canUseForStyle(const RenderStyle& style, IncludeReas
     AvoidanceReasonFlags reasons = { };
     if (style.textOverflow() == TextOverflow::Ellipsis)
         SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextOverflow, reasons, includeReasons);
-    if ((style.textDecorationsInEffect() & TextDecoration::Underline) && (style.textUnderlinePosition() != TextUnderlinePosition::Auto || !style.textUnderlineOffset().isAuto() || !style.textDecorationThickness().isAuto()))
+    if (style.textUnderlinePosition() != TextUnderlinePosition::Auto || !style.textUnderlineOffset().isAuto() || !style.textDecorationThickness().isAuto())
         SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedUnderlineDecoration, reasons, includeReasons);
     // Non-visible overflow should be pretty easy to support.
     if (style.overflowX() != Overflow::Visible || style.overflowY() != Overflow::Visible)