Commit ded59a65 authored by akling@apple.com's avatar akling@apple.com

Remove unused TOUCH_ADJUSTMENT code.

<https://webkit.org/b/127181>

Source/WebCore:

There are no ports using the ENABLE(TOUCH_ADJUSTMENT) feature
anymore, so nuke it from orbit.

Reviewed by Anders Carlsson.

* page/EventHandler.cpp:
* page/EventHandler.h:
* page/Settings.in:
* page/TouchAdjustment.cpp: Removed.
* page/TouchAdjustment.h: Removed.
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Reviewed by Anders Carlsson.

* WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
(WebKit::WebPage::findZoomableAreaForPoint):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d99f20e7
2014-01-17 Andreas Kling <akling@apple.com>
Remove unused TOUCH_ADJUSTMENT code.
<https://webkit.org/b/127181>
There are no ports using the ENABLE(TOUCH_ADJUSTMENT) feature
anymore, so nuke it from orbit.
Reviewed by Anders Carlsson.
* page/EventHandler.cpp:
* page/EventHandler.h:
* page/Settings.in:
* page/TouchAdjustment.cpp: Removed.
* page/TouchAdjustment.h: Removed.
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
2014-01-17 Beth Dakin <bdakin@apple.com>
Need a way to test the tile cache with margins enabled
......@@ -92,10 +92,6 @@
#include <wtf/StdLibExtras.h>
#include <wtf/TemporaryChange.h>
#if ENABLE(TOUCH_ADJUSTMENT)
#include "TouchAdjustment.h"
#endif
#if ENABLE(SVG)
#include "SVGDocument.h"
#include "SVGElementInstance.h"
......@@ -2625,43 +2621,6 @@ void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv
m_previousWheelScrolledElement = stopElement;
}
#if ENABLE(TOUCH_ADJUSTMENT)
bool EventHandler::bestClickableNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode)
{
IntPoint hitTestPoint = m_frame.view()->windowToContents(touchCenter);
HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active, touchRadius);
IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
// FIXME: Should be able to handle targetNode being a shadow DOM node to avoid performing uncessary hit tests
// in the case where further processing on the node is required. Returning the shadow ancestor prevents a
// regression in touchadjustment/html-label.html. Some refinement is required to testing/internals to
// handle targetNode being a shadow DOM node.
bool success = findBestClickableCandidate(targetNode, targetPoint, touchCenter, touchRect, result.rectBasedTestResult());
if (success && targetNode)
targetNode = targetNode->deprecatedShadowAncestorNode();
return success;
}
bool EventHandler::bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode)
{
IntPoint hitTestPoint = m_frame.view()->windowToContents(touchCenter);
HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active, touchRadius);
IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
return findBestContextMenuCandidate(targetNode, targetPoint, touchCenter, touchRect, result.rectBasedTestResult());
}
bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntRect& targetArea, Node*& targetNode)
{
IntPoint hitTestPoint = m_frame.view()->windowToContents(touchCenter);
HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent, touchRadius);
IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
return findBestZoomableArea(targetNode, targetArea, touchCenter, touchRect, result.rectBasedTestResult());
}
#endif
#if ENABLE(CONTEXT_MENUS)
bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event)
{
......
......@@ -215,12 +215,6 @@ public:
void defaultTouchEventHandler(Node*, TouchEvent*);
#endif
#if ENABLE(TOUCH_ADJUSTMENT)
bool bestClickableNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode);
bool bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode);
bool bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntRect& targetArea, Node*& targetNode);
#endif
#if ENABLE(CONTEXT_MENUS)
bool sendContextMenuEvent(const PlatformMouseEvent&);
bool sendContextMenuEventForKey();
......
......@@ -151,11 +151,6 @@ requestAnimationFrameEnabled initial=true
deviceSupportsTouch initial=false
deviceSupportsMouse initial=true
# For touch adjustment to apply, the compile option TOUCH_ADJUSTMENT must also be enabled.
# This setting adds a means to dynamically disable the feature at runtime on systems with
# support for touch adjustment.
touchAdjustmentEnabled initial=true
fixedPositionCreatesStackingContext initial=defaultFixedPositionCreatesStackingContext
syncXHRInDocumentsEnabled initial=true
cookieEnabled initial=true
......
This diff is collapsed.
/*
* Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef TouchAdjustment_h
#define TouchAdjustment_h
#include "IntPoint.h"
#include "IntRect.h"
#include "Node.h"
#include "NodeList.h"
#include <wtf/Vector.h>
namespace WebCore {
typedef ListHashSet<RefPtr<Node> > NodeListHashSet;
bool findBestClickableCandidate(Node*& targetNode, IntPoint& targetPoint, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeListHashSet&);
bool findBestContextMenuCandidate(Node*& targetNode, IntPoint& targetPoint, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeListHashSet&);
bool findBestZoomableArea(Node*& targetNode, IntRect& targetArea, const IntPoint& touchHotspot, const IntRect& touchArea, const NodeListHashSet&);
// FIXME: Implement the similar functions for other gestures here as well.
} // namespace WebCore
#endif
......@@ -118,10 +118,6 @@
#include "DeviceProximityController.h"
#endif
#if ENABLE(TOUCH_ADJUSTMENT)
#include "WebKitPoint.h"
#endif
#if ENABLE(MOUSE_CURSOR_SCALE)
#include <wtf/dtoa.h>
#endif
......@@ -1034,105 +1030,6 @@ void Internals::setDelegatesScrolling(bool enabled, ExceptionCode& ec)
document->view()->setDelegatesScrolling(enabled);
}
#if ENABLE(TOUCH_ADJUSTMENT)
PassRefPtr<WebKitPoint> Internals::touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, ExceptionCode& ec)
{
Document* document = contextDocument();
if (!document || !document->frame()) {
ec = INVALID_ACCESS_ERR;
return 0;
}
IntSize radius(width / 2, height / 2);
IntPoint point(x + radius.width(), y + radius.height());
Node* targetNode;
IntPoint adjustedPoint;
bool foundNode = document->frame()->eventHandler().bestClickableNodeForTouchPoint(point, radius, adjustedPoint, targetNode);
if (foundNode)
return WebKitPoint::create(adjustedPoint.x(), adjustedPoint.y());
return 0;
}
Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, ExceptionCode& ec)
{
Document* document = contextDocument();
if (!document || !document->frame()) {
ec = INVALID_ACCESS_ERR;
return 0;
}
IntSize radius(width / 2, height / 2);
IntPoint point(x + radius.width(), y + radius.height());
Node* targetNode;
IntPoint adjustedPoint;
document->frame()->eventHandler().bestClickableNodeForTouchPoint(point, radius, adjustedPoint, targetNode);
return targetNode;
}
PassRefPtr<WebKitPoint> Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, ExceptionCode& ec)
{
Document* document = contextDocument();
if (!document || !document->frame()) {
ec = INVALID_ACCESS_ERR;
return 0;
}
IntSize radius(width / 2, height / 2);
IntPoint point(x + radius.width(), y + radius.height());
Node* targetNode = 0;
IntPoint adjustedPoint;
bool foundNode = document->frame()->eventHandler().bestContextMenuNodeForTouchPoint(point, radius, adjustedPoint, targetNode);
if (foundNode)
return WebKitPoint::create(adjustedPoint.x(), adjustedPoint.y());
return WebKitPoint::create(x, y);
}
Node* Internals::touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, ExceptionCode& ec)
{
Document* document = contextDocument();
if (!document || !document->frame()) {
ec = INVALID_ACCESS_ERR;
return 0;
}
IntSize radius(width / 2, height / 2);
IntPoint point(x + radius.width(), y + radius.height());
Node* targetNode = 0;
IntPoint adjustedPoint;
document->frame()->eventHandler().bestContextMenuNodeForTouchPoint(point, radius, adjustedPoint, targetNode);
return targetNode;
}
PassRefPtr<ClientRect> Internals::bestZoomableAreaForTouchPoint(long x, long y, long width, long height, ExceptionCode& ec)
{
Document* document = contextDocument();
if (!document || !document->frame()) {
ec = INVALID_ACCESS_ERR;
return 0;
}
IntSize radius(width / 2, height / 2);
IntPoint point(x + radius.width(), y + radius.height());
Node* targetNode;
IntRect zoomableArea;
bool foundNode = document->frame()->eventHandler().bestZoomableAreaForTouchPoint(point, radius, zoomableArea, targetNode);
if (foundNode)
return ClientRect::create(zoomableArea);
return 0;
}
#endif
int Internals::lastSpellCheckRequestSequence(ExceptionCode& ec)
{
Document* document = contextDocument();
......
......@@ -56,7 +56,6 @@ class Page;
class Range;
class ScriptExecutionContext;
class ShadowRoot;
class WebKitPoint;
class MallocStatistics;
class SerializedScriptValue;
class TimeRanges;
......@@ -158,13 +157,6 @@ public:
String rangeAsText(const Range*, ExceptionCode&);
void setDelegatesScrolling(bool enabled, ExceptionCode&);
#if ENABLE(TOUCH_ADJUSTMENT)
PassRefPtr<WebKitPoint> touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, ExceptionCode&);
Node* touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, ExceptionCode&);
PassRefPtr<WebKitPoint> touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, ExceptionCode&);
Node* touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, ExceptionCode&);
PassRefPtr<ClientRect> bestZoomableAreaForTouchPoint(long x, long y, long width, long height, ExceptionCode&);
#endif
int lastSpellCheckRequestSequence(ExceptionCode&);
int lastSpellCheckProcessedSequence(ExceptionCode&);
......
......@@ -114,13 +114,6 @@
[RaisesException] DOMString rangeAsText(Range range);
[RaisesException] void setDelegatesScrolling(boolean enabled);
#if defined(ENABLE_TOUCH_ADJUSTMENT) && ENABLE_TOUCH_ADJUSTMENT
[RaisesException] WebKitPoint touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height);
[RaisesException] Node touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height);
[RaisesException] WebKitPoint touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height);
[RaisesException] Node touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height);
[RaisesException] ClientRect bestZoomableAreaForTouchPoint(long x, long y, long width, long height);
#endif
[RaisesException] long lastSpellCheckRequestSequence();
[RaisesException] long lastSpellCheckProcessedSequence();
......
2014-01-17 Andreas Kling <akling@apple.com>
Remove unused TOUCH_ADJUSTMENT code.
<https://webkit.org/b/127181>
Reviewed by Anders Carlsson.
* WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
(WebKit::WebPage::findZoomableAreaForPoint):
2014-01-17 Anders Carlsson <andersca@apple.com>
Fix build.
......
......@@ -42,25 +42,6 @@ using namespace WebCore;
namespace WebKit {
#if ENABLE(TOUCH_ADJUSTMENT)
void WebPage::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
{
Node* node = 0;
IntRect zoomableArea;
bool foundAreaForTouchPoint = m_mainFrame->coreFrame()->eventHandler().bestZoomableAreaForTouchPoint(point, IntSize(area.width() / 2, area.height() / 2), zoomableArea, node);
if (!foundAreaForTouchPoint)
return;
ASSERT(node);
if (node->document().view())
zoomableArea = node->document().view()->contentsToWindow(zoomableArea);
send(Messages::WebPageProxy::DidFindZoomableArea(point, zoomableArea));
}
#else
void WebPage::findZoomableAreaForPoint(const IntPoint& point, const IntSize& area)
{
UNUSED_PARAM(area);
......@@ -98,7 +79,6 @@ void WebPage::findZoomableAreaForPoint(const IntPoint& point, const IntSize& are
send(Messages::WebPageProxy::DidFindZoomableArea(point, zoomableArea));
}
#endif
} // namespace WebKit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment