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

Issue 2916563003: Compute effective touch action in StyleAdjuster. (Closed)

Created:
3 years, 6 months ago by sunxd
Modified:
3 years, 5 months ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, dtapuska+blinkwatch_chromium.org, hayleyferr, Navid Zolghadr, rwlbuis
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Compute effective touch action in StyleAdjuster. We used to store touch action bits in ComputedStyle and recompute the effective touch action in TouchActionUtil whenever we need to use it. In order to process touch action info in cc, we need to adjust this method as cc has no access to TouchActionUtil. We can compute them when recomputing styles or in cc. As cc lacks hit testing information, it is more feasible to do it in StyleAdjuster. Pre-computing the style also saves time by avoiding tree walks. This CL adds the EffectiveTouchAction to non-css RareInheritedData and uses it when computing styles. There are also special cases where touch action is not supported in atomic inline level elements and there are exceptions if an element is an iframe or scrolls. BUG=727853 Review-Url: https://codereview.chromium.org/2916563003 Cr-Commit-Position: refs/heads/master@{#486363} Committed: https://chromium.googlesource.com/chromium/src/+/4d9c0082acd8bd604a1a44260dc6f62a400e5ddb

Patch Set 1 #

Patch Set 2 : Fix clang compiling error. #

Patch Set 3 : Rebase!! A conflict patch was landed, reverted and landed again. #

Patch Set 4 : fix layout test failures #

Total comments: 37

Patch Set 5 : Move ComputeEffectiveTouchAction out of AdjustComputedStyle. #

Total comments: 19

Patch Set 6 : Unifying ScrollsOverflow #

Total comments: 4

Patch Set 7 : Iframe touch action updates trigger descendant style recalc. #

Total comments: 11

Patch Set 8 : early out in style adjuster #

Total comments: 2

Patch Set 9 : resolve comments #

Total comments: 4

Patch Set 10 : resolve comments #

Patch Set 11 : Add rendering test that tests iframe style change #

Total comments: 4

Patch Set 12 : Add StyleAdjusterTest #

Total comments: 6

Patch Set 13 : resolve comments #

Patch Set 14 : add test case #

Total comments: 8

Patch Set 15 : resolve comments #

Total comments: 2

Patch Set 16 : nit change #

Patch Set 17 : Do not traverse across frames #

Total comments: 8

Patch Set 18 : Skip elements that don't need a layout object #

Total comments: 3

Patch Set 19 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+230 lines, -70 lines) Patch
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/ComputedStyleExtraFields.json5 View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +68 lines, -1 line 0 comments Download
A third_party/WebKit/Source/core/css/resolver/StyleAdjusterTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +103 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StyleChangeReason.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StyleChangeReason.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/input/TouchActionUtil.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +4 lines, -58 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +5 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +36 lines, -0 lines 0 comments Download

Messages

Total messages: 115 (69 generated)
sunxd
PTAL. Per our discussion offline, I'm not sure if the new logic is totally compatible ...
3 years, 6 months ago (2017-05-31 22:08:03 UTC) #13
wkorman
I am new to StyleAdjuster work, so please take my feedback with that grain of ...
3 years, 6 months ago (2017-06-02 03:07:06 UTC) #20
flackr
https://codereview.chromium.org/2916563003/diff/60001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/60001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode456 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:456: bool is_svg_root = false; On 2017/06/02 03:07:05, wkorman wrote: ...
3 years, 6 months ago (2017-06-05 18:43:10 UTC) #21
sunxd
I'm working on some of the comments, but there are also questions raised by comments ...
3 years, 6 months ago (2017-06-05 20:12:04 UTC) #22
sunxd
PTAL. I made some changes according to the comments. https://codereview.chromium.org/2916563003/diff/60001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/60001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode511 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:511: ...
3 years, 6 months ago (2017-06-06 15:24:59 UTC) #25
flackr
https://codereview.chromium.org/2916563003/diff/60001/third_party/WebKit/Source/core/input/TouchActionUtil.cpp File third_party/WebKit/Source/core/input/TouchActionUtil.cpp (right): https://codereview.chromium.org/2916563003/diff/60001/third_party/WebKit/Source/core/input/TouchActionUtil.cpp#newcode74 third_party/WebKit/Source/core/input/TouchActionUtil.cpp:74: // This code is to prevent failure when node ...
3 years, 6 months ago (2017-06-07 18:21:48 UTC) #28
sunxd
PTAL. Resolved some comments. I'm going to try the TouchActionUtil stuff and recall the reason ...
3 years, 6 months ago (2017-06-08 19:08:12 UTC) #31
flackr
https://codereview.chromium.org/2916563003/diff/80001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/80001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode386 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:386: // support both the CSS width and height properties. ...
3 years, 6 months ago (2017-06-08 19:35:21 UTC) #32
sunxd
I haven't uploaded the patch as I'm still trying to work on the iframe case. ...
3 years, 6 months ago (2017-06-09 21:00:35 UTC) #35
sunxd
PTAL. There are only two tests remaining here: 1) Add StyleAdjuster unit test that tests ...
3 years, 6 months ago (2017-06-12 17:27:05 UTC) #38
rune
https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode376 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:376: Element* element) { This method looks like it's doing ...
3 years, 6 months ago (2017-06-12 21:09:02 UTC) #42
sunxd
PTAL. I attempted to early out in style adjuster, but as the early out also ...
3 years, 6 months ago (2017-06-14 17:55:58 UTC) #43
sunxd
PTAL. I attempted to early out in style adjuster, but as the early out also ...
3 years, 6 months ago (2017-06-14 17:55:59 UTC) #44
rune
https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode376 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:376: Element* element) { On 2017/06/14 17:55:58, sunxd wrote: > ...
3 years, 6 months ago (2017-06-15 00:04:40 UTC) #46
flackr
Can you add some unit tests for effective touch action? https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode393 ...
3 years, 6 months ago (2017-06-15 00:32:42 UTC) #47
rune
https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode393 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:393: style.SetTouchAction(TouchAction::kTouchActionAuto); On 2017/06/15 00:32:42, flackr wrote: > Is this ...
3 years, 6 months ago (2017-06-15 08:19:04 UTC) #48
flackr
https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode393 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:393: style.SetTouchAction(TouchAction::kTouchActionAuto); On 2017/06/15 08:19:03, rune wrote: > On 2017/06/15 ...
3 years, 6 months ago (2017-06-15 14:16:20 UTC) #49
sunxd
PTAL. https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/120001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode376 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:376: Element* element) { On 2017/06/15 00:04:40, rune wrote: ...
3 years, 6 months ago (2017-06-15 16:10:27 UTC) #50
flackr
https://codereview.chromium.org/2916563003/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/2916563003/diff/180001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode412 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:412: frame_style->GetEffectiveTouchAction() | TouchAction::kTouchActionPan; I still think it'd be cleaner ...
3 years, 6 months ago (2017-06-19 15:45:42 UTC) #51
sunxd
PTAL. This patch mainly resolves iframe style change problem. https://codereview.chromium.org/2916563003/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/2916563003/diff/180001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode412 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:412: ...
3 years, 6 months ago (2017-06-21 15:13:03 UTC) #58
flackr
Also please add other tests for the effective touch action in non iframe cases. I.e. ...
3 years, 6 months ago (2017-06-21 15:24:35 UTC) #59
sunxd
PTAL. I've added tests that reflects logic when changing touch-action styles. But I don't get ...
3 years, 6 months ago (2017-06-22 17:22:55 UTC) #64
flackr
The other case I was thinking was something like <div id="a" style="touch-action: pan-x pan-y"> <div ...
3 years, 6 months ago (2017-06-22 19:15:31 UTC) #67
sunxd
PTAL. https://codereview.chromium.org/2916563003/diff/240001/third_party/WebKit/Source/core/css/resolver/StyleAdjusterTest.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjusterTest.cpp (right): https://codereview.chromium.org/2916563003/diff/240001/third_party/WebKit/Source/core/css/resolver/StyleAdjusterTest.cpp#newcode30 third_party/WebKit/Source/core/css/resolver/StyleAdjusterTest.cpp:30: ASSERT_TRUE(target && target->GetComputedStyle()); On 2017/06/22 19:15:31, flackr wrote: ...
3 years, 5 months ago (2017-06-26 17:52:01 UTC) #72
flackr
https://codereview.chromium.org/2916563003/diff/280001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/280001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode402 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:402: // iframe element. nit: I think this comment would ...
3 years, 5 months ago (2017-06-29 14:34:06 UTC) #75
sunxd
PTAL. https://codereview.chromium.org/2916563003/diff/280001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/280001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode402 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:402: // iframe element. On 2017/06/29 14:34:06, flackr wrote: ...
3 years, 5 months ago (2017-06-29 15:21:19 UTC) #78
flackr
LGTM with nit https://codereview.chromium.org/2916563003/diff/300001/third_party/WebKit/Source/core/input/TouchActionUtil.cpp File third_party/WebKit/Source/core/input/TouchActionUtil.cpp (right): https://codereview.chromium.org/2916563003/diff/300001/third_party/WebKit/Source/core/input/TouchActionUtil.cpp#newcode34 third_party/WebKit/Source/core/input/TouchActionUtil.cpp:34: return node.GetComputedStyle()->GetEffectiveTouchAction(); This check and early ...
3 years, 5 months ago (2017-06-29 15:29:27 UTC) #79
flackr
https://codereview.chromium.org/2916563003/diff/300001/third_party/WebKit/Source/core/input/TouchActionUtil.cpp File third_party/WebKit/Source/core/input/TouchActionUtil.cpp (right): https://codereview.chromium.org/2916563003/diff/300001/third_party/WebKit/Source/core/input/TouchActionUtil.cpp#newcode17 third_party/WebKit/Source/core/input/TouchActionUtil.cpp:17: const Node* ParentNodeAcrossFrames(const Node* cur_node) { I think the ...
3 years, 5 months ago (2017-06-29 15:31:29 UTC) #80
flackr
3 years, 5 months ago (2017-06-29 15:31:32 UTC) #81
flackr
3 years, 5 months ago (2017-06-29 15:31:33 UTC) #82
sunxd
Hi Chris, Can you take a look at this change please? Thanks.
3 years, 5 months ago (2017-06-29 16:06:36 UTC) #86
chrishtr
Rune is already reviewing. Addding meade@ for a second pair of style eyes. This is ...
3 years, 5 months ago (2017-06-29 16:26:14 UTC) #88
rune
https://codereview.chromium.org/2916563003/diff/340001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/340001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode391 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:391: if (is_non_replaced_inline_elements || is_table_row_or_column) { Does touch-action apply to ...
3 years, 5 months ago (2017-06-29 21:20:21 UTC) #89
flackr
https://codereview.chromium.org/2916563003/diff/340001/third_party/WebKit/Source/core/input/TouchActionUtil.cpp File third_party/WebKit/Source/core/input/TouchActionUtil.cpp (right): https://codereview.chromium.org/2916563003/diff/340001/third_party/WebKit/Source/core/input/TouchActionUtil.cpp#newcode20 third_party/WebKit/Source/core/input/TouchActionUtil.cpp:20: return cur_node->GetComputedStyle()->GetEffectiveTouchAction(); On 2017/06/29 21:20:21, rune wrote: > GetComputedStyle() ...
3 years, 5 months ago (2017-06-30 02:49:54 UTC) #90
meade_UTC10
+shend and nainar who have been working on ComputedStyle and co. and can review those. ...
3 years, 5 months ago (2017-06-30 02:54:08 UTC) #91
meade_UTC10
actually adding nainar and shend this time
3 years, 5 months ago (2017-06-30 03:00:09 UTC) #93
shend
https://codereview.chromium.org/2916563003/diff/340001/third_party/WebKit/Source/build/scripts/make_computed_style_base.py File third_party/WebKit/Source/build/scripts/make_computed_style_base.py (right): https://codereview.chromium.org/2916563003/diff/340001/third_party/WebKit/Source/build/scripts/make_computed_style_base.py#newcode39 third_party/WebKit/Source/build/scripts/make_computed_style_base.py:39: 'LineClampValue', 'OutlineValue', 'TouchAction', 'unsigned', 'size_t', 'int', (A) You won't ...
3 years, 5 months ago (2017-06-30 03:05:40 UTC) #94
sunxd
PTAL. I applied the suggested changes to json files. Regarding display:contents element, I checked the ...
3 years, 5 months ago (2017-07-04 15:35:42 UTC) #97
shend
On 2017/07/04 at 15:35:42, sunxd wrote: > PTAL. > > I applied the suggested changes ...
3 years, 5 months ago (2017-07-04 23:26:50 UTC) #100
sunxd
On 2017/07/04 23:26:50, shend wrote: > On 2017/07/04 at 15:35:42, sunxd wrote: > > PTAL. ...
3 years, 5 months ago (2017-07-11 18:21:04 UTC) #101
meade_UTC10
In that case, StyleAdjuster lgtm so you're not blocked, but it is hit a lot, ...
3 years, 5 months ago (2017-07-12 06:26:41 UTC) #102
nainar
One nit comment. But lgtm otherwise. https://codereview.chromium.org/2916563003/diff/360001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/360001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode379 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:379: bool is_svg_root = ...
3 years, 5 months ago (2017-07-12 06:27:59 UTC) #103
sunxd
https://codereview.chromium.org/2916563003/diff/360001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/360001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode379 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:379: bool is_svg_root = element && element->IsSVGElement() && On 2017/07/12 ...
3 years, 5 months ago (2017-07-12 16:06:28 UTC) #105
nainar
lgtm still https://codereview.chromium.org/2916563003/diff/360001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp File third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp (right): https://codereview.chromium.org/2916563003/diff/360001/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp#newcode379 third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp:379: bool is_svg_root = element && element->IsSVGElement() && ...
3 years, 5 months ago (2017-07-13 01:08:43 UTC) #109
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/2916563003/380001
3 years, 5 months ago (2017-07-13 13:56:03 UTC) #112
commit-bot: I haz the power
3 years, 5 months ago (2017-07-13 14:03:46 UTC) #115
Message was sent while issue was closed.
Committed patchset #19 (id:380001) as
https://chromium.googlesource.com/chromium/src/+/4d9c0082acd8bd604a1a44260dc6...

Powered by Google App Engine
This is Rietveld 408576698