Input elements with type=range do not have default touch handlers.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jul 2012 01:47:58 +0000 (01:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jul 2012 01:47:58 +0000 (01:47 +0000)
commite0db5892234fb816c9090f12faddbdb4f4673aca
treeea1348676f29fc81d182ad88f9fb1a04a0d98cb7
parent411b4b30900cfeb24fbb2daf4531e86b843a67e8
Input elements with type=range do not have default touch handlers.
https://bugs.webkit.org/show_bug.cgi?id=88807

Patch by Kevin Ellis <kevers@chromium.org> on 2012-07-10
Reviewed by Antonio Gomes.

Source/WebCore:

This patch adds support for touch event handling on input elements
and dragging a slider with touch start and move events.  Previously,
manipulating a slider on a touch screen required generation of
synthetic mouse events.

Tests: fast/events/touch/touch-slider-no-js-touch-listener.html
       fast/events/touch/touch-slider.html

* dom/Event.cpp:
(WebCore::Event::isTouchEvent):
(WebCore):
* dom/Event.h:
(Event):
* dom/Touch.cpp:
(WebCore::Touch::Touch):
* dom/Touch.h:
(WebCore::Touch::absoluteLocation):
(Touch):
* dom/TouchEvent.cpp:
(WebCore::TouchEvent::isTouchEvent):
(WebCore):
* dom/TouchEvent.h:
(TouchEvent):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::~HTMLInputElement):
(WebCore::HTMLInputElement::updateType):
(WebCore::HTMLInputElement::defaultEventHandler):
* html/HTMLInputElement.h:
(HTMLInputElement):
* html/InputType.cpp:
(WebCore):
(WebCore::InputType::handleTouchEvent):
(WebCore::InputType::hasTouchEventHandler):
* html/InputType.h:
(WebCore):
(ClickHandlingState):
(InputType):
* html/RangeInputType.cpp:
(WebCore):
(WebCore::RangeInputType::handleTouchEvent):
(WebCore::RangeInputType::hasTouchEventHandler):
* html/RangeInputType.h:
(RangeInputType):
* html/shadow/SliderThumbElement.h:
(SliderThumbElement):

Source/WebKit/chromium:

Adds flag to enable native handling of touch events for input elements
with type=range.

* features.gypi:

LayoutTests:

Add automated test for manipulating an input slider via touch
events.

* fast/events/touch/script-tests/touch-slider-no-js-touch-listener.js: Added.
(checkPosition):
* fast/events/touch/script-tests/touch-slider.js: Added.
(onTouchStart):
(onTouchEnd):
(onKeyDown):
(checkPosition):
* fast/events/touch/touch-slider-expected.txt: Added.
* fast/events/touch/touch-slider-no-js-touch-listener-expected.txt: Added.
* fast/events/touch/touch-slider-no-js-touch-listener.html: Added.
* fast/events/touch/touch-slider.html: Added.
* platform/chromium/fast/events/touch/touch-slider-expected.txt: Added.
* platform/chromium/fast/events/touch/touch-slider-no-js-touch-listener-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/script-tests/touch-slider-no-js-touch-listener.js [new file with mode: 0644]
LayoutTests/fast/events/touch/script-tests/touch-slider.js [new file with mode: 0644]
LayoutTests/fast/events/touch/touch-slider-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/touch-slider-no-js-touch-listener-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/touch-slider-no-js-touch-listener.html [new file with mode: 0644]
LayoutTests/fast/events/touch/touch-slider.html [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/touch/touch-slider-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/touch/touch-slider-no-js-touch-listener-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Event.cpp
Source/WebCore/dom/Event.h
Source/WebCore/dom/Touch.cpp
Source/WebCore/dom/Touch.h
Source/WebCore/dom/TouchEvent.cpp
Source/WebCore/dom/TouchEvent.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/InputType.cpp
Source/WebCore/html/InputType.h
Source/WebCore/html/RangeInputType.cpp
Source/WebCore/html/RangeInputType.h
Source/WebCore/html/shadow/SliderThumbElement.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/features.gypi