New issue
Advanced search Search tips

Issue 602344 link

Starred by 3 users

Issue metadata

Status: Archived
Owner:
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Compat



Sign in to add a comment

Android WebResourceReponse with no mime type causes XHTML document.createElement to return element with undefined style

Reported by jetison...@gmail.com, Apr 11 2016

Issue description

Example URL:

Steps to reproduce the problem:
1. Install test app: https://github.com/FaultException/WebViewElementNoStyleBug
2. An alert dialog should appear with a message containing the value of document.createElement('div').style.

What is the expected behavior?
document.createElement('div').style should contain a CSSStyleDecleration.

The dialog should say something along the lines of [object CSSStyleDeclaration]

What went wrong?
document.createElement('div').style is undefined.

The dialog says undefined.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? N/A 

Did this work before? N/A 

Does this work in other browsers? N/A 

Chrome version: 49.0.2623.105  Channel: stable
OS Version: 6.0.1
Flash Version: 

This happens when loading an XHTML document through Android WebView's shouldInterceptRequest and returning a WebResourceResponse with a null or blank mime type.

If you specify "text/html" it works fine, even though the document is XHTML.

You shouldn't return a null mime type, but there is no error if you do, and it causes this unexpected and hard to track down behavior.
 
Here's an APK build of the test app.
undefinedstyle.apk
1.2 MB Download
Components: Mobile>WebView
Owner: michaelbai@chromium.org
Assigning to Michael as I believe you are taking over shouldInterceptRequest after Mikhail?
An additional note: If the document is HTML (not XHTML) then it works fine.
Project Member

Comment 5 by sheriffbot@chromium.org, Apr 24 2017

Status: Archived (was: Unconfirmed)
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment