зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1421885 - Part 1: Don't let mNoActionRegion get complex when we've already added it to mDispatchToContentRegion. r=kats
MozReview-Commit-ID: 5DwLyJ7qeN0 --HG-- extra : rebase_source : 34740ca99fe1bec2f594c58967e39964026c1014
This commit is contained in:
Родитель
19611b7362
Коммит
3def26fd12
|
@ -659,6 +659,8 @@ public:
|
||||||
* mDispatchToContentHitRegion.
|
* mDispatchToContentHitRegion.
|
||||||
*/
|
*/
|
||||||
nsRegion mVerticalPanRegion;
|
nsRegion mVerticalPanRegion;
|
||||||
|
|
||||||
|
bool mCollapsedTouchActions = false;
|
||||||
/**
|
/**
|
||||||
* Scaled versions of the bounds of mHitRegion and mMaybeHitRegion.
|
* Scaled versions of the bounds of mHitRegion and mMaybeHitRegion.
|
||||||
* We store these because FindPaintedLayerFor() needs to consume them
|
* We store these because FindPaintedLayerFor() needs to consume them
|
||||||
|
@ -3877,8 +3879,22 @@ PaintedLayerData::AccumulateHitTestInfo(ContainerState* aState,
|
||||||
|
|
||||||
auto touchFlags = hitTestInfo & CompositorHitTestInfo::eTouchActionMask;
|
auto touchFlags = hitTestInfo & CompositorHitTestInfo::eTouchActionMask;
|
||||||
if (touchFlags) {
|
if (touchFlags) {
|
||||||
// something was disabled
|
// If there are multiple touch-action areas, there are multiple elements with
|
||||||
if (touchFlags == CompositorHitTestInfo::eTouchActionMask) {
|
// touch-action properties. We don't know what the relationship is between
|
||||||
|
// those elements in terms of DOM ancestry, and so we don't know how to
|
||||||
|
// combine the regions properly. Instead, we just add all the areas to the
|
||||||
|
// dispatch-to-content region, so that the APZ knows to check with the
|
||||||
|
// main thread. See bug 1286957.
|
||||||
|
if (mCollapsedTouchActions) {
|
||||||
|
mDispatchToContentHitRegion.OrWith(area);
|
||||||
|
} else if (!CombinedTouchActionRegion().IsEmpty()) {
|
||||||
|
mDispatchToContentHitRegion.OrWith(CombinedTouchActionRegion());
|
||||||
|
mDispatchToContentHitRegion.OrWith(area);
|
||||||
|
mNoActionRegion.SetEmpty();
|
||||||
|
mHorizontalPanRegion.SetEmpty();
|
||||||
|
mVerticalPanRegion.SetEmpty();
|
||||||
|
mCollapsedTouchActions = true;
|
||||||
|
} else if (touchFlags == CompositorHitTestInfo::eTouchActionMask) {
|
||||||
// everything was disabled, so touch-action:none
|
// everything was disabled, so touch-action:none
|
||||||
mNoActionRegion.OrWith(area);
|
mNoActionRegion.OrWith(area);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3914,20 +3930,6 @@ PaintedLayerData::AccumulateHitTestInfo(ContainerState* aState,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there are multiple touch-action areas, there are multiple elements with
|
|
||||||
// touch-action properties. We don't know what the relationship is between
|
|
||||||
// those elements in terms of DOM ancestry, and so we don't know how to
|
|
||||||
// combine the regions properly. Instead, we just add all the areas to the
|
|
||||||
// dispatch-to-content region, so that the APZ knows to check with the
|
|
||||||
// main thread. See bug 1286957.
|
|
||||||
const int alreadyHadRegions = mNoActionRegion.GetNumRects() +
|
|
||||||
mHorizontalPanRegion.GetNumRects() +
|
|
||||||
mVerticalPanRegion.GetNumRects();
|
|
||||||
|
|
||||||
if (alreadyHadRegions > 1) {
|
|
||||||
mDispatchToContentHitRegion.OrWith(CombinedTouchActionRegion());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Avoid quadratic performance as a result of the region growing to include
|
// Avoid quadratic performance as a result of the region growing to include
|
||||||
// and arbitrarily large number of rects, which can happen on some pages.
|
// and arbitrarily large number of rects, which can happen on some pages.
|
||||||
mMaybeHitRegion.SimplifyOutward(8);
|
mMaybeHitRegion.SimplifyOutward(8);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче