Reviewed by Darin Adler.

        <rdar://problem/5694920> Typing (esp. deleting) is slower due to TOT WebCore changes

        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::initializeStartEnd): The common case here
        is where there are no special elements.  Avoid creating VisiblePositions in
        that case.  Additionally, this change postpones the more expensive creation
        of an upstream VisiblePosition until the last possible moment.
        (WebCore::DeleteSelectionCommand::saveTypingStyleState):
        (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Add an 
        early return for a common case: deleting characters that are all inside the 
        same text node. In that case the style at the start of the selection will 
        not change during the delete, so there is no need to save/recompute it.
        (WebCore::DeleteSelectionCommand::saveFullySelectedAnchor): Early return
        before VisiblePosition creation if the ends of the selection aren't enclosed
        by an anchor.
        * editing/TypingCommand.cpp:
        (WebCore::TypingCommand::markMisspellingsAfterTyping): Early return if spell
        checking isn't enabled.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/editing/TypingCommand.cpp b/WebCore/editing/TypingCommand.cpp
index f480c07..2c0518e 100644
--- a/WebCore/editing/TypingCommand.cpp
+++ b/WebCore/editing/TypingCommand.cpp
@@ -280,6 +280,8 @@
 
 void TypingCommand::markMisspellingsAfterTyping()
 {
+    if (!document()->frame()->editor()->isContinuousSpellCheckingEnabled())
+        return;
     // Take a look at the selection that results after typing and determine whether we need to spellcheck. 
     // Since the word containing the current selection is never marked, this does a check to
     // see if typing made a new word that is not in the current selection. Basically, you