Title: [243660] trunk
Revision
243660
Author
[email protected]
Date
2019-03-29 13:26:49 -0700 (Fri, 29 Mar 2019)

Log Message

[Simple line layout] Turn off inline boxtree generation for multiline content
https://bugs.webkit.org/show_bug.cgi?id=196404
<rdar://problem/49234033>

Reviewed by Simon Fraser.

Source/WebCore:

Currently simple line layout can't provide the correct line breaking context to the inline tree when the boxtree is
generated using the simple line runs. This patch limits the generation of such trees to single lines. Multiline content will
go through the "let's layout this content again" codepath.
This patch fixes disappearing content on Questar.

Test: fast/text/simple-line-layout-and-multiline-inlineboxtree.html

* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::canUseForLineBoxTree):

LayoutTests:

* fast/text/simple-line-layout-and-multiline-inlineboxtree-expected.html: Added.
* fast/text/simple-line-layout-and-multiline-inlineboxtree.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243659 => 243660)


--- trunk/LayoutTests/ChangeLog	2019-03-29 20:23:05 UTC (rev 243659)
+++ trunk/LayoutTests/ChangeLog	2019-03-29 20:26:49 UTC (rev 243660)
@@ -1,3 +1,14 @@
+2019-03-29  Zalan Bujtas  <[email protected]>
+
+        [Simple line layout] Turn off inline boxtree generation for multiline content
+        https://bugs.webkit.org/show_bug.cgi?id=196404
+        <rdar://problem/49234033>
+
+        Reviewed by Simon Fraser.
+
+        * fast/text/simple-line-layout-and-multiline-inlineboxtree-expected.html: Added.
+        * fast/text/simple-line-layout-and-multiline-inlineboxtree.html: Added.
+
 2019-03-29  Shawn Roberts  <[email protected]>
 
         imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-stop.html is a flaky failure

Added: trunk/LayoutTests/fast/text/simple-line-layout-and-multiline-inlineboxtree-expected.html (0 => 243660)


--- trunk/LayoutTests/fast/text/simple-line-layout-and-multiline-inlineboxtree-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/simple-line-layout-and-multiline-inlineboxtree-expected.html	2019-03-29 20:26:49 UTC (rev 243660)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we can reconstruct the line tree when a dynamic change is triggered on the block after switching out of simple line layout.</title>
+<script>
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(true);
+</script>
+</head>
+<body>
+<div id=container style="width: 200px;">
+This long long long long long text should not get cut off after "extra text" is added to the end. extra text
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/simple-line-layout-and-multiline-inlineboxtree.html (0 => 243660)


--- trunk/LayoutTests/fast/text/simple-line-layout-and-multiline-inlineboxtree.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/simple-line-layout-and-multiline-inlineboxtree.html	2019-03-29 20:26:49 UTC (rev 243660)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we can reconstruct the line tree when a dynamic change is triggered on the block after switching out of simple line layout.</title>
+<script>
+if (window.internals)
+    internals.settings.setSimpleLineLayoutEnabled(true);
+</script>
+</head>
+<body>
+<div id=container style="width: 200px;">
+This long long long long long text should not get cut off after "extra text" is added to the end.
+</div>
+<script>
+const selection = window.getSelection();
+const range = document.createRange();
+range.selectNodeContents(container);
+selection.addRange(range);
+document.body.offsetHeight;
+selection.removeAllRanges();
+document.body.offsetHeight;
+
+let span = document.createElement("span");
+span.innerText = "extra text";
+container.appendChild(span);
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (243659 => 243660)


--- trunk/Source/WebCore/ChangeLog	2019-03-29 20:23:05 UTC (rev 243659)
+++ trunk/Source/WebCore/ChangeLog	2019-03-29 20:26:49 UTC (rev 243660)
@@ -1,3 +1,21 @@
+2019-03-29  Zalan Bujtas  <[email protected]>
+
+        [Simple line layout] Turn off inline boxtree generation for multiline content
+        https://bugs.webkit.org/show_bug.cgi?id=196404
+        <rdar://problem/49234033>
+
+        Reviewed by Simon Fraser.
+
+        Currently simple line layout can't provide the correct line breaking context to the inline tree when the boxtree is
+        generated using the simple line runs. This patch limits the generation of such trees to single lines. Multiline content will
+        go through the "let's layout this content again" codepath.
+        This patch fixes disappearing content on Questar.
+
+        Test: fast/text/simple-line-layout-and-multiline-inlineboxtree.html
+
+        * rendering/SimpleLineLayoutFunctions.cpp:
+        (WebCore::SimpleLineLayout::canUseForLineBoxTree):
+
 2019-03-29  Justin Fan  <[email protected]>
 
         [Web GPU] Replace unsigned longs in WebGPU with uint64_t

Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp (243659 => 243660)


--- trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp	2019-03-29 20:23:05 UTC (rev 243659)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp	2019-03-29 20:26:49 UTC (rev 243660)
@@ -285,6 +285,10 @@
 
 bool canUseForLineBoxTree(RenderBlockFlow& flow, const Layout& layout)
 {
+    // Line breaking requires some context that SLL can't provide at the moment (see RootInlineBox::setLineBreakInfo).
+    if (layout.lineCount() > 1)
+        return false;
+
     if (layout.isPaginated())
         return false;
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to