Commit b5e60ea4 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Android: Fix anchor link bug on a new tab

This CL addresses the bug that scrolls to the bottom of the page
opened by anchor in a new tab. The size of the contents should have
been set earlier at |initializeTab|.

This change comes with a risk of reintroducing the regression fixed by
https://crrev.com/c/795479 since it's basically reverting what the CL
did. As of this change, the reported regression is not reproducible,
and it's not easy to find any other sites that exhibit the issue.
The plan is to land this CL and react timely to any problems it might
cause.


Bug: 850868
Change-Id: Ie4fdbaa012f72a2b667b7b27c177fcc6b7a21032
Reviewed-on: https://chromium-review.googlesource.com/1180637Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584662}
parent 380436db
......@@ -210,14 +210,6 @@ public class CompositorViewHolder extends FrameLayout
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
// Have content pick up the size and browser control information when the content
// view got laid out. Successive calls with the same values are ignored by
// ViewAndroid that stores the size.
View view = getContentView();
if (view != null) {
Point viewportSize = getViewportSize();
setSize(getWebContents(), view, viewportSize.x, viewportSize.y);
}
onViewportChanged();
// If there's an event that needs to occur after the keyboard is hidden, post
......@@ -1039,6 +1031,8 @@ public class CompositorViewHolder extends FrameLayout
if (tab.getView() == null) return;
tab.setTopControlsHeight(getTopControlsHeightPixels(), controlsResizeView());
tab.setBottomControlsHeight(getBottomControlsHeightPixels());
Point viewportSize = getViewportSize();
setSize(webContents, tab.getView(), viewportSize.x, viewportSize.y);
}
/**
......
Markdown is supported
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