Title: [253750] trunk
- Revision
- 253750
- Author
- [email protected]
- Date
- 2019-12-19 07:15:07 -0800 (Thu, 19 Dec 2019)
Log Message
REGRESSION (r251015): Hitting return before a space deletes text after the insertion position
https://bugs.webkit.org/show_bug.cgi?id=205425
<rdar://problem/57575960>
Reviewed by Tim Horton.
Source/WebCore:
After r251015, we (rightfully) no longer call ensureLineBoxes() when computing upstream or downstream positions.
However, logic in deleteInsignificantTextDownstream (which is invoked after hitting return before a space in a
text node) assumes that line boxes must be generated for the RenderText of the text node containing the
downstream position. The lack of inline text boxes then causes deleteInsignificantText to always remove the
entire text node.
To fix this, have deleteInsignificantText ensure that line boxes exist for the text node's renderer, right
before asking for the renderer's line boxes.
Test: editing/inserting/insert-paragraph-before-space.html
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::deleteInsignificantText):
LayoutTests:
Add a layout test to exercise this bug, by executing "insertParagraph" in a text node before a space.
* editing/inserting/insert-paragraph-before-space-expected.txt: Added.
* editing/inserting/insert-paragraph-before-space.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (253749 => 253750)
--- trunk/LayoutTests/ChangeLog 2019-12-19 13:54:24 UTC (rev 253749)
+++ trunk/LayoutTests/ChangeLog 2019-12-19 15:15:07 UTC (rev 253750)
@@ -1,3 +1,16 @@
+2019-12-19 Wenson Hsieh <[email protected]>
+
+ REGRESSION (r251015): Hitting return before a space deletes text after the insertion position
+ https://bugs.webkit.org/show_bug.cgi?id=205425
+ <rdar://problem/57575960>
+
+ Reviewed by Tim Horton.
+
+ Add a layout test to exercise this bug, by executing "insertParagraph" in a text node before a space.
+
+ * editing/inserting/insert-paragraph-before-space-expected.txt: Added.
+ * editing/inserting/insert-paragraph-before-space.html: Added.
+
2019-12-19 Carlos Alberto Lopez Perez <[email protected]>
REGRESSION(r253683): [GTK][WPE] Lots of offscreen-canvas WPT tests failing
Added: trunk/LayoutTests/editing/inserting/insert-paragraph-before-space-expected.txt (0 => 253750)
--- trunk/LayoutTests/editing/inserting/insert-paragraph-before-space-expected.txt (rev 0)
+++ trunk/LayoutTests/editing/inserting/insert-paragraph-before-space-expected.txt 2019-12-19 15:15:07 UTC (rev 253750)
@@ -0,0 +1,23 @@
+Verifies that inserting a paragraph before a space does not cause text after the insertion position to be deleted.
+
+Before inserting paragraph:
+| "
+ "
+| <p>
+| "Hello<#selection-caret> world"
+| "
+
+
+"
+
+After inserting paragraph:
+| "
+ "
+| <p>
+| "Hello"
+| <p>
+| "<#selection-caret> world"
+| "
+
+
+"
Added: trunk/LayoutTests/editing/inserting/insert-paragraph-before-space.html (0 => 253750)
--- trunk/LayoutTests/editing/inserting/insert-paragraph-before-space.html (rev 0)
+++ trunk/LayoutTests/editing/inserting/insert-paragraph-before-space.html 2019-12-19 15:15:07 UTC (rev 253750)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf8">
+ <script src=""
+ <script>
+ addEventListener("DOMContentLoaded", () => {
+ document.designMode = "on";
+ Markup.description("Verifies that inserting a paragraph before a space does not cause text after the insertion position to be deleted.");
+
+ getSelection().setPosition(document.querySelector("p").childNodes[0], 5);
+
+ Markup.dump(document.body, "Before inserting paragraph");
+ document.execCommand("InsertParagraph");
+ Markup.dump(document.body, "After inserting paragraph");
+ });
+ </script>
+</head>
+<body>
+ <p>Hello world</p>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (253749 => 253750)
--- trunk/Source/WebCore/ChangeLog 2019-12-19 13:54:24 UTC (rev 253749)
+++ trunk/Source/WebCore/ChangeLog 2019-12-19 15:15:07 UTC (rev 253750)
@@ -1,3 +1,25 @@
+2019-12-19 Wenson Hsieh <[email protected]>
+
+ REGRESSION (r251015): Hitting return before a space deletes text after the insertion position
+ https://bugs.webkit.org/show_bug.cgi?id=205425
+ <rdar://problem/57575960>
+
+ Reviewed by Tim Horton.
+
+ After r251015, we (rightfully) no longer call ensureLineBoxes() when computing upstream or downstream positions.
+ However, logic in deleteInsignificantTextDownstream (which is invoked after hitting return before a space in a
+ text node) assumes that line boxes must be generated for the RenderText of the text node containing the
+ downstream position. The lack of inline text boxes then causes deleteInsignificantText to always remove the
+ entire text node.
+
+ To fix this, have deleteInsignificantText ensure that line boxes exist for the text node's renderer, right
+ before asking for the renderer's line boxes.
+
+ Test: editing/inserting/insert-paragraph-before-space.html
+
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::CompositeEditCommand::deleteInsignificantText):
+
2019-12-19 Carlos Garcia Campos <[email protected]>
[GTK][WPE] Add initial API for input method
Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (253749 => 253750)
--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp 2019-12-19 13:54:24 UTC (rev 253749)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp 2019-12-19 15:15:07 UTC (rev 253750)
@@ -1002,6 +1002,7 @@
Vector<InlineTextBox*> sortedTextBoxes;
size_t sortedTextBoxesPosition = 0;
+ textRenderer->ensureLineBoxes();
for (InlineTextBox* textBox = textRenderer->firstTextBox(); textBox; textBox = textBox->nextTextBox())
sortedTextBoxes.append(textBox);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes