Android Webview Dropdown behavior change
Reported by
mdhorne...@gmail.com,
Mar 4 2016
|
||
Issue descriptionExample URL: http://m.opentable.com Steps to reproduce the problem: 1. Instantiate a WebView, passing in a MutableContextWrapper as a proxy to an Application. 2. Change the underlying context to an Activity, attempt to display the WebView. 3. Install the app 4. Open the WebView, press on a dropdown (select tag), the dropdown works. 5. Press the back button which finishes the Activity, open it again, press on the same dropdown. What is the expected behavior? The dropdown continues to work What went wrong? The dropdown does not work, and will not until either a complete uninstall or a swipe kill from the recent app list. Does it occur on multiple sites: Yes Is it a problem with a plugin? N/A Did this work before? Yes As recently as Android 4.4.4 Does this work in other browsers? N/A Chrome version: 48.0.2564.95 Channel: stable OS Version: 5.1.1 Flash Version: I initially noticed this on an internal company website, but I'm able to reproduce it on Open Table, so I suspect this could happen anywhere. I understand that the best practice is to never pass in an Application as a Context when working with views, but there never seemed to be a penalty around it until the WebView behavior changed as of Android 5.0 (detailed in the release notes). Was this accidental or does there need to be more explicit documentation around this change?
,
Mar 7 2016
You can blame all the apps that always passes Application into webview as the context. What webview version are you using here? <select> pop up Should be fixed in 48.0.2564.95 already.
,
Mar 7 2016
Using an Application context has never been 100% functional, even before 5.0 - it's never been supported and apps should never do this, it only worked by accident - ideally we would intentionally crash in this case. Using WebView with MutableContextWrapper is also not a good idea at all, even if you use only Activity contexts. It will *mostly* appear to work, because in most cases all the Activity instances in the app share the same application-wide asset manager/resources object (just with possibly different themes wrapped around them), but there are cases where activities in a single app *don't* use the same resource object (such as projection to external displays, or the split-screen/multiwindow features on some OEM devices) because the DPI or size or other parameters may be different from one activity to another, and in this case WebView will not work correctly if switched between contexts that don't share an underlying resources object. These kinds of cases may well become more common in future (as more devices support fancy ways to use screen space) and so your app is at risk of failing to work in more and more cases.
,
Apr 6 2016
As I said earlier, <select> dropdowns should be fixed already. |
||
►
Sign in to add a comment |
||
Comment 1 by kochi@chromium.org
, Mar 7 2016