Commit 6ba514d3 authored by Hayato Ito's avatar Hayato Ito Committed by Commit Bot

Update comments about TouchEvent adjustment

The previous comment was added at [1], saying the code is suspicious, however,
the code is correct.

To avoid a confusion, update the comments.

[1]: https://chromium-review.googlesource.com/c/chromium/src/+/755855

Change-Id: I9c30c53b6cd24e14160fa18b8fc0c3dc7aff2dc0
Reviewed-on: https://chromium-review.googlesource.com/959947
Commit-Queue: Hayato Ito <hayato@chromium.org>
Reviewed-by: default avatarTakayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543014}
parent 4583ba5d
......@@ -315,6 +315,7 @@ void EventPath::ShrinkForRelatedTarget(const Node& event_target_node,
}
void EventPath::AdjustForTouchEvent(const TouchEvent& touch_event) {
// Each vector and a TouchEventContext share the same TouchList instance.
HeapVector<Member<TouchList>> adjusted_touches;
HeapVector<Member<TouchList>> adjusted_target_touches;
HeapVector<Member<TouchList>> adjusted_changed_touches;
......@@ -329,8 +330,9 @@ void EventPath::AdjustForTouchEvent(const TouchEvent& touch_event) {
tree_scopes.push_back(&tree_scope_event_context->GetTreeScope());
}
// TODO(mustaq): The following adjustments to local vars seems suspicious.
// Only used for DCHECK?
// AdjustTouchList appends adjusted Touch(es) to each member TouchList
// instance in |adjusted_touch_list| argument, which is reflected on
// TouchEventContext because they refer to the same TouchList instance.
AdjustTouchList(touch_event.touches(), adjusted_touches, tree_scopes);
AdjustTouchList(touch_event.targetTouches(), adjusted_target_touches,
tree_scopes);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment