Skip to content
Permalink
Browse files
Add roundedPoint to HitTestResult and change platform code to use it
https://bugs.webkit.org/show_bug.cgi?id=80715

Reviewed by James Robinson.

Change ports to use roundedPoint to avoid exposing subpixel types to
platform code.

Source/WebCore:

No new tests.

* rendering/HitTestResult.h:
(WebCore::HitTestResult::roundedPoint):

Source/WebKit/chromium:

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::mouseDidMoveOverElement):
* src/ContextMenuClientImpl.cpp:
(WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):

Source/WebKit/mac:

* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::showContextMenu):

Source/WebKit/qt:

* Api/qwebframe.cpp:
(QWebHitTestResultPrivate::QWebHitTestResultPrivate):

Source/WebKit/win:

* WebView.cpp:
(WebView::handleContextMenuEvent):

Source/WebKit2:

* WebProcess/WebPage/WebContextMenu.cpp:
(WebKit::WebContextMenu::show):


Canonical link: https://commits.webkit.org/97940@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eaenet committed Mar 10, 2012
1 parent 5a4c3ee commit 3f82327168c61b2d4c6933b2e5b93fbd81c1267b
Showing 13 changed files with 89 additions and 6 deletions.
@@ -1,3 +1,18 @@
2012-03-09 Emil A Eklund <eae@chromium.org>

Add roundedPoint to HitTestResult and change platform code to use it
https://bugs.webkit.org/show_bug.cgi?id=80715

Reviewed by James Robinson.

Change ports to use roundedPoint to avoid exposing subpixel types to
platform code.

No new tests.

* rendering/HitTestResult.h:
(WebCore::HitTestResult::roundedPoint):

2012-03-09 Kentaro Hara <haraken@chromium.org>

[V8][Performance] Inline hot methods in V8Bindings.h
@@ -57,6 +57,7 @@ class HitTestResult {
Node* innerNode() const { return m_innerNode.get(); }
Node* innerNonSharedNode() const { return m_innerNonSharedNode.get(); }
LayoutPoint point() const { return m_point; }
IntPoint roundedPoint() const { return roundedIntPoint(m_point); }
LayoutPoint localPoint() const { return m_localPoint; }
Element* URLElement() const { return m_innerURLElement.get(); }
Scrollbar* scrollbar() const { return m_scrollbar.get(); }
@@ -1,3 +1,18 @@
2012-03-09 Emil A Eklund <eae@chromium.org>

Add roundedPoint to HitTestResult and change platform code to use it
https://bugs.webkit.org/show_bug.cgi?id=80715

Reviewed by James Robinson.

Change ports to use roundedPoint to avoid exposing subpixel types to
platform code.

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::mouseDidMoveOverElement):
* src/ContextMenuClientImpl.cpp:
(WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):

2012-03-09 W. James MacLean <wjmaclean@chromium.org>

[chromium] Implement scroll physics architecture for impl/main thread
@@ -618,7 +618,7 @@ void ChromeClientImpl::mouseDidMoveOverElement(
Widget* widget = toRenderWidget(object)->widget();
if (widget && widget->isPluginContainer()) {
WebPluginContainerImpl* plugin = static_cast<WebPluginContainerImpl*>(widget);
url = plugin->plugin()->linkAtPosition(result.point());
url = plugin->plugin()->linkAtPosition(result.roundedPoint());
}
}
}
@@ -158,7 +158,7 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems(
Frame* selectedFrame = r.innerNonSharedNode()->document()->frame();

WebContextMenuData data;
data.mousePosition = selectedFrame->view()->contentsToWindow(r.point());
data.mousePosition = selectedFrame->view()->contentsToWindow(r.roundedPoint());

// Compute edit flags.
data.editFlags = WebContextMenuData::CanDoNone;
@@ -1,3 +1,16 @@
2012-03-09 Emil A Eklund <eae@chromium.org>

Add roundedPoint to HitTestResult and change platform code to use it
https://bugs.webkit.org/show_bug.cgi?id=80715

Reviewed by James Robinson.

Change ports to use roundedPoint to avoid exposing subpixel types to
platform code.

* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::showContextMenu):

2012-03-09 Jon Lee <jonlee@apple.com>

Add support for ENABLE(LEGACY_NOTIFICATIONS)
@@ -366,7 +366,7 @@ static void fixMenusReceivedFromOldClients(NSMutableArray *newMenuItems, NSMutab
if (!frameView)
return;

IntPoint point = frameView->contentsToWindow(controller->hitTestResult().point());
IntPoint point = frameView->contentsToWindow(controller->hitTestResult().roundedPoint());
NSView* view = frameView->documentView();
NSPoint nsScreenPoint = [view convertPoint:point toView:nil];
// Show the contextual menu for this event.
@@ -1750,7 +1750,7 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult
{
if (!hitTest.innerNode())
return;
pos = hitTest.point();
pos = hitTest.roundedPoint();
WebCore::TextDirection dir;
title = hitTest.title(dir);
linkText = hitTest.textContent();
@@ -1,3 +1,16 @@
2012-03-09 Emil A Eklund <eae@chromium.org>

Add roundedPoint to HitTestResult and change platform code to use it
https://bugs.webkit.org/show_bug.cgi?id=80715

Reviewed by James Robinson.

Change ports to use roundedPoint to avoid exposing subpixel types to
platform code.

* Api/qwebframe.cpp:
(QWebHitTestResultPrivate::QWebHitTestResultPrivate):

2012-03-09 Jon Lee <jonlee@apple.com>

Add support for ENABLE(LEGACY_NOTIFICATIONS)
@@ -1,3 +1,16 @@
2012-03-09 Emil A Eklund <eae@chromium.org>

Add roundedPoint to HitTestResult and change platform code to use it
https://bugs.webkit.org/show_bug.cgi?id=80715

Reviewed by James Robinson.

Change ports to use roundedPoint to avoid exposing subpixel types to
platform code.

* WebView.cpp:
(WebView::handleContextMenuEvent):

2012-03-08 Steve Falkenburg <sfalken@apple.com>

Separate WTF parts of JavaScriptCoreGenerated into WTFGenerated for Windows build
@@ -1349,7 +1349,7 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
if (!view)
return false;

POINT point(view->contentsToWindow(contextMenuController->hitTestResult().point()));
POINT point(view->contentsToWindow(contextMenuController->hitTestResult().roundedPoint()));

// Translate the point to screen coordinates
if (!::ClientToScreen(m_viewWindow, &point))
@@ -1,3 +1,16 @@
2012-03-09 Emil A Eklund <eae@chromium.org>

Add roundedPoint to HitTestResult and change platform code to use it
https://bugs.webkit.org/show_bug.cgi?id=80715

Reviewed by James Robinson.

Change ports to use roundedPoint to avoid exposing subpixel types to
platform code.

* WebProcess/WebPage/WebContextMenu.cpp:
(WebKit::WebContextMenu::show):

2012-03-09 Alexey Proskuryakov <ap@apple.com>

[Mac] Pass sandbox profiles through preprocessor
@@ -83,7 +83,7 @@ void WebContextMenu::show()

// Mark the WebPage has having a shown context menu then notify the UIProcess.
m_page->contextMenuShowing();
m_page->send(Messages::WebPageProxy::ShowContextMenu(view->contentsToWindow(controller->hitTestResult().point()), webHitTestResultData, proposedMenu, InjectedBundleUserMessageEncoder(userData.get())));
m_page->send(Messages::WebPageProxy::ShowContextMenu(view->contentsToWindow(controller->hitTestResult().roundedPoint()), webHitTestResultData, proposedMenu, InjectedBundleUserMessageEncoder(userData.get())));
}

void WebContextMenu::itemSelected(const WebContextMenuItemData& item)

0 comments on commit 3f82327

Please sign in to comment.