|
|
DescriptionEnable zoom and make contents fit into viewport.
Make android webview shell behaviour to be like chrome shell: enable
zoom and fit we page contents into viewport.
BUG=n/a
Committed: https://crrev.com/a550da81b3c8bb7238bea5be5ea9a036e917e804
Cr-Commit-Position: refs/heads/master@{#314305}
Patch Set 1 #Patch Set 2 : WIP: adjust to comments and check what to do with presubmit check #
Total comments: 2
Messages
Total messages: 14 (2 generated)
p.sergey@samsung.com changed reviewers: + mnaganov@chromium.org, sgurun@chromium.org
Hello. Can we make android webview shell to behave more like chrome shell in terms of content fitting and zoom? Please, let me know your opinion. Thank you.
On 2015/02/02 05:23:05, Sergey wrote: > Hello. > > Can we make android webview shell to behave more like chrome shell in terms of > content fitting and zoom? > > Please, let me know your opinion. > Thank you. Thanks for the patch! Can you please share the motivation behind it? The WebView shell is not the best way to use the Chromium engine, it is mostly for tests. Also, to bring the rendering behaviour of the WebView shell closer to the Chromium test shell, you should actually do a couple more things: - set 'supportsLegacyQuirks' argument value of AwSettings constructor call to 'false'; - call awSettings.setLayoutAlgorithm(android.webkit.WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING); this also requires that you run the shell on KitKat+, as this enum value was added in KitKat.
> Thanks for the patch! Can you please share the motivation behind it? The WebView > shell is not the best way to use the Chromium engine, it is mostly for tests. The motivation matches the WebView shell purpose precisely: for the tests. I mean, it is good to have a shell to be able to test engine. But if you open some page in this shell and it shows the upper left corner of the page -- it is not what you would like to see for the test. So, I think it would be more comfortable to make the behaviour similar to the Chrome shell. > Also, to bring the rendering behaviour of the WebView shell closer to the > Chromium test shell, you should actually do a couple more things: > > - set 'supportsLegacyQuirks' argument value of AwSettings constructor call to > 'false'; Can you, please, briefly describe what is this for?... I mean, I've found the set of the settings it changes in android_webview/native/aw_settings.cc, but I would like to understand the overall logic. > - call > awSettings.setLayoutAlgorithm(android.webkit.WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING); > this also requires that you run the shell on KitKat+, as this enum value was > added in KitKat. I am fine with that, but is it fine to just add this here? Is there a policy to support previous Android APIs?
Uploaded new patch for the reference and adjustments. PTAL. https://codereview.chromium.org/872363005/diff/20001/android_webview/test/she... File android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java (left): https://codereview.chromium.org/872363005/diff/20001/android_webview/test/she... android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java:187: event.getAction() != KeyEvent.ACTION_DOWN)) { git cl upload presubmit check annoyingly fails here with "'||' should be on a new line" error. Can I include this small formatting fix into this patch?
On 2015/02/03 07:04:28, Sergey wrote: > > Thanks for the patch! Can you please share the motivation behind it? The > WebView > > shell is not the best way to use the Chromium engine, it is mostly for tests. > > The motivation matches the WebView shell purpose precisely: for the tests. I > mean, it is good to have a shell to be able to test engine. But if you open some > page in this shell and it shows the upper left corner of the page -- it is not > what you would like to see for the test. So, I think it would be more > comfortable to make the behaviour similar to the Chrome shell. > > > Also, to bring the rendering behaviour of the WebView shell closer to the > > Chromium test shell, you should actually do a couple more things: > > > > - set 'supportsLegacyQuirks' argument value of AwSettings constructor call to > > 'false'; > > Can you, please, briefly describe what is this for?... I mean, I've found the > set of the settings it changes in android_webview/native/aw_settings.cc, but I > would like to understand the overall logic. > Check out "Quirk" in https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit... There is a bunch of options that turn on "legacy" (pre-KitKat) behaviour for WebView. These aspects are pretty much incompatible with how recent Chromium behaves, so you would want to turn them off. > > - call > > > awSettings.setLayoutAlgorithm(android.webkit.WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING); > > this also requires that you run the shell on KitKat+, as this enum value was > > added in KitKat. > > I am fine with that, but is it fine to just add this here? Is there a policy to > support previous Android APIs?
On 2015/02/03 07:04:28, Sergey wrote: > > Thanks for the patch! Can you please share the motivation behind it? The > WebView > > shell is not the best way to use the Chromium engine, it is mostly for tests. > > The motivation matches the WebView shell purpose precisely: for the tests. I > mean, it is good to have a shell to be able to test engine. But if you open some > page in this shell and it shows the upper left corner of the page -- it is not > what you would like to see for the test. So, I think it would be more > comfortable to make the behaviour similar to the Chrome shell. > > > Also, to bring the rendering behaviour of the WebView shell closer to the > > Chromium test shell, you should actually do a couple more things: > > > > - set 'supportsLegacyQuirks' argument value of AwSettings constructor call to > > 'false'; > > Can you, please, briefly describe what is this for?... I mean, I've found the > set of the settings it changes in android_webview/native/aw_settings.cc, but I > would like to understand the overall logic. > > > - call > > > awSettings.setLayoutAlgorithm(android.webkit.WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING); > > this also requires that you run the shell on KitKat+, as this enum value was > > added in KitKat. > > I am fine with that, but is it fine to just add this here? Is there a policy to > support previous Android APIs? Yes, it's fine. We don't support WebView running on pre-KitKat versions. See http://crbug.com/161864.
LGTM https://codereview.chromium.org/872363005/diff/20001/android_webview/test/she... File android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java (left): https://codereview.chromium.org/872363005/diff/20001/android_webview/test/she... android_webview/test/shell/src/org/chromium/android_webview/shell/AwShellActivity.java:187: event.getAction() != KeyEvent.ACTION_DOWN)) { On 2015/02/03 07:11:43, Sergey wrote: > git cl upload presubmit check annoyingly fails here with "'||' should be on a > new line" error. Can I include this small formatting fix into this patch? Absolutely.
The CQ bit was checked by p.sergey@samsung.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/872363005/20001
> Yes, it's fine. We don't support WebView running on pre-KitKat versions. See > http://crbug.com/161864. Could you please re-check the bug ID? I can't open that one.. Or is it really the case that I don't have permissions?
On 2015/02/03 09:52:18, Sergey wrote: > > Yes, it's fine. We don't support WebView running on pre-KitKat versions. See > > http://crbug.com/161864. > > Could you please re-check the bug ID? I can't open that one.. Or is it really > the case that I don't have permissions? Yeah, sorry, it was private due to historical reasons, I have removed that flag.
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/a550da81b3c8bb7238bea5be5ea9a036e917e804 Cr-Commit-Position: refs/heads/master@{#314305} |