From 6fbaea61d241814b015fd7e022796e68d8ef3e8e Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Mon, 16 May 2011 16:35:58 +0100 Subject: 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 --- .gitignore | 145 ---------------------- Source/WebCore/Android.jscbindings.mk | 3 - Source/WebCore/bindings/v8/V8NPUtils.cpp | 5 - Source/WebCore/html/HTMLInputElement.cpp | 12 ++ Source/WebCore/html/InputType.cpp | 6 + Source/WebCore/html/InputType.h | 9 ++ Source/WebCore/html/RangeInputType.cpp | 29 +++-- Source/WebCore/html/RangeInputType.h | 3 + Source/WebCore/html/shadow/SliderThumbElement.cpp | 118 ++++++++---------- Source/WebCore/page/EventHandler.cpp | 34 ++++- Source/WebCore/page/EventHandler.h | 6 + Source/WebCore/page/FrameView.h | 9 +- Source/WebCore/rendering/RenderMedia.cpp | 19 ++- 13 files changed, 159 insertions(+), 239 deletions(-) diff --git a/.gitignore b/.gitignore index 26a6a18..e83a5dd 100644 --- a/.gitignore +++ b/.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 diff --git a/Source/WebCore/Android.jscbindings.mk b/Source/WebCore/Android.jscbindings.mk index 281425c..bd5dfbd 100644 --- a/Source/WebCore/Android.jscbindings.mk +++ b/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 \ diff --git a/Source/WebCore/bindings/v8/V8NPUtils.cpp b/Source/WebCore/bindings/v8/V8NPUtils.cpp index dccdb15..250ee5b 100644 --- a/Source/WebCore/bindings/v8/V8NPUtils.cpp +++ b/Source/WebCore/bindings/v8/V8NPUtils.cpp @@ -63,14 +63,9 @@ void convertV8ObjectToNPVariant(v8::Local 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(malloc(length)); memcpy(utf8Chars, *utf8, length); -======= - char* utf8Chars = reinterpret_cast(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()); diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp index 637e831..0d20389 100644 --- a/Source/WebCore/html/HTMLInputElement.cpp +++ b/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(evt)); + if (evt->defaultHandled()) + return; + } +#endif + m_inputType->forwardEvent(evt); if (!callBaseClassEarly && !evt->defaultHandled()) diff --git a/Source/WebCore/html/InputType.cpp b/Source/WebCore/html/InputType.cpp index 2f8d414..8e3a9e3 100644 --- a/Source/WebCore/html/InputType.cpp +++ b/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*) { } diff --git a/Source/WebCore/html/InputType.h b/Source/WebCore/html/InputType.h index e6ceb96..40606d1 100644 --- a/Source/WebCore/html/InputType.h +++ b/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 @@ public: 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 formForSubmission() const; diff --git a/Source/WebCore/html/RangeInputType.cpp b/Source/WebCore/html/RangeInputType.cpp index e9ac295..7c74206 100644 --- a/Source/WebCore/html/RangeInputType.cpp +++ b/Source/WebCore/html/RangeInputType.cpp @@ -45,6 +45,10 @@ #include #include +#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())); diff --git a/Source/WebCore/html/RangeInputType.h b/Source/WebCore/html/RangeInputType.h index 15d224d..1447018 100644 --- a/Source/WebCore/html/RangeInputType.h +++ b/Source/WebCore/html/RangeInputType.h @@ -66,6 +66,9 @@ private: 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 diff --git a/Source/WebCore/html/shadow/SliderThumbElement.cpp b/Source/WebCore/html/shadow/SliderThumbElement.cpp index ad93261..758d3c7 100644 --- a/Source/WebCore/html/shadow/SliderThumbElement.cpp +++ b/Source/WebCore/html/shadow/SliderThumbElement.cpp @@ -43,12 +43,13 @@ #include "StepRange.h" #include -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(event); + isLeftButton = mouseEvent->button() == LeftButton; + } +#else MouseEvent* mouseEvent = static_cast(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(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(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(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); diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp index 476921e..8432c10 100644 --- a/Source/WebCore/page/EventHandler.cpp +++ b/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 n) +{ + m_capturingTouchEventsNode = n; +} +#endif + void EventHandler::setCapturingMouseEventsNode(PassRefPtr 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 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; diff --git a/Source/WebCore/page/EventHandler.h b/Source/WebCore/page/EventHandler.h index d12a56e..77668f1 100644 --- a/Source/WebCore/page/EventHandler.h +++ b/Source/WebCore/page/EventHandler.h @@ -215,6 +215,9 @@ public: #if ENABLE(TOUCH_EVENTS) bool handleTouchEvent(const PlatformTouchEvent&); +#if PLATFORM(ANDROID) + void setCapturingTouchEventsNode(PassRefPtr); +#endif #endif private: @@ -440,6 +443,9 @@ private: typedef HashMap > TouchTargetMap; TouchTargetMap m_originatingTouchPointTargets; bool m_touchPressed; +#if PLATFORM(ANDROID) + RefPtr m_capturingTouchEventsNode; +#endif #endif }; diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h index c75aab8..e61099e 100644 --- a/Source/WebCore/page/FrameView.h +++ b/Source/WebCore/page/FrameView.h @@ -100,13 +100,8 @@ public: 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 @@ public: bool hasOverflowScroll() const { return m_hasOverflowScroll; } #endif +#if PLATFORM(ANDROID) + void updatePositionedObjects(); +#endif + bool hasCompositedContent() const; bool hasCompositedContentIncludingDescendants() const; bool hasCompositingAncestor() const; diff --git a/Source/WebCore/rendering/RenderMedia.cpp b/Source/WebCore/rendering/RenderMedia.cpp index f59a995..0b913ee 100644 --- a/Source/WebCore/rendering/RenderMedia.cpp +++ b/Source/WebCore/rendering/RenderMedia.cpp @@ -39,7 +39,8 @@ #include #include -#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(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. -- cgit v1.1