New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 620929 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Feature


Sign in to add a comment

[developer preview] Screen Zoom setting are not reflected to contents of the WebView app (targetSDKVersion=24)

Reported by cddd.dcm@gmail.com, Jun 17 2016

Issue description

Example URL:

Steps to reproduce the problem:
Preconditions:
 - Android N Developer Preview 4 / Nexus5x(bullhead/NPD56N)
 - Android System WebView (51.0.2704.90 / pre-installed)
 - WebView app (targetSDKVersion=24)

Test Procedure:
 1. launch WebView app
 2. change Display Size (Screen Zoom) value. (WebView app is not killed)
 3. return WebView app
 4. kill WebView app from Recent Apps menu
 5. relaunch WebView app

What is the expected behavior?
Screen Zoom setting are reflected to contents of the WebView app at test procedure 3.

What went wrong?
Results:
 * Screen Zoom setting are NOT reflected to contents of the WebView app at test procedure 3.
 * Screen Zoom setting are reflected to contents of the WebView app at test procedure 5.

Reproduction:
 10/10 (100%) 

Attached Files:
 - Video: screenzoom_webview.mp4
 - Sample apps and source code
   * WebViewSample.apk(targetSDKVersion=22)
   * WebViewSample24(targetSDKVersion=24)

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? N/A 

Chrome version: 51.0.2704.90  Channel: n/a
OS Version: N Developer Preview 4
Flash Version: 

* NOTES
 - I was sent from AOSP Issue tracker (https://code.google.com/p/android/issues/detail?id=213270)
 - targetSDKVersion<24 app (WebViewSample.apk) is not replicable
 - This issue occurs in Chrome as well
 

Comment 1 by cddd.dcm@gmail.com, Jun 17 2016

Attached File
screenzoom_webview.zip
9.0 MB Download
 Issue 620926  has been merged into this issue.
Components: -Blink Mobile>WebView

Comment 4 by boliu@chromium.org, Jun 17 2016

Labels: -Type-Bug Type-Feature
Status: Untriaged (was: Unconfirmed)
You are correct that webview does not support dynamically adjusting the screen density. Only workaround is force restarting the whole app (ie restaring the underlying process)

Comment 5 by hush@chromium.org, Jun 17 2016

Cc: hush@chromium.org

Comment 6 Deleted

I was able to repro this issue on latest android N preview build with M51/webview

Comment 8 by k...@chromium.org, Jun 22 2016

Cc: k...@chromium.org

Comment 9 by sgu...@chromium.org, Jul 26 2016

Owner: ti...@chromium.org
Status: Assigned (was: Untriaged)
Labels: M-55
Cc: sgu...@chromium.org
Project Member

Comment 12 by bugdroid1@chromium.org, Aug 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/164e1eecb22e6c1d5a004666bff8ca8d0b127e34

commit 164e1eecb22e6c1d5a004666bff8ca8d0b127e34
Author: timav <timav@chromium.org>
Date: Wed Aug 17 21:45:34 2016

Remove dip scale dependency from ui::WindowAndroid

Starting from Android N dip scale can be changed dynamically.
In this CL we remove the dip scale impliciltly stored in
WindowAndroid's |content_offset_| and use the scale at the
time of calculations that involve the content offset.

This is a prerequisite for https://codereview.chromium.org/2202123002/

BUG= 620929 

Review-Url: https://codereview.chromium.org/2249243002
Cr-Commit-Position: refs/heads/master@{#412653}

[modify] https://crrev.com/164e1eecb22e6c1d5a004666bff8ca8d0b127e34/content/browser/android/content_view_core_impl.cc
[modify] https://crrev.com/164e1eecb22e6c1d5a004666bff8ca8d0b127e34/ui/android/view_android.cc
[modify] https://crrev.com/164e1eecb22e6c1d5a004666bff8ca8d0b127e34/ui/android/window_android.h
[modify] https://crrev.com/164e1eecb22e6c1d5a004666bff8ca8d0b127e34/ui/snapshot/snapshot_android.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Aug 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8521fda07ea8d04953d856873a6e08afb96701d2

commit 8521fda07ea8d04953d856873a6e08afb96701d2
Author: timav <timav@chromium.org>
Date: Tue Aug 30 05:30:05 2016

Use WindowAndroid to get display metrics in ContentViewCore

Since Chrome can do window reparenting, DisplayMetrics should
be extracted from the Context that is associated with the window.

In this CL we pass the context to RenderCoordinates that obtains
the display density (device scale factor) and wheel scroll factor
from it.

BUG= 620929 

Review-Url: https://codereview.chromium.org/2268103002
Cr-Commit-Position: refs/heads/master@{#415158}

[modify] https://crrev.com/8521fda07ea8d04953d856873a6e08afb96701d2/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
[modify] https://crrev.com/8521fda07ea8d04953d856873a6e08afb96701d2/content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java

Project Member

Comment 14 by bugdroid1@chromium.org, Aug 31 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bffd0a001eca22ac472bbc0ca8c942b73dfbcff2

commit bffd0a001eca22ac472bbc0ca8c942b73dfbcff2
Author: timav <timav@chromium.org>
Date: Wed Aug 31 18:34:28 2016

Reland: Move DIP scale away from AwContents

This small refactoring removes device scale factor from AwContents
cache and uses the value from ContentViewCore.
The device scale factor in ContentViewCore is defined after
ContentViewCore native initialization, therefore this CL also
moves the device scale propagation until after that.

This is a prerequisite for https://codereview.chromium.org/2300463002

BUG= 620929 

> Committed: https://crrev.com/8d849fd2d39c9db747f4e8d89dcedfebb0273a97
> Cr-Commit-Position: refs/heads/master@{#415546}

Reland after fix related to PopupTouchHandleDrawable.

Review-Url: https://codereview.chromium.org/2288273003
Cr-Commit-Position: refs/heads/master@{#415690}

[modify] https://crrev.com/bffd0a001eca22ac472bbc0ca8c942b73dfbcff2/android_webview/java/src/org/chromium/android_webview/AwContents.java

Project Member

Comment 15 by bugdroid1@chromium.org, Sep 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1f49e889d08b4b9245579fbdc744f2590770f61b

commit 1f49e889d08b4b9245579fbdc744f2590770f61b
Author: timav <timav@chromium.org>
Date: Mon Sep 19 21:45:00 2016

Remove velocities parameters from onFlingStartGesture()

This is the part of preparation to DIP scale change
processing. These parameters are converted from DIP
to pixels but never used.

BUG= 620929 

Review-Url: https://codereview.chromium.org/2347373002
Cr-Commit-Position: refs/heads/master@{#419571}

[modify] https://crrev.com/1f49e889d08b4b9245579fbdc744f2590770f61b/android_webview/java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java
[modify] https://crrev.com/1f49e889d08b4b9245579fbdc744f2590770f61b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
[modify] https://crrev.com/1f49e889d08b4b9245579fbdc744f2590770f61b/chrome/android/java/src/org/chromium/chrome/browser/banners/SwipableOverlayView.java
[modify] https://crrev.com/1f49e889d08b4b9245579fbdc744f2590770f61b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
[modify] https://crrev.com/1f49e889d08b4b9245579fbdc744f2590770f61b/content/browser/android/content_view_core_impl.cc
[modify] https://crrev.com/1f49e889d08b4b9245579fbdc744f2590770f61b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
[modify] https://crrev.com/1f49e889d08b4b9245579fbdc744f2590770f61b/content/public/android/java/src/org/chromium/content_public/browser/GestureStateListener.java

Project Member

Comment 16 by bugdroid1@chromium.org, Sep 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1bce7c3445dec41e42574f7c58af01793d706f37

commit 1bce7c3445dec41e42574f7c58af01793d706f37
Author: timav <timav@chromium.org>
Date: Wed Sep 21 00:43:39 2016

Keep ContentViewCore selection rectangle in DIP

ContentViewCore holds selection rectangle in physical pixels,
thus making it indirectly dependent on DIP scale.

This CL changes it to DIP and does the necessary conversions
in Java layer. As a consequence the position of the paste popup
dialog is also passed from native layer in DIP.

BUG= 620929 

Review-Url: https://codereview.chromium.org/2352143002
Cr-Commit-Position: refs/heads/master@{#419922}

[modify] https://crrev.com/1bce7c3445dec41e42574f7c58af01793d706f37/content/browser/android/content_view_core_impl.cc
[modify] https://crrev.com/1bce7c3445dec41e42574f7c58af01793d706f37/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Project Member

Comment 17 by bugdroid1@chromium.org, Sep 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d6ff51fbbf957bd3fea85fedc49f459a03a624fe

commit d6ff51fbbf957bd3fea85fedc49f459a03a624fe
Author: timav <timav@chromium.org>
Date: Wed Sep 21 21:10:20 2016

Remove unused version of SelectBetweenCoordinates()

In ContentViewCoreImpl there are two versions of the method
SelectBetweenCoordinates(), one comes from native side and
another from Java side. The Java version is apparently never
used.

BUG= 620929 

Review-Url: https://codereview.chromium.org/2360013002
Cr-Commit-Position: refs/heads/master@{#420163}

[modify] https://crrev.com/d6ff51fbbf957bd3fea85fedc49f459a03a624fe/content/browser/android/content_view_core_impl.cc
[modify] https://crrev.com/d6ff51fbbf957bd3fea85fedc49f459a03a624fe/content/browser/android/content_view_core_impl.h
[modify] https://crrev.com/d6ff51fbbf957bd3fea85fedc49f459a03a624fe/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Project Member

Comment 18 by bugdroid1@chromium.org, Sep 21 2016

Project Member

Comment 20 by bugdroid1@chromium.org, Oct 15 2016

Project Member

Comment 21 by bugdroid1@chromium.org, Nov 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9483b39990200554ba76602455869962005ace0e

commit 9483b39990200554ba76602455869962005ace0e
Author: timav <timav@chromium.org>
Date: Tue Nov 08 06:16:15 2016

Add observers for DIP scale change.

Extended Java DisplayAndroidObserver interface to receive
the DIP scale change notifications.

Added two such observers: ContentViewCore and AwContents.

Upon receiving the notification ContentViewCore now sets the DIP
scale both on Java and native side.

It happens
1. During initialization,
2. When ContentViewCore is attached to a window, either for
   the first time or due to reparenting,
3. Due to notification from observer.

In cases (2) and (3) we force layout.

BUG= 620929 

Review-Url: https://codereview.chromium.org/2300463002
Cr-Commit-Position: refs/heads/master@{#430536}

[modify] https://crrev.com/9483b39990200554ba76602455869962005ace0e/android_webview/java/src/org/chromium/android_webview/AwContents.java
[modify] https://crrev.com/9483b39990200554ba76602455869962005ace0e/content/browser/android/content_view_core_impl.cc
[modify] https://crrev.com/9483b39990200554ba76602455869962005ace0e/content/browser/android/content_view_core_impl.h
[modify] https://crrev.com/9483b39990200554ba76602455869962005ace0e/content/browser/site_per_process_browsertest.cc
[modify] https://crrev.com/9483b39990200554ba76602455869962005ace0e/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
[modify] https://crrev.com/9483b39990200554ba76602455869962005ace0e/content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java
[modify] https://crrev.com/9483b39990200554ba76602455869962005ace0e/content/public/android/javatests/src/org/chromium/content/browser/ScreenOrientationListenerTest.java
[modify] https://crrev.com/9483b39990200554ba76602455869962005ace0e/ui/android/java/src/org/chromium/ui/display/DisplayAndroid.java

Cc: ti...@chromium.org
 Issue 667667  has been merged into this issue.
Project Member

Comment 23 by bugdroid1@chromium.org, Nov 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2d5570dfe70975e2697eeced6402430316572f80

commit 2d5570dfe70975e2697eeced6402430316572f80
Author: timav <timav@chromium.org>
Date: Tue Nov 29 17:44:13 2016

Update selection handle bitmaps in AW if DIP scale changes

In android webview the selection handles are implemented in
PopupTouchHandleDrawable.java

In this CL we make this class an observer that listens to
display changes and keep the current dip scale as a member
instead of retrieving it from ContentViewCore.

We cannot update the bitmaps by the DisplayAndroid signal
(i.e. in onDIPScaleChanged()) because the resources are not
yet updated at the moment. Instead, we update the bitmap in the subsequent
onConfigurationChanged() that should follow the display change.

To make sure that the configuration corresponds to the display change
we check that the display density in resources is equal to the expected
value.

BUG= 620929 

Review-Url: https://codereview.chromium.org/2515343004
Cr-Commit-Position: refs/heads/master@{#435025}

[modify] https://crrev.com/2d5570dfe70975e2697eeced6402430316572f80/android_webview/java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java

Comment 24 by ti...@chromium.org, Nov 30 2016

Blockedon: 669733

Comment 25 by ti...@chromium.org, Nov 30 2016

Blockedon: 669738

Comment 26 by ti...@chromium.org, Nov 30 2016

Blockedon: 650351
Blockedon: 670475
Blockedon: 670537
Project Member

Comment 29 by bugdroid1@chromium.org, Dec 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4537fa801ee646b95ef496083e824e468978a374

commit 4537fa801ee646b95ef496083e824e468978a374
Author: timav <timav@chromium.org>
Date: Mon Dec 12 06:46:54 2016

Emulate Android joystick scroll with synthetic mouse wheel event

The JoystickScrollProvider Java class used to emulate a View
scroll events and call ContentViewCore.scrollBy(), now it
emulates the mouse wheel events directly, dropping the calculation
of the current event position (it is set to (0,0)).

This CL also removes JoystickScrollProvider dependency on
ContentViewCore, it talks to its own native counterpart.

BUG= 620929 ,  650351 

Review-Url: https://codereview.chromium.org/2548363007
Cr-Commit-Position: refs/heads/master@{#437826}

[modify] https://crrev.com/4537fa801ee646b95ef496083e824e468978a374/content/browser/BUILD.gn
[modify] https://crrev.com/4537fa801ee646b95ef496083e824e468978a374/content/browser/android/browser_jni_registrar.cc
[add] https://crrev.com/4537fa801ee646b95ef496083e824e468978a374/content/browser/android/joystick_scroll_provider.cc
[add] https://crrev.com/4537fa801ee646b95ef496083e824e468978a374/content/browser/android/joystick_scroll_provider.h
[modify] https://crrev.com/4537fa801ee646b95ef496083e824e468978a374/content/public/android/BUILD.gn
[modify] https://crrev.com/4537fa801ee646b95ef496083e824e468978a374/content/public/android/java/src/org/chromium/content/browser/ContentView.java
[modify] https://crrev.com/4537fa801ee646b95ef496083e824e468978a374/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
[modify] https://crrev.com/4537fa801ee646b95ef496083e824e468978a374/content/public/android/java/src/org/chromium/content/browser/input/JoystickScrollProvider.java

Project Member

Comment 30 by bugdroid1@chromium.org, Dec 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/06ad74dc6f599d3fbe163433a030da25a76c6506

commit 06ad74dc6f599d3fbe163433a030da25a76c6506
Author: timav <timav@chromium.org>
Date: Tue Dec 20 22:56:11 2016

[SystemWebViewShell] Prevent activity recycling for DIP scale changes

Modified AndroidManifest.xml to include "density" as one of the
configuration changes to be processed by activity. With that flag the
activity will not be recycled (onDestroy/onCreate) upon the density
change, Android will call onCongifurationChanged() instead.

BUG= 620929 

Review-Url: https://codereview.chromium.org/2555963005
Cr-Commit-Position: refs/heads/master@{#439902}

[modify] https://crrev.com/06ad74dc6f599d3fbe163433a030da25a76c6506/android_webview/tools/system_webview_shell/apk/AndroidManifest.xml

Comment 31 by ti...@chromium.org, Jan 12 2017

 Issue 636686  has been merged into this issue.
Project Member

Comment 32 by sheriffbot@chromium.org, Sep 4 2017

Labels: Hotlist-Recharge-BouncingOwner
Owner: ----
Status: Untriaged (was: Assigned)
The assigned owner "timav@chromium.org" is not able to receive e-mails, please re-triage.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Pri-2 Pri-3
cddd.dcm@ is this working now?

Comment 34 by cddd.dcm@gmail.com, Sep 13 2017

cddd.dcm@ is working
cddd.dcm@: please clarify your last comment.  Did you mean "Chrome is now working correctly"?

Comment 36 by cddd.dcm@gmail.com, Sep 19 2017

I have confirmed that this issue has been modified correctly

Comment 37 by boliu@chromium.org, Sep 26 2017

Status: Fixed (was: Untriaged)
assume fixed

Sign in to add a comment