Commit d307380a authored by MozLando's avatar MozLando
Browse files

Merge #5107

5107: Use minus offset for vertical clipping. r=pocmo a=hiikezoe

After bug 1586144 the area which is initially covered by the dynamic toolbar
is outside of the ICB so that we need to use minus offsets.

https://bugzilla.mozilla.org/show_bug.cgi?id=1586144

Co-authored-by: default avatarHiroyuki Ikezoe <hiroyuki.ikezoe@gmail.com>
parents d80c05ee 30aedd67
......@@ -80,9 +80,9 @@ class GeckoEngineViewTest {
val engineView = GeckoEngineView(context)
engineView.currentGeckoView = mock()
engineView.setVerticalClipping(42)
engineView.setVerticalClipping(-42)
verify(engineView.currentGeckoView).setVerticalClipping(42)
verify(engineView.currentGeckoView).setVerticalClipping(-42)
}
@Test
......
......@@ -80,9 +80,9 @@ class GeckoEngineViewTest {
val engineView = GeckoEngineView(context)
engineView.currentGeckoView = mock()
engineView.setVerticalClipping(42)
engineView.setVerticalClipping(-42)
verify(engineView.currentGeckoView).setVerticalClipping(42)
verify(engineView.currentGeckoView).setVerticalClipping(-42)
}
@Test
......
......@@ -80,9 +80,9 @@ class GeckoEngineViewTest {
val engineView = GeckoEngineView(context)
engineView.currentGeckoView = mock()
engineView.setVerticalClipping(42)
engineView.setVerticalClipping(-42)
verify(engineView.currentGeckoView).setVerticalClipping(42)
verify(engineView.currentGeckoView).setVerticalClipping(-42)
}
@Test
......
......@@ -44,7 +44,7 @@ class EngineViewBottomBehavior(
*/
override fun onDependentViewChanged(parent: CoordinatorLayout, child: View, dependency: View): Boolean {
val engineView = child.findViewInHierarchy { it is EngineView } as EngineView?
engineView?.setVerticalClipping(dependency.height - dependency.translationY.toInt())
engineView?.setVerticalClipping(-dependency.translationY.toInt())
return true
}
}
......@@ -36,7 +36,7 @@ class EngineViewBottomBehaviorTest {
doReturn(42f).`when`(toolbar).translationY
behavior.onDependentViewChanged(mock(), engineView.asView(), toolbar)
verify(engineView).setVerticalClipping(58)
verify(engineView).setVerticalClipping(-42)
}
@Test
......
Supports Markdown
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