Move TextIndicator{Window} to WebCore
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Nov 2014 20:18:29 +0000 (20:18 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Nov 2014 20:18:29 +0000 (20:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138954
<rdar://problem/18992185>

Some adjustments by Csaba Osztrogonác.
Reviewed by Anders Carlsson.

Move TextIndicator and TextIndicatorWindow to WebCore so that both
WebKits can share the implementation.

* CMakeLists.txt:
Remove TextIndicator.cpp.

* Scripts/webkit/messages.py:
(struct_or_class):
(headers_for_type):
Tell messages.py that TextIndicatorData is a struct, and comes from TextIndicator.h.

* Shared/WebCoreArgumentCoders.h:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
Add argument coders for TextIndicatorData.

* Shared/DictionaryPopupInfo.h:
* Shared/mac/ActionMenuHitTestResult.h:
* Shared/mac/ActionMenuHitTestResult.mm:
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/PageClientImpl.cpp:
* UIProcess/API/mac/WKView.mm:
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/CoordinatedGraphics/WebView.h:
* UIProcess/CoordinatedGraphics/WebView.cpp:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/WKContentView.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
* UIProcess/mac/WKActionMenuController.mm:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
* WebProcess/WebPage/mac/WebPageMac.mm:
Adjust to TextIndicator and TextIndicatorWindow's new home.

* CMakeLists.txt:
Build TextIndicator.

* WebCore.exp.in:
Export TextIndicator{Window} symbols for the WebKits.

* WebCore.xcodeproj/project.pbxproj:
* page/TextIndicator.cpp: Renamed from Source/WebKit2/Shared/TextIndicator.cpp.
* page/TextIndicator.h: Renamed from Source/WebKit2/Shared/TextIndicator.h.
Straighforward move of TextIndicator from WebKit2, except:

Move TextIndicator::Data and TextIndicator::PresentationTransition out directly
into the WebCore namespace to allow for implementation of WebKit2 argument coders.

Use Image instead of ShareableBitmap internally.

Move the TextIndicatorData encode/decode to WebCoreArgumentCoders.

* page/mac/TextIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h.
* page/mac/TextIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm.
Straighforward move of TextIndicatorWindow from WebKit2.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176462 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/TextIndicator.cpp [moved from Source/WebKit2/Shared/TextIndicator.cpp with 59% similarity]
Source/WebCore/page/TextIndicator.h [moved from Source/WebKit2/Shared/TextIndicator.h with 51% similarity]
Source/WebCore/page/mac/TextIndicatorWindow.h [moved from Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h with 91% similarity]
Source/WebCore/page/mac/TextIndicatorWindow.mm [moved from Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm with 90% similarity]
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/Scripts/webkit/messages.py
Source/WebKit2/Shared/DictionaryPopupInfo.h
Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
Source/WebKit2/Shared/WebCoreArgumentCoders.h
Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h
Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/ios/WKContentView.h
Source/WebKit2/UIProcess/mac/PageClientImpl.h
Source/WebKit2/UIProcess/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm
Source/WebKit2/WebProcess/WebPage/FindController.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

index 796043f8afbe72f80170e4fe810f0ef02ec21f03..e0563a48d887a864a908f59e52f4a0adc353472d 100644 (file)
@@ -1934,6 +1934,7 @@ set(WebCore_SOURCES
     page/Settings.cpp
     page/SpatialNavigation.cpp
     page/SuspendableTimer.cpp
+    page/TextIndicator.cpp
     page/UserContentController.cpp
     page/UserContentURLPattern.cpp
     page/VisitedLinkStore.cpp
index 513ab8eae8c270e122515fe0df7d9038a8a4d37b..1d8048408bd41cf301b2ca1fd98e3ed304df6ce9 100644 (file)
@@ -1,3 +1,37 @@
+2014-11-21  Tim Horton  <timothy_horton@apple.com>
+
+        Move TextIndicator{Window} to WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=138954
+        <rdar://problem/18992185>
+
+        Some adjustments by Csaba Osztrogonác.
+        Reviewed by Anders Carlsson.
+
+        Move TextIndicator and TextIndicatorWindow to WebCore so that both
+        WebKits can share the implementation.
+
+        * CMakeLists.txt:
+        Build TextIndicator.
+
+        * WebCore.exp.in:
+        Export TextIndicator{Window} symbols for the WebKits.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/TextIndicator.cpp: Renamed from Source/WebKit2/Shared/TextIndicator.cpp.
+        * page/TextIndicator.h: Renamed from Source/WebKit2/Shared/TextIndicator.h.
+        Straighforward move of TextIndicator from WebKit2, except:
+
+        Move TextIndicator::Data and TextIndicator::PresentationTransition out directly
+        into the WebCore namespace to allow for implementation of WebKit2 argument coders.
+
+        Use Image instead of ShareableBitmap internally.
+
+        Move the TextIndicatorData encode/decode to WebCoreArgumentCoders.
+        
+        * page/mac/TextIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h.
+        * page/mac/TextIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm.
+        Straighforward move of TextIndicatorWindow from WebKit2.
+
 2014-11-21  Anders Carlsson  <andersca@apple.com>
 
         Remove the Timer parameters from timer callbacks
index b793cee52e50d821e8647ff1013b4d8052b9bb37..4ef96374120198c82c81ebfeff69ef4f02ddb154 100644 (file)
@@ -2295,6 +2295,10 @@ __ZN7WebCore12EventHandler7mouseUpEP7NSEvent
 __ZN7WebCore12EventHandler8keyEventEP7NSEvent
 __ZN7WebCore12EventHandler9mouseDownEP7NSEvent
 __ZN7WebCore13DataDetection29detectItemAroundHitTestResultERKNS_13HitTestResultERNS_9FloatRectERN3WTF6RefPtrINS_5RangeEEE
+__ZN7WebCore13TextIndicator15createWithRangeERKNS_5RangeENS_35TextIndicatorPresentationTransitionE
+__ZN7WebCore13TextIndicator26createWithSelectionInFrameERNS_5FrameENS_35TextIndicatorPresentationTransitionE
+__ZN7WebCore13TextIndicator6createERKNS_17TextIndicatorDataE
+__ZN7WebCore13TextIndicatorD1Ev
 __ZN7WebCore13getRawCookiesERKNS_21NetworkStorageSessionERKNS_3URLES5_RN3WTF6VectorINS_6CookieELj0ENS6_15CrashOnOverflowEEE
 __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
 __ZN7WebCore14cookiesEnabledERKNS_21NetworkStorageSessionERKNS_3URLES5_
@@ -2309,6 +2313,9 @@ __ZN7WebCore17ScrollbarThemeMac23setUpOverhangAreaShadowEP7CALayer
 __ZN7WebCore17ScrollbarThemeMac24removeOverhangAreaShadowEP7CALayer
 __ZN7WebCore17ScrollbarThemeMac27setUpOverhangAreaBackgroundEP7CALayerRKNS_5ColorE
 __ZN7WebCore17ScrollbarThemeMac28removeOverhangAreaBackgroundEP7CALayer
+__ZN7WebCore19TextIndicatorWindow16setTextIndicatorEN3WTF10PassRefPtrINS_13TextIndicatorEEEbNSt3__18functionIFvvEEE
+__ZN7WebCore19TextIndicatorWindowC1EP6NSView
+__ZN7WebCore19TextIndicatorWindowD1Ev
 __ZN7WebCore19applicationIsSafariEv
 __ZN7WebCore20PlatformEventFactory24createPlatformMouseEventEP7NSEventP6NSView
 __ZN7WebCore20PlatformEventFactory27createPlatformKeyboardEventEP7NSEvent
index ed4fb431e0500d609daf40cadecab893245cc277..838f80a5e3d6fe230bf1cb29590bfd2f85edd3d8 100644 (file)
                2D481F02146B5C5500AA7834 /* CrossfadeGeneratedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D2FC0551460CD6F00263633 /* CrossfadeGeneratedImage.h */; };
                2D481F03146B5C6500AA7834 /* GradientImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D2FC0561460CD6F00263633 /* GradientImage.cpp */; };
                2D481F04146B5C6B00AA7834 /* GradientImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D2FC0571460CD6F00263633 /* GradientImage.h */; };
+               2D4F96F51A1ECC240098BF88 /* TextIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */; };
+               2D4F96F61A1ECC240098BF88 /* TextIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D4F96F21A1ECC240098BF88 /* TextIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               2D4F96F71A1ECC240098BF88 /* TextIndicatorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D4F96F31A1ECC240098BF88 /* TextIndicatorWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               2D4F96F81A1ECC240098BF88 /* TextIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D4F96F41A1ECC240098BF88 /* TextIndicatorWindow.mm */; };
                2D58D8551A15F65F00A5F726 /* DataDetection.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D58D8531A15F65F00A5F726 /* DataDetection.h */; settings = {ATTRIBUTES = (Private, ); }; };
                2D58D8561A15F65F00A5F726 /* DataDetection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D58D8541A15F65F00A5F726 /* DataDetection.mm */; };
                2D59F1BF1A0044C6001F3D29 /* DataDetectorsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                2D413F601A187A3F0041A521 /* LookupSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LookupSPI.h; sourceTree = "<group>"; };
                2D46F04D17B96FBD005647F0 /* IntPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntPoint.cpp; sourceTree = "<group>"; };
                2D46F04F17B96FD2005647F0 /* IntSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntSize.cpp; sourceTree = "<group>"; };
+               2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextIndicator.cpp; sourceTree = "<group>"; };
+               2D4F96F21A1ECC240098BF88 /* TextIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextIndicator.h; sourceTree = "<group>"; };
+               2D4F96F31A1ECC240098BF88 /* TextIndicatorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextIndicatorWindow.h; sourceTree = "<group>"; };
+               2D4F96F41A1ECC240098BF88 /* TextIndicatorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextIndicatorWindow.mm; sourceTree = "<group>"; };
                2D58D8531A15F65F00A5F726 /* DataDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetection.h; sourceTree = "<group>"; };
                2D58D8541A15F65F00A5F726 /* DataDetection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetection.mm; sourceTree = "<group>"; };
                2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsSPI.h; sourceTree = "<group>"; };
                                626CDE0D1140424C001E5A68 /* SpatialNavigation.h */,
                                62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */,
                                62C1217B11AB9E77003C462C /* SuspendableTimer.h */,
+                               2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */,
+                               2D4F96F21A1ECC240098BF88 /* TextIndicator.h */,
                                1AE79D40188DB61F002239C2 /* UserContentController.cpp */,
                                1AE79D41188DB61F002239C2 /* UserContentController.h */,
                                003F1FE911E6AB43008258D9 /* UserContentTypes.h */,
                                2D93AEE119DF5641002A86C3 /* ServicesOverlayController.h */,
                                2D93AEE219DF5641002A86C3 /* ServicesOverlayController.mm */,
                                E1C2F2481533A2120083F974 /* SettingsMac.mm */,
+                               2D4F96F31A1ECC240098BF88 /* TextIndicatorWindow.h */,
+                               2D4F96F41A1ECC240098BF88 /* TextIndicatorWindow.mm */,
                                26255F0218878E110006E1FD /* UserAgentMac.mm */,
                                F587854C02DE375901EA4122 /* WebCoreFrameView.h */,
                        );
                                BC5EB5DB0E81B7EA00B25965 /* BorderValue.h in Headers */,
                                6ED8C37A183BFF8C009E53BD /* BoxShape.h in Headers */,
                                BCEA4855097D93020094C9E4 /* break_lines.h in Headers */,
+                               2D4F96F61A1ECC240098BF88 /* TextIndicator.h in Headers */,
                                93309DDB099E64920056E581 /* BreakBlockquoteCommand.h in Headers */,
                                599E759011055A1F00D904FA /* Bridge.h in Headers */,
                                59B5977511086579007159E8 /* BridgeJSC.h in Headers */,
                                B8DBDB4E130B0F8A00F5CDB1 /* SpellingCorrectionCommand.h in Headers */,
                                4512502315DCE37D002F84E2 /* SpinButtonElement.h in Headers */,
                                93309E12099E64920056E581 /* SplitElementCommand.h in Headers */,
+                               2D4F96F71A1ECC240098BF88 /* TextIndicatorWindow.h in Headers */,
                                93309E14099E64920056E581 /* SplitTextNodeCommand.h in Headers */,
                                93309E16099E64920056E581 /* SplitTextNodeContainingElementCommand.h in Headers */,
                                84730D931248F0B300D3A9C9 /* SpotLightSource.h in Headers */,
                                85DF2EEE0AA387CB00AD64C5 /* DOMHTMLElement.mm in Sources */,
                                85C050BB0AD84F5E005532E7 /* DOMHTMLEmbedElement.mm in Sources */,
                                85BA4CE00AA6861B0088052D /* DOMHTMLFieldSetElement.mm in Sources */,
+                               2D4F96F81A1ECC240098BF88 /* TextIndicatorWindow.mm in Sources */,
                                85ECBEF00AA7626900544F0B /* DOMHTMLFontElement.mm in Sources */,
                                85DF2C5D0AA341F600AD64C5 /* DOMHTMLFormElement.mm in Sources */,
                                85DF81960AA77E4B00486AD7 /* DOMHTMLFrameElement.mm in Sources */,
                                FE8A674716CDD19E00930BF8 /* SQLStatementBackend.cpp in Sources */,
                                97BC6A4D1505F081001B74AC /* SQLStatementSync.cpp in Sources */,
                                97BC6A4F1505F081001B74AC /* SQLTransaction.cpp in Sources */,
+                               2D4F96F51A1ECC240098BF88 /* TextIndicator.cpp in Sources */,
                                FEE1811316C319E800084849 /* SQLTransactionBackend.cpp in Sources */,
                                FEAD7D8716C339EE00D4670B /* SQLTransactionBackendSync.cpp in Sources */,
                                97BC6A541505F081001B74AC /* SQLTransactionClient.cpp in Sources */,
similarity index 59%
rename from Source/WebKit2/Shared/TextIndicator.cpp
rename to Source/WebCore/page/TextIndicator.cpp
index 32e9230917bcc13c332c8d6d9990ced055ac5f81..2ea6b210953bce2689b84776e5779bc31e2012f6 100644 (file)
 #include "config.h"
 #include "TextIndicator.h"
 
-#if PLATFORM(COCOA)
-#include "ArgumentCodersCF.h"
-#endif
-
-#include "ArgumentDecoder.h"
-#include "ArgumentEncoder.h"
-#include "ShareableBitmap.h"
-#include "WebCoreArgumentCoders.h"
-#include "WebFrame.h"
-#include "WebPage.h"
-#include <WebCore/Document.h>
-#include <WebCore/Frame.h>
-#include <WebCore/FrameSelection.h>
-#include <WebCore/FrameSnapshotting.h>
-#include <WebCore/FrameView.h>
-#include <WebCore/GeometryUtilities.h>
-#include <WebCore/GraphicsContext.h>
-#include <WebCore/ImageBuffer.h>
-#include <WebCore/IntRect.h>
+#include "Document.h"
+#include "Frame.h"
+#include "FrameSelection.h"
+#include "FrameSnapshotting.h"
+#include "FrameView.h"
+#include "GeometryUtilities.h"
+#include "GraphicsContext.h"
+#include "ImageBuffer.h"
+#include "IntRect.h"
+#include "Page.h"
 
 using namespace WebCore;
 
@@ -60,7 +51,7 @@ const float verticalBorder = 1;
 const float dropShadowBlurRadius = 12;
 #endif
 
-namespace WebKit {
+namespace WebCore {
 
 static FloatRect outsetIndicatorRectIncludingShadow(const FloatRect rect)
 {
@@ -94,12 +85,12 @@ static bool textIndicatorsForTextRectsOverlap(const Vector<FloatRect>& textRects
     return false;
 }
 
-PassRefPtr<TextIndicator> TextIndicator::create(const TextIndicator::Data& data)
+PassRefPtr<TextIndicator> TextIndicator::create(const TextIndicatorData& data)
 {
     return adoptRef(new TextIndicator(data));
 }
 
-PassRefPtr<TextIndicator> TextIndicator::createWithRange(const Range& range, PresentationTransition presentationTransition)
+PassRefPtr<TextIndicator> TextIndicator::createWithRange(const Range& range, TextIndicatorPresentationTransition presentationTransition)
 {
     Frame* frame = range.startContainer()->document().frame();
 
@@ -109,7 +100,7 @@ PassRefPtr<TextIndicator> TextIndicator::createWithRange(const Range& range, Pre
     VisibleSelection oldSelection = frame->selection().selection();
     frame->selection().setSelection(&range);
 
-    RefPtr<TextIndicator> indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(*frame), presentationTransition);
+    RefPtr<TextIndicator> indicator = TextIndicator::createWithSelectionInFrame(*frame, presentationTransition);
 
     frame->selection().setSelection(oldSelection);
     
@@ -118,7 +109,7 @@ PassRefPtr<TextIndicator> TextIndicator::createWithRange(const Range& range, Pre
 
 // FIXME (138889): Ideally the FrameSnapshotting functions would be more flexible
 // and we wouldn't have to implement this here.
-static PassRefPtr<ShareableBitmap> snapshotSelectionWithHighlight(Frame& frame)
+static PassRefPtr<Image> snapshotSelectionWithHighlight(Frame& frame)
 {
     auto& selection = frame.selection();
 
@@ -136,36 +127,26 @@ static PassRefPtr<ShareableBitmap> snapshotSelectionWithHighlight(Frame& frame)
     if (!snapshot)
         return nullptr;
 
-    RefPtr<ShareableBitmap> sharedSnapshot = ShareableBitmap::createShareable(snapshot->internalSize(), ShareableBitmap::SupportsAlpha);
-    if (!sharedSnapshot)
-        return nullptr;
-
-    auto graphicsContext = sharedSnapshot->createGraphicsContext();
-    float deviceScaleFactor = frame.page()->deviceScaleFactor();
-    graphicsContext->scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
-    graphicsContext->drawImageBuffer(snapshot.get(), ColorSpaceDeviceRGB, FloatPoint());
-
-    return sharedSnapshot.release();
+    return snapshot->copyImage(CopyBackingStore, Unscaled);
 }
 
-PassRefPtr<TextIndicator> TextIndicator::createWithSelectionInFrame(const WebFrame& frame, PresentationTransition presentationTransition)
+PassRefPtr<TextIndicator> TextIndicator::createWithSelectionInFrame(Frame& frame, TextIndicatorPresentationTransition presentationTransition)
 {
-    Frame& coreFrame = *frame.coreFrame();
-    IntRect selectionRect = enclosingIntRect(coreFrame.selection().selectionBounds());
-    RefPtr<ShareableBitmap> indicatorBitmap = frame.createSelectionSnapshot();
+    IntRect selectionRect = enclosingIntRect(frame.selection().selectionBounds());
+    RefPtr<Image> indicatorBitmap = snapshotSelection(frame, SnapshotOptionsForceBlackText)->copyImage(CopyBackingStore, Unscaled);
     if (!indicatorBitmap)
         return nullptr;
 
-    RefPtr<ShareableBitmap> indicatorBitmapWithHighlight;
-    if (presentationTransition == PresentationTransition::BounceAndCrossfade)
-        indicatorBitmapWithHighlight = snapshotSelectionWithHighlight(coreFrame);
+    RefPtr<Image> indicatorBitmapWithHighlight;
+    if (presentationTransition == TextIndicatorPresentationTransition::BounceAndCrossfade)
+        indicatorBitmapWithHighlight = snapshotSelectionWithHighlight(frame);
 
     // Store the selection rect in window coordinates, to be used subsequently
     // to determine if the indicator and selection still precisely overlap.
-    IntRect selectionRectInWindowCoordinates = coreFrame.view()->contentsToWindow(selectionRect);
+    IntRect selectionRectInWindowCoordinates = frame.view()->contentsToWindow(selectionRect);
 
     Vector<FloatRect> textRects;
-    coreFrame.selection().getClippedVisibleTextRectangles(textRects);
+    frame.selection().getClippedVisibleTextRectangles(textRects);
 
     // The bounding rect of all the text rects can be different than the selection
     // rect when the selection spans multiple lines; the indicator doesn't actually
@@ -173,7 +154,7 @@ PassRefPtr<TextIndicator> TextIndicator::createWithSelectionInFrame(const WebFra
     FloatRect textBoundingRectInWindowCoordinates;
     Vector<FloatRect> textRectsInWindowCoordinates;
     for (const FloatRect& textRect : textRects) {
-        FloatRect textRectInWindowCoordinates = coreFrame.view()->contentsToWindow(enclosingIntRect(textRect));
+        FloatRect textRectInWindowCoordinates = frame.view()->contentsToWindow(enclosingIntRect(textRect));
         textRectsInWindowCoordinates.append(textRectInWindowCoordinates);
         textBoundingRectInWindowCoordinates.unite(textRectInWindowCoordinates);
     }
@@ -184,7 +165,7 @@ PassRefPtr<TextIndicator> TextIndicator::createWithSelectionInFrame(const WebFra
         textRectsInBoundingRectCoordinates.append(rect);
     }
 
-    TextIndicator::Data data;
+    TextIndicatorData data;
     data.selectionRectInWindowCoordinates = selectionRectInWindowCoordinates;
     data.textBoundingRectInWindowCoordinates = textBoundingRectInWindowCoordinates;
     data.textRectsInBoundingRectCoordinates = textRectsInBoundingRectCoordinates;
@@ -196,7 +177,7 @@ PassRefPtr<TextIndicator> TextIndicator::createWithSelectionInFrame(const WebFra
     return TextIndicator::create(data);
 }
 
-TextIndicator::TextIndicator(const TextIndicator::Data& data)
+TextIndicator::TextIndicator(const TextIndicatorData& data)
     : m_data(data)
 {
     ASSERT(m_data.contentImageScaleFactor != 1 || m_data.contentImage->size() == enclosingIntRect(m_data.selectionRectInWindowCoordinates).size());
@@ -211,57 +192,4 @@ TextIndicator::~TextIndicator()
 {
 }
 
-void TextIndicator::Data::encode(IPC::ArgumentEncoder& encoder) const
-{
-    encoder << selectionRectInWindowCoordinates;
-    encoder << textBoundingRectInWindowCoordinates;
-    encoder << textRectsInBoundingRectCoordinates;
-    encoder << contentImageScaleFactor;
-    encoder.encodeEnum(presentationTransition);
-
-    ShareableBitmap::Handle contentImageHandle;
-    if (contentImage)
-        contentImage->createHandle(contentImageHandle, SharedMemory::ReadOnly);
-    encoder << contentImageHandle;
-
-    ShareableBitmap::Handle contentImageWithHighlightHandle;
-    if (contentImageWithHighlight)
-        contentImageWithHighlight->createHandle(contentImageWithHighlightHandle, SharedMemory::ReadOnly);
-    encoder << contentImageWithHighlightHandle;
-}
-
-bool TextIndicator::Data::decode(IPC::ArgumentDecoder& decoder, TextIndicator::Data& textIndicatorData)
-{
-    if (!decoder.decode(textIndicatorData.selectionRectInWindowCoordinates))
-        return false;
-
-    if (!decoder.decode(textIndicatorData.textBoundingRectInWindowCoordinates))
-        return false;
-
-    if (!decoder.decode(textIndicatorData.textRectsInBoundingRectCoordinates))
-        return false;
-
-    if (!decoder.decode(textIndicatorData.contentImageScaleFactor))
-        return false;
-
-    if (!decoder.decodeEnum(textIndicatorData.presentationTransition))
-        return false;
-
-    ShareableBitmap::Handle contentImageHandle;
-    if (!decoder.decode(contentImageHandle))
-        return false;
-
-    if (!contentImageHandle.isNull())
-        textIndicatorData.contentImage = ShareableBitmap::create(contentImageHandle, SharedMemory::ReadOnly);
-
-    ShareableBitmap::Handle contentImageWithHighlightHandle;
-    if (!decoder.decode(contentImageWithHighlightHandle))
-        return false;
-
-    if (!contentImageWithHighlightHandle.isNull())
-        textIndicatorData.contentImageWithHighlight = ShareableBitmap::create(contentImageWithHighlightHandle, SharedMemory::ReadOnly);
-
-    return true;
-}
-
-} // namespace WebKit
+} // namespace WebCore
similarity index 51%
rename from Source/WebKit2/Shared/TextIndicator.h
rename to Source/WebCore/page/TextIndicator.h
index 4e1a24b893a96ff309298d3e28ef3307dcd00ad3..be10a3333f2fee235713ef708f0a2d81f4c68d24 100644 (file)
@@ -26,8 +26,8 @@
 #ifndef TextIndicator_h
 #define TextIndicator_h
 
-#include "ShareableBitmap.h"
-#include <WebCore/FloatRect.h>
+#include "FloatRect.h"
+#include "Image.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
 #endif
 
 namespace WebCore {
+
+class Frame;
 class GraphicsContext;
 class Range;
-}
-
-namespace IPC {
-class ArgumentDecoder;
-class ArgumentEncoder;
-}
 
-namespace WebKit {
+enum class TextIndicatorPresentationTransition {
+    None,
+    Bounce,
+    BounceAndCrossfade
+};
 
-class WebFrame;
+struct TextIndicatorData {
+    FloatRect selectionRectInWindowCoordinates;
+    FloatRect textBoundingRectInWindowCoordinates;
+    Vector<FloatRect> textRectsInBoundingRectCoordinates;
+    float contentImageScaleFactor;
+    RefPtr<Image> contentImageWithHighlight;
+    RefPtr<Image> contentImage;
+    TextIndicatorPresentationTransition presentationTransition;
+};
 
 class TextIndicator : public RefCounted<TextIndicator> {
 public:
-    enum class PresentationTransition {
-        None,
-        Bounce,
-        BounceAndCrossfade
-    };
-
-    struct Data {
-        WebCore::FloatRect selectionRectInWindowCoordinates;
-        WebCore::FloatRect textBoundingRectInWindowCoordinates;
-        Vector<WebCore::FloatRect> textRectsInBoundingRectCoordinates;
-        float contentImageScaleFactor;
-        RefPtr<ShareableBitmap> contentImageWithHighlight;
-        RefPtr<ShareableBitmap> contentImage;
-        PresentationTransition presentationTransition;
-
-        void encode(IPC::ArgumentEncoder&) const;
-        static bool decode(IPC::ArgumentDecoder&, Data&);
-    };
-
-    static PassRefPtr<TextIndicator> create(const TextIndicator::Data&);
-    static PassRefPtr<TextIndicator> createWithSelectionInFrame(const WebFrame&, PresentationTransition);
-    static PassRefPtr<TextIndicator> createWithRange(const WebCore::Range&, PresentationTransition);
+    static PassRefPtr<TextIndicator> create(const TextIndicatorData&);
+    static PassRefPtr<TextIndicator> createWithSelectionInFrame(Frame&, TextIndicatorPresentationTransition);
+    static PassRefPtr<TextIndicator> createWithRange(const Range&, TextIndicatorPresentationTransition);
 
     ~TextIndicator();
 
-    WebCore::FloatRect selectionRectInWindowCoordinates() const { return m_data.selectionRectInWindowCoordinates; }
-    WebCore::FloatRect textBoundingRectInWindowCoordinates() const { return m_data.textBoundingRectInWindowCoordinates; }
-    const Vector<WebCore::FloatRect>& textRectsInBoundingRectCoordinates() const { return m_data.textRectsInBoundingRectCoordinates; }
+    FloatRect selectionRectInWindowCoordinates() const { return m_data.selectionRectInWindowCoordinates; }
+    FloatRect textBoundingRectInWindowCoordinates() const { return m_data.textBoundingRectInWindowCoordinates; }
+    const Vector<FloatRect>& textRectsInBoundingRectCoordinates() const { return m_data.textRectsInBoundingRectCoordinates; }
     float contentImageScaleFactor() const { return m_data.contentImageScaleFactor; }
-    ShareableBitmap *contentImageWithHighlight() const { return m_data.contentImageWithHighlight.get(); }
-    ShareableBitmap *contentImage() const { return m_data.contentImage.get(); }
-    PresentationTransition presentationTransition() const { return m_data.presentationTransition; }
+    Image *contentImageWithHighlight() const { return m_data.contentImageWithHighlight.get(); }
+    Image *contentImage() const { return m_data.contentImage.get(); }
+    TextIndicatorPresentationTransition presentationTransition() const { return m_data.presentationTransition; }
 
-    void setPresentationTransition(PresentationTransition transition) { m_data.presentationTransition = transition; }
+    void setPresentationTransition(TextIndicatorPresentationTransition transition) { m_data.presentationTransition = transition; }
 
-    Data data() const { return m_data; }
+    TextIndicatorData data() const { return m_data; }
 
 private:
-    TextIndicator(const TextIndicator::Data&);
+    TextIndicator(const TextIndicatorData&);
 
-    Data m_data;
+    TextIndicatorData m_data;
 };
 
 } // namespace WebKit
similarity index 91%
rename from Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h
rename to Source/WebCore/page/mac/TextIndicatorWindow.h
index c927f33dfb53aa11c81163b5ace184aa2b3e0e71..99d2140ed7e829401794cc445cc94b627cef4db5 100644 (file)
 #import <wtf/RetainPtr.h>
 #import <wtf/RunLoop.h>
 
-@class WKTextIndicatorView;
-@class WKView;
+@class NSView;
+@class WebTextIndicatorView;
 
-namespace WebKit {
+namespace WebCore {
 
 class TextIndicator;
 
@@ -45,7 +45,7 @@ class TextIndicatorWindow {
     WTF_MAKE_NONCOPYABLE(TextIndicatorWindow);
 
 public:
-    explicit TextIndicatorWindow(WKView *);
+    explicit TextIndicatorWindow(NSView *);
     ~TextIndicatorWindow();
 
     void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut, std::function<void ()> animationCompletionHandler);
@@ -55,10 +55,10 @@ private:
 
     void startFadeOutTimerFired();
 
-    WKView* m_wkView;
+    NSView *m_targetView;
     RefPtr<TextIndicator> m_textIndicator;
     RetainPtr<NSWindow> m_textIndicatorWindow;
-    RetainPtr<WKTextIndicatorView> m_textIndicatorView;
+    RetainPtr<WebTextIndicatorView> m_textIndicatorView;
 
     RunLoop::Timer<TextIndicatorWindow> m_startFadeOutTimer;
 
similarity index 90%
rename from Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm
rename to Source/WebCore/page/mac/TextIndicatorWindow.mm
index 98346b3eab2df9c46c3995e9c83086c2b12aea1f..0ac426c7576acdf4a89c655aa407e33df4bac148 100644 (file)
 
 #if PLATFORM(MAC)
 
+#import "GraphicsContext.h"
+#import "QuartzCoreSPI.h"
 #import "TextIndicator.h"
-#import "WKView.h"
-#import <WebCore/GraphicsContext.h>
-#import <WebCore/QuartzCoreSPI.h>
-#import <WebCore/WebActionDisablingCALayerDelegate.h>
+#import "WebActionDisablingCALayerDelegate.h"
 
 const CFTimeInterval bounceAnimationDuration = 0.12;
 const CFTimeInterval bounceWithCrossfadeAnimationDuration = 0.3;
@@ -66,22 +65,22 @@ NSString *rimShadowLayerKey = @"RimShadowLayer";
 
 using namespace WebCore;
 
-@interface WKTextIndicatorView : NSView {
-    RefPtr<WebKit::TextIndicator> _textIndicator;
+@interface WebTextIndicatorView : NSView {
+    RefPtr<TextIndicator> _textIndicator;
     RetainPtr<NSArray> _bounceLayers;
     NSSize _margin;
 }
 
-- (instancetype)initWithFrame:(NSRect)frame textIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator margin:(NSSize)margin;
+- (instancetype)initWithFrame:(NSRect)frame textIndicator:(PassRefPtr<TextIndicator>)textIndicator margin:(NSSize)margin;
 
 - (void)presentWithCompletionHandler:(void(^)(void))completionHandler;
 - (void)hideWithCompletionHandler:(void(^)(void))completionHandler;
 
 @end
 
-@implementation WKTextIndicatorView
+@implementation WebTextIndicatorView
 
-- (instancetype)initWithFrame:(NSRect)frame textIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator margin:(NSSize)margin
+- (instancetype)initWithFrame:(NSRect)frame textIndicator:(PassRefPtr<TextIndicator>)textIndicator margin:(NSSize)margin
 {
     if (!(self = [super initWithFrame:frame]))
         return nil;
@@ -92,15 +91,15 @@ using namespace WebCore;
     self.wantsLayer = YES;
     self.layer.anchorPoint = CGPointZero;
 
-    bool wantsCrossfade = _textIndicator->presentationTransition() == WebKit::TextIndicator::PresentationTransition::BounceAndCrossfade;
+    bool wantsCrossfade = _textIndicator->presentationTransition() == TextIndicatorPresentationTransition::BounceAndCrossfade;
 
     FloatSize contentsImageLogicalSize = _textIndicator->contentImage()->size();
     contentsImageLogicalSize.scale(1 / _textIndicator->contentImageScaleFactor());
     RetainPtr<CGImageRef> contentsImage;
     if (wantsCrossfade)
-        contentsImage = _textIndicator->contentImageWithHighlight()->makeCGImage();
+        contentsImage = _textIndicator->contentImageWithHighlight()->getCGImageRef();
     else
-        contentsImage = _textIndicator->contentImage()->makeCGImage();
+        contentsImage = _textIndicator->contentImage()->getCGImageRef();
 
     RetainPtr<NSMutableArray> bounceLayers = adoptNS([[NSMutableArray alloc] init]);
 
@@ -190,7 +189,7 @@ using namespace WebCore;
 
 - (void)presentWithCompletionHandler:(void(^)(void))completionHandler
 {
-    bool wantsCrossfade = _textIndicator->presentationTransition() == WebKit::TextIndicator::PresentationTransition::BounceAndCrossfade;
+    bool wantsCrossfade = _textIndicator->presentationTransition() == TextIndicatorPresentationTransition::BounceAndCrossfade;
     double animationDuration = wantsCrossfade ? bounceWithCrossfadeAnimationDuration : bounceAnimationDuration;
     RetainPtr<CAKeyframeAnimation> bounceAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
     [bounceAnimation setValues:@[
@@ -204,7 +203,7 @@ using namespace WebCore;
     RetainPtr<CABasicAnimation> fadeShadowInAnimation;
     if (wantsCrossfade) {
         crossfadeAnimation = [CABasicAnimation animationWithKeyPath:@"contents"];
-        RetainPtr<CGImageRef> contentsImage = _textIndicator->contentImage()->makeCGImage();
+        RetainPtr<CGImageRef> contentsImage = _textIndicator->contentImage()->getCGImageRef();
         [crossfadeAnimation setToValue:(id)contentsImage.get()];
         [crossfadeAnimation setFillMode:kCAFillModeForwards];
         [crossfadeAnimation setRemovedOnCompletion:NO];
@@ -254,10 +253,10 @@ using namespace WebCore;
 
 @end
 
-namespace WebKit {
+namespace WebCore {
 
-TextIndicatorWindow::TextIndicatorWindow(WKView *wkView)
-    : m_wkView(wkView)
+TextIndicatorWindow::TextIndicatorWindow(NSView *targetView)
+    : m_targetView(targetView)
     , m_startFadeOutTimer(RunLoop::main(), this, &TextIndicatorWindow::startFadeOutTimerFired)
 {
 }
@@ -286,8 +285,8 @@ void TextIndicatorWindow::setTextIndicator(PassRefPtr<TextIndicator> textIndicat
     CGFloat verticalMargin = std::max(dropShadowBlurRadius * 2 + verticalBorder, contentRect.size.height * 2);
 
     contentRect = NSInsetRect(contentRect, -horizontalMargin, -verticalMargin);
-    NSRect windowFrameRect = NSIntegralRect([m_wkView convertRect:contentRect toView:nil]);
-    windowFrameRect = [[m_wkView window] convertRectToScreen:windowFrameRect];
+    NSRect windowFrameRect = NSIntegralRect([m_targetView convertRect:contentRect toView:nil]);
+    windowFrameRect = [[m_targetView window] convertRectToScreen:windowFrameRect];
     NSRect windowContentRect = [NSWindow contentRectForFrameRect:windowFrameRect styleMask:NSBorderlessWindowMask];
 
     m_textIndicatorWindow = adoptNS([[NSWindow alloc] initWithContentRect:windowContentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
@@ -296,13 +295,13 @@ void TextIndicatorWindow::setTextIndicator(PassRefPtr<TextIndicator> textIndicat
     [m_textIndicatorWindow setOpaque:NO];
     [m_textIndicatorWindow setIgnoresMouseEvents:YES];
 
-    m_textIndicatorView = adoptNS([[WKTextIndicatorView alloc] initWithFrame:NSMakeRect(0, 0, [m_textIndicatorWindow frame].size.width, [m_textIndicatorWindow frame].size.height) textIndicator:m_textIndicator margin:NSMakeSize(horizontalMargin, verticalMargin)]);
+    m_textIndicatorView = adoptNS([[WebTextIndicatorView alloc] initWithFrame:NSMakeRect(0, 0, [m_textIndicatorWindow frame].size.width, [m_textIndicatorWindow frame].size.height) textIndicator:m_textIndicator margin:NSMakeSize(horizontalMargin, verticalMargin)]);
     [m_textIndicatorWindow setContentView:m_textIndicatorView.get()];
 
-    [[m_wkView window] addChildWindow:m_textIndicatorWindow.get() ordered:NSWindowAbove];
+    [[m_targetView window] addChildWindow:m_textIndicatorWindow.get() ordered:NSWindowAbove];
     [m_textIndicatorWindow setReleasedWhenClosed:NO];
 
-    if (m_textIndicator->presentationTransition() != TextIndicator::PresentationTransition::None) {
+    if (m_textIndicator->presentationTransition() != TextIndicatorPresentationTransition::None) {
         [m_textIndicatorView presentWithCompletionHandler:[animationCompletionHandler] {
             animationCompletionHandler();
         }];
@@ -333,6 +332,6 @@ void TextIndicatorWindow::startFadeOutTimerFired()
     }];
 }
 
-} // namespace WebKit
+} // namespace WebCore
 
 #endif // PLATFORM(MAC)
index de0b5efd3e17ad07bd1524db424d553961ee90b9..fdef46e82c916aa19fa10ef4e8f9125ca9efee78 100644 (file)
@@ -207,7 +207,6 @@ set(WebKit2_SOURCES
     Shared/ShareableBitmap.cpp
     Shared/ShareableResource.cpp
     Shared/StatisticsData.cpp
-    Shared/TextIndicator.cpp
     Shared/UpdateInfo.cpp
     Shared/UserData.cpp
     Shared/VisitedLinkTable.cpp
index e85c04d7050e5f4bc1bc1a11017f673be432fc09..3a3ed05e458edd1bc2170f2bf747f06d52f6a960 100644 (file)
@@ -1,3 +1,52 @@
+2014-11-21  Tim Horton  <timothy_horton@apple.com>
+
+        Move TextIndicator{Window} to WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=138954
+        <rdar://problem/18992185>
+
+        Some adjustments by Csaba Osztrogonác.
+        Reviewed by Anders Carlsson.
+
+        * CMakeLists.txt:
+        Remove TextIndicator.cpp.
+
+        * Scripts/webkit/messages.py:
+        (struct_or_class):
+        (headers_for_type):
+        Tell messages.py that TextIndicatorData is a struct, and comes from TextIndicator.h.
+
+        * Shared/WebCoreArgumentCoders.h:
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder<TextIndicatorData>::encode):
+        (IPC::ArgumentCoder<TextIndicatorData>::decode):
+        Add argument coders for TextIndicatorData.
+
+        * Shared/DictionaryPopupInfo.h:        
+        * Shared/mac/ActionMenuHitTestResult.h:
+        * Shared/mac/ActionMenuHitTestResult.mm:
+        * UIProcess/API/gtk/PageClientImpl.h:
+        * UIProcess/API/gtk/PageClientImpl.cpp:
+        * UIProcess/API/mac/WKView.mm:
+        * UIProcess/API/mac/WKViewInternal.h:
+        * UIProcess/CoordinatedGraphics/WebView.h:
+        * UIProcess/CoordinatedGraphics/WebView.cpp:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/WKContentView.h:
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        * UIProcess/mac/WKActionMenuController.mm:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
+        * WebProcess/WebPage/FindController.cpp:
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        Adjust to TextIndicator and TextIndicatorWindow's new home.
+
 2014-11-21  Tim Horton  <timothy_horton@apple.com>
 
         REGRESSION (r176238): Mailto links are getting preloaded, which results in a compose window
index b65ecf1f039a0fc03d54932f21a82c8b1c8bf8c9..ec427cb0054bba1541178560bf06f44c700f2084 100644 (file)
@@ -183,6 +183,7 @@ def struct_or_class(namespace, type):
         'WebCore::RotateTransformOperation',
         'WebCore::ScaleTransformOperation',
         'WebCore::SkewTransformOperation',
+        'WebCore::TextIndicatorData',
         'WebCore::TimingFunction',
         'WebCore::TransformationMatrix',
         'WebCore::TransformOperation',
@@ -438,6 +439,7 @@ def headers_for_type(type):
         'WebCore::PasteboardWebContent': ['<WebCore/Pasteboard.h>'],
         'WebCore::TextCheckingRequestData': ['<WebCore/TextChecking.h>'],
         'WebCore::TextCheckingResult': ['<WebCore/TextCheckerClient.h>'],
+        'WebCore::TextIndicatorData': ['<WebCore/TextIndicator.h>'],
         'WebCore::ViewportAttributes': ['<WebCore/ViewportArguments.h>'],
         'WebKit::BackForwardListItemState': ['"SessionState.h"'],
         'WebKit::InjectedBundleUserMessageEncoder': [],
index a54fc083444edf4de3add4dc3346ad7c20975f70..ed3c006cc66085cefd727f580f8a9e0e8ba75ff6 100644 (file)
@@ -26,8 +26,8 @@
 #ifndef DictionaryPopupInfo_h
 #define DictionaryPopupInfo_h
 
-#include "TextIndicator.h"
 #include <WebCore/FloatPoint.h>
+#include <WebCore/TextIndicator.h>
 
 #if PLATFORM(COCOA)
 #include "AttributedString.h"
@@ -46,7 +46,7 @@ struct DictionaryPopupInfo {
     static bool decode(IPC::ArgumentDecoder&, DictionaryPopupInfo&);
 
     WebCore::FloatPoint origin;
-    TextIndicator::Data textIndicator;
+    WebCore::TextIndicatorData textIndicator;
 #if PLATFORM(COCOA)
     RetainPtr<CFDictionaryRef> options;
     AttributedString attributedString;
index 12192fc67581b0e27822103d97d6c4525e9d0b30..f62df6da193f8b53b8e52d041f0ca63a32f13fb3 100644 (file)
@@ -59,6 +59,7 @@
 #include <WebCore/ScrollingCoordinator.h>
 #include <WebCore/SessionID.h>
 #include <WebCore/TextCheckerClient.h>
+#include <WebCore/TextIndicator.h>
 #include <WebCore/TimingFunction.h>
 #include <WebCore/TransformationMatrix.h>
 #include <WebCore/URL.h>
@@ -1960,4 +1961,41 @@ bool ArgumentCoder<BlobPart>::decode(ArgumentDecoder& decoder, BlobPart& blobPar
     return true;
 }
 
+void ArgumentCoder<TextIndicatorData>::encode(ArgumentEncoder& encoder, const TextIndicatorData& textIndicatorData)
+{
+    encoder << textIndicatorData.selectionRectInWindowCoordinates;
+    encoder << textIndicatorData.textBoundingRectInWindowCoordinates;
+    encoder << textIndicatorData.textRectsInBoundingRectCoordinates;
+    encoder << textIndicatorData.contentImageScaleFactor;
+    encoder.encodeEnum(textIndicatorData.presentationTransition);
+    encodeImage(encoder, textIndicatorData.contentImage.get());
+    encodeImage(encoder, textIndicatorData.contentImageWithHighlight.get());
+}
+
+bool ArgumentCoder<TextIndicatorData>::decode(ArgumentDecoder& decoder, TextIndicatorData& textIndicatorData)
+{
+    if (!decoder.decode(textIndicatorData.selectionRectInWindowCoordinates))
+        return false;
+
+    if (!decoder.decode(textIndicatorData.textBoundingRectInWindowCoordinates))
+        return false;
+
+    if (!decoder.decode(textIndicatorData.textRectsInBoundingRectCoordinates))
+        return false;
+
+    if (!decoder.decode(textIndicatorData.contentImageScaleFactor))
+        return false;
+
+    if (!decoder.decodeEnum(textIndicatorData.presentationTransition))
+        return false;
+
+    if (!decodeImage(decoder, textIndicatorData.contentImage))
+        return false;
+
+    if (!decodeImage(decoder, textIndicatorData.contentImageWithHighlight))
+        return false;
+
+    return true;
+}
+
 } // namespace IPC
index 5995e5ab10b460d6b8f596f3b854e216b22fdb10..c68e09d31cc9fb0bb0fc4a9685bfaf5795149313 100644 (file)
@@ -85,6 +85,7 @@ struct PasteboardWebContent;
 struct PluginInfo;
 struct ScrollableAreaParameters;
 struct TextCheckingResult;
+struct TextIndicatorData;
 struct ViewportAttributes;
 struct WindowFeatures;
 }
@@ -435,6 +436,11 @@ template<> struct ArgumentCoder<WebCore::ContentFilter> {
 };
 #endif
 
+template<> struct ArgumentCoder<WebCore::TextIndicatorData> {
+    static void encode(ArgumentEncoder&, const WebCore::TextIndicatorData&);
+    static bool decode(ArgumentDecoder&, WebCore::TextIndicatorData&);
+};
+
 } // namespace IPC
 
 #endif // WebCoreArgumentCoders_h
index e7be170442f839ee22ca1277f91b3a238543ef49..702c56e9f149bdcb3b9d619dc553b5b35b561374 100644 (file)
 #include "DataReference.h"
 #include "ShareableBitmap.h"
 #include "SharedMemory.h"
-#include "TextIndicator.h"
 #include "WebHitTestResult.h"
 #include <WebCore/FloatRect.h>
 #include <WebCore/PageOverlay.h>
+#include <WebCore/TextIndicator.h>
 #include <wtf/text/WTFString.h>
 
 OBJC_CLASS DDActionContext;
@@ -57,7 +57,7 @@ struct ActionMenuHitTestResult {
 
     RetainPtr<DDActionContext> actionContext;
     WebCore::FloatRect detectedDataBoundingBox;
-    RefPtr<TextIndicator> detectedDataTextIndicator;
+    RefPtr<WebCore::TextIndicator> detectedDataTextIndicator;
     WebCore::PageOverlay::PageOverlayID detectedDataOriginatingPageOverlay;
 };
 
index 367c7aefc5d77ddb7a43a0455238a5ce437ca5f6..690bc9f82a74ae940b8ad5eb5cca23d480a11ccd 100644 (file)
@@ -31,9 +31,9 @@
 #import "ArgumentCodersCF.h"
 #import "ArgumentDecoder.h"
 #import "ArgumentEncoder.h"
-#import "TextIndicator.h"
 #import "WebCoreArgumentCoders.h"
 #import <WebCore/DataDetectorsSPI.h>
+#import <WebCore/TextIndicator.h>
 
 namespace WebKit {
 
@@ -118,11 +118,11 @@ bool ActionMenuHitTestResult::decode(IPC::ArgumentDecoder& decoder, ActionMenuHi
             return false;
 
         if (hasTextIndicator) {
-            TextIndicator::Data indicatorData;
+            WebCore::TextIndicatorData indicatorData;
             if (!decoder.decode(indicatorData))
                 return false;
 
-            actionMenuHitTestResult.detectedDataTextIndicator = TextIndicator::create(indicatorData);
+            actionMenuHitTestResult.detectedDataTextIndicator = WebCore::TextIndicator::create(indicatorData);
         }
     }
 
index 7062a61cb4655037a937d4032755bc470f9c6c8d..ca2509e0f3ed7a1d7a190cd58c9b86b1b281cb8c 100644 (file)
@@ -233,7 +233,7 @@ PassRefPtr<WebColorPicker> PageClientImpl::createColorPicker(WebPageProxy*, cons
 }
 #endif
 
-void PageClientImpl::setTextIndicator(PassRefPtr<TextIndicator>, bool /* fadeOut */)
+void PageClientImpl::setTextIndicator(PassRefPtr<WebCore::TextIndicator>, bool /* fadeOut */)
 {
     notImplemented();
 }
index ac40aef8a780c0d1f35eb6917ceaa632ceb4cc62..56e0657bec4f5e6413e81c51dc078479e81e5e0f 100644 (file)
@@ -93,7 +93,7 @@ private:
 #if ENABLE(INPUT_TYPE_COLOR)
     virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&) override;
 #endif
-    virtual void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut) override;
+    virtual void setTextIndicator(PassRefPtr<WebCore::TextIndicator>, bool fadeOut) override;
     virtual void getEditorCommandsForKeyEvent(const NativeWebKeyboardEvent&, const AtomicString&, Vector<WTF::String>&) override;
     virtual void updateTextInputState() override;
 #if ENABLE(DRAG_SUPPORT)
index 09b55d48d27e892810d6479b4510540d5c2e8dcb..1620f74e4b5023eebf9ba5a70561a6277438f998 100644 (file)
@@ -51,8 +51,6 @@
 #import "StringUtilities.h"
 #import "TextChecker.h"
 #import "TextCheckerState.h"
-#import "TextIndicator.h"
-#import "TextIndicatorWindow.h"
 #import "TiledCoreAnimationDrawingAreaProxy.h"
 #import "ViewGestureController.h"
 #import "ViewSnapshotStore.h"
@@ -96,6 +94,8 @@
 #import <WebCore/SharedBuffer.h>
 #import <WebCore/SoftLinking.h>
 #import <WebCore/TextAlternativeWithRange.h>
+#import <WebCore/TextIndicator.h>
+#import <WebCore/TextIndicatorWindow.h>
 #import <WebCore/TextUndoInsertionMarkupMac.h>
 #import <WebCore/WebActionDisablingCALayerDelegate.h>
 #import <WebCore/WebCoreCALayerExtras.h>
index 06ba2014e41ae8d1c225b9c8ed4d4f6d12ac5ded..654cf985c02f274374390c58fadec62d6468573c 100644 (file)
@@ -41,13 +41,13 @@ class DataReference;
 namespace WebCore {
 class Image;
 class SharedBuffer;
+class TextIndicator;
 struct KeypressCommand;
 }
 
 namespace WebKit {
 class DrawingAreaProxy;
 class LayerTreeContext;
-class TextIndicator;
 class ViewSnapshot;
 class WebContext;
 struct ActionMenuHitTestResult;
@@ -80,8 +80,8 @@ struct WebPageConfiguration;
 - (void)_setIntrinsicContentSize:(NSSize)intrinsicContentSize;
 - (NSRect)_convertToDeviceSpace:(NSRect)rect;
 - (NSRect)_convertToUserSpace:(NSRect)rect;
-- (void)_setTextIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut;
-- (void)_setTextIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut animationCompletionHandler:(std::function<void ()>)completionHandler;
+- (void)_setTextIndicator:(PassRefPtr<WebCore::TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut;
+- (void)_setTextIndicator:(PassRefPtr<WebCore::TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut animationCompletionHandler:(std::function<void ()>)completionHandler;
 
 - (void)_setAcceleratedCompositingModeRootLayer:(CALayer *)rootLayer;
 - (CALayer *)_acceleratedCompositingModeRootLayer;
index 02d02c061da8b0f6a6cecf6889f9770de4614489..1c844db6020c05e795f03f32804179bb11f11198 100644 (file)
@@ -448,7 +448,7 @@ PassRefPtr<WebColorPicker> WebView::createColorPicker(WebPageProxy*, const WebCo
 }
 #endif
 
-void WebView::setTextIndicator(PassRefPtr<TextIndicator>, bool)
+void WebView::setTextIndicator(PassRefPtr<WebCore::TextIndicator>, bool)
 {
     notImplemented();
 }
index 5c40b8209e419bf2404aab10b38bada0283eea0b..9f6a35f204bed7dd2f0c365b390a90ecb996d76a 100644 (file)
@@ -184,7 +184,7 @@ protected:
     virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) override;
 #endif
 
-    virtual void setTextIndicator(PassRefPtr<TextIndicator>, bool) override;
+    virtual void setTextIndicator(PassRefPtr<WebCore::TextIndicator>, bool) override;
 
     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) override;
     virtual void exitAcceleratedCompositingMode() override;
index a89b3e2550aa5082b2a5e18535d6cf7c51432a00..f16cafc10153a94b8fe54126adc0329c1c0f5a4b 100644 (file)
@@ -47,14 +47,14 @@ OBJC_CLASS NSTextAlternatives;
 
 namespace WebCore {
 class Cursor;
-struct ViewportAttributes;
+class TextIndicator;
 struct Highlight;
+struct ViewportAttributes;
 }
 
 namespace WebKit {
 
 class DrawingAreaProxy;
-class TextIndicator;
 class NativeWebKeyboardEvent;
 class RemoteLayerTreeTransaction;
 class ViewSnapshot;
@@ -214,7 +214,7 @@ public:
     virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) = 0;
 #endif
 
-    virtual void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut) = 0;
+    virtual void setTextIndicator(PassRefPtr<WebCore::TextIndicator>, bool fadeOut) = 0;
 
     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) = 0;
     virtual void exitAcceleratedCompositingMode() = 0;
index b780a4128d420abfe607ab0f0c2f6f409e51c3d6..1f399bff02ff536d55a431b4980b964854266d4a 100644 (file)
@@ -54,7 +54,6 @@
 #include "PrintInfo.h"
 #include "TextChecker.h"
 #include "TextCheckerState.h"
-#include "TextIndicator.h"
 #include "UserMediaPermissionRequestProxy.h"
 #include "WKContextPrivate.h"
 #include "WebBackForwardList.h"
@@ -97,6 +96,7 @@
 #include <WebCore/RenderEmbeddedObject.h>
 #include <WebCore/SerializedCryptoKeyWrap.h>
 #include <WebCore/TextCheckerClient.h>
+#include <WebCore/TextIndicator.h>
 #include <WebCore/WindowFeatures.h>
 #include <stdio.h>
 #include <wtf/NeverDestroyed.h>
@@ -3658,7 +3658,7 @@ void WebPageProxy::didGetImageForFindMatch(const ShareableBitmap::Handle& conten
     m_findMatchesClient.didGetImageForMatchResult(this, WebImage::create(ShareableBitmap::create(contentImageHandle)).get(), matchIndex);
 }
 
-void WebPageProxy::setTextIndicator(const TextIndicator::Data& indicatorData, bool fadeOut)
+void WebPageProxy::setTextIndicator(const TextIndicatorData& indicatorData, bool fadeOut)
 {
     m_pageClient.setTextIndicator(TextIndicator::create(indicatorData), fadeOut);
 }
index 5f8cfd8ed0db9054b94de48af641148381b00911..36d46ef8bc9269d4a14dafffac235cccb04e0ace 100644 (file)
@@ -130,6 +130,7 @@ class MediaConstraintsImpl;
 class ProtectionSpace;
 class RunLoopObserver;
 class SharedBuffer;
+class TextIndicator;
 struct FileChooserSettings;
 struct TextAlternativeWithRange;
 struct TextCheckingResult;
@@ -155,7 +156,6 @@ class PageClient;
 class RemoteLayerTreeTransaction;
 class RemoteScrollingCoordinatorProxy;
 class StringPairVector;
-class TextIndicator;
 class ViewSnapshot;
 class VisitedLinkProvider;
 class WebBackForwardList;
@@ -668,7 +668,7 @@ public:
     void hideFindUI();
     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
     void didCountStringMatches(const String&, uint32_t matchCount);
-    void setTextIndicator(const TextIndicator::Data&, bool fadeOut);
+    void setTextIndicator(const WebCore::TextIndicatorData&, bool fadeOut);
     void clearTextIndicator();
     void didFindString(const String&, uint32_t matchCount, int32_t matchIndex);
     void didFailToFindString(const String&);
index 74b9ab7b8e611e7e89da729ad2099d4da24e4a72..684c76a63e3652e019633034b4bc1da7697538db 100644 (file)
@@ -227,7 +227,7 @@ messages -> WebPageProxy {
 
     # Find messages
     DidCountStringMatches(String string, uint32_t matchCount)
-    SetTextIndicator(WebKit::TextIndicator::Data indicator, bool fadeOut)
+    SetTextIndicator(WebCore::TextIndicatorData indicator, bool fadeOut)
     ClearTextIndicator()
     DidFindString(String string, uint32_t matchCount, int32_t matchIndex)
     DidFailToFindString(String string)
index 79cbd2f1997649e14c9b5732e14cfa9181877968..d89a23619b9989bd393e5a5e43e141db2d01bb2f 100644 (file)
@@ -96,7 +96,7 @@ private:
 #endif
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) override;
     virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) override;
-    virtual void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut) override;
+    virtual void setTextIndicator(PassRefPtr<WebCore::TextIndicator>, bool fadeOut) override;
 
     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) override;
     virtual void exitAcceleratedCompositingMode() override;
index e51efa2e123d7907ceaee32819ce8106c199e867..63b4a2092b7e3f811bff27faca45c917fd1c8539 100644 (file)
@@ -41,7 +41,6 @@ namespace WebKit {
 class DrawingAreaProxy;
 class GeolocationPermissionRequestProxy;
 class RemoteLayerTreeTransaction;
-class TextIndicator;
 class WebContext;
 class WebFrameProxy;
 class WebPageProxy;
index 795f84c6b3511bc136a30ca46a2bcedf8d2f2dc7..c2db8fb8c75f8cb627bdf8f2b2340409c22a686d 100644 (file)
@@ -42,7 +42,6 @@ class AlternativeTextUIController;
 }
 
 namespace WebKit {
-class TextIndicatorWindow;
 
 class PageClientImpl final : public PageClient
 #if ENABLE(FULLSCREEN_API)
@@ -120,7 +119,7 @@ private:
     virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&);
 #endif
 
-    void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut);
+    void setTextIndicator(PassRefPtr<WebCore::TextIndicator>, bool fadeOut);
 
     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
     virtual void exitAcceleratedCompositingMode();
index 82d3e2d280abdf31ca2f93c78b1472bdb73e8515..5ed7a3d4f8e43b12b45afe625cc00166bacf25e0 100644 (file)
@@ -37,7 +37,6 @@
 #import "NativeWebWheelEvent.h"
 #import "NavigationState.h"
 #import "StringUtilities.h"
-#import "TextIndicator.h"
 #import "ViewSnapshotStore.h"
 #import "WKAPICast.h"
 #import "WKFullScreenWindowController.h"
@@ -61,6 +60,7 @@
 #import <WebCore/LookupSPI.h>
 #import <WebCore/NotImplemented.h>
 #import <WebCore/SharedBuffer.h>
+#import <WebCore/TextIndicator.h>
 #import <WebCore/TextUndoInsertionMarkupMac.h>
 #import <WebKitSystemInterface.h>
 #import <wtf/text/CString.h>
index d6c8ed3dd547e4f80442b824f95f67ffd1ebe008..ecbe7f5dc9b17b4bb41734f7ff67275f1cefd614 100644 (file)
@@ -28,7 +28,6 @@
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
 
-#import "TextIndicator.h"
 #import "WKNSURLExtras.h"
 #import "WKViewInternal.h"
 #import "WKWebView.h"
@@ -50,6 +49,7 @@
 #import <WebCore/NSSharingServicePickerSPI.h>
 #import <WebCore/NSViewSPI.h>
 #import <WebCore/SoftLinking.h>
+#import <WebCore/TextIndicator.h>
 #import <WebCore/URL.h>
 
 SOFT_LINK_FRAMEWORK_IN_UMBRELLA(Quartz, ImageKit)
@@ -652,7 +652,7 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
 
     NSArray *menuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForResult:[_currentActionContext mainResult] actionContext:_currentActionContext.get()];
     if (menuItems.count == 1 && _hitTestResult.detectedDataTextIndicator)
-        _hitTestResult.detectedDataTextIndicator->setPresentationTransition(TextIndicator::PresentationTransition::Bounce);
+        _hitTestResult.detectedDataTextIndicator->setPresentationTransition(TextIndicatorPresentationTransition::Bounce);
     return menuItems;
 }
 
index d7199d7e641b8f37f7030992e85b73f9d88b48fc..6713e2e2a6246fc2de0c4e06b2db1baf65bd4239 100644 (file)
                0FCB4E5118BBE044000FCFC9 /* WKGeolocationProviderIOSObjCSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E4118BBE044000FCFC9 /* WKGeolocationProviderIOSObjCSecurityOrigin.mm */; };
                0FCB4E5418BBE044000FCFC9 /* WKScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E4418BBE044000FCFC9 /* WKScrollView.h */; };
                0FCB4E5518BBE044000FCFC9 /* WKScrollView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E4518BBE044000FCFC9 /* WKScrollView.mm */; };
-               0FCB4E6018BBE3D9000FCFC9 /* TextIndicatorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5618BBE3D9000FCFC9 /* TextIndicatorWindow.h */; };
-               0FCB4E6118BBE3D9000FCFC9 /* TextIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E5718BBE3D9000FCFC9 /* TextIndicatorWindow.mm */; };
                0FCB4E6218BBE3D9000FCFC9 /* PageClientImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5818BBE3D9000FCFC9 /* PageClientImpl.h */; };
                0FCB4E6318BBE3D9000FCFC9 /* PageClientImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E5918BBE3D9000FCFC9 /* PageClientImpl.mm */; };
                0FCB4E6618BBE3D9000FCFC9 /* WKPrintingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5C18BBE3D9000FCFC9 /* WKPrintingView.h */; };
                1A90C1EE1264FD50003E44D4 /* WebFindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A90C1ED1264FD50003E44D4 /* WebFindOptions.h */; };
                1A90C1F41264FD71003E44D4 /* FindController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A90C1F21264FD71003E44D4 /* FindController.h */; };
                1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A90C1F31264FD71003E44D4 /* FindController.cpp */; };
-               1A910071126675C4001842F5 /* TextIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A91006F126675C3001842F5 /* TextIndicator.h */; };
-               1A910072126675C4001842F5 /* TextIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A910070126675C4001842F5 /* TextIndicator.cpp */; };
                1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */; };
                1A92DC1312F8BAB90017AF65 /* LayerTreeContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A92DC1212F8BAB90017AF65 /* LayerTreeContext.cpp */; };
                1A9E32891821636900F5D04C /* _WKRemoteObjectRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9E32871821636900F5D04C /* _WKRemoteObjectRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FCB4E4118BBE044000FCFC9 /* WKGeolocationProviderIOSObjCSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKGeolocationProviderIOSObjCSecurityOrigin.mm; path = ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm; sourceTree = "<group>"; };
                0FCB4E4418BBE044000FCFC9 /* WKScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKScrollView.h; path = ios/WKScrollView.h; sourceTree = "<group>"; };
                0FCB4E4518BBE044000FCFC9 /* WKScrollView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKScrollView.mm; path = ios/WKScrollView.mm; sourceTree = "<group>"; };
-               0FCB4E5618BBE3D9000FCFC9 /* TextIndicatorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextIndicatorWindow.h; sourceTree = "<group>"; };
-               0FCB4E5718BBE3D9000FCFC9 /* TextIndicatorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextIndicatorWindow.mm; sourceTree = "<group>"; };
                0FCB4E5818BBE3D9000FCFC9 /* PageClientImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageClientImpl.h; sourceTree = "<group>"; };
                0FCB4E5918BBE3D9000FCFC9 /* PageClientImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageClientImpl.mm; sourceTree = "<group>"; };
                0FCB4E5C18BBE3D9000FCFC9 /* WKPrintingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPrintingView.h; sourceTree = "<group>"; };
                1A90C1ED1264FD50003E44D4 /* WebFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFindOptions.h; sourceTree = "<group>"; };
                1A90C1F21264FD71003E44D4 /* FindController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindController.h; sourceTree = "<group>"; };
                1A90C1F31264FD71003E44D4 /* FindController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindController.cpp; sourceTree = "<group>"; };
-               1A91006F126675C3001842F5 /* TextIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextIndicator.h; sourceTree = "<group>"; };
-               1A910070126675C4001842F5 /* TextIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextIndicator.cpp; sourceTree = "<group>"; };
                1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeContext.h; sourceTree = "<group>"; };
                1A92DC1212F8BAB90017AF65 /* LayerTreeContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerTreeContext.cpp; sourceTree = "<group>"; };
                1A9E32871821636900F5D04C /* _WKRemoteObjectRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKRemoteObjectRegistry.h; sourceTree = "<group>"; };
                                5272B2881406985D0096A5D0 /* StatisticsData.cpp */,
                                5272B2891406985D0096A5D0 /* StatisticsData.h */,
                                1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */,
-                               1A910070126675C4001842F5 /* TextIndicator.cpp */,
-                               1A91006F126675C3001842F5 /* TextIndicator.h */,
                                1A64245D12DE29A100CAAE2C /* UpdateInfo.cpp */,
                                1A64245C12DE29A100CAAE2C /* UpdateInfo.h */,
                                1AC1336518565B5700F3EC05 /* UserData.cpp */,
                        children = (
                                B878B613133428DC006888E9 /* CorrectionPanel.h */,
                                B878B614133428DC006888E9 /* CorrectionPanel.mm */,
-                               0FCB4E5618BBE3D9000FCFC9 /* TextIndicatorWindow.h */,
-                               0FCB4E5718BBE3D9000FCFC9 /* TextIndicatorWindow.mm */,
                                1AFDE65B1954E8D500C48FFA /* LegacySessionStateCoding.cpp */,
                                0FCB4E5818BBE3D9000FCFC9 /* PageClientImpl.h */,
                                0FCB4E5918BBE3D9000FCFC9 /* PageClientImpl.mm */,
                                4A3CC18F19B07B8A00D14AEF /* WKUserMediaPermissionRequest.h in Headers */,
                                1AA575FB1496B52600A4EE06 /* EventDispatcher.h in Headers */,
                                1A90C1F41264FD71003E44D4 /* FindController.h in Headers */,
-                               1A910071126675C4001842F5 /* TextIndicator.h in Headers */,
                                515E7728183DD6F60007203F /* AsyncRequest.h in Headers */,
                                BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */,
                                1ABC3DFC1899F51C004F0626 /* WKNavigationDelegate.h in Headers */,
                                51654EFE184EF33F007DC837 /* UniqueIDBDatabaseBackingStoreSQLite.h in Headers */,
                                BC33E0D112408E8600360F3F /* InjectedBundleRangeHandle.h in Headers */,
                                A115DC72191D82DA00DA8072 /* _WKWebViewPrintFormatter.h in Headers */,
-                               0FCB4E6018BBE3D9000FCFC9 /* TextIndicatorWindow.h in Headers */,
                                BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
                                BCB0B0DE12305A8C00B1341E /* InjectedBundleUserMessageCoders.h in Headers */,
                                1AE49A4911FFA8CE0048B464 /* JSNPMethod.h in Headers */,
                                1AA576021496B97900A4EE06 /* EventDispatcherMessageReceiver.cpp in Sources */,
                                1A1E093318861D3800D2DC49 /* WebProgressTrackerClient.cpp in Sources */,
                                1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */,
-                               1A910072126675C4001842F5 /* TextIndicator.cpp in Sources */,
                                BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */,
                                378E1A4918208CD60031007A /* WKNSString.mm in Sources */,
                                1AAF08B719269E6D00B6390C /* WebUserContentControllerMessageReceiver.cpp in Sources */,
                                BCBAAC72144E61990053F82F /* WKBrowsingContextController.mm in Sources */,
                                BCBAACF51452324F0053F82F /* WKBrowsingContextGroup.mm in Sources */,
                                51290992183ACEAF005522A6 /* WebIDBServerConnection.cpp in Sources */,
-                               0FCB4E6118BBE3D9000FCFC9 /* TextIndicatorWindow.mm in Sources */,
                                BC204EEE11C83EC8008F3375 /* WKBundle.cpp in Sources */,
                                7C6E70FB18B2DC7A00F24E2E /* WebProcessCocoa.mm in Sources */,
                                935EEB9E127761AC003322B8 /* WKBundleBackForwardList.cpp in Sources */,
index 0b0dc3a4cc0c59774bb96d01f81dedfa65184248..4ed5e25e672fdc363760dc83640ab11714b37ff1 100644 (file)
 #if ENABLE(CONTEXT_MENUS)
 
 #import "DictionaryPopupInfo.h"
-#import "TextIndicator.h"
 #import "WebCoreArgumentCoders.h"
 #import "WebPage.h"
 #import "WebPageProxyMessages.h"
 #import <WebCore/FrameView.h>
 #import <WebCore/MainFrame.h>
 #import <WebCore/Page.h>
+#import <WebCore/TextIndicator.h>
 #import <wtf/text/WTFString.h>
 
 using namespace WebCore;
@@ -44,7 +44,7 @@ namespace WebKit {
 
 void WebContextMenuClient::lookUpInDictionary(Frame* frame)
 {
-    m_page->performDictionaryLookupForSelection(frame, frame->selection().selection(), TextIndicator::PresentationTransition::BounceAndCrossfade);
+    m_page->performDictionaryLookupForSelection(frame, frame->selection().selection(), TextIndicatorPresentationTransition::BounceAndCrossfade);
 }
 
 bool WebContextMenuClient::isSpeaking()
index 1e642c24995f37cd2add3cc9cf1d2b0f08a0ad1f..a86b09611a8faf91f14f7376cf02f40f4aa25baa 100644 (file)
@@ -29,7 +29,6 @@
 #include "DrawingArea.h"
 #include "PluginView.h"
 #include "ShareableBitmap.h"
-#include "TextIndicator.h"
 #include "WKPage.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebPage.h"
@@ -44,6 +43,7 @@
 #include <WebCore/PageOverlayController.h>
 #include <WebCore/PlatformMouseEvent.h>
 #include <WebCore/PluginDocument.h>
+#include <WebCore/TextIndicator.h>
 
 using namespace WebCore;
 
@@ -314,7 +314,7 @@ void FindController::hideFindUI()
 #if !PLATFORM(IOS)
 bool FindController::updateFindIndicator(Frame& selectedFrame, bool isShowingOverlay, bool shouldAnimate)
 {
-    RefPtr<TextIndicator> indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(selectedFrame), shouldAnimate ? TextIndicator::PresentationTransition::Bounce : TextIndicator::PresentationTransition::None);
+    RefPtr<TextIndicator> indicator = TextIndicator::createWithSelectionInFrame(selectedFrame, shouldAnimate ? TextIndicatorPresentationTransition::Bounce : TextIndicatorPresentationTransition::None);
     if (!indicator)
         return false;
 
index 4fabc0e28072b8a430056b4962e76ada41769af0..9576efcd0db84dcdf6d2e4910ec76f37ba7e6e54 100644 (file)
@@ -44,7 +44,6 @@
 #include "Plugin.h"
 #include "SandboxExtension.h"
 #include "ShareableBitmap.h"
-#include "TextIndicator.h"
 #include "UserMediaPermissionRequestManager.h"
 #include <WebCore/DictationAlternative.h>
 #include <WebCore/DragData.h>
@@ -58,6 +57,7 @@
 #include <WebCore/PageVisibilityState.h>
 #include <WebCore/ScrollTypes.h>
 #include <WebCore/TextChecking.h>
+#include <WebCore/TextIndicator.h>
 #include <WebCore/UserActivity.h>
 #include <WebCore/ViewState.h>
 #include <WebCore/ViewportConfiguration.h>
@@ -673,7 +673,7 @@ public:
     void speak(const String&);
     void stopSpeaking();
 
-    void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&, TextIndicator::PresentationTransition);
+    void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&, WebCore::TextIndicatorPresentationTransition);
 #endif
 
     bool isSmartInsertDeleteEnabled();
@@ -991,7 +991,7 @@ private:
 #if PLATFORM(COCOA)
     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
     void performDictionaryLookupOfCurrentSelection();
-    void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options, TextIndicator::PresentationTransition);
+    void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
 
     void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
 
index e05fc8b4078b204740c542c9fd6a8b0c2b543508..cdb256ca8725b16a17a6061ccd0e845409fa9586 100644 (file)
@@ -296,12 +296,12 @@ void WebPage::performDictionaryLookupAtLocation(const FloatPoint&)
     notImplemented();
 }
 
-void WebPage::performDictionaryLookupForSelection(Frame*, const VisibleSelection&, TextIndicator::PresentationTransition)
+void WebPage::performDictionaryLookupForSelection(Frame*, const VisibleSelection&, TextIndicatorPresentationTransition)
 {
     notImplemented();
 }
 
-void WebPage::performDictionaryLookupForRange(Frame*, Range&, NSDictionary *, TextIndicator::PresentationTransition)
+void WebPage::performDictionaryLookupForRange(Frame*, Range&, NSDictionary *, TextIndicatorPresentationTransition)
 {
     notImplemented();
 }
index 92f9b1e50e006d0f0d0304971ef238a99fbf3a23..7a12c2cc57c09b506238e68a2a32c1e8315485a9 100644 (file)
@@ -494,10 +494,10 @@ void WebPage::performDictionaryLookupAtLocation(const FloatPoint& floatPoint)
     if (!range)
         return;
 
-    performDictionaryLookupForRange(frame, *range, options, TextIndicator::PresentationTransition::Bounce);
+    performDictionaryLookupForRange(frame, *range, options, TextIndicatorPresentationTransition::Bounce);
 }
 
-void WebPage::performDictionaryLookupForSelection(Frame* frame, const VisibleSelection& selection, TextIndicator::PresentationTransition presentationTransition)
+void WebPage::performDictionaryLookupForSelection(Frame* frame, const VisibleSelection& selection, TextIndicatorPresentationTransition presentationTransition)
 {
     NSDictionary *options = nil;
     RefPtr<Range> selectedRange = rangeForDictionaryLookupForSelection(selection, &options);
@@ -508,10 +508,10 @@ void WebPage::performDictionaryLookupForSelection(Frame* frame, const VisibleSel
 void WebPage::performDictionaryLookupOfCurrentSelection()
 {
     Frame* frame = &m_page->focusController().focusedOrMainFrame();
-    performDictionaryLookupForSelection(frame, frame->selection().selection(), TextIndicator::PresentationTransition::BounceAndCrossfade);
+    performDictionaryLookupForSelection(frame, frame->selection().selection(), TextIndicatorPresentationTransition::BounceAndCrossfade);
 }
 
-void WebPage::performDictionaryLookupForRange(Frame* frame, Range& range, NSDictionary *options, TextIndicator::PresentationTransition presentationTransition)
+void WebPage::performDictionaryLookupForRange(Frame* frame, Range& range, NSDictionary *options, TextIndicatorPresentationTransition presentationTransition)
 {
     if (range.text().stripWhiteSpace().isEmpty())
         return;
@@ -1040,7 +1040,7 @@ void WebPage::performActionMenuHitTestAtLocation(WebCore::FloatPoint locationInV
             detectedDataBoundingBox.unite(frameView->contentsToWindow(quad.enclosingBoundingBox()));
 
         actionMenuResult.detectedDataBoundingBox = detectedDataBoundingBox;
-        actionMenuResult.detectedDataTextIndicator = TextIndicator::createWithRange(*mainResultRange, TextIndicator::PresentationTransition::BounceAndCrossfade);
+        actionMenuResult.detectedDataTextIndicator = TextIndicator::createWithRange(*mainResultRange, TextIndicatorPresentationTransition::BounceAndCrossfade);
         actionMenuResult.detectedDataOriginatingPageOverlay = overlay->pageOverlayID();
         m_lastActionMenuRangeForSelection = mainResultRange;
 
@@ -1054,7 +1054,7 @@ void WebPage::performActionMenuHitTestAtLocation(WebCore::FloatPoint locationInV
         actionMenuResult.actionContext = DataDetection::detectItemAroundHitTestResult(hitTestResult, detectedDataBoundingBox, detectedDataRange);
         if (actionMenuResult.actionContext && detectedDataRange) {
             actionMenuResult.detectedDataBoundingBox = detectedDataBoundingBox;
-            actionMenuResult.detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicator::PresentationTransition::BounceAndCrossfade);
+            actionMenuResult.detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicatorPresentationTransition::BounceAndCrossfade);
             m_lastActionMenuRangeForSelection = detectedDataRange;
         }
     }