diff --git a/gfx/layers/apz/test/mochitest/helper_hittest_hidden_inactive_scrollframe.html b/gfx/layers/apz/test/mochitest/helper_hittest_hidden_inactive_scrollframe.html new file mode 100644 index 000000000000..bdc20be0f094 --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_hittest_hidden_inactive_scrollframe.html @@ -0,0 +1,52 @@ + + + + APZ hit-testing with an inactive scrollframe that is visibility:hidden (bug 1673505) + + + + + + +
+
+
+ The body of this document is scrollable and is the main scrollable + element. On top of that we have a hidden fixed-pos item containing another + scrollframe, but this nested scrollframe is inactive. + Since the fixed-pos item is hidden, the nested scrollframe is hidden + too and shouldn't be the target of hit-testing. However, because it is + an inactive scrollframe, code to generate the "this is an inactive + scrollframe" area was marking it as hit-testable. This bug led to hit- + tests being mis-targeted to the nested scrollframe's layers id instead + of whatever was underneath. +
+
+
+ + + diff --git a/gfx/layers/apz/test/mochitest/test_group_hittest.html b/gfx/layers/apz/test/mochitest/test_group_hittest.html index ef14b16ab464..608447297106 100644 --- a/gfx/layers/apz/test/mochitest/test_group_hittest.html +++ b/gfx/layers/apz/test/mochitest/test_group_hittest.html @@ -41,6 +41,7 @@ var subtests = [ {"file": "helper_hittest_clippath.html", "prefs": prefs}, {"file": "helper_hittest_hoisted_scrollinfo.html", "prefs": prefs}, {"file": "helper_hittest_spam.html", "prefs": prefs}, + {"file": "helper_hittest_hidden_inactive_scrollframe.html", "prefs": prefs}, ]; if (isApzEnabled()) { diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index a73bd8a31765..de6fa88983f2 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3683,8 +3683,9 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, if (mWillBuildScrollableLayer) { couldBuildLayer = true; } else { - couldBuildLayer = - nsLayoutUtils::AsyncPanZoomEnabled(mOuter) && WantAsyncScroll(); + couldBuildLayer = mOuter->StyleVisibility()->IsVisible() && + nsLayoutUtils::AsyncPanZoomEnabled(mOuter) && + WantAsyncScroll(); } }