Diff
Modified: tags/Safari-602.1.13.2/Source/WebCore/ChangeLog (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebCore/ChangeLog 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebCore/ChangeLog 2015-12-09 01:56:59 UTC (rev 193799)
@@ -1,5 +1,9 @@
2015-12-08 Babak Shafiei <bshaf...@apple.com>
+ Roll out r193645.
+
+2015-12-08 Babak Shafiei <bshaf...@apple.com>
+
Merge r193645.
2015-12-07 Beth Dakin <bda...@apple.com>
Modified: tags/Safari-602.1.13.2/Source/WebCore/WebCore.xcodeproj/project.pbxproj (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2015-12-09 01:56:59 UTC (rev 193799)
@@ -3571,7 +3571,6 @@
933A14AA0B7D1D0900A53FFD /* DOMTextEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 933A14A90B7D1D0900A53FFD /* DOMTextEvent.mm */; };
933A14B80B7D1D5200A53FFD /* JSTextEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 933A14B60B7D1D5200A53FFD /* JSTextEvent.cpp */; };
933A14B90B7D1D5200A53FFD /* JSTextEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 933A14B70B7D1D5200A53FFD /* JSTextEvent.h */; };
- 933C7A751C0FBC440034FB97 /* NSSpellCheckerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 933C7A741C0FBC440034FB97 /* NSSpellCheckerSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
9343CB8112F25E510033C5EE /* TextCodecUTF8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9343CB7F12F25E510033C5EE /* TextCodecUTF8.cpp */; };
9343CB8212F25E510033C5EE /* TextCodecUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 9343CB8012F25E510033C5EE /* TextCodecUTF8.h */; };
93442C9E0D2B335C00338FF9 /* HTMLTableRowsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93442C9D0D2B335C00338FF9 /* HTMLTableRowsCollection.h */; };
@@ -11096,7 +11095,6 @@
933A14A90B7D1D0900A53FFD /* DOMTextEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMTextEvent.mm; sourceTree = "<group>"; };
933A14B60B7D1D5200A53FFD /* JSTextEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextEvent.cpp; sourceTree = "<group>"; };
933A14B70B7D1D5200A53FFD /* JSTextEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTextEvent.h; sourceTree = "<group>"; };
- 933C7A741C0FBC440034FB97 /* NSSpellCheckerSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSSpellCheckerSPI.h; sourceTree = "<group>"; };
9343CB7F12F25E510033C5EE /* TextCodecUTF8.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextCodecUTF8.cpp; sourceTree = "<group>"; };
9343CB8012F25E510033C5EE /* TextCodecUTF8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCodecUTF8.h; sourceTree = "<group>"; };
93442C9D0D2B335C00338FF9 /* HTMLTableRowsCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTableRowsCollection.h; sourceTree = "<group>"; };
@@ -18739,7 +18737,6 @@
F40EA8AA1B867D6500CE5581 /* NSScrollingInputFilterSPI.h */,
2DCB837719F99BBA00A7FBE4 /* NSSharingServicePickerSPI.h */,
2DCB837819F99BBA00A7FBE4 /* NSSharingServiceSPI.h */,
- 933C7A741C0FBC440034FB97 /* NSSpellCheckerSPI.h */,
2D77AC281BF2B9860072470A /* NSTextFinderSPI.h */,
2D77AC2C1BF2B9A00072470A /* NSViewSPI.h */,
2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */,
@@ -27759,7 +27756,6 @@
83C1D430178D5AB500141E68 /* SVGPathSegLinetoHorizontalAbs.h in Headers */,
83C1D431178D5AB500141E68 /* SVGPathSegLinetoHorizontalRel.h in Headers */,
83C1D432178D5AB500141E68 /* SVGPathSegLinetoRel.h in Headers */,
- 933C7A751C0FBC440034FB97 /* NSSpellCheckerSPI.h in Headers */,
B2227A7D0D00BF220071B782 /* SVGPathSegLinetoVertical.h in Headers */,
83C1D433178D5AB500141E68 /* SVGPathSegLinetoVerticalAbs.h in Headers */,
83C1D434178D5AB500141E68 /* SVGPathSegLinetoVerticalRel.h in Headers */,
Modified: tags/Safari-602.1.13.2/Source/WebCore/editing/Editor.cpp (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebCore/editing/Editor.cpp 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebCore/editing/Editor.cpp 2015-12-09 01:56:59 UTC (rev 193799)
@@ -3264,11 +3264,6 @@
if (client())
client()->respondToChangedSelection(&m_frame);
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
- if (client() && canEdit())
- client()->requestCandidatesForSelection(m_frame.selection().selection());
-#endif
-
#if ENABLE(TELEPHONE_NUMBER_DETECTION) && !PLATFORM(IOS)
if (shouldDetectTelephoneNumbers())
m_telephoneNumberDetectionUpdateTimer.startOneShot(0);
Modified: tags/Safari-602.1.13.2/Source/WebCore/loader/EmptyClients.h (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebCore/loader/EmptyClients.h 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebCore/loader/EmptyClients.h 2015-12-09 01:56:59 UTC (rev 193799)
@@ -537,10 +537,6 @@
virtual void willSetInputMethodState() override { }
virtual void setInputMethodState(bool) override { }
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
- virtual void requestCandidatesForSelection(const VisibleSelection&) override { }
-#endif
-
private:
EmptyTextCheckerClient m_textCheckerClient;
};
Modified: tags/Safari-602.1.13.2/Source/WebCore/page/EditorClient.h (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebCore/page/EditorClient.h 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebCore/page/EditorClient.h 2015-12-09 01:56:59 UTC (rev 193799)
@@ -186,10 +186,6 @@
// Support for global selections, used on platforms like the X Window System that treat
// selection as a type of clipboard.
virtual bool supportsGlobalSelection() { return false; }
-
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
- virtual void requestCandidatesForSelection(const VisibleSelection&) = 0;
-#endif
};
}
Deleted: tags/Safari-602.1.13.2/Source/WebCore/platform/spi/mac/NSSpellCheckerSPI.h (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebCore/platform/spi/mac/NSSpellCheckerSPI.h 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebCore/platform/spi/mac/NSSpellCheckerSPI.h 2015-12-09 01:56:59 UTC (rev 193799)
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef NSSpellCheckerSPI_h
-#define NSSpellCheckerSPI_h
-
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
-
-// FIXME: This header should include system headers when possible.
-
-@interface NSSpellChecker ()
-- (NSInteger)requestCandidatesForSelectedRange:(NSRange)selectedRange inString:(NSString *)stringToCheck types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary<NSString *, id> *)options inSpellDocumentWithTag:(NSInteger)tag completionHandler:(void (^)(NSInteger sequenceNumber, NSArray<NSTextCheckingResult *> *candidates))completionHandler;
-- (void)showCandidates:(NSArray<NSTextCheckingResult *> *)candidates forString:(NSString *)string inRect:(NSRect)rectOfTypedString view:(NSView *)view completionHandler:(void (^)(NSTextCheckingResult *acceptedCandidate))completionBlock;
-@end
-
-#endif // PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 102000
-
-#endif // NSSpellCheckerSPI_h
Modified: tags/Safari-602.1.13.2/Source/WebKit/mac/ChangeLog (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebKit/mac/ChangeLog 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebKit/mac/ChangeLog 2015-12-09 01:56:59 UTC (rev 193799)
@@ -1,5 +1,9 @@
2015-12-08 Babak Shafiei <bshaf...@apple.com>
+ Roll out r193645.
+
+2015-12-08 Babak Shafiei <bshaf...@apple.com>
+
Merge r193645.
2015-12-07 Beth Dakin <bda...@apple.com>
Modified: tags/Safari-602.1.13.2/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h 2015-12-09 01:56:59 UTC (rev 193799)
@@ -29,11 +29,9 @@
#import <WebCore/EditorClient.h>
#import <WebCore/TextCheckerClient.h>
-#import <WebCore/VisibleSelection.h>
#import <wtf/Forward.h>
#import <wtf/RetainPtr.h>
#import <wtf/Vector.h>
-#import <wtf/WeakPtr.h>
#import <wtf/text/StringView.h>
#if PLATFORM(IOS)
@@ -169,12 +167,6 @@
virtual void setInputMethodState(bool enabled) override;
virtual void requestCheckingOfString(PassRefPtr<WebCore::TextCheckingRequest>) override;
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
- virtual void requestCandidatesForSelection(const WebCore::VisibleSelection&) override;
- void handleRequestedCandidates(NSInteger, NSArray<NSTextCheckingResult *> *);
- void handleAcceptedCandidate(NSTextCheckingResult *);
-#endif
-
void registerUndoOrRedoStep(PassRefPtr<WebCore::UndoStep>, bool isRedo);
WebView *m_webView;
@@ -185,10 +177,6 @@
bool m_delayingContentChangeNotifications;
bool m_hasDelayedContentChangeNotification;
#endif
-
- WebCore::VisibleSelection m_lastSelectionForRequestedCandidates;
-
- WeakPtrFactory<WebEditorClient> m_weakPtrFactory;
};
#if PLATFORM(COCOA)
Modified: tags/Safari-602.1.13.2/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm 2015-12-09 01:56:59 UTC (rev 193799)
@@ -54,25 +54,18 @@
#import <WebCore/ArchiveResource.h>
#import <WebCore/Document.h>
#import <WebCore/DocumentFragment.h>
-#import <WebCore/Editor.h>
-#import <WebCore/FloatQuad.h>
-#import <WebCore/Frame.h>
-#import <WebCore/FrameView.h>
#import <WebCore/HTMLInputElement.h>
#import <WebCore/HTMLNames.h>
#import <WebCore/HTMLTextAreaElement.h>
#import <WebCore/KeyboardEvent.h>
#import <WebCore/LegacyWebArchive.h>
-#import <WebCore/NSSpellCheckerSPI.h>
#import <WebCore/Page.h>
#import <WebCore/PlatformKeyboardEvent.h>
#import <WebCore/Settings.h>
#import <WebCore/SpellChecker.h>
#import <WebCore/StyleProperties.h>
-#import <WebCore/TextIterator.h>
#import <WebCore/UndoStep.h>
#import <WebCore/UserTypingGestureIndicator.h>
-#import <WebCore/VisibleUnits.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <runtime/InitializeThreading.h>
#import <wtf/MainThread.h>
@@ -202,7 +195,6 @@
, m_delayingContentChangeNotifications(0)
, m_hasDelayedContentChangeNotification(0)
#endif
- , m_weakPtrFactory(this)
{
}
@@ -1119,114 +1111,6 @@
{
}
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
-void WebEditorClient::requestCandidatesForSelection(const VisibleSelection& selection)
-{
- RefPtr<Range> selectedRange = selection.toNormalizedRange();
- if (!selectedRange)
- return;
-
- m_lastSelectionForRequestedCandidates = selection;
-
- VisiblePosition selectionStart = selection.visibleStart();
- VisiblePosition selectionEnd = selection.visibleEnd();
-
- // Use the surrounding paragraphs of text as context.
- VisiblePosition paragraphStart = startOfParagraph(selectionStart);
- VisiblePosition paragraphEnd = endOfParagraph(selectionEnd);
-
- int lengthToSelectionStart = TextIterator::rangeLength(makeRange(paragraphStart, selectionStart).get());
- int lengthToSelectionEnd = TextIterator::rangeLength(makeRange(paragraphStart, selectionEnd).get());
- NSRange rangeForCandidates = NSMakeRange(lengthToSelectionStart, lengthToSelectionEnd - lengthToSelectionStart);
-
- String fullPlainTextStringOfParagraph = plainText(makeRange(paragraphStart, paragraphEnd).get());
-
- NSTextCheckingTypes checkingTypes = NSTextCheckingTypeSpelling | NSTextCheckingTypeReplacement | NSTextCheckingTypeCorrection;
- auto weakEditor = m_weakPtrFactory.createWeakPtr();
- [[NSSpellChecker sharedSpellChecker] requestCandidatesForSelectedRange:rangeForCandidates inString:fullPlainTextStringOfParagraph types:checkingTypes options:nil inSpellDocumentWithTag:spellCheckerDocumentTag() completionHandler:[weakEditor](NSInteger sequenceNumber, NSArray<NSTextCheckingResult *> *candidates) {
- dispatch_async(dispatch_get_main_queue(), ^{
- if (!weakEditor)
- return;
- weakEditor->handleRequestedCandidates(sequenceNumber, candidates);
- });
- }];
-}
-
-static RefPtr<Range> candidateRangeForSelection(const VisibleSelection& selection, Frame* frame)
-{
- return selection.isCaret() ? wordRangeFromPosition(selection.start()) : frame->selection().toNormalizedRange();
-}
-
-static bool candidateWouldReplaceText(const VisibleSelection& selection)
-{
- // If the character behind the caret in the current selection is anything but a space or a newline then we should
- // replace the whole current word with the candidate.
- UChar32 characterAfterSelection, characterBeforeSelection, twoCharacterBeforeSelection = 0;
- charactersAroundPosition(selection.visibleStart(), characterAfterSelection, characterBeforeSelection, twoCharacterBeforeSelection);
- return !(characterBeforeSelection == '\0' || characterBeforeSelection == '\n' || characterBeforeSelection == ' ');
-}
-
-void WebEditorClient::handleRequestedCandidates(NSInteger sequenceNumber, NSArray<NSTextCheckingResult *> *candidates)
-{
- Frame* frame = core([m_webView _selectedOrMainFrame]);
- if (!frame)
- return;
-
- const VisibleSelection& selection = frame->selection().selection();
- if (selection != m_lastSelectionForRequestedCandidates)
- return;
-
- RefPtr<Range> rangeForCurrentlyTypedString = candidateRangeForSelection(selection, frame);
- NSString *currentlyTypedString;
- if (rangeForCurrentlyTypedString && candidateWouldReplaceText(selection))
- currentlyTypedString = plainText(rangeForCurrentlyTypedString.get());
- else
- currentlyTypedString = @"";
-
- RefPtr<Range> selectedRange = frame->selection().selection().toNormalizedRange();
- if (!selectedRange)
- return;
-
- IntRect rectForSelectionCandidates;
- Vector<FloatQuad> quads;
- selectedRange->absoluteTextQuads(quads);
- if (!quads.isEmpty())
- rectForSelectionCandidates = frame->view()->contentsToWindow(quads[0].enclosingBoundingBox());
-
- auto weakEditor = m_weakPtrFactory.createWeakPtr();
- [[NSSpellChecker sharedSpellChecker] showCandidates:candidates forString:currentlyTypedString inRect:rectForSelectionCandidates view:m_webView completionHandler:[weakEditor](NSTextCheckingResult *acceptedCandidate) {
- dispatch_async(dispatch_get_main_queue(), ^{
- if (!weakEditor)
- return;
- weakEditor->handleAcceptedCandidate(acceptedCandidate);
- });
- }];
-
-}
-
-void WebEditorClient::handleAcceptedCandidate(NSTextCheckingResult *acceptedCandidate)
-{
- Frame* frame = core([m_webView _selectedOrMainFrame]);
- if (!frame)
- return;
-
- const VisibleSelection& selection = frame->selection().selection();
- if (selection != m_lastSelectionForRequestedCandidates)
- return;
-
- RefPtr<Range> candidateRange = candidateRangeForSelection(selection, frame);
-
- frame->editor().setIgnoreCompositionSelectionChange(true);
-
- if (candidateWouldReplaceText(selection))
- frame->selection().setSelectedRange(candidateRange.get(), UPSTREAM, true);
-
- frame->editor().insertText(acceptedCandidate.replacementString, 0);
- frame->editor().insertText(String(" "), 0);
- frame->editor().setIgnoreCompositionSelectionChange(false);
-}
-#endif // PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
-
#if !PLATFORM(IOS)
@interface WebEditorSpellCheckResponder : NSObject
{
Modified: tags/Safari-602.1.13.2/Source/WebKit2/ChangeLog (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebKit2/ChangeLog 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebKit2/ChangeLog 2015-12-09 01:56:59 UTC (rev 193799)
@@ -1,5 +1,9 @@
2015-12-08 Babak Shafiei <bshaf...@apple.com>
+ Roll out r193645.
+
+2015-12-08 Babak Shafiei <bshaf...@apple.com>
+
Merge r193645.
2015-12-07 Beth Dakin <bda...@apple.com>
Modified: tags/Safari-602.1.13.2/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h (193798 => 193799)
--- tags/Safari-602.1.13.2/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h 2015-12-09 01:18:29 UTC (rev 193798)
+++ tags/Safari-602.1.13.2/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h 2015-12-09 01:56:59 UTC (rev 193799)
@@ -149,11 +149,6 @@
virtual void willSetInputMethodState() override;
virtual void setInputMethodState(bool enabled) override;
virtual void requestCheckingOfString(WTF::PassRefPtr<WebCore::TextCheckingRequest>) override;
-
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
- virtual void requestCandidatesForSelection(const WebCore::VisibleSelection&) override { }
-#endif
-
#if PLATFORM(GTK)
virtual bool shouldShowUnicodeMenu() override;
#endif