Skip to content

Commit

Permalink
Revert "[Reland] VT: Fix snapshot rect for a resizing virtual keyboard"
Browse files Browse the repository at this point in the history
This reverts commit c5d45f4.

Reason for revert: Still failing ViewTransitionPixelTest#testVirtualKeyboardResizesContentOld on multiple bots.
For details see https://crbug.com/1383541


Original change's description:
> [Reland] VT: Fix snapshot rect for a resizing virtual keyboard
>
> Reland note: original CL in initial upload. Fix is to avoid using
> the inset method which was added in a newer API level.
>
> ViewTransitions compute the "snapshot rect" which is a viewport-like
> rect that doesn't change size when UI such as scrollbars, virtual
> keyboard, mobile URL bar are showing or hidden.
>
> When the keyboard is in a resize-content mode (so that innerHeight is
> changed by the keyboard, see:
> https://developer.chrome.com/blog/viewport-resize-behavior/), the
> snapshot rect must account for the keyboard by outsetting the layout
> viewport.
>
> This CL plumbs the virtual-keyboard height into the renderer via
> SynchronizeVisualProperties so that DocumentTransitionStyleTracker can
> use this value to perform the outset. This value includes any keyboard
> accessories such as the autofill bar.
>
> Since the keyboard resize behavior is implemented in the //chrome layer,
> this CL adds end-to-end chrome browser tests for this behavior. This
> requires introducing some hand-rolled pixel testing functionality into
> java tests which isn't common so also requires plumbing the
> InsertVisualStateCallback mechanism into java, allowing tests to wait on
> a Blink main frame to be presented to the screen.
>
> Bug: 1350910
> Change-Id: Ib86da86fbc4f9079fc4eafe26d055cb6d2837a6d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4021408
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Reviewed-by: Ted Choc <tedchoc@chromium.org>
> Auto-Submit: David Bokan <bokan@chromium.org>
> Reviewed-by: danakj <danakj@chromium.org>
> Commit-Queue: David Bokan <bokan@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1069983}

Bug: 1350910, 1383541
Change-Id: I131d55a4af94a3d7b38bc896092588cde63cd7b5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4023983
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Owners-Override: Tommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1070607}
  • Loading branch information
tommynyquist authored and Chromium LUCI CQ committed Nov 12, 2022
1 parent f386e5f commit 3246177
Show file tree
Hide file tree
Showing 35 changed files with 16 additions and 823 deletions.
1 change: 0 additions & 1 deletion chrome/android/chrome_test_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ chrome_test_java_sources = [
"javatests/src/org/chromium/chrome/browser/TabsTest.java",
"javatests/src/org/chromium/chrome/browser/UrlSchemeTest.java",
"javatests/src/org/chromium/chrome/browser/VideoFullscreenOrientationLockChromeTest.java",
"javatests/src/org/chromium/chrome/browser/ViewTransitionPixelTest.java",
"javatests/src/org/chromium/chrome/browser/VirtualKeyboardResizeTest.java",
"javatests/src/org/chromium/chrome/browser/WarmupManagerTest.java",
"javatests/src/org/chromium/chrome/browser/accessibility/FontSizePrefsTest.java",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,6 @@ public boolean controlsResizeView() {
&& mCompositorViewHolderSupplier.get().controlsResizeView();
}

@Override
public int getVirtualKeyboardHeight() {
return mCompositorViewHolderSupplier.hasValue()
? mCompositorViewHolderSupplier.get().getVirtualKeyboardHeight()
: 0;
}

@Override
public void enterFullscreenModeForTab(boolean prefersNavigationBar, boolean prefersStatusBar) {
if (mFullscreenManager != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1872,22 +1872,6 @@ void setCompositorViewForTesting(CompositorView compositorView) {
mCompositorView = compositorView;
}

/**
* Returns its height, in physical pixels, of the virtual keyboard if shown or 0 if hidden.
*/
public int getVirtualKeyboardHeight() {
// TODO(https://crbug.com/1211066): This class shouldn't know so much about bottom insets.
// Make this an external value that CompositorViewHolder consumes.
int keyboardHeight = KeyboardVisibilityDelegate.getInstance().calculateKeyboardHeight(
this.getRootView());
int keyboardAccessoriesHeight = mAutofillUiBottomInsetSupplier != null
&& mAutofillUiBottomInsetSupplier.get() != null
? mAutofillUiBottomInsetSupplier.get()
: 0;

return keyboardHeight + keyboardAccessoriesHeight;
}

@VirtualKeyboardMode.EnumType
public int getVirtualKeyboardModeForTesting() {
return mVirtualKeyboardMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,6 @@ public boolean controlsResizeView() {
return mDelegate.controlsResizeView();
}

@Override
public int getVirtualKeyboardHeight() {
return mDelegate.getVirtualKeyboardHeight();
}

@VisibleForTesting
void showFramebustBlockInfobarForTesting(String url) {
TabWebContentsDelegateAndroidImplJni.get().showFramebustBlockInfoBar(
Expand Down

0 comments on commit 3246177

Please sign in to comment.