https://bugs.webkit.org/show_bug.cgi?id=138956
<rdar://problem/
18992185>
Reviewed by Beth Dakin.
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithSelectionInFrame):
(WebCore::TextIndicator::TextIndicator):
* page/TextIndicator.h:
(WebCore::TextIndicator::selectionRectInScreenCoordinates):
(WebCore::TextIndicator::textBoundingRectInScreenCoordinates):
(WebCore::TextIndicator::selectionRectInWindowCoordinates): Deleted.
(WebCore::TextIndicator::textBoundingRectInWindowCoordinates): Deleted.
Store TextIndicator rects in screen coordinates, since that's what we
want anyway, and this makes it easier to share this code between the WebKits.
* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
(WebCore::TextIndicatorWindow::setTextIndicator):
Avoid some rect conversion because the TextIndicator rects are already in screen coordinates.
* WebView/WebActionMenuController.h:
* WebView/WebActionMenuController.mm:
(-[WebActionMenuController webView:willHandleMouseDown:]):
(-[WebActionMenuController webView:didHandleScrollWheel:]):
(-[WebActionMenuController prepareForMenu:withEvent:]):
(-[WebActionMenuController didCloseMenu:withEvent:]):
(-[WebActionMenuController _defaultMenuItemsForDataDetectedText]):
(-[WebActionMenuController _showTextIndicator]):
(-[WebActionMenuController _hideTextIndicator]):
(-[WebActionMenuController _dismissActionMenuPopovers]):
Copy the WebKit2 WKActionMenuController TextIndicator implementation
into WebActionMenuController. The only significant difference is
that we build the TextIndicator right at menu construction time
instead of in the Web process.
* WebView/WebHTMLView.mm:
(-[WebHTMLView scrollWheel:]):
Let the WebActionMenuController know that we're handling a scroll.
(-[WebHTMLView mouseDown:]):
Let the WebActionMenuController know that we're handling a mouseDown.
* WebView/WebView.mm:
(-[WebView _setTextIndicator:fadeOut:animationCompletionHandler:]):
(-[WebView _clearTextIndicator]):
(-[WebView _actionMenuController]):
(-[WebView _convertRectFromRootView:]): Deleted.
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
* WebView/WebViewInternal.h:
Keep a TextIndicatorWindow on WebView, just like WKView does.
Expose the WebActionMenuController on WebView (internally).
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
(WebKit::FindController::drawRect):
Adjust to the fact that TextIndicator keeps screen-relative rects.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176599
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-12-01 Tim Horton <timothy_horton@apple.com>
+
+ Implement yellow highlight for WebKit1 data detectors
+ https://bugs.webkit.org/show_bug.cgi?id=138956
+ <rdar://problem/18992185>
+
+ Reviewed by Beth Dakin.
+
+ * page/TextIndicator.cpp:
+ (WebCore::TextIndicator::createWithSelectionInFrame):
+ (WebCore::TextIndicator::TextIndicator):
+ * page/TextIndicator.h:
+ (WebCore::TextIndicator::selectionRectInScreenCoordinates):
+ (WebCore::TextIndicator::textBoundingRectInScreenCoordinates):
+ (WebCore::TextIndicator::selectionRectInWindowCoordinates): Deleted.
+ (WebCore::TextIndicator::textBoundingRectInWindowCoordinates): Deleted.
+ Store TextIndicator rects in screen coordinates, since that's what we
+ want anyway, and this makes it easier to share this code between the WebKits.
+
+ * page/mac/TextIndicatorWindow.mm:
+ (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
+ (WebCore::TextIndicatorWindow::setTextIndicator):
+ Avoid some rect conversion because the TextIndicator rects are already in screen coordinates.
+
2014-12-01 Anders Carlsson <andersca@apple.com>
Remove old site specific quirks code that was added in 2009
// Store the selection rect in window coordinates, to be used subsequently
// to determine if the indicator and selection still precisely overlap.
- IntRect selectionRectInWindowCoordinates = frame.view()->contentsToWindow(selectionRect);
+ IntRect selectionRectInScreenCoordinates = frame.view()->contentsToScreen(selectionRect);
Vector<FloatRect> 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
// care where the selection highlight goes, just where the text actually is.
- FloatRect textBoundingRectInWindowCoordinates;
- Vector<FloatRect> textRectsInWindowCoordinates;
+ FloatRect textBoundingRectInScreenCoordinates;
+ Vector<FloatRect> textRectsInScreenCoordinates;
for (const FloatRect& textRect : textRects) {
- FloatRect textRectInWindowCoordinates = frame.view()->contentsToWindow(enclosingIntRect(textRect));
- textRectsInWindowCoordinates.append(textRectInWindowCoordinates);
- textBoundingRectInWindowCoordinates.unite(textRectInWindowCoordinates);
+ FloatRect textRectInScreenCoordinates = frame.view()->contentsToScreen(enclosingIntRect(textRect));
+ textRectsInScreenCoordinates.append(textRectInScreenCoordinates);
+ textBoundingRectInScreenCoordinates.unite(textRectInScreenCoordinates);
}
Vector<FloatRect> textRectsInBoundingRectCoordinates;
- for (auto rect : textRectsInWindowCoordinates) {
- rect.moveBy(-textBoundingRectInWindowCoordinates.location());
+ for (auto rect : textRectsInScreenCoordinates) {
+ rect.moveBy(-textBoundingRectInScreenCoordinates.location());
textRectsInBoundingRectCoordinates.append(rect);
}
TextIndicatorData data;
- data.selectionRectInWindowCoordinates = selectionRectInWindowCoordinates;
- data.textBoundingRectInWindowCoordinates = textBoundingRectInWindowCoordinates;
+ data.selectionRectInScreenCoordinates = selectionRectInScreenCoordinates;
+ data.textBoundingRectInScreenCoordinates = textBoundingRectInScreenCoordinates;
data.textRectsInBoundingRectCoordinates = textRectsInBoundingRectCoordinates;
data.contentImageScaleFactor = frame.page()->deviceScaleFactor();
data.contentImage = indicatorBitmap;
TextIndicator::TextIndicator(const TextIndicatorData& data)
: m_data(data)
{
- ASSERT(m_data.contentImageScaleFactor != 1 || m_data.contentImage->size() == enclosingIntRect(m_data.selectionRectInWindowCoordinates).size());
+ ASSERT(m_data.contentImageScaleFactor != 1 || m_data.contentImage->size() == enclosingIntRect(m_data.selectionRectInScreenCoordinates).size());
if (textIndicatorsForTextRectsOverlap(m_data.textRectsInBoundingRectCoordinates)) {
m_data.textRectsInBoundingRectCoordinates[0] = unionRect(m_data.textRectsInBoundingRectCoordinates);
};
struct TextIndicatorData {
- FloatRect selectionRectInWindowCoordinates;
- FloatRect textBoundingRectInWindowCoordinates;
+ FloatRect selectionRectInScreenCoordinates;
+ FloatRect textBoundingRectInScreenCoordinates;
Vector<FloatRect> textRectsInBoundingRectCoordinates;
float contentImageScaleFactor;
RefPtr<Image> contentImageWithHighlight;
~TextIndicator();
- FloatRect selectionRectInWindowCoordinates() const { return m_data.selectionRectInWindowCoordinates; }
- FloatRect textBoundingRectInWindowCoordinates() const { return m_data.textBoundingRectInWindowCoordinates; }
+ FloatRect selectionRectInScreenCoordinates() const { return m_data.selectionRectInScreenCoordinates; }
+ FloatRect textBoundingRectInScreenCoordinates() const { return m_data.textBoundingRectInScreenCoordinates; }
const Vector<FloatRect>& textRectsInBoundingRectCoordinates() const { return m_data.textRectsInBoundingRectCoordinates; }
float contentImageScaleFactor() const { return m_data.contentImageScaleFactor; }
Image *contentImageWithHighlight() const { return m_data.contentImageWithHighlight.get(); }
[textLayer setContents:(id)contentsImage.get()];
FloatRect imageRect = textRect;
- imageRect.move(_textIndicator->textBoundingRectInWindowCoordinates().location() - _textIndicator->selectionRectInWindowCoordinates().location());
+ imageRect.move(_textIndicator->textBoundingRectInScreenCoordinates().location() - _textIndicator->selectionRectInScreenCoordinates().location());
[textLayer setContentsRect:CGRectMake(imageRect.x() / contentsImageLogicalSize.width(), imageRect.y() / contentsImageLogicalSize.height(), imageRect.width() / contentsImageLogicalSize.width(), imageRect.height() / contentsImageLogicalSize.height())];
[textLayer setContentsGravity:kCAGravityCenter];
[textLayer setContentsScale:_textIndicator->contentImageScaleFactor()];
if (!m_textIndicator)
return;
- NSRect contentRect = m_textIndicator->textBoundingRectInWindowCoordinates();
-
+ NSRect contentRect = m_textIndicator->textBoundingRectInScreenCoordinates();
CGFloat horizontalMargin = std::max(dropShadowBlurRadius * 2 + horizontalBorder, contentRect.size.width * 2);
CGFloat verticalMargin = std::max(dropShadowBlurRadius * 2 + verticalBorder, contentRect.size.height * 2);
contentRect = NSInsetRect(contentRect, -horizontalMargin, -verticalMargin);
- NSRect windowFrameRect = NSIntegralRect([m_targetView convertRect:contentRect toView:nil]);
- windowFrameRect = [[m_targetView window] convertRectToScreen:windowFrameRect];
- NSRect windowContentRect = [NSWindow contentRectForFrameRect:windowFrameRect styleMask:NSBorderlessWindowMask];
-
+ NSRect windowContentRect = [NSWindow contentRectForFrameRect:NSIntegralRect(contentRect) styleMask:NSBorderlessWindowMask];
m_textIndicatorWindow = adoptNS([[NSWindow alloc] initWithContentRect:windowContentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
[m_textIndicatorWindow setBackgroundColor:[NSColor clearColor]];
+2014-12-01 Tim Horton <timothy_horton@apple.com>
+
+ Implement yellow highlight for WebKit1 data detectors
+ https://bugs.webkit.org/show_bug.cgi?id=138956
+ <rdar://problem/18992185>
+
+ Reviewed by Beth Dakin.
+
+ * WebView/WebActionMenuController.h:
+ * WebView/WebActionMenuController.mm:
+ (-[WebActionMenuController webView:willHandleMouseDown:]):
+ (-[WebActionMenuController webView:didHandleScrollWheel:]):
+ (-[WebActionMenuController prepareForMenu:withEvent:]):
+ (-[WebActionMenuController didCloseMenu:withEvent:]):
+ (-[WebActionMenuController _defaultMenuItemsForDataDetectedText]):
+ (-[WebActionMenuController _showTextIndicator]):
+ (-[WebActionMenuController _hideTextIndicator]):
+ (-[WebActionMenuController _dismissActionMenuPopovers]):
+ Copy the WebKit2 WKActionMenuController TextIndicator implementation
+ into WebActionMenuController. The only significant difference is
+ that we build the TextIndicator right at menu construction time
+ instead of in the Web process.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView scrollWheel:]):
+ Let the WebActionMenuController know that we're handling a scroll.
+
+ (-[WebHTMLView mouseDown:]):
+ Let the WebActionMenuController know that we're handling a mouseDown.
+
+ * WebView/WebView.mm:
+ (-[WebView _setTextIndicator:fadeOut:animationCompletionHandler:]):
+ (-[WebView _clearTextIndicator]):
+ (-[WebView _actionMenuController]):
+ (-[WebView _convertRectFromRootView:]): Deleted.
+ * WebView/WebViewData.h:
+ * WebView/WebViewData.mm:
+ * WebView/WebViewInternal.h:
+ Keep a TextIndicatorWindow on WebView, just like WKView does.
+ Expose the WebActionMenuController on WebView (internally).
+
2014-12-01 Anders Carlsson <andersca@apple.com>
Remove old site specific quirks code that was added in 2009
namespace WebCore {
class Range;
+class TextIndicator;
}
@interface WebActionMenuController : NSObject <NSSharingServiceDelegate, NSSharingServicePickerDelegate> {
RetainPtr<NSSharingServicePicker> _sharingServicePicker;
RetainPtr<DDActionContext> _currentActionContext;
RefPtr<WebCore::Range> _currentDetectedDataRange;
+ BOOL _isShowingTextIndicator;
+ RefPtr<WebCore::TextIndicator> _currentDetectedDataTextIndicator;
+ BOOL _hasActivatedActionContext;
}
- (id)initWithWebView:(WebView *)webView;
- (void)willOpenMenu:(NSMenu *)menu withEvent:(NSEvent *)event;
- (void)didCloseMenu:(NSMenu *)menu withEvent:(NSEvent *)event;
+- (void)webView:(WebView *)webView willHandleMouseDown:(NSEvent *)event;
+- (void)webView:(WebView *)webView didHandleScrollWheel:(NSEvent *)event;
+
@end
#import <WebCore/SharedBuffer.h>
#import <WebCore/SoftLinking.h>
#import <WebCore/TextCheckerClient.h>
+#import <WebCore/TextIndicator.h>
#import <WebKitSystemInterface.h>
#import <objc/objc-class.h>
#import <objc/objc.h>
return [[[WebElementDictionary alloc] initWithHitTestResult:_hitTestResult] autorelease];
}
+- (void)webView:(WebView *)webView willHandleMouseDown:(NSEvent *)event
+{
+ if (_type == WebActionMenuDataDetectedItem && _currentActionContext && _hasActivatedActionContext) {
+ [getDDActionsManagerClass() didUseActions];
+ _hasActivatedActionContext = NO;
+ }
+}
+
+- (void)webView:(WebView *)webView didHandleScrollWheel:(NSEvent *)event
+{
+ [self _dismissActionMenuPopovers];
+}
+
- (void)prepareForMenu:(NSMenu *)menu withEvent:(NSEvent *)event
{
if (!_webView)
if (menu != actionMenu)
return;
+ [self _dismissActionMenuPopovers];
[actionMenu removeAllItems];
WebElementDictionary *hitTestResult = [self performHitTestAtPoint:event.locationInWindow];
for (NSMenuItem *item in menuItems)
[actionMenu addItem:item];
- if (_type == WebActionMenuDataDetectedItem && _currentActionContext && ![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
- [menu cancelTracking];
- [menu removeAllItems];
+ if (_type == WebActionMenuDataDetectedItem && _currentActionContext) {
+ _hasActivatedActionContext = YES;
+ if (![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
+ [menu cancelTracking];
+ [menu removeAllItems];
+ }
}
}
if (menu != _webView.actionMenu)
return;
- if (_type == WebActionMenuDataDetectedItem && _currentActionContext)
+ if (_type == WebActionMenuDataDetectedItem && _currentActionContext && _hasActivatedActionContext) {
[getDDActionsManagerClass() didUseActions];
+ _hasActivatedActionContext = NO;
+ }
_type = WebActionMenuNone;
_sharingServicePicker = nil;
+ _currentDetectedDataTextIndicator = nil;
+ _currentDetectedDataRange = nil;
+ _currentActionContext = nil;
}
#pragma mark Link actions
return @[ ];
}
- // FIXME: We should hide/show the yellow highlight here.
+ _currentDetectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicatorPresentationTransition::BounceAndCrossfade);
+
_currentActionContext = [actionContext contextForView:_webView altMode:YES interactionStartedHandler:^() {
} interactionChangedHandler:^() {
+ [self _showTextIndicator];
} interactionStoppedHandler:^() {
+ [self _hideTextIndicator];
}];
_currentDetectedDataRange = detectedDataRange;
- [_currentActionContext setHighlightFrame:[_webView.window convertRectToScreen:[_webView convertRect:detectedDataBoundingBox toView:nil]]];
+ [_currentActionContext setHighlightFrame:[_webView.window convertRectToScreen:detectedDataBoundingBox]];
- return [[getDDActionsManagerClass() sharedManager] menuItemsForResult:[_currentActionContext mainResult] actionContext:_currentActionContext.get()];
+ NSArray *menuItems = [[getDDActionsManagerClass() sharedManager] menuItemsForResult:[_currentActionContext mainResult] actionContext:_currentActionContext.get()];
+ if (menuItems.count == 1 && _currentDetectedDataTextIndicator)
+ _currentDetectedDataTextIndicator->setPresentationTransition(TextIndicatorPresentationTransition::Bounce);
+ return menuItems;
}
- (void)_copySelection:(id)sender
return @[ ];
}
+#pragma mark Text Indicator
+
+- (void)_showTextIndicator
+{
+ if (_isShowingTextIndicator)
+ return;
+
+ if (_type == WebActionMenuDataDetectedItem && _currentDetectedDataTextIndicator) {
+ [_webView _setTextIndicator:_currentDetectedDataTextIndicator.get() fadeOut:NO animationCompletionHandler:^ { }];
+ _isShowingTextIndicator = YES;
+ }
+}
+
+- (void)_hideTextIndicator
+{
+ if (!_isShowingTextIndicator)
+ return;
+
+ [_webView _clearTextIndicator];
+ _isShowingTextIndicator = NO;
+}
+
+- (void)_dismissActionMenuPopovers
+{
+ DDActionsManager *actionsManager = [getDDActionsManagerClass() sharedManager];
+ if ([actionsManager respondsToSelector:@selector(requestBubbleClosureUnanchorOnFailure:)])
+ [actionsManager requestBubbleClosureUnanchorOnFailure:YES];
+
+ [self _hideTextIndicator];
+}
+
@end
#import "DOMDocumentInternal.h"
#import "DOMNodeInternal.h"
#import "DOMRangeInternal.h"
+#import "WebActionMenuController.h"
#import "WebArchive.h"
#import "WebClipView.h"
#import "WebDOMOperationsInternal.h"
#if !PLATFORM(IOS)
if (!frame || !frame->eventHandler().wheelEvent(event))
[super scrollWheel:event];
+
+ [[[self _webView] _actionMenuController] webView:[self _webView] didHandleScrollWheel:event];
#else
if (frame)
frame->eventHandler().wheelEvent(event);
// Record the mouse down position so we can determine drag hysteresis.
[self _setMouseDownEvent:event];
+#if PLATFORM(MAC)
+ [[[self _webView] _actionMenuController] webView:[self _webView] willHandleMouseDown:event];
+#endif
+
#if PLATFORM(IOS)
// TEXTINPUT: if there is marked text and the current input
// manager wants to handle mouse events, we need to make sure to
#import "WebNSPrintOperationExtras.h"
#import "WebPDFView.h"
#import <WebCore/NSViewSPI.h>
+#import <WebCore/TextIndicator.h>
+#import <WebCore/TextIndicatorWindow.h>
#import <WebCore/WebVideoFullscreenController.h>
#else
#import "MemoryMeasure.h"
return NSMakeRect(rect.origin.x, [self bounds].size.height - rect.origin.y - rect.size.height, rect.size.width, rect.size.height);
}
-#if !PLATFORM(IOS)
+#if PLATFORM(MAC)
- (void)prepareForMenu:(NSMenu *)menu withEvent:(NSEvent *)event
{
if (menu != self.actionMenu)
[_private->actionMenuController didCloseMenu:menu withEvent:event];
}
+
+- (void)_setTextIndicator:(TextIndicator *)textIndicator fadeOut:(BOOL)fadeOut animationCompletionHandler:(std::function<void ()>)completionHandler
+{
+ if (!textIndicator) {
+ _private->textIndicatorWindow = nullptr;
+ return;
+ }
+
+ if (!_private->textIndicatorWindow)
+ _private->textIndicatorWindow = std::make_unique<TextIndicatorWindow>(self);
+
+ _private->textIndicatorWindow->setTextIndicator(textIndicator, fadeOut, WTF::move(completionHandler));
+}
+
+- (void)_clearTextIndicator
+{
+ [self _setTextIndicator:nullptr fadeOut:NO animationCompletionHandler:^ { }];
+}
+
+- (WebActionMenuController *)_actionMenuController
+{
+ return _private->actionMenuController;
+}
#endif
@end
class AlternativeTextUIController;
class HistoryItem;
class Page;
+class TextIndicatorWindow;
}
@class WebActionMenuController;
WebNodeHighlight *currentNodeHighlight;
WebActionMenuController *actionMenuController;
+ std::unique_ptr<WebCore::TextIndicatorWindow> textIndicatorWindow;
BOOL allowsUndo;
#import <WebCore/AlternativeTextUIController.h>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebCore/HistoryItem.h>
+#import <WebCore/TextIndicatorWindow.h>
#import <objc/objc-auto.h>
#import <runtime/InitializeThreading.h>
#import <wtf/MainThread.h>
#import <WebCore/LayoutMilestones.h>
#import <WebCore/TextAlternativeWithRange.h>
#import <WebCore/WebCoreKeyboardUIMode.h>
-
-#include <wtf/Forward.h>
-#include <wtf/RetainPtr.h>
+#import <functional>
+#import <wtf/Forward.h>
+#import <wtf/RetainPtr.h>
namespace WebCore {
class Element;
class Event;
class Frame;
+class HTMLVideoElement;
class HistoryItem;
-class URL;
class KeyboardEvent;
class Page;
class RenderBox;
-class HTMLVideoElement;
+class TextIndicator;
+class URL;
struct DictationAlternative;
}
class WebSelectionServiceController;
#endif
+@class WebActionMenuController;
@class WebBasePluginPackage;
@class WebDownload;
@class WebNodeHighlight;
- (NSPoint)_convertPointFromRootView:(NSPoint)point;
- (NSRect)_convertRectFromRootView:(NSRect)rect;
+#if PLATFORM(MAC) && defined(__cplusplus)
+- (void)_setTextIndicator:(WebCore::TextIndicator*)textIndicator fadeOut:(BOOL)fadeOut animationCompletionHandler:(std::function<void ()>)completionHandler;
+- (void)_clearTextIndicator;
+- (WebActionMenuController *)_actionMenuController;
+#endif
+
@end
+2014-12-01 Tim Horton <timothy_horton@apple.com>
+
+ Implement yellow highlight for WebKit1 data detectors
+ https://bugs.webkit.org/show_bug.cgi?id=138956
+ <rdar://problem/18992185>
+
+ Reviewed by Beth Dakin.
+
+ * Shared/WebCoreArgumentCoders.cpp:
+ (IPC::ArgumentCoder<TextIndicatorData>::encode):
+ (IPC::ArgumentCoder<TextIndicatorData>::decode):
+ * WebProcess/WebPage/FindController.cpp:
+ (WebKit::FindController::updateFindIndicator):
+ (WebKit::FindController::drawRect):
+ Adjust to the fact that TextIndicator keeps screen-relative rects.
+
2014-12-01 Anders Carlsson <andersca@apple.com>
Remove old site specific quirks code that was added in 2009
void ArgumentCoder<TextIndicatorData>::encode(ArgumentEncoder& encoder, const TextIndicatorData& textIndicatorData)
{
- encoder << textIndicatorData.selectionRectInWindowCoordinates;
- encoder << textIndicatorData.textBoundingRectInWindowCoordinates;
+ encoder << textIndicatorData.selectionRectInScreenCoordinates;
+ encoder << textIndicatorData.textBoundingRectInScreenCoordinates;
encoder << textIndicatorData.textRectsInBoundingRectCoordinates;
encoder << textIndicatorData.contentImageScaleFactor;
encoder.encodeEnum(textIndicatorData.presentationTransition);
bool ArgumentCoder<TextIndicatorData>::decode(ArgumentDecoder& decoder, TextIndicatorData& textIndicatorData)
{
- if (!decoder.decode(textIndicatorData.selectionRectInWindowCoordinates))
+ if (!decoder.decode(textIndicatorData.selectionRectInScreenCoordinates))
return false;
- if (!decoder.decode(textIndicatorData.textBoundingRectInWindowCoordinates))
+ if (!decoder.decode(textIndicatorData.textBoundingRectInScreenCoordinates))
return false;
if (!decoder.decode(textIndicatorData.textRectsInBoundingRectCoordinates))
if (!indicator)
return false;
- m_findIndicatorRect = enclosingIntRect(indicator->selectionRectInWindowCoordinates());
+ m_findIndicatorRect = enclosingIntRect(indicator->selectionRectInScreenCoordinates());
m_webPage->send(Messages::WebPageProxy::SetTextIndicator(indicator->data(), !isShowingOverlay));
m_isShowingFindIndicator = true;
return;
if (Frame* selectedFrame = frameWithSelection(m_webPage->corePage())) {
- IntRect findIndicatorRect = selectedFrame->view()->contentsToWindow(enclosingIntRect(selectedFrame->selection().selectionBounds()));
+ IntRect findIndicatorRect = selectedFrame->view()->contentsToScreen(enclosingIntRect(selectedFrame->selection().selectionBounds()));
if (findIndicatorRect != m_findIndicatorRect)
hideFindIndicator();