mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 037f46cdfd80 (bug 976605)
This commit is contained in:
parent
2ab567a6db
commit
a4e7d784f4
@ -214,7 +214,6 @@ public:
|
||||
* Sets allowed touch behavior values for current touch-session for specific apzc (determined by guid).
|
||||
* Should be invoked by the widget. Each value of the aValues arrays corresponds to the different
|
||||
* touch point that is currently active.
|
||||
* Must be called after receiving the TOUCH_START event that starts the touch-session.
|
||||
*/
|
||||
void SetAllowedTouchBehavior(const ScrollableLayerGuid& aGuid,
|
||||
const nsTArray<TouchBehaviorFlags>& aValues);
|
||||
|
@ -315,8 +315,6 @@ public:
|
||||
* Sets allowed touch behavior for current touch session.
|
||||
* This method is invoked by the APZCTreeManager which in its turn invoked by
|
||||
* the widget after performing touch-action values retrieving.
|
||||
* Must be called after receiving the TOUCH_START even that started the
|
||||
* touch session.
|
||||
*/
|
||||
void SetAllowedTouchBehavior(const nsTArray<TouchBehaviorFlags>& aBehaviors);
|
||||
|
||||
|
@ -168,14 +168,7 @@ FrameMetrics TestFrameMetrics() {
|
||||
* consumed them and triggered scrolling behavior.
|
||||
*/
|
||||
static
|
||||
void ApzcPan(AsyncPanZoomController* apzc,
|
||||
TestAPZCTreeManager* aTreeManager,
|
||||
int& aTime,
|
||||
int aTouchStartY,
|
||||
int aTouchEndY,
|
||||
bool expectIgnoredPan = false,
|
||||
bool hasTouchListeners = false,
|
||||
nsTArray<uint32_t>* aAllowedTouchBehaviors = nullptr) {
|
||||
void ApzcPan(AsyncPanZoomController* apzc, TestAPZCTreeManager* aTreeManager, int& aTime, int aTouchStartY, int aTouchEndY, bool expectIgnoredPan = false, bool hasTouchListeners = false) {
|
||||
|
||||
const int TIME_BETWEEN_TOUCH_EVENT = 100;
|
||||
const int OVERCOME_TOUCH_TOLERANCE = 100;
|
||||
@ -205,11 +198,6 @@ void ApzcPan(AsyncPanZoomController* apzc,
|
||||
EXPECT_EQ(status, touchStartStatus);
|
||||
// APZC should be in TOUCHING state
|
||||
|
||||
// Allowed touch behaviours must be set after sending touch-start.
|
||||
if (aAllowedTouchBehaviors) {
|
||||
apzc->SetAllowedTouchBehavior(*aAllowedTouchBehaviors);
|
||||
}
|
||||
|
||||
nsEventStatus touchMoveStatus;
|
||||
if (expectIgnoredPan) {
|
||||
// APZC should ignore panning, be in TOUCHING state and therefore return eIgnore.
|
||||
@ -266,11 +254,12 @@ void DoPanTest(bool aShouldTriggerScroll, bool aShouldUseTouchAction, uint32_t a
|
||||
ScreenPoint pointOut;
|
||||
ViewTransform viewTransformOut;
|
||||
|
||||
nsTArray<uint32_t> allowedTouchBehaviors;
|
||||
allowedTouchBehaviors.AppendElement(aBehavior);
|
||||
nsTArray<uint32_t> values;
|
||||
values.AppendElement(aBehavior);
|
||||
|
||||
// Pan down
|
||||
ApzcPan(apzc, tm, time, touchStart, touchEnd, !aShouldTriggerScroll, false, &allowedTouchBehaviors);
|
||||
apzc->SetAllowedTouchBehavior(values);
|
||||
ApzcPan(apzc, tm, time, touchStart, touchEnd, !aShouldTriggerScroll);
|
||||
apzc->SampleContentTransformForFrame(testStartTime, &viewTransformOut, pointOut);
|
||||
|
||||
if (aShouldTriggerScroll) {
|
||||
@ -282,7 +271,8 @@ void DoPanTest(bool aShouldTriggerScroll, bool aShouldUseTouchAction, uint32_t a
|
||||
}
|
||||
|
||||
// Pan back
|
||||
ApzcPan(apzc, tm, time, touchEnd, touchStart, !aShouldTriggerScroll, false, &allowedTouchBehaviors);
|
||||
apzc->SetAllowedTouchBehavior(values);
|
||||
ApzcPan(apzc, tm, time, touchEnd, touchStart, !aShouldTriggerScroll);
|
||||
apzc->SampleContentTransformForFrame(testStartTime, &viewTransformOut, pointOut);
|
||||
|
||||
EXPECT_EQ(pointOut, ScreenPoint());
|
||||
@ -623,10 +613,11 @@ TEST_F(AsyncPanZoomControllerTester, PanWithPreventDefault) {
|
||||
ViewTransform viewTransformOut;
|
||||
|
||||
// Pan down
|
||||
nsTArray<uint32_t> allowedTouchBehaviors;
|
||||
allowedTouchBehaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN);
|
||||
nsTArray<uint32_t> values;
|
||||
values.AppendElement(mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN);
|
||||
apzc->SetTouchActionEnabled(true);
|
||||
ApzcPan(apzc, tm, time, touchStart, touchEnd, true, true, &allowedTouchBehaviors);
|
||||
apzc->SetAllowedTouchBehavior(values);
|
||||
ApzcPan(apzc, tm, time, touchStart, touchEnd, true, true);
|
||||
|
||||
// Send the signal that content has handled and preventDefaulted the touch
|
||||
// events. This flushes the event queue.
|
||||
@ -755,18 +746,16 @@ DoLongPressTest(bool aShouldUseTouchAction, uint32_t aBehavior) {
|
||||
apzc->NotifyLayersUpdated(TestFrameMetrics(), true);
|
||||
apzc->UpdateZoomConstraints(ZoomConstraints(false, false, CSSToScreenScale(1.0), CSSToScreenScale(1.0)));
|
||||
|
||||
nsTArray<uint32_t> values;
|
||||
values.AppendElement(aBehavior);
|
||||
apzc->SetTouchActionEnabled(aShouldUseTouchAction);
|
||||
apzc->SetAllowedTouchBehavior(values);
|
||||
|
||||
int time = 0;
|
||||
|
||||
nsEventStatus status = ApzcDown(apzc, 10, 10, time);
|
||||
EXPECT_EQ(nsEventStatus_eConsumeNoDefault, status);
|
||||
|
||||
// SetAllowedTouchBehavior() must be called after sending touch-start.
|
||||
nsTArray<uint32_t> allowedTouchBehaviors;
|
||||
allowedTouchBehaviors.AppendElement(aBehavior);
|
||||
apzc->SetAllowedTouchBehavior(allowedTouchBehaviors);
|
||||
|
||||
MockFunction<void(std::string checkPointName)> check;
|
||||
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user