[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

enrica at apple.com enrica at apple.com
Wed Dec 22 15:32:06 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 4f53e9fa47e36e35d410b993bef5aee2ff4976ee
Author: enrica at apple.com <enrica at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Nov 6 00:14:52 2010 +0000

    Pasting large amounts of plain text in a text area is very slow
    https://bugs.webkit.org/show_bug.cgi?id=49040
    <rdar://problem/7640912>
    
    Reviewed by Adele Peterson.
    
    The optimization consists in skipping the ApplyStyle command when
    pasting into a text area or into an element that has -webkit-user-modify: read-write-plaintext-only.
    The biggest performance hit comes from iterating through
    a large number of paragraph when no style change is needed.
    A further step will be to improve the paragraph iteration when it
    can't be avoided.
    
    * editing/ReplaceSelectionCommand.cpp:
    (WebCore::ReplaceSelectionCommand::doApply): Check if the selection
    is in a text form control or in an element that has -webkit-user-modify: read-write-plaintext-only
    and force no style matching.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71459 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 535fd45..bb9b0f7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-11-04  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Pasting large amounts of plain text in a text area is very slow
+        https://bugs.webkit.org/show_bug.cgi?id=49040
+        <rdar://problem/7640912>
+        
+        The optimization consists in skipping the ApplyStyle command when
+        pasting into a text area or into an element that has -webkit-user-modify: read-write-plaintext-only.
+        The biggest performance hit comes from iterating through
+        a large number of paragraph when no style change is needed.
+        A further step will be to improve the paragraph iteration when it
+        can't be avoided.
+        
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::doApply): Check if the selection
+        is in a text form control or in an element that has -webkit-user-modify: read-write-plaintext-only
+        and force no style matching.
+
 2010-11-05  Ryosuke Niwa  <rniwa at webkit.org>
 
         Reviewed by David Levin.
diff --git a/WebCore/editing/ReplaceSelectionCommand.cpp b/WebCore/editing/ReplaceSelectionCommand.cpp
index 53ab70f..c9f7aa7 100644
--- a/WebCore/editing/ReplaceSelectionCommand.cpp
+++ b/WebCore/editing/ReplaceSelectionCommand.cpp
@@ -799,6 +799,11 @@ void ReplaceSelectionCommand::doApply()
     if (performTrivialReplace(fragment))
         return;
     
+    // We can skip matching the style if the selection is plain text.
+    if ((selection.start().node()->renderer() && selection.start().node()->renderer()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY) &&
+        (selection.end().node()->renderer() && selection.end().node()->renderer()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY))
+        m_matchStyle = false;
+    
     if (m_matchStyle)
         m_insertionStyle = ApplyStyleCommand::editingStyleAtPosition(selection.start(), IncludeTypingStyle);
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list