Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge WebKit at r76408: Fix conflicts.

Android.jscbindings.mk
Conflict due to local addition of EntrySyncCustom.cpp and http://trac.webkit.org/changeset/76216

V8NPUtils.cpp
Conflict due to local cherry pick of http://trac.webkit.org/changeset/78994 and
merge of http://trac.webkit.org/changeset/76264

FrameView.h
Conflict due to local addition of updatePositionedObjects() and http://trac.webkit.org/changeset/76278

RangeInputType.cpp
SliderThumbElement.cpp
Conflicts due to Android addition of touch handling code in slider code.
See http://trac.webkit.org/changeset/76147

.gitignore - keep ours

Change-Id: I38aeb361a37e7939f805c6689d7cc8fc720b3e52
  • Loading branch information...
commit 6fbaea61d241814b015fd7e022796e68d8ef3e8e 1 parent 61f2d6a
Ben Murdoch authored
View
145 .gitignore
@@ -1,147 +1,2 @@
-<<<<<<< HEAD
WebKitBuild/*
WebCore/WebCore.xcodeproj/*
-=======
-*.mode*
-*.pbxuser
-*.perspective*
-*.pyc
-.DS_Store
-build/
-/WebKitBuild/
-autoinstall.cache.d
-Tools/Scripts/webkitpy/thirdparty/autoinstalled
-
-# Ignore common tool auto-generated files.
-.gdb_history
-tags
-*~
-
-# Ignore Chromium projects auto-generated from .gyp files:
-Source/JavaScriptCore/JavaScriptCore.gyp/*.Makefile
-Source/JavaScriptCore/JavaScriptCore.gyp/*.mk
-Source/JavaScriptCore/JavaScriptCore.gyp/*.sln
-Source/JavaScriptCore/JavaScriptCore.gyp/*.vcproj*
-Source/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.xcodeproj
-Source/WebCore/WebCore.gyp/*.Makefile
-Source/WebCore/WebCore.gyp/*.mk
-Source/WebCore/WebCore.gyp/*.rules
-Source/WebCore/WebCore.gyp/*.sln
-Source/WebCore/WebCore.gyp/*.tmp
-Source/WebCore/WebCore.gyp/*.vcproj*
-Source/WebCore/WebCore.gyp/WebCore.xcodeproj
-Source/WebKit/chromium/*.Makefile
-Source/WebKit/chromium/*.mk
-Source/WebKit/chromium/*.sln
-Source/WebKit/chromium/*.vcproj*
-Source/WebKit/chromium/WebKit.xcodeproj
-Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.xcodeproj
-
-# Ignore status files that manage Chromium dependencies.
-Source/WebKit/chromium/.gclient
-Source/WebKit/chromium/.gclient_entries
-
-# Ignore Chromium dependencies
-Source/WebKit/chromium/.gclient
-Source/WebKit/chromium/.gclient_entries
-Source/WebKit/chromium/app/
-Source/WebKit/chromium/base/
-Source/WebKit/chromium/chromium_deps/
-Source/WebKit/chromium/depot_tools/
-Source/WebKit/chromium/gfx/
-Source/WebKit/chromium/googleurl/
-Source/WebKit/chromium/gpu/
-Source/WebKit/chromium/ipc/
-Source/WebKit/chromium/media/
-Source/WebKit/chromium/net/
-Source/WebKit/chromium/ppapi/
-Source/WebKit/chromium/printing/
-Source/WebKit/chromium/sdch/
-Source/WebKit/chromium/skia/
-Source/WebKit/chromium/testing/
-Source/WebKit/chromium/third_party/
-Source/WebKit/chromium/tools/
-Source/WebKit/chromium/ui/
-Source/WebKit/chromium/v8/
-Source/WebKit/chromium/webkit/
-Source/WebKit/chromium/xcodebuild/
-
-# Ignore files that Chromium port generates
-/Makefile.chromium
-/out
-
-# Ignore compiled java tests:
-LayoutTests/java/*.class
-
-# Though the GTK build builds in a subdirectory, autogen.sh still deposits
-# a few files into the source tree.
-/aclocal.m4
-/autom4te.cache
-/Source/autotools/compile
-/Source/autotools/config.guess
-/Source/autotools/config.sub
-/Source/autotools/depcomp
-/Source/autotools/gtk-doc.m4
-/Source/autotools/install-sh
-/Source/autotools/libtool.m4
-/Source/autotools/ltmain.sh
-/Source/autotools/ltoptions.m4
-/Source/autotools/ltsugar.m4
-/Source/autotools/ltversion.m4
-/Source/autotools/lt~obsolete.m4
-/Source/autotools/missing
-/Source/WebKit/gtk/docs/GNUmakefile.in
-/Source/WebKit/gtk/po/*.pot
-/autotoolsconfig.h.in
-/configure
-/GNUmakefile.in
-/gtk-doc.make
-/INSTALL
-/README
-
-# Ignore files installed by WebKitSupportLibrary/WebKitAuxiliaryLibrary
-/WebKitSupportLibrary.zip
-/WebKitLibraries/win/Software License Agreement for WebKit Support Libraries.rtf
-/WebKitLibraries/win/WebKitChangesToPthreads.diff
-/WebKitLibraries/win/include/ApplicationServices/
-/WebKitLibraries/win/include/AssertMacros.h
-/WebKitLibraries/win/include/Availability.h
-/WebKitLibraries/win/include/AvailabilityInternal.h
-/WebKitLibraries/win/include/AvailabilityMacros.h
-/WebKitLibraries/win/include/CFNetwork/
-/WebKitLibraries/win/include/ColorSync/
-/WebKitLibraries/win/include/ConditionalMacros.h
-/WebKitLibraries/win/include/CoreFoundation/
-/WebKitLibraries/win/include/CoreGraphics/
-/WebKitLibraries/win/include/CoreServices/
-/WebKitLibraries/win/include/ImageIO/
-/WebKitLibraries/win/include/QuartzCore/
-/WebKitLibraries/win/include/SQLite/
-/WebKitLibraries/win/include/SafariTheme/
-/WebKitLibraries/win/include/TargetConditionals.h
-/WebKitLibraries/win/include/checkint.h
-/WebKitLibraries/win/include/dispatch/
-/WebKitLibraries/win/include/inttypes.h
-/WebKitLibraries/win/include/libxml/
-/WebKitLibraries/win/include/libxslt/
-/WebKitLibraries/win/include/pthreads/
-/WebKitLibraries/win/include/stdbool.h
-/WebKitLibraries/win/include/stdint.h
-/WebKitLibraries/win/include/unicode/
-/WebKitLibraries/win/include/unistd.h
-/WebKitLibraries/win/include/xlocale.h
-/WebKitLibraries/win/include/zlib/
-/WebKitLibraries/win/lib/CFNetwork.lib
-/WebKitLibraries/win/lib/CoreFoundation.lib
-/WebKitLibraries/win/lib/CoreGraphics.lib
-/WebKitLibraries/win/lib/QuartzCore.lib
-/WebKitLibraries/win/lib/SQLite3.lib
-/WebKitLibraries/win/lib/SafariTheme.lib
-/WebKitLibraries/win/lib/icuin.lib
-/WebKitLibraries/win/lib/icuuc.lib
-/WebKitLibraries/win/lib/libdispatch.lib
-/WebKitLibraries/win/lib/libxml2.lib
-/WebKitLibraries/win/lib/libxslt.lib
-/WebKitLibraries/win/lib/pthreadVC2.lib
-/WebKitLibraries/win/lib/zdll.lib
->>>>>>> WebKit.org at r76408
View
3  Source/WebCore/Android.jscbindings.mk
@@ -113,11 +113,8 @@ LOCAL_SRC_FILES += \
bindings/js/JSDirectoryEntrySyncCustom.cpp \
bindings/js/JSDocumentCustom.cpp \
bindings/js/JSElementCustom.cpp \
-<<<<<<< HEAD
bindings/js/JSEntrySyncCustom.cpp \
-=======
bindings/js/JSErrorHandler.cpp \
->>>>>>> WebKit.org at r76408
bindings/js/JSEventCustom.cpp \
bindings/js/JSEventListener.cpp \
bindings/js/JSEventTarget.cpp \
View
5 Source/WebCore/bindings/v8/V8NPUtils.cpp
@@ -63,14 +63,9 @@ void convertV8ObjectToNPVariant(v8::Local<v8::Value> object, NPObject* owner, NP
VOID_TO_NPVARIANT(*result);
else if (object->IsString()) {
v8::String::Utf8Value utf8(object);
-<<<<<<< HEAD
int length = utf8.length() + 1;
char* utf8Chars = reinterpret_cast<char*>(malloc(length));
memcpy(utf8Chars, *utf8, length);
-=======
- char* utf8Chars = reinterpret_cast<char*>(malloc(utf8.length()));
- memcpy(utf8Chars, *utf8, utf8.length());
->>>>>>> WebKit.org at r76408
STRINGN_TO_NPVARIANT(utf8Chars, utf8.length(), *result);
} else if (object->IsObject()) {
DOMWindow* window = V8Proxy::retrieveWindow(V8Proxy::currentContext());
View
12 Source/WebCore/html/HTMLInputElement.cpp
@@ -57,6 +57,10 @@
#include "PlatformBridge.h"
#endif
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+#include "TouchEvent.h"
+#endif
+
using namespace std;
namespace WebCore {
@@ -1054,6 +1058,14 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
return;
}
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+ if (evt->isTouchEvent() && evt->type() == eventNames().touchstartEvent) {
+ m_inputType->handleTouchStartEvent(static_cast<TouchEvent*>(evt));
+ if (evt->defaultHandled())
+ return;
+ }
+#endif
+
m_inputType->forwardEvent(evt);
if (!callBaseClassEarly && !evt->defaultHandled())
View
6 Source/WebCore/html/InputType.cpp
@@ -309,6 +309,12 @@ void InputType::handleMouseDownEvent(MouseEvent*)
{
}
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+void InputType::handleTouchStartEvent(TouchEvent*)
+{
+}
+#endif
+
void InputType::handleDOMActivateEvent(Event*)
{
}
View
9 Source/WebCore/html/InputType.h
@@ -54,6 +54,10 @@ class RenderObject;
class RenderStyle;
class WheelEvent;
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+class TouchEvent;
+#endif
+
typedef int ExceptionCode;
struct ClickHandlingState {
@@ -165,6 +169,11 @@ class InputType {
virtual void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*);
virtual void handleWheelEvent(WheelEvent*);
virtual void forwardEvent(Event*);
+
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+ virtual void handleTouchStartEvent(TouchEvent*);
+#endif
+
// Helpers for event handlers.
virtual bool shouldSubmitImplicitly(Event*);
virtual PassRefPtr<HTMLFormElement> formForSubmission() const;
View
29 Source/WebCore/html/RangeInputType.cpp
@@ -45,6 +45,10 @@
#include <wtf/MathExtras.h>
#include <wtf/PassOwnPtr.h>
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+#include "TouchEvent.h"
+#endif
+
namespace WebCore {
using namespace HTMLNames;
@@ -192,21 +196,22 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
event->setDefaultHandled();
}
-<<<<<<< HEAD
-void RangeInputType::forwardEvent(Event* event)
-{
- if (element()->renderer()
- && (event->isMouseEvent()
#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
- || event->isTouchEvent()
-#endif
- || event->isDragEvent()
- || event->isWheelEvent()))
- toRenderSlider(element()->renderer())->forwardEvent(event);
+void RangeInputType::handleTouchStartEvent(TouchEvent* touchEvent)
+{
+ if (SliderThumbElement* thumb = toSliderThumbElement(element()->shadowRoot())) {
+ if (touchEvent->touches() && touchEvent->touches()->item(0)) {
+ IntPoint curPoint;
+ curPoint.setX(touchEvent->touches()->item(0)->pageX());
+ curPoint.setY(touchEvent->touches()->item(0)->pageY());
+ thumb->dragFrom(curPoint);
+ touchEvent->setDefaultHandled();
+ touchEvent->setDefaultPrevented(true);
+ }
+ }
}
+#endif
-=======
->>>>>>> WebKit.org at r76408
void RangeInputType::createShadowSubtree()
{
element()->setShadowRoot(SliderThumbElement::create(element()->document()));
View
3  Source/WebCore/html/RangeInputType.h
@@ -66,6 +66,9 @@ class RangeInputType : public InputType {
virtual String fallbackValue();
virtual String sanitizeValue(const String& proposedValue);
virtual bool shouldRespectListAttribute();
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+ virtual void handleTouchStartEvent(TouchEvent*);
+#endif
};
} // namespace WebCore
View
118 Source/WebCore/html/shadow/SliderThumbElement.cpp
@@ -43,12 +43,13 @@
#include "StepRange.h"
#include <wtf/MathExtras.h>
-using namespace std;
-
#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+#include "Page.h"
#include "TouchEvent.h"
#endif
+using namespace std;
+
namespace WebCore {
// FIXME: Find a way to cascade appearance (see the layout method) and get rid of this class.
@@ -139,6 +140,12 @@ void SliderThumbElement::startDragging()
{
if (Frame* frame = document()->frame()) {
frame->eventHandler()->setCapturingMouseEventsNode(this);
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+ // Touch events come from Java to the main frame event handler, so we need
+ // to flag we are capturing those events also on the main frame event
+ // handler.
+ frame->page()->mainFrame()->eventHandler()->setCapturingTouchEventsNode(this);
+#endif
m_inDragMode = true;
}
}
@@ -150,6 +157,11 @@ void SliderThumbElement::stopDragging()
if (Frame* frame = document()->frame())
frame->eventHandler()->setCapturingMouseEventsNode(0);
+
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+ if (Frame* frame = document()->frame())
+ frame->page()->mainFrame()->eventHandler()->setCapturingTouchEventsNode(0);
+#endif
m_inDragMode = false;
}
@@ -164,88 +176,62 @@ void SliderThumbElement::defaultEventHandler(Event* event)
return;
}
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+ bool isLeftButton = false;
+
+ if (event->isMouseEvent()) {
+ MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
+ isLeftButton = mouseEvent->button() == LeftButton;
+ }
+#else
MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
bool isLeftButton = mouseEvent->button() == LeftButton;
+#endif
const AtomicString& eventType = event->type();
-<<<<<<< HEAD
if (eventType == eventNames().mousedownEvent && isLeftButton
#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
- || eventType == eventNames().touchstartEvent
+ || eventType == eventNames().touchstartEvent
#endif
- ) {
- if (document()->frame() && renderer()) {
- RenderSlider* slider = toRenderSlider(renderer()->parent());
- if (slider) {
- if (slider->mouseEventIsInThumb(mouseEvent)) {
- // We selected the thumb, we want the cursor to always stay at
- // the same position relative to the thumb.
- m_offsetToThumb = slider->mouseEventOffsetToThumb(mouseEvent);
- } else {
- // We are outside the thumb, move the thumb to the point were
- // we clicked. We'll be exactly at the center of the thumb.
- m_offsetToThumb.setX(0);
- m_offsetToThumb.setY(0);
- }
-
- m_inDragMode = true;
- document()->frame()->eventHandler()->setCapturingMouseEventsNode(shadowHost());
- event->setDefaultHandled();
- return;
- }
- }
+ ) {
+ startDragging();
+ return;
} else if (eventType == eventNames().mouseupEvent && isLeftButton
#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
- || eventType == eventNames().touchendEvent
+ || eventType == eventNames().touchendEvent
+ || eventType == eventNames().touchcancelEvent
#endif
- ) {
- if (m_inDragMode) {
- if (Frame* frame = document()->frame())
- frame->eventHandler()->setCapturingMouseEventsNode(0);
- m_inDragMode = false;
- event->setDefaultHandled();
- return;
- }
+ ) {
+ stopDragging();
+ return;
} else if (eventType == eventNames().mousemoveEvent
#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
- || eventType == eventNames().touchmoveEvent
+ || eventType == eventNames().touchmoveEvent
#endif
- ) {
- if (m_inDragMode && renderer() && renderer()->parent()) {
- RenderSlider* slider = toRenderSlider(renderer()->parent());
- if (slider) {
- FloatPoint curPoint = slider->absoluteToLocal(mouseEvent->absoluteLocation(), false, true);
+ ) {
+ if (m_inDragMode)
#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
- // Update the position when it is a touch event
- if (event->isTouchEvent()) {
- TouchEvent* touchEvent = static_cast<TouchEvent*>(event);
- if (touchEvent && touchEvent->touches() && touchEvent->touches()->item(0)) {
- curPoint.setX(touchEvent->touches()->item(0)->pageX());
- curPoint.setY(touchEvent->touches()->item(0)->pageY());
- curPoint = slider->absoluteToLocal(curPoint, false, true);
- }
- }
- // Tell the webview that webkit will handle the following move events
- event->setDefaultPrevented(true);
+ {
+ if (event->isMouseEvent()) {
+ MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
#endif
- IntPoint eventOffset(curPoint.x() + m_offsetToThumb.x(), curPoint.y() + m_offsetToThumb.y());
- slider->setValueForPosition(slider->positionForOffset(eventOffset));
- event->setDefaultHandled();
- return;
+ setPosition(mouseEvent->absoluteLocation());
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+ } else if (event->isTouchEvent()) {
+ TouchEvent* touchEvent = static_cast<TouchEvent*>(event);
+ if (touchEvent->touches() && touchEvent->touches()->item(0)) {
+ IntPoint curPoint;
+ curPoint.setX(touchEvent->touches()->item(0)->pageX());
+ curPoint.setY(touchEvent->touches()->item(0)->pageY());
+ setPosition(curPoint);
+ // Tell the webview that webkit will handle the following move events
+ event->setDefaultPrevented(true);
+ }
}
+
}
-=======
- if (eventType == eventNames().mousedownEvent && isLeftButton) {
- startDragging();
- return;
- } else if (eventType == eventNames().mouseupEvent && isLeftButton) {
- stopDragging();
- return;
- } else if (eventType == eventNames().mousemoveEvent) {
- if (m_inDragMode)
- setPosition(mouseEvent->absoluteLocation());
+#endif
return;
->>>>>>> WebKit.org at r76408
}
HTMLDivElement::defaultEventHandler(event);
View
34 Source/WebCore/page/EventHandler.cpp
@@ -249,6 +249,9 @@ void EventHandler::clear()
m_previousWheelScrolledNode = 0;
#if ENABLE(TOUCH_EVENTS)
m_originatingTouchPointTargets.clear();
+#if PLATFORM(ANDROID)
+ m_capturingTouchEventsNode = 0;
+#endif
#endif
}
@@ -1788,6 +1791,13 @@ void EventHandler::clearDragState()
}
#endif // ENABLE(DRAG_SUPPORT)
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+void EventHandler::setCapturingTouchEventsNode(PassRefPtr<Node> n)
+{
+ m_capturingTouchEventsNode = n;
+}
+#endif
+
void EventHandler::setCapturingMouseEventsNode(PassRefPtr<Node> n)
{
m_capturingMouseEventsNode = n;
@@ -2921,7 +2931,20 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
default:
break;
}
+#if PLATFORM(ANDROID)
+ Node* node = 0;
+ if (m_capturingTouchEventsNode)
+ node = m_capturingTouchEventsNode.get();
+ else {
+ HitTestResult result = hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, false, DontHitTestScrollbars, hitType);
+ node = result.innerNode();
+ ASSERT(node);
+ // Touch events should not go to text nodes
+ if (node->isTextNode())
+ node = node->parentNode();
+ }
+#else
HitTestResult result = hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, false, DontHitTestScrollbars, hitType);
Node* node = result.innerNode();
ASSERT(node);
@@ -2929,6 +2952,8 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// Touch events should not go to text nodes
if (node->isTextNode())
node = node->parentNode();
+#endif
+
Document* doc = node->document();
if (!doc)
@@ -2947,6 +2972,11 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.
unsigned touchPointTargetKey = point.id() + 1;
RefPtr<EventTarget> touchTarget;
+#if PLATFORM(ANDROID)
+ if (m_capturingTouchEventsNode)
+ touchTarget = node;
+ else {
+#endif
if (pointState == PlatformTouchPoint::TouchPressed) {
m_originatingTouchPointTargets.set(touchPointTargetKey, node);
touchTarget = node;
@@ -2956,7 +2986,9 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey);
} else
touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey);
-
+#if PLATFORM(ANDROID)
+ }
+#endif
if (!touchTarget.get())
continue;
View
6 Source/WebCore/page/EventHandler.h
@@ -215,6 +215,9 @@ class EventHandler {
#if ENABLE(TOUCH_EVENTS)
bool handleTouchEvent(const PlatformTouchEvent&);
+#if PLATFORM(ANDROID)
+ void setCapturingTouchEventsNode(PassRefPtr<Node>);
+#endif
#endif
private:
@@ -440,6 +443,9 @@ class EventHandler {
typedef HashMap<int, RefPtr<EventTarget> > TouchTargetMap;
TouchTargetMap m_originatingTouchPointTargets;
bool m_touchPressed;
+#if PLATFORM(ANDROID)
+ RefPtr<Node> m_capturingTouchEventsNode;
+#endif
#endif
};
View
9 Source/WebCore/page/FrameView.h
@@ -100,13 +100,8 @@ class FrameView : public ScrollView {
bool needsFullRepaint() const { return m_doFullRepaint; }
-<<<<<<< HEAD
-#if PLATFORM(ANDROID)
- void updatePositionedObjects();
-=======
#if ENABLE(REQUEST_ANIMATION_FRAME)
void serviceScriptedAnimations();
->>>>>>> WebKit.org at r76408
#endif
#if USE(ACCELERATED_COMPOSITING)
@@ -121,6 +116,10 @@ class FrameView : public ScrollView {
bool hasOverflowScroll() const { return m_hasOverflowScroll; }
#endif
+#if PLATFORM(ANDROID)
+ void updatePositionedObjects();
+#endif
+
bool hasCompositedContent() const;
bool hasCompositedContentIncludingDescendants() const;
bool hasCompositingAncestor() const;
View
19 Source/WebCore/rendering/RenderMedia.cpp
@@ -39,7 +39,8 @@
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
-#if PLATFORM(ANDROID)
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+#include "TouchEvent.h"
#define TOUCH_DELAY 4
#endif
@@ -467,7 +468,7 @@ void RenderMedia::updateControlVisibility()
if (style()->visibility() != VISIBLE)
return;
-#if PLATFORM(ANDROID)
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
if (WTF::currentTime() - m_lastTouch > TOUCH_DELAY)
m_mouseOver = false;
else
@@ -631,6 +632,20 @@ void RenderMedia::forwardEvent(Event* event)
updateControlVisibility();
}
}
+#if PLATFORM(ANDROID) && ENABLE(TOUCH_EVENTS)
+ // We want to process touch events landing on the timeline so that the user
+ // can drag the scrollbar thumb with their finger.
+ else if (event->isTouchEvent() && m_controlsShadowRoot) {
+ TouchEvent* touchEvent = static_cast<TouchEvent*>(event);
+ if (touchEvent->touches() && touchEvent->touches()->item(0)) {
+ IntPoint point;
+ point.setX(touchEvent->touches()->item(0)->pageX());
+ point.setY(touchEvent->touches()->item(0)->pageY());
+ if (m_timeline && m_timeline->hitTest(point))
+ m_timeline->defaultEventHandler(event);
+ }
+ }
+#endif
}
// We want the timeline slider to be at least 100 pixels wide.
Please sign in to comment.
Something went wrong with that request. Please try again.