Commit 5ab21b0a authored by Daniel Libby's avatar Daniel Libby Committed by Commit Bot

Revert "Add popup client support for injected scroll gestures."

This reverts commit 287cb744.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Add popup client support for injected scroll gestures.
> 
> I missed adding support for injecting scroll gestures to
> PagePopupChromeClient and scrollbar presses broke for select popups
> that had scrollbars. Add an override that forwards to the
> WebWidgetClient and add a test that validates that this works correctly.
> 
> R=​bokan@chromium.org
> 
> Bug: 960747
> Change-Id: I7a5164bb3d8c7b15252d0a9a806e932f7cc269a9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1600444
> Reviewed-by: David Bokan <bokan@chromium.org>
> Commit-Queue: Daniel Libby <dlibby@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#658137}

TBR=bokan@chromium.org,dlibby@microsoft.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 960747
Change-Id: Ib4ee6e5ef03910ef9b6253e03381cd1dcc780431
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1613756Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Commit-Queue: Daniel Libby <dlibby@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#660661}
parent 2bad2fa2
...@@ -231,14 +231,6 @@ class PagePopupChromeClient final : public EmptyChromeClient { ...@@ -231,14 +231,6 @@ class PagePopupChromeClient final : public EmptyChromeClient {
} }
} }
void InjectGestureScrollEvent(const blink::WebFloatSize& delta,
blink::WebScrollGranularity granularity,
cc::ElementId scrollable_area_element_id,
WebInputEvent::Type injected_type) override {
popup_->WidgetClient()->InjectGestureScrollEvent(
delta, granularity, scrollable_area_element_id, injected_type);
}
WebPagePopupImpl* popup_; WebPagePopupImpl* popup_;
}; };
......
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../resources/common.js"></script>
<script src="../resources/picker-common.js"></script>
</head>
<body>
<select id="menu">
<option>option1</option>
<option>option2</option>
<option>option3</option>
<option>option4</option>
<option>option5</option>
<option>option6</option>
<option>option7</option>
<option>option8</option>
<option>option9</option>
<option>option10</option>
<option>option11</option>
<option>option12</option>
<option>option13</option>
<option>option14</option>
<option>option15</option>
<option>option16</option>
<option>option17</option>
<option>option18</option>
<option>option19</option>
<option>option20</option>
<option>option21</option>
<option>option22</option>
<option>option23</option>
<option>option24</option>
<option>option25</option>
<option>option26</option>
<option>option27</option>
<option>option28</option>
</select>
<script>
internals.settings.setMockScrollbarsEnabled(true);
internals.settings.setScrollAnimatorEnabled(false);
let test = async_test(function(test) {
openPicker(menu, test.step_func(testScrollbarScroll),
test.unreached_func('Picker failed to open'));
}, "Scrollbar clicks in a popup must scroll");
function testScrollbarScroll() {
let picker = internals.pagePopupWindow.global.picker;
let scrollEvents = 0;
// Click on the scrollbar forward button, and then validate with
// a pixel test that the scrollbar/scrollable area scrolled.
//
// Note: when there is an active popup, eventSender's events are sent with
// coordinates relative to the popup itself, so we don't need to take the
// outer select element's position into account.
let selectElement = internals.pagePopupWindow.global.picker._selectElement;
let innerSelectRect = selectElement.getBoundingClientRect();
let scrollbarX = innerSelectRect.x + innerSelectRect.width - 5;
let scrollbarY = innerSelectRect.y + innerSelectRect.height - 10;
eventSender.mouseMoveTo(scrollbarX, scrollbarY);
eventSender.mouseDown();
eventSender.mouseUp();
requestAnimationFrame(test.step_func(function() {
requestAnimationFrame(test.step_func(function() {
assert_greater_than(selectElement.scrollTop, 0);
test.done();
}));
}));
}
</script>
</body>
</html>
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