Title: [261517] branches/safari-609-branch
Revision
261517
Author
[email protected]
Date
2020-05-11 17:21:45 -0700 (Mon, 11 May 2020)

Log Message

Cherry-pick r260528. rdar://problem/62978914

    REGRESSION (r249160): Deleting newline after pasting text ending in a newline results in a discontinuity
    https://bugs.webkit.org/show_bug.cgi?id=210677
    <rdar://problem/61954169>

    Reviewed by Zalan Bujtas.

    Source/WebCore:

    Test: fast/text/delete-line-break-in-pre.html

    * rendering/RenderTextLineBoxes.cpp:
    (WebCore::RenderTextLineBoxes::dirtyRange):

    r249160 changed InlineTextBox end offset to be consistently first-past-end.
    The code here that updates lineBreakPos needs to take this into account too.

    LayoutTests:

    * fast/text/delete-line-break-in-pre-expected.html: Added.
    * fast/text/delete-line-break-in-pre.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-609-branch/LayoutTests/ChangeLog (261516 => 261517)


--- branches/safari-609-branch/LayoutTests/ChangeLog	2020-05-12 00:21:42 UTC (rev 261516)
+++ branches/safari-609-branch/LayoutTests/ChangeLog	2020-05-12 00:21:45 UTC (rev 261517)
@@ -1,5 +1,44 @@
 2020-05-07  Russell Epstein  <[email protected]>
 
+        Cherry-pick r260528. rdar://problem/62978914
+
+    REGRESSION (r249160): Deleting newline after pasting text ending in a newline results in a discontinuity
+    https://bugs.webkit.org/show_bug.cgi?id=210677
+    <rdar://problem/61954169>
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    Test: fast/text/delete-line-break-in-pre.html
+    
+    * rendering/RenderTextLineBoxes.cpp:
+    (WebCore::RenderTextLineBoxes::dirtyRange):
+    
+    r249160 changed InlineTextBox end offset to be consistently first-past-end.
+    The code here that updates lineBreakPos needs to take this into account too.
+    
+    LayoutTests:
+    
+    * fast/text/delete-line-break-in-pre-expected.html: Added.
+    * fast/text/delete-line-break-in-pre.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-04-22  Antti Koivisto  <[email protected]>
+
+            REGRESSION (r249160): Deleting newline after pasting text ending in a newline results in a discontinuity
+            https://bugs.webkit.org/show_bug.cgi?id=210677
+            <rdar://problem/61954169>
+
+            Reviewed by Zalan Bujtas.
+
+            * fast/text/delete-line-break-in-pre-expected.html: Added.
+            * fast/text/delete-line-break-in-pre.html: Added.
+
+2020-05-07  Russell Epstein  <[email protected]>
+
         Cherry-pick r259877. rdar://problem/62978910
 
     [CSS Shadow Parts] Bad style sharing between sibling elements with different part attributes

Added: branches/safari-609-branch/LayoutTests/fast/text/delete-line-break-in-pre-expected.html (0 => 261517)


--- branches/safari-609-branch/LayoutTests/fast/text/delete-line-break-in-pre-expected.html	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/fast/text/delete-line-break-in-pre-expected.html	2020-05-12 00:21:45 UTC (rev 261517)
@@ -0,0 +1,7 @@
+<style>
+#text { white-space:pre-wrap; }
+</style>
+<div><span id=text></span></div>
+<script>
+text.textContent = "a\nb\nc\n";
+</script>

Added: branches/safari-609-branch/LayoutTests/fast/text/delete-line-break-in-pre.html (0 => 261517)


--- branches/safari-609-branch/LayoutTests/fast/text/delete-line-break-in-pre.html	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/fast/text/delete-line-break-in-pre.html	2020-05-12 00:21:45 UTC (rev 261517)
@@ -0,0 +1,9 @@
+<style>
+#text { white-space:pre-wrap; }
+</style>
+<div><span id=text></span></div>
+<script>
+text.textContent = "a\nb\n\nc\n";
+text.offsetWidth;
+text.firstChild.deleteData(3, 1);
+</script>

Modified: branches/safari-609-branch/Source/WebCore/ChangeLog (261516 => 261517)


--- branches/safari-609-branch/Source/WebCore/ChangeLog	2020-05-12 00:21:42 UTC (rev 261516)
+++ branches/safari-609-branch/Source/WebCore/ChangeLog	2020-05-12 00:21:45 UTC (rev 261517)
@@ -1,5 +1,49 @@
 2020-05-07  Russell Epstein  <[email protected]>
 
+        Cherry-pick r260528. rdar://problem/62978914
+
+    REGRESSION (r249160): Deleting newline after pasting text ending in a newline results in a discontinuity
+    https://bugs.webkit.org/show_bug.cgi?id=210677
+    <rdar://problem/61954169>
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    Test: fast/text/delete-line-break-in-pre.html
+    
+    * rendering/RenderTextLineBoxes.cpp:
+    (WebCore::RenderTextLineBoxes::dirtyRange):
+    
+    r249160 changed InlineTextBox end offset to be consistently first-past-end.
+    The code here that updates lineBreakPos needs to take this into account too.
+    
+    LayoutTests:
+    
+    * fast/text/delete-line-break-in-pre-expected.html: Added.
+    * fast/text/delete-line-break-in-pre.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-04-22  Antti Koivisto  <[email protected]>
+
+            REGRESSION (r249160): Deleting newline after pasting text ending in a newline results in a discontinuity
+            https://bugs.webkit.org/show_bug.cgi?id=210677
+            <rdar://problem/61954169>
+
+            Reviewed by Zalan Bujtas.
+
+            Test: fast/text/delete-line-break-in-pre.html
+
+            * rendering/RenderTextLineBoxes.cpp:
+            (WebCore::RenderTextLineBoxes::dirtyRange):
+
+            r249160 changed InlineTextBox end offset to be consistently first-past-end.
+            The code here that updates lineBreakPos needs to take this into account too.
+
+2020-05-07  Russell Epstein  <[email protected]>
+
         Cherry-pick r260201. rdar://problem/62978925
 
     [macOS] Update ScreenTime as playback state changes

Modified: branches/safari-609-branch/Source/WebCore/rendering/RenderTextLineBoxes.cpp (261516 => 261517)


--- branches/safari-609-branch/Source/WebCore/rendering/RenderTextLineBoxes.cpp	2020-05-12 00:21:42 UTC (rev 261516)
+++ branches/safari-609-branch/Source/WebCore/rendering/RenderTextLineBoxes.cpp	2020-05-12 00:21:45 UTC (rev 261517)
@@ -547,11 +547,13 @@
         firstRootBox->markDirty();
         dirtiedLines = true;
     }
+
     for (auto* current = firstRootBox; current && current != lastRootBox; current = current->nextRootBox()) {
-        if (current->lineBreakObj() == &renderer && current->lineBreakPos() > end)
+        auto lineBreakPos = current->lineBreakPos();
+        if (current->lineBreakObj() == &renderer && (lineBreakPos > end || (start != end && lineBreakPos == end)))
             current->setLineBreakPos(current->lineBreakPos() + lengthDelta);
     }
-    
+
     // If the text node is empty, dirty the line where new text will be inserted.
     if (!m_first && renderer.parent()) {
         renderer.parent()->dirtyLinesFromChangedChild(renderer);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to