WebKit Bugzilla
Attachment 359079 Details for
Bug 193408
: Add Reveal support in iOSMac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193408-20190114142929.patch (text/plain), 21.09 KB, created by
Megan Gardner
on 2019-01-14 14:29:30 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Megan Gardner
Created:
2019-01-14 14:29:30 PST
Size:
21.09 KB
patch
obsolete
>Subversion Revision: 239871 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f7f33131c17ff3d21cb95051381c00d58a605888..6676fda075337d0796dd2a27f3fd8379e76f2846 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,33 @@ >+2019-01-14 Megan Gardner <megan_gardner@apple.com> >+ >+ Add Reveal support in iOSMac >+ https://bugs.webkit.org/show_bug.cgi?id=193408 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ iOSMac and Reveal are currently not testable. >+ >+ Add support for the reveal SPI specifically for iOSMac. >+ Show the controller when called, and implement the delegate to >+ correctly re-paint the content with the auto-generated highlight from >+ the reveal framework. >+ >+ * Configurations/WebCore.xcconfig: >+ * editing/cocoa/DictionaryLookup.mm: >+ (-[WebRevealHighlight initWithHighlightRect:view:]): >+ (-[WebRevealHighlight setImage:]): >+ (-[WebRevealHighlight highlightRectsForItem:]): >+ (-[WebRevealHighlight startHighlightingItem:]): >+ (-[WebRevealHighlight highlightItem:withProgress:]): >+ (-[WebRevealHighlight completeHighlightingItem:]): >+ (-[WebRevealHighlight stopHighlightingItem:]): >+ (-[WebRevealHighlight highlightRangeChangedForItem:]): >+ (-[WebRevealHighlight highlighting]): >+ (-[WebRevealHighlight drawHighlightContentForItem:context:]): >+ (WebCore::showPopupOrCreateAnimationController): >+ (WebCore::DictionaryLookup::showPopup): >+ * editing/mac/DictionaryLookup.h: >+ > 2019-01-11 Miguel Gomez <magomez@igalia.com> > > [GTK] Garbled rendering on Youtube while scrolling under X11. >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index 5a10d74915990661294e920d87eab81002b27efb..b42615aee504685da6890097d85fc2a78b2a407b 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-14 Megan Gardner <megan_gardner@apple.com> >+ >+ Add Reveal support in iOSMac >+ https://bugs.webkit.org/show_bug.cgi?id=193408 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add additional needed SPI. >+ >+ * pal/spi/cocoa/RevealSPI.h: >+ > 2019-01-10 John Wilander <wilander@apple.com> > > Override the session configuration for cookieAcceptPolicy >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index d53cc33c6927e61aa4e69dae90da8051257de925..fc15524cd9ad19f987d084462099757b6e2c800f 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2019-01-14 Megan Gardner <megan_gardner@apple.com> >+ >+ Add Reveal support in iOSMac >+ https://bugs.webkit.org/show_bug.cgi?id=193408 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add calls to DictionaryLookup from the appropriate places. >+ >+ * UIProcess/PageClient.h: >+ * UIProcess/ios/PageClientImplIOS.h: >+ * UIProcess/ios/PageClientImplIOS.mm: >+ (WebKit::PageClientImpl::didPerformDictionaryLookup): >+ * UIProcess/ios/WebPageProxyIOS.mm: >+ (WebKit::WebPageProxy::didPerformDictionaryLookup): >+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: >+ (WebKit::WebPage::dictionaryPopupInfoForRange): >+ > 2019-01-11 Wenson Hsieh <wenson_hsieh@apple.com> > > Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API >diff --git a/Source/WebCore/Configurations/WebCore.xcconfig b/Source/WebCore/Configurations/WebCore.xcconfig >index ab84e890de20b2ebcc6a823dc6de5e37ed126764..1af09f5dffff540f9dc01db6a37d11e3716bcb19 100644 >--- a/Source/WebCore/Configurations/WebCore.xcconfig >+++ b/Source/WebCore/Configurations/WebCore.xcconfig >@@ -115,6 +115,9 @@ WK_OPENGL_LDFLAGS_appletvos = $(WK_OPENGL_LDFLAGS_iphoneos); > WK_OPENGL_LDFLAGS_appletvsimulator = $(WK_OPENGL_LDFLAGS_iphonesimulator); > WK_OPENGL_LDFLAGS_macosx = -framework OpenGL; > >+WK_UIKITMAC_LDFLAGS = $(WK_UIKITMAC_LDFLAGS_$(WK_PLATFORM_NAME)); >+WK_UIKITMAC_LDFLAGS_iosmac = -framework UIKitMacHelper; >+ > WK_SYSTEM_CONFIGURATION_LDFLAGS = $(WK_SYSTEM_CONFIGURATION_LDFLAGS_$(WK_PLATFORM_NAME)); > WK_SYSTEM_CONFIGURATION_LDFLAGS_macosx = -framework SystemConfiguration; > >@@ -126,7 +129,7 @@ WK_URL_FORMATTING_LDFLAGS = $(WK_URL_FORMATTING_LDFLAGS_$(WK_HAVE_URL_FORMATTING > WK_URL_FORMATTING_LDFLAGS_YES = -framework URLFormatting; > > // FIXME: Reduce the number of allowable_clients <rdar://problem/31823969> >-OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a -framework CFNetwork -framework CoreAudio -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework Metal $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH)) $(OTHER_LDFLAGS_PLATFORM_$(WK_PLATFORM_NAME)) $(WK_APPKIT_LDFLAGS) $(WK_APPSUPPORT_LDFLAGS) $(WK_AUDIO_UNIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_UI_LDFLAGS) $(WK_DATA_DETECTORS_CORE_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_SYSTEM_CONFIGURATION_LDFLAGS) $(WK_SYSTEM_PREVIEW_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS); >+OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a -framework CFNetwork -framework CoreAudio -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework Metal $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH)) $(OTHER_LDFLAGS_PLATFORM_$(WK_PLATFORM_NAME)) $(WK_APPKIT_LDFLAGS) $(WK_APPSUPPORT_LDFLAGS) $(WK_AUDIO_UNIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_UI_LDFLAGS) $(WK_DATA_DETECTORS_CORE_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_SYSTEM_CONFIGURATION_LDFLAGS) $(WK_SYSTEM_PREVIEW_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS) $(WK_UIKITMAC_LDFLAGS); > > OTHER_LDFLAGS_PLATFORM_cocoatouch = -allowable_client WebKit -allowable_client iTunesU -allowable_client Casablanca -allowable_client Remote -allowable_client TVBooks -allowable_client DumpRenderTree -allowable_client WebKitTestRunner -allowable_client TestWebKitAPI; > OTHER_LDFLAGS_PLATFORM_macosx = -sub_library libobjc -umbrella WebKit; >diff --git a/Source/WebCore/PAL/pal/spi/cocoa/RevealSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/RevealSPI.h >index 82b7c4a091bc9ddbc9462b58719ab53391b470f4..39dba5c7b68905d0b0bd03b87c59cf77c60a1c27 100644 >--- a/Source/WebCore/PAL/pal/spi/cocoa/RevealSPI.h >+++ b/Source/WebCore/PAL/pal/spi/cocoa/RevealSPI.h >@@ -44,9 +44,9 @@ SOFT_LINK_CLASS_OPTIONAL(RevealCore, RVSelection) > #import <Reveal/RVPresenter.h> > #import <Reveal/Reveal.h> > #endif // PLATFORM(MAC) >+#import <RevealCore/RVItem_Private.h> > #import <RevealCore/RVSelection.h> > #import <RevealCore/RevealCore.h> >- > #else // USE(APPLE_INTERNAL_SDK) > > >diff --git a/Source/WebCore/editing/cocoa/DictionaryLookup.mm b/Source/WebCore/editing/cocoa/DictionaryLookup.mm >index 671ac9ab30a59fda8941f3845c3ea8bba9e54f21..b078043f646081cdefbca0e4aec4f7202bade6e6 100644 >--- a/Source/WebCore/editing/cocoa/DictionaryLookup.mm >+++ b/Source/WebCore/editing/cocoa/DictionaryLookup.mm >@@ -45,6 +45,7 @@ > #import "VisiblePosition.h" > #import "VisibleSelection.h" > #import "VisibleUnits.h" >+#import <pal/spi/cg/CoreGraphicsSPI.h> > #import <pal/spi/cocoa/RevealSPI.h> > #import <pal/spi/mac/LookupSPI.h> > #import <wtf/BlockObjCExceptions.h> >@@ -54,6 +55,10 @@ > > #import <PDFKit/PDFKit.h> > >+extern "C" { >+#import <UIKitMacHelper/UINSRevealController.h> >+} >+ > #endif // !PLATFORM(WATCH) > > #if PLATFORM(MAC) >@@ -141,7 +146,118 @@ - (void)revealContext:(RVPresentingContext *)context stopHighlightingItem:(RVIte > > @end > >-#endif // PLATFORM(MAC) >+#elif PLATFORM(IOSMAC) // PLATFORM(MAC) >+ >+@interface WebRevealHighlight <UIRVPresenterHighlightDelegate> : NSObject { >+@private >+ RefPtr<WebCore::Image> _image; >+ CGRect _highlightRect; >+ BOOL _highlighting; >+ UIView *_view; >+} >+ >+@property (nonatomic, readonly) CGRect highlightRect; >+@property (nonatomic, readonly) UIView* view; >+ >+- (instancetype)initWithHighlightRect:(NSRect)highlightRect view:(UIView*)view; >+- (void)setImage:(RefPtr<WebCore::Image>&&)image; >+ >+@end >+ >+@implementation WebRevealHighlight >+ >+@synthesize highlightRect=_highlightRect; >+@synthesize view=_view; >+ >+- (instancetype)initWithHighlightRect:(NSRect)highlightRect view:(UIView*)view >+{ >+ if (!(self = [super init])) >+ return nil; >+ >+ _highlightRect = highlightRect; >+ _view = view; >+ _highlighting = NO; >+ >+ return self; >+} >+ >+- (void)setImage:(RefPtr<WebCore::Image>&&)image >+{ >+ _image = WTFMove(image); >+} >+ >+- (NSArray <NSValue *> *)highlightRectsForItem:(RVItem *)item >+{ >+ UNUSED_PARAM(item); >+ return @[[NSValue valueWithCGRect:self.highlightRect]]; >+} >+- (void)startHighlightingItem:(RVItem *)item >+{ >+ UNUSED_PARAM(item); >+ _highlighting = YES; >+} >+- (void)highlightItem:(RVItem *)item withProgress:(CGFloat)progress >+{ >+ UNUSED_PARAM(item); >+ UNUSED_PARAM(progress); >+} >+- (void)completeHighlightingItem:(RVItem *)item >+{ >+ UNUSED_PARAM(item); >+} >+- (void)stopHighlightingItem:(RVItem *)item >+{ >+ UNUSED_PARAM(item); >+ _highlighting = NO; >+} >+- (void)highlightRangeChangedForItem:(RVItem *)item >+{ >+ UNUSED_PARAM(item); >+} >+ >+- (BOOL)highlighting >+{ >+ return _highlighting; >+} >+ >+- (void)drawHighlightContentForItem:(RVItem *)item context:(CGContextRef)context >+{ >+ UNUSED_PARAM(item); >+ UNUSED_PARAM(context); >+ >+ NSArray <NSValue *> * rects = [self highlightRectsForItem:item]; >+ if (!rects.count) >+ return; >+ >+ UIView * textContentView = self.view; >+ >+ CGRect highlightRect = rects.firstObject.CGRectValue; >+ for (NSUInteger i = 1; i < rects.count; i++) >+ highlightRect = CGRectUnion(highlightRect, rects[i].CGRectValue); >+ highlightRect = [textContentView convertRect:highlightRect fromView:nil]; >+ >+ CGContextSaveGState(context); >+ CGAffineTransform ct = CGContextGetCTM(context); >+ CGAffineTransform t = CGAffineTransformIdentity; >+ CGFloat backingScale = ct.a; >+ CGFloat iOSMacScaleFactor = 0.77; >+ t = CGAffineTransformScale(t, iOSMacScaleFactor, iOSMacScaleFactor); >+ CGContextSetCTM(context, t); >+ >+ for (NSValue * v in rects) { >+ CGRect imgSrcRect = [textContentView convertRect:v.CGRectValue fromView:nil]; >+ RetainPtr<CGImageRef> imgRef = _image->nativeImage(); >+ CGRect origin = CGRectMake(backingScale*(imgSrcRect.origin.x - highlightRect.origin.x), backingScale*(imgSrcRect.origin.y - highlightRect.origin.y), backingScale*(highlightRect.size.width), backingScale*(highlightRect.size.height)); >+ CGContextDrawImage(context, origin, imgRef.get()); >+ } >+ >+ CGContextRestoreGState(context); >+ >+} >+ >+@end >+ >+#endif // PLATFORM(IOSMAC) > > #endif // ENABLE(REVEAL) > >@@ -321,7 +437,7 @@ std::tuple<NSString *, NSDictionary *> DictionaryLookup::stringForPDFSelection(P > > #endif // !PLATFORM(WATCH) > >-static WKRevealController showPopupOrCreateAnimationController(bool createAnimationController, const DictionaryPopupInfo& dictionaryPopupInfo, NSView *view, const WTF::Function<void(TextIndicator&)>& textIndicatorInstallationCallback, const WTF::Function<FloatRect(FloatRect)>& rootViewToViewConversionCallback, WTF::Function<void()>&& clearTextIndicator) >+static WKRevealController showPopupOrCreateAnimationController(bool createAnimationController, const DictionaryPopupInfo& dictionaryPopupInfo, RevealView *view, const WTF::Function<void(TextIndicator&)>& textIndicatorInstallationCallback, const WTF::Function<FloatRect(FloatRect)>& rootViewToViewConversionCallback, WTF::Function<void()>&& clearTextIndicator) > { > BEGIN_BLOCK_OBJC_EXCEPTIONS; > >@@ -379,7 +495,26 @@ static WKRevealController showPopupOrCreateAnimationController(bool createAnimat > [presenter revealItem:item.get() documentContext:nil presentingContext:context.get() options:nil]; > return nil; > >-#else // PLATFORM(MAC) >+#elif PLATFORM(IOSMAC) >+ >+ UNUSED_PARAM(view); >+ UNUSED_PARAM(textIndicatorInstallationCallback); >+ UNUSED_PARAM(rootViewToViewConversionCallback); >+ UNUSED_PARAM(clearTextIndicator); >+ >+ UNUSED_PARAM(createAnimationController); // remove once we create this correctly >+ >+ auto textIndicator = TextIndicator::create(dictionaryPopupInfo.textIndicator); >+ >+ RetainPtr<WebRevealHighlight> webHighlight = adoptNS([[WebRevealHighlight alloc] initWithHighlightRect:[view convertRect:textIndicator->selectionRectInRootViewCoordinates() toView:nil] view:view]); >+ >+ RetainPtr<RVItem> item = adoptNS([allocRVItemInstance() initWithText:dictionaryPopupInfo.attributedString.get().string selectedRange:NSMakeRange(0, 0)]); >+ >+ [webHighlight setImage:textIndicator->contentImage()]; >+ [UINSSharedRevealController() revealItem:item.get() locationInWindow:dictionaryPopupInfo.origin window:view.window highlighter: (id<UIRVPresenterHighlightDelegate>) webHighlight.get()]; >+ return nil; >+ >+#else // PLATFORM(IOS_FAMILY) > > UNUSED_PARAM(createAnimationController); > UNUSED_PARAM(dictionaryPopupInfo); >@@ -389,13 +524,13 @@ static WKRevealController showPopupOrCreateAnimationController(bool createAnimat > UNUSED_PARAM(clearTextIndicator); > > return nil; >-#endif // PLATFORM(MAC) >+#endif // PLATFORM(IOS_FAMILY) > > END_BLOCK_OBJC_EXCEPTIONS; > > } > >-void DictionaryLookup::showPopup(const DictionaryPopupInfo& dictionaryPopupInfo, NSView *view, const WTF::Function<void(TextIndicator&)>& textIndicatorInstallationCallback, const WTF::Function<FloatRect(FloatRect)>& rootViewToViewConversionCallback, WTF::Function<void()>&& clearTextIndicator) >+void DictionaryLookup::showPopup(const DictionaryPopupInfo& dictionaryPopupInfo, RevealView *view, const WTF::Function<void(TextIndicator&)>& textIndicatorInstallationCallback, const WTF::Function<FloatRect(FloatRect)>& rootViewToViewConversionCallback, WTF::Function<void()>&& clearTextIndicator) > { > showPopupOrCreateAnimationController(false, dictionaryPopupInfo, view, textIndicatorInstallationCallback, rootViewToViewConversionCallback, WTFMove(clearTextIndicator)); > } >diff --git a/Source/WebCore/editing/mac/DictionaryLookup.h b/Source/WebCore/editing/mac/DictionaryLookup.h >index f8f761cdc81aebd3df08837a3231c08f35a4feb9..1631967ff92adf8a8895f7fec5782d8c6123a637 100644 >--- a/Source/WebCore/editing/mac/DictionaryLookup.h >+++ b/Source/WebCore/editing/mac/DictionaryLookup.h >@@ -34,12 +34,15 @@ > #include <wtf/Function.h> > > OBJC_CLASS NSView; >+OBJC_CLASS UIView; > OBJC_CLASS PDFSelection; > > #if PLATFORM(MAC) > typedef id <NSImmediateActionAnimationController> WKRevealController; >+using RevealView = NSView; > #else > typedef id WKRevealController; >+using RevealView = UIView; > #endif // PLATFORM(MAC) > > namespace WebCore { >@@ -56,7 +59,7 @@ public: > > // FIXME: Should move/unify dictionaryPopupInfoForRange here too. > >- WEBCORE_EXPORT static void showPopup(const DictionaryPopupInfo&, NSView *, const WTF::Function<void(TextIndicator&)>& textIndicatorInstallationCallback, const WTF::Function<FloatRect(FloatRect)>& rootViewToViewConversionCallback = nullptr, WTF::Function<void()>&& clearTextIndicator = nullptr); >+ WEBCORE_EXPORT static void showPopup(const DictionaryPopupInfo&, RevealView *, const WTF::Function<void(TextIndicator&)>& textIndicatorInstallationCallback, const WTF::Function<FloatRect(FloatRect)>& rootViewToViewConversionCallback = nullptr, WTF::Function<void()>&& clearTextIndicator = nullptr); > WEBCORE_EXPORT static void hidePopup(); > > #if PLATFORM(MAC) >diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h >index 149714ab1d2265a6834d57ef47b116ea4e29e351..ead915f0945dbda5bb666497d532fa9402227fbe 100644 >--- a/Source/WebKit/UIProcess/PageClient.h >+++ b/Source/WebKit/UIProcess/PageClient.h >@@ -303,6 +303,8 @@ public: > virtual void setTextIndicator(Ref<WebCore::TextIndicator>, WebCore::TextIndicatorWindowLifetime) = 0; > virtual void clearTextIndicator(WebCore::TextIndicatorWindowDismissalAnimation) = 0; > virtual void setTextIndicatorAnimationProgress(float) = 0; >+ >+ virtual void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&) = 0; > #endif > > virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) = 0; >@@ -312,7 +314,6 @@ public: > #if PLATFORM(MAC) > virtual void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus) = 0; > virtual void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState) = 0; >- virtual void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&) = 0; > virtual void showCorrectionPanel(WebCore::AlternativeTextType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) = 0; > virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeText) = 0; > virtual String dismissCorrectionPanelSoon(WebCore::ReasonForDismissingAlternativeText) = 0; >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >index 877c8137f3316582ac5433eed5b17bdab2539d9f..5da6f99bf524023303d871da07bf72e16afcb526 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >@@ -134,6 +134,8 @@ private: > > void didCommitLayerTree(const RemoteLayerTreeTransaction&) override; > void layerTreeCommitComplete() override; >+ >+ void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&) override; > > void couldNotRestorePageState() override; > void restorePageState(Optional<WebCore::FloatPoint>, const WebCore::FloatPoint&, const WebCore::FloatBoxExtent&, double) override; >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >index 7e063da1d38c05ea36f2109b20fd7414c20b7532..bfb7542a42d8f0b92ec05360dfc2ff66866dbc72 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >@@ -54,6 +54,7 @@ > #import "WebEditCommandProxy.h" > #import "WebProcessProxy.h" > #import "_WKDownloadInternal.h" >+#import <WebCore/DictionaryLookup.h> > #import <WebCore/NotImplemented.h> > #import <WebCore/PlatformScreen.h> > #import <WebCore/PromisedAttachmentInfo.h> >@@ -453,6 +454,11 @@ void PageClientImpl::updateAcceleratedCompositingMode(const LayerTreeContext&) > { > } > >+void PageClientImpl::didPerformDictionaryLookup(const DictionaryPopupInfo& dictionaryPopupInfo) >+{ >+ DictionaryLookup::showPopup(dictionaryPopupInfo, m_contentView, nullptr); >+} >+ > void PageClientImpl::setRemoteLayerTreeRootNode(RemoteLayerTreeNode* rootNode) > { > [m_contentView _setAcceleratedCompositingRootView:rootNode ? rootNode->uiView() : nil]; >diff --git a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >index 11a746739f76bf723c3ba80116addde93ab48210..b9bd70c9bee1069e1b4f123098b9cae12d6487c5 100644 >--- a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >+++ b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >@@ -981,9 +981,9 @@ void WebPageProxy::setFocusedElementSelectedIndex(uint32_t index, bool allowMult > process().send(Messages::WebPage::SetFocusedElementSelectedIndex(index, allowMultipleSelection), m_pageID); > } > >-void WebPageProxy::didPerformDictionaryLookup(const DictionaryPopupInfo&) >+void WebPageProxy::didPerformDictionaryLookup(const DictionaryPopupInfo& dictionaryPopupInfo) > { >- notImplemented(); >+ pageClient().didPerformDictionaryLookup(dictionaryPopupInfo); > } > > void WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication(const String&, const String&, const IPC::DataReference&, const String&) >diff --git a/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm b/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm >index 8ce565fb956f36cb752ef811a1245eb55ddcf9b3..a2cf03a65fd4c865229d89067a1951fa942edaa1 100644 >--- a/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm >+++ b/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm >@@ -137,7 +137,7 @@ DictionaryPopupInfo WebPage::dictionaryPopupInfoForRange(Frame& frame, Range& ra > float scaledAscent = style ? style->fontMetrics().ascent() * pageScaleFactor() : 0; > dictionaryPopupInfo.origin = FloatPoint(rangeRect.x(), rangeRect.y() + scaledAscent); > dictionaryPopupInfo.options = options; >- >+ > #if PLATFORM(MAC) > > NSAttributedString *nsAttributedString = editingAttributedStringFromRange(range, IncludeImagesInAttributedString::No); >@@ -175,6 +175,10 @@ DictionaryPopupInfo WebPage::dictionaryPopupInfoForRange(Frame& frame, Range& ra > dictionaryPopupInfo.attributedString = scaledNSAttributedString; > #endif // PLATFORM(MAC) > >+#if PLATFORM(IOSMAC) >+ dictionaryPopupInfo.attributedString = [[NSMutableAttributedString alloc] initWithString:range.text()]; >+#endif // PLATFORM(IOSMAC) >+ > editor.setIsGettingDictionaryPopupInfo(false); > return dictionaryPopupInfo; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193408
:
359079
|
359093
|
359102
|
359103
|
359184
|
359212
|
359219
|
359223