Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Issue 2209773002: Remove the blocking touch handlers for the input[type=range] and add touch-action instead (Closed)

Created:
4 years, 4 months ago by sunyunjia
Modified:
4 years, 3 months ago
Reviewers:
tkent, majidvp, dtapuska
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove the blocking touch handlers for the input[type=range] element and add touch-action instead. In current implementation, the input[type=range] blocks browser's scrolling in all directions. After adding "touch-action: pan-y" with a passive event listener to the horizontal input[type=range], or "pan-x" to the vertical input[type=range], the slider will only consume pan in its direction and does not block scrolling on the other direction. This touch-action will be overridden if the user has already defined the touch-action. It will update if the slider changes to horizontal/vertical. BUG=584438 Committed: https://crrev.com/cb18694aff180e913277a346a37e74835935b37d Cr-Commit-Position: refs/heads/master@{#413616}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Change the function name. Deal with the out-of-range situation #

Patch Set 3 : '==' -> '>=' and '==' -> #

Total comments: 3

Patch Set 4 : Temporarily remove the drag-to-extend case #

Total comments: 2

Patch Set 5 : A workable version with layout tests. #

Patch Set 6 : style.. #

Total comments: 6

Patch Set 7 : Use better functions, structures and names #

Total comments: 4

Patch Set 8 : Improvement from reviews #

Patch Set 9 : Better tests #

Patch Set 10 : Move the touch event handlers to the container in the shadow dom #

Total comments: 11

Patch Set 11 : Move the touch-action code back to LayoutTheme. #

Patch Set 12 : Move the touch handler registry to slidercontainer under the shadow #

Patch Set 13 : Fix the failed tests #

Patch Set 14 : Removed 'id=container' to pass more tests #

Total comments: 6

Patch Set 15 : Add a test for user-facing behavior and remove unnecessary code. #

Patch Set 16 : Removed unnecessary functions #

Patch Set 17 : Add parseAttribute back to pass one more test #

Total comments: 2

Patch Set 18 : Format the test. Add parserDidSetAttributes back to see if we can pass more tests #

Patch Set 19 : When dragging on the thumb on an angle, either the slider values will be changed, or the page will … #

Patch Set 20 : To pass more tests #

Patch Set 21 : Pass my test #

Patch Set 22 : Pass my test #

Patch Set 23 : Better code style #

Total comments: 7

Patch Set 24 : Better code style #

Patch Set 25 : Check if element is nullptr to fix the crash #

Unified diffs Side-by-side diffs Delta from patch set Stats (+377 lines, -83 lines) Patch
A third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +221 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLInputElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLInputElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 7 chunks +0 lines, -40 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/InputTypeView.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/InputTypeView.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/RangeInputType.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/RangeInputType.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +1 line, -26 lines 0 comments Download
M third_party/WebKit/Source/core/html/shadow/SliderThumbElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +116 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTheme.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTheme.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +19 lines, -0 lines 0 comments Download

Messages

Total messages: 124 (86 generated)
sunyunjia
Not sure if this is the right way to do it, but please take a ...
4 years, 4 months ago (2016-08-03 17:04:03 UTC) #2
majidvp
We need a layout test to ensure the right type of event handler is added ...
4 years, 4 months ago (2016-08-03 18:01:06 UTC) #3
sunyunjia
Changed the function name and dealt with the out-of-range situation. This is just an attempt ...
4 years, 4 months ago (2016-08-03 23:55:39 UTC) #4
majidvp
Taking a step back. I think it will be more appropriate to handle the new ...
4 years, 4 months ago (2016-08-04 15:20:26 UTC) #5
majidvp
https://codereview.chromium.org/2209773002/diff/40001/third_party/WebKit/Source/core/html/HTMLInputElement.cpp File third_party/WebKit/Source/core/html/HTMLInputElement.cpp (right): https://codereview.chromium.org/2209773002/diff/40001/third_party/WebKit/Source/core/html/HTMLInputElement.cpp#newcode416 third_party/WebKit/Source/core/html/HTMLInputElement.cpp:416: registry.didAddEventHandler(*this, EventHandlerRegistry::TouchStartOrMoveEventBlocking); The idea is to use TouchStartOrMoveEventPassive here. ...
4 years, 4 months ago (2016-08-04 15:20:36 UTC) #6
sunyunjia
Temporarily remove the drag-to-extend case. Handle the initial value for touch-action with vertical mode. Change ...
4 years, 4 months ago (2016-08-04 17:41:36 UTC) #7
majidvp
Please add a test to verify we are adding the right touch-action and event handler. ...
4 years, 4 months ago (2016-08-04 21:21:58 UTC) #8
sunyunjia
PTAL tkent@
4 years, 4 months ago (2016-08-08 20:26:33 UTC) #11
sunyunjia
PTAL tkent@
4 years, 4 months ago (2016-08-08 20:32:14 UTC) #13
tkent
> In current implementation, the InputRange element blocks browser's scrolling in all directions. The first ...
4 years, 4 months ago (2016-08-09 00:29:46 UTC) #22
sunyunjia
PTAL, Thanks!
4 years, 4 months ago (2016-08-09 17:55:39 UTC) #25
majidvp
https://codereview.chromium.org/2209773002/diff/100001/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html File third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html (right): https://codereview.chromium.org/2209773002/diff/100001/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html#newcode9 third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html:9: assert_equals(internals.blockingTouchStartOrMoveEventHandlerCount(document), 2); Why are we expecting two blocking touch ...
4 years, 4 months ago (2016-08-09 18:30:09 UTC) #26
sunyunjia
PTAL Besides, we are thinking about moving all the touch handler logic of <input type="range"> ...
4 years, 4 months ago (2016-08-09 23:01:45 UTC) #27
tkent
On 2016/08/09 at 23:01:45, sunyunjia wrote: > PTAL > > Besides, we are thinking about ...
4 years, 4 months ago (2016-08-10 02:20:53 UTC) #28
majidvp
On 2016/08/10 02:20:53, tkent wrote: > On 2016/08/09 at 23:01:45, sunyunjia wrote: > > PTAL ...
4 years, 4 months ago (2016-08-10 14:31:24 UTC) #29
sunyunjia
Moved the touch event handlers of <input type="range"> to the container in the shadow dom. ...
4 years, 4 months ago (2016-08-12 02:03:47 UTC) #30
majidvp
https://codereview.chromium.org/2209773002/diff/180001/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html File third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html (right): https://codereview.chromium.org/2209773002/diff/180001/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html#newcode24 third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html:24: var ctner1 = internals.shadowRoot(slider1).getElementById('container'); ctner does not read that ...
4 years, 4 months ago (2016-08-12 03:35:44 UTC) #35
tkent
https://codereview.chromium.org/2209773002/diff/180001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2209773002/diff/180001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode438 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:438: // Container's layoutObject() has been initialized this time. On ...
4 years, 4 months ago (2016-08-12 06:15:18 UTC) #36
sunyunjia
Moved the touch-action logic to LayoutTheme.cpp using -webkit-appearance: inherit The touch event handler is still ...
4 years, 4 months ago (2016-08-15 15:52:04 UTC) #38
sunyunjia
With the newest patch, the touch event handler is registered directly through SliderContainer element and ...
4 years, 4 months ago (2016-08-16 00:09:26 UTC) #47
sunyunjia
With the newest patch, the touch event handler is registered directly through SliderContainer element and ...
4 years, 4 months ago (2016-08-16 00:09:32 UTC) #48
dtapuska
On 2016/08/16 00:09:32, sunyunjia wrote: > With the newest patch, the touch event handler is ...
4 years, 4 months ago (2016-08-16 20:37:36 UTC) #57
sunyunjia
On 2016/08/16 20:37:36, dtapuska wrote: > On 2016/08/16 00:09:32, sunyunjia wrote: > tkent@ can you ...
4 years, 4 months ago (2016-08-17 00:08:13 UTC) #58
tkent
https://codereview.chromium.org/2209773002/diff/260001/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html File third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html (right): https://codereview.chromium.org/2209773002/diff/260001/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html#newcode18 third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html:18: 'Tests that there are 4 blocking touch handlers in ...
4 years, 4 months ago (2016-08-17 01:32:00 UTC) #59
sunyunjia
> https://codereview.chromium.org/2209773002/diff/260001/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp#newcode380 > third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp:380: void > SliderContainerElement::parserDidSetAttributes() > Why is it necessary though parseAttribute() calls ...
4 years, 4 months ago (2016-08-17 02:03:55 UTC) #60
tkent
On 2016/08/17 at 02:03:55, sunyunjia wrote: > > https://codereview.chromium.org/2209773002/diff/260001/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp#newcode380 > > third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp:380: void > > ...
4 years, 4 months ago (2016-08-17 03:56:44 UTC) #61
sunyunjia
Added a test for user-facing behavior and removed unnecessary code in SliderContainerElement. PTAL. Thanks!
4 years, 4 months ago (2016-08-17 23:50:09 UTC) #66
tkent
https://codereview.chromium.org/2209773002/diff/320001/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html File third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html (right): https://codereview.chromium.org/2209773002/diff/320001/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html#newcode26 third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html:26: <script> Indentation and coding style in this element look ...
4 years, 4 months ago (2016-08-18 05:13:49 UTC) #71
sunyunjia
> https://codereview.chromium.org/2209773002/diff/320001/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp#newcode369 > third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp:369: > registry.didAddEventHandler(*this, > EventHandlerRegistry::TouchStartOrMoveEventPassive); > didRemoveEventHandler() isn't called for *this. Is ...
4 years, 4 months ago (2016-08-22 02:02:56 UTC) #108
tkent
https://codereview.chromium.org/2209773002/diff/440001/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html File third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html (right): https://codereview.chromium.org/2209773002/diff/440001/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html#newcode28 third_party/WebKit/LayoutTests/fast/events/touch/touch-action-range-input.html:28: function forceLayoutUpdate() { Wrong indentation. 'function' should be started ...
4 years, 4 months ago (2016-08-22 06:00:48 UTC) #109
sunyunjia
> https://codereview.chromium.org/2209773002/diff/440001/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp#newcode361 > third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp:361: if > (m_slidingDirection != NoMove && canSlide()) { > m_slidingDirection==NoMove was ...
4 years, 4 months ago (2016-08-22 16:55:14 UTC) #114
tkent
lgtm
4 years, 4 months ago (2016-08-23 00:53:48 UTC) #115
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2209773002/460001
4 years, 4 months ago (2016-08-23 01:05:55 UTC) #117
commit-bot: I haz the power
Committed patchset #24 (id:460001)
4 years, 4 months ago (2016-08-23 01:11:49 UTC) #119
commit-bot: I haz the power
Patchset 24 (id:??) landed as https://crrev.com/cb18694aff180e913277a346a37e74835935b37d Cr-Commit-Position: refs/heads/master@{#413616}
4 years, 4 months ago (2016-08-23 01:14:51 UTC) #121
sunyunjia
A revert of this CL (patchset #25 id:480001) has been created in https://codereview.chromium.org/2266423003/ by sunyunjia@chromium.org. ...
4 years, 4 months ago (2016-08-23 13:36:46 UTC) #122
sunyunjia
https://codereview.chromium.org/2209773002/diff/180001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2209773002/diff/180001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode438 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:438: // Container's layoutObject() has been initialized this time. On ...
4 years, 3 months ago (2016-09-20 21:39:07 UTC) #123
tkent
4 years, 3 months ago (2016-09-20 23:01:55 UTC) #124
Message was sent while issue was closed.
> According to https://bugs.chromium.org/p/chromium/issues/detail?id=648589, we
can't change the inline style of sliderContainer under this circumstance. Are we
going back to this logic?

IMO, CSP shouldn't reject inline style in User-Agent shadow trees.

Powered by Google App Engine
This is Rietveld 408576698