From afe0d512fa452ba960804654278977f31408a0c0 Mon Sep 17 00:00:00 2001 From: "jpu@apple.com" Date: Tue, 26 Jun 2012 18:38:56 +0000 Subject: [PATCH] On Mac, autocorrection sometimes fails to take place in Safari. https://bugs.webkit.org/show_bug.cgi?id=89982 Reviewed by Darin Adler. Existing test was turned off due to intermittent failure, which is caused by autocorrection result depending on user data that may be altered by previous test runs. Hopefully we can turn the test back on once we have a way to make autocorrection behave consistently. Basically we should check the value of shouldCheckForCorrection, not shouldShowCorrectionPanel, to determine if we should early return in markAndReplaceFor(). * editing/Editor.cpp: (WebCore::Editor::markAndReplaceFor): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121271 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 17 +++++++++++++++++ Source/WebCore/editing/Editor.cpp | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 6bfd3ae..41c288a 100755 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,20 @@ +2012-06-26 Jia Pu + + On Mac, autocorrection sometimes fails to take place in Safari. + https://bugs.webkit.org/show_bug.cgi?id=89982 + + Reviewed by Darin Adler. + + Existing test was turned off due to intermittent failure, which is caused by autocorrection result depending on user data + that may be altered by previous test runs. Hopefully we can turn the test back on once we have a way to make autocorrection + behave consistently. + + Basically we should check the value of shouldCheckForCorrection, not shouldShowCorrectionPanel, to determine if we should + early return in markAndReplaceFor(). + + * editing/Editor.cpp: + (WebCore::Editor::markAndReplaceFor): + 2012-06-26 Joe Thomas Do early-return when author and user styles are disabled. diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp index 85cab13..44e6a0d 100644 --- a/Source/WebCore/editing/Editor.cpp +++ b/Source/WebCore/editing/Editor.cpp @@ -2085,7 +2085,7 @@ void Editor::markAndReplaceFor(PassRefPtr request, const Vect if (result->type == TextCheckingTypeLink && selectionOffset > resultLocation + resultLength + 1) continue; - if (!(shouldPerformReplacement || shouldShowCorrectionPanel || shouldMarkLink) || !doReplacement) + if (!(shouldPerformReplacement || shouldCheckForCorrection || shouldMarkLink) || !doReplacement) continue; String replacedString = plainText(rangeToReplace.get()); -- 2.7.4