Title: [148335] branches/safari-536.30-branch/Source/WebCore
Revision
148335
Author
lforsch...@apple.com
Date
2013-04-12 19:00:23 -0700 (Fri, 12 Apr 2013)

Log Message

Merged r129814.  <rdar://problem/13334978>

Modified Paths

Diff

Modified: branches/safari-536.30-branch/Source/WebCore/ChangeLog (148334 => 148335)


--- branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-04-13 01:52:13 UTC (rev 148334)
+++ branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-04-13 02:00:23 UTC (rev 148335)
@@ -1,3 +1,28 @@
+2013-04-12  Lucas Forschler  <lforsch...@apple.com>
+
+        Merge r129814
+
+    2012-09-27  Levi Weintraub  <le...@chromium.org>
+
+            REGRESSION(r129186): Pressing enter at the end of a line deletes the line
+            https://bugs.webkit.org/show_bug.cgi?id=97763
+
+            Reviewed by Ryosuke Niwa.
+
+            r129186 exposed incorrect behavior in RenderText whereby RenderText's lines were
+            dirtied but the renderer wasn't marked for layout. Rich text editing in GMail exposed
+            this behavior. RenderText::setTextWithOffset is called with a text string identical
+            to the current text. It still dirties lines, then calls setText, which has a check
+            for the case when the strings are the same and returns early and doesn't mark us as
+            needing layout.
+
+            This change adds the same early bailing logic in setText to setTextWithOffset, but
+            forces setText to work its magic whenever we dirty lines there (and avoid double-
+            checking that the strings are equal).
+
+            * rendering/RenderText.cpp:
+            (WebCore::RenderText::setTextWithOffset):
+
 2013-04-12  Roger Fong  <roger_f...@apple.com>
 
         Merge r143565.

Modified: branches/safari-536.30-branch/Source/WebCore/rendering/RenderText.cpp (148334 => 148335)


--- branches/safari-536.30-branch/Source/WebCore/rendering/RenderText.cpp	2013-04-13 01:52:13 UTC (rev 148334)
+++ branches/safari-536.30-branch/Source/WebCore/rendering/RenderText.cpp	2013-04-13 02:00:23 UTC (rev 148335)
@@ -1173,6 +1173,9 @@
 
 void RenderText::setTextWithOffset(PassRefPtr<StringImpl> text, unsigned offset, unsigned len, bool force)
 {
+    if (!force && equal(m_text.impl(), text.get()))
+        return;
+
     unsigned oldLen = textLength();
     unsigned newLen = text->length();
     int delta = newLen - oldLen;
@@ -1245,7 +1248,7 @@
     }
 
     m_linesDirty = dirtiedLines;
-    setText(text, force);
+    setText(text, force || dirtiedLines);
 }
 
 void RenderText::transformText()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to