Title: [210601] trunk
Revision
210601
Author
mmaxfi...@apple.com
Date
2017-01-11 15:06:13 -0800 (Wed, 11 Jan 2017)

Log Message

ASSERTION FAILED: run->m_stop > 0 in *WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment
https://bugs.webkit.org/show_bug.cgi?id=166030

Reviewed by Ryosuke Niwa.

Source/WebCore:

Ordinarily, we don't process empty BiDi runs (because we filter them out).
However, when using isolates, we invoke extra machinery to create a
placeholder BiDi run, and replace it with the runs for the isolate. The
isolate's runs, though, can be empty, and rather than just deleting the
placeholder run, we will keep it around so that the m_logicallyLastRun is
still valid. This means that it is possible when all is said and done to
have empty runs, and computeInlineDirectionPositionsForSegment() needs to
not ASSERT() in this case.

Test: fast/text/bidi-isolate-empty-run.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):

LayoutTests:

* fast/text/bidi-isolate-empty-run-expected.txt: Added.
* fast/text/bidi-isolate-empty-run.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (210600 => 210601)


--- trunk/LayoutTests/ChangeLog	2017-01-11 22:44:51 UTC (rev 210600)
+++ trunk/LayoutTests/ChangeLog	2017-01-11 23:06:13 UTC (rev 210601)
@@ -1,3 +1,13 @@
+2017-01-11  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        ASSERTION FAILED: run->m_stop > 0 in *WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment
+        https://bugs.webkit.org/show_bug.cgi?id=166030
+
+        Reviewed by Ryosuke Niwa.
+
+        * fast/text/bidi-isolate-empty-run-expected.txt: Added.
+        * fast/text/bidi-isolate-empty-run.html: Added.
+
 2017-01-11  Chris Dumez  <cdu...@apple.com>
 
         Iterating over URLSearchParams does not work

Added: trunk/LayoutTests/fast/text/bidi-isolate-empty-run-expected.txt (0 => 210601)


--- trunk/LayoutTests/fast/text/bidi-isolate-empty-run-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/text/bidi-isolate-empty-run-expected.txt	2017-01-11 23:06:13 UTC (rev 210601)
@@ -0,0 +1,2 @@
+This test passes if there is no ASSERT().
+f foo
Property changes on: trunk/LayoutTests/fast/text/bidi-isolate-empty-run-expected.txt
___________________________________________________________________

Added: svn:eol-style

+native \ No newline at end of property

Added: svn:keywords

+Author Date Id Rev URL \ No newline at end of property

Added: trunk/LayoutTests/fast/text/bidi-isolate-empty-run.html (0 => 210601)


--- trunk/LayoutTests/fast/text/bidi-isolate-empty-run.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/bidi-isolate-empty-run.html	2017-01-11 23:06:13 UTC (rev 210601)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.foo {
+	unicode-bidi: -webkit-isolate;
+}
+</style>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</head>
+<body>
+This test passes if there is no ASSERT().
+<div style="width: 30px;" contenteditable="true"><span>f </span><span class=foo>
+foo</span></div>
+</body>
+</html>
+

Modified: trunk/Source/WebCore/ChangeLog (210600 => 210601)


--- trunk/Source/WebCore/ChangeLog	2017-01-11 22:44:51 UTC (rev 210600)
+++ trunk/Source/WebCore/ChangeLog	2017-01-11 23:06:13 UTC (rev 210601)
@@ -1,3 +1,24 @@
+2017-01-11  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        ASSERTION FAILED: run->m_stop > 0 in *WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment
+        https://bugs.webkit.org/show_bug.cgi?id=166030
+
+        Reviewed by Ryosuke Niwa.
+
+        Ordinarily, we don't process empty BiDi runs (because we filter them out).
+        However, when using isolates, we invoke extra machinery to create a
+        placeholder BiDi run, and replace it with the runs for the isolate. The
+        isolate's runs, though, can be empty, and rather than just deleting the
+        placeholder run, we will keep it around so that the m_logicallyLastRun is
+        still valid. This means that it is possible when all is said and done to
+        have empty runs, and computeInlineDirectionPositionsForSegment() needs to
+        not ASSERT() in this case.
+
+        Test: fast/text/bidi-isolate-empty-run.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
+
 2017-01-11  Brent Fulgham  <bfulg...@apple.com>
 
         File scheme should not allow access of a resource on a different volume.

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (210600 => 210601)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2017-01-11 22:44:51 UTC (rev 210600)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2017-01-11 23:06:13 UTC (rev 210601)
@@ -897,8 +897,9 @@
             if (unsigned length = renderText.textLength()) {
                 if (!run->m_start && needsWordSpacing && isSpaceOrNewline(renderText.characterAt(run->m_start)))
                     totalLogicalWidth += lineStyle(*renderText.parent(), lineInfo).fontCascade().wordSpacing();
-                ASSERT(run->m_stop > 0);
-                needsWordSpacing = !isSpaceOrNewline(renderText.characterAt(run->m_stop - 1)) && run->m_stop == length;
+                // run->m_start == run->m_stop should only be true iff the run is a replaced run for bidi: isolate.
+                ASSERT(run->m_stop > 0 || run->m_start == run->m_stop);
+                needsWordSpacing = run->m_stop == length && !isSpaceOrNewline(renderText.characterAt(run->m_stop - 1));
             }
 
             setLogicalWidthForTextRun(lineBox, run, renderText, totalLogicalWidth, lineInfo, textBoxDataMap, verticalPositionCache, wordMeasurements);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to