Title: [161579] tags/Safari-538.10.2

Diff

Modified: tags/Safari-538.10.2/LayoutTests/ChangeLog (161578 => 161579)


--- tags/Safari-538.10.2/LayoutTests/ChangeLog	2014-01-09 21:23:30 UTC (rev 161578)
+++ tags/Safari-538.10.2/LayoutTests/ChangeLog	2014-01-09 21:26:54 UTC (rev 161579)
@@ -1,3 +1,20 @@
+2014-01-09  Lucas Forschler  <[email protected]>
+
+        Merge r161404
+
+    2014-01-06  Ryosuke Niwa  <[email protected]>
+
+            REGRESSION(r157851): trailing space inside an editable region could be erroneously collapsed
+            https://bugs.webkit.org/show_bug.cgi?id=126549
+
+            Reviewed by Sam Weinig.
+
+            Added a regression test and reverted the erroneous rebaseline in r157851.
+
+            * editing/inserting/inserting-trailing-space-and-letter-expected.html: Added.
+            * editing/inserting/inserting-trailing-space-and-letter.html: Added.
+            * platform/mac/editing/selection/after-line-wrap-expected.txt:
+
 2013-12-19  Oliver Hunt  <[email protected]>
 
         DOM bindings should use thisValue for attributes

Copied: tags/Safari-538.10.2/LayoutTests/editing/inserting/inserting-trailing-space-and-letter-expected.html (from rev 161404, trunk/LayoutTests/editing/inserting/inserting-trailing-space-and-letter-expected.html) (0 => 161579)


--- tags/Safari-538.10.2/LayoutTests/editing/inserting/inserting-trailing-space-and-letter-expected.html	                        (rev 0)
+++ tags/Safari-538.10.2/LayoutTests/editing/inserting/inserting-trailing-space-and-letter-expected.html	2014-01-09 21:26:54 UTC (rev 161579)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#editor {
+    width: 160px;
+    height: 100px;
+    font-family: Ahem;
+    font-size: 50px;
+    border: 1px solid black;
+}
+</style>
+</head>
+<body>
+<p>This tests inserting a character after the collapsed space at the end of a line.<br>
+There should be a space between the last two boxes below, and there should be two boxes on the first line and exactly one box on the second line.</p>
+<div id="editor" contenteditable>a b c</div>
+</body>
+</html>

Copied: tags/Safari-538.10.2/LayoutTests/editing/inserting/inserting-trailing-space-and-letter.html (from rev 161404, trunk/LayoutTests/editing/inserting/inserting-trailing-space-and-letter.html) (0 => 161579)


--- tags/Safari-538.10.2/LayoutTests/editing/inserting/inserting-trailing-space-and-letter.html	                        (rev 0)
+++ tags/Safari-538.10.2/LayoutTests/editing/inserting/inserting-trailing-space-and-letter.html	2014-01-09 21:26:54 UTC (rev 161579)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#editor {
+    width: 160px;
+    height: 100px;
+    font-family: Ahem;
+    font-size: 50px;
+    border: 1px solid black;
+}
+</style>
+</head>
+<body>
+<p>This tests inserting a character after the collapsed space at the end of a line.<br>
+There should be a space between the last two boxes below, and there should be two boxes on the first line and exactly one box on the second line.</p>
+<div id="editor" contenteditable>a b</div>
+<script>
+
+var editor = document.getElementById('editor');
+editor.focus();
+getSelection().collapse(editor.firstChild, 3);
+
+document.execCommand('insertText', false, ' ');
+document.execCommand('insertText', false, 'c');
+
+editor.blur();
+
+</script>
+</body>
+</html>

Modified: tags/Safari-538.10.2/LayoutTests/platform/mac/editing/selection/after-line-wrap-expected.txt (161578 => 161579)


--- tags/Safari-538.10.2/LayoutTests/platform/mac/editing/selection/after-line-wrap-expected.txt	2014-01-09 21:23:30 UTC (rev 161578)
+++ tags/Safari-538.10.2/LayoutTests/platform/mac/editing/selection/after-line-wrap-expected.txt	2014-01-09 21:26:54 UTC (rev 161579)
@@ -29,9 +29,9 @@
           text run at (0,18) width 285: "after a line wrap can be selected successfully."
       RenderBlock {P} at (0,104) size 784x0
       RenderBlock {DIV} at (16,104) size 752x38 [border: (1px solid #000000)]
-        RenderText {#text} at (1,1) size 749x18
+        RenderText {#text} at (1,1) size 750x18
           text run at (1,1) width 93: "don't select me"
-          text run at (94,1) width 656: "                                                                                                                                                                    "
+          text run at (94,1) width 657: "                                                                                                                                                                                                                                                                                                                                                             "
         RenderInline {I} at (0,0) size 150x18
           RenderText {#text} at (1,19) size 150x18
             text run at (1,19) width 150: "try to select just this text"

Modified: tags/Safari-538.10.2/Source/WebCore/ChangeLog (161578 => 161579)


--- tags/Safari-538.10.2/Source/WebCore/ChangeLog	2014-01-09 21:23:30 UTC (rev 161578)
+++ tags/Safari-538.10.2/Source/WebCore/ChangeLog	2014-01-09 21:26:54 UTC (rev 161579)
@@ -1,3 +1,27 @@
+2014-01-09  Lucas Forschler  <[email protected]>
+
+        Merge r161404
+
+    2014-01-06  Ryosuke Niwa  <[email protected]>
+
+            REGRESSION(r157851): trailing space inside an editable region could be erroneously collapsed
+            https://bugs.webkit.org/show_bug.cgi?id=126549
+
+            Reviewed by Sam Weinig.
+
+            The regression was caused by erroneous use of m_currentCharacterIsSpace in place of m_currentCharacterIsWS.
+
+            See the following two lines before the refactoring:
+            http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp?rev=157850#L3074
+            http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp?rev=157850#L3198
+
+            I've also cross-checked other places where m_currentCharacterIsSpace and m_currentCharacterIsWS are used.
+
+            Test: editing/inserting/inserting-trailing-space-and-letter.html
+
+            * rendering/line/BreakingContextInlineHeaders.h:
+            (WebCore::BreakingContext::handleText):
+
 2013-12-19  Anders Carlsson  <[email protected]>
 
         Begin stubbing out the KeyedDecoder class

Modified: tags/Safari-538.10.2/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h (161578 => 161579)


--- tags/Safari-538.10.2/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h	2014-01-09 21:23:30 UTC (rev 161578)
+++ tags/Safari-538.10.2/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h	2014-01-09 21:26:54 UTC (rev 161579)
@@ -799,7 +799,7 @@
                 // If we break only after white-space, consider the current character
                 // as candidate width for this line.
                 bool lineWasTooWide = false;
-                if (m_width.fitsOnLine() && m_currentCharacterIsSpace && m_currentStyle->breakOnlyAfterWhiteSpace() && !midWordBreak) {
+                if (m_width.fitsOnLine() && m_currentCharacterIsWS && m_currentStyle->breakOnlyAfterWhiteSpace() && !midWordBreak) {
                     float charWidth = textWidth(renderText, m_current.m_pos, 1, font, m_width.currentWidth(), isFixedPitch, m_collapseWhiteSpace, wordMeasurement.fallbackFonts, textLayout) + (applyWordSpacing ? wordSpacing : 0);
                     // Check if line is too big even without the extra space
                     // at the end of the line. If it is not, do nothing.
@@ -927,7 +927,7 @@
             }
         }
 
-        if (!m_currentCharacterIsSpace && previousCharacterIsWS) {
+        if (!m_currentCharacterIsWS && previousCharacterIsWS) {
             if (m_autoWrap && m_currentStyle->breakOnlyAfterWhiteSpace())
                 m_lineBreak.moveTo(m_current.renderer(), m_current.m_pos, m_current.nextBreakablePosition());
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to