Bug 11139 - Content types other than HTML are not handled
Summary: Content types other than HTML are not handled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 420+
Hardware: PC Windows XP
: P2 Normal
Assignee: Dex Deacon
URL:
Keywords:
: 11190 (view as bug list)
Depends on:
Blocks: 11142 11190
  Show dependency treegraph
 
Reported: 2006-10-03 15:37 PDT by Dex Deacon
Modified: 2007-10-01 09:12 PDT (History)
1 user (show)

See Also:


Attachments
Work in progress for handling mime types (4.97 KB, patch)
2006-10-05 11:40 PDT, Dex Deacon
no flags Details | Formatted Diff | Diff
Review candidate (18.62 KB, patch)
2006-10-09 16:09 PDT, Dex Deacon
no flags Details | Formatted Diff | Diff
Proposed patch (289.17 KB, patch)
2006-10-09 16:27 PDT, Dex Deacon
no flags Details | Formatted Diff | Diff
Proposed patch (fixed) (17.84 KB, patch)
2006-10-09 17:20 PDT, Dex Deacon
no flags Details | Formatted Diff | Diff
Proposed patch (17.86 KB, patch)
2006-10-10 16:13 PDT, Dex Deacon
no flags Details | Formatted Diff | Diff
Proposed patch (17.88 KB, patch)
2006-10-12 12:43 PDT, Dex Deacon
no flags Details | Formatted Diff | Diff
Download support added (32.91 KB, patch)
2006-10-13 13:13 PDT, Dex Deacon
oliver: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dex Deacon 2006-10-03 15:37:42 PDT
Specifically, WebView::setPolicyDelegate is not implemented.

Any page that isn't HTML is displayed as text by the renderer.  For example, navigating to an image URL will display as garbage.
Comment 1 Dex Deacon 2006-10-05 11:40:51 PDT
Created attachment 10934 [details]
Work in progress for handling mime types

Here's what I have so far.
Comment 2 Dex Deacon 2006-10-09 16:09:53 PDT
Created attachment 11000 [details]
Review candidate

This patch adds support for determining the mime type of content, and passing that to various places.  Navigating to images will display the image rather than garbage.  There is also partial support for policy delegates and IWebPolicyDelegate::decidePolicyForMIMEType().

This also fixes a crash bug in WebFrame::loadDataSource().
Comment 3 Dex Deacon 2006-10-09 16:27:30 PDT
Created attachment 11002 [details]
Proposed patch

Same as before, but without my irrelevant change to TemporaryLinkStubs.cpp.

Also, the crash this fixes is the one mentioned in http://bugs.webkit.org/show_bug.cgi?id=11190 .
Comment 4 Dex Deacon 2006-10-09 17:20:20 PDT
Created attachment 11003 [details]
Proposed patch (fixed)

Resubmitting previous patch, since I had accidentally changed tons of lines in the ChangeLog.
Comment 5 Dex Deacon 2006-10-10 16:13:23 PDT
Created attachment 11026 [details]
Proposed patch

Small tweak to previous patch that fixes behavior if the WebPolicyDelegate chooses to ignore a mime type.
Comment 6 Maciej Stachowiak 2006-10-12 02:53:59 PDT
I will give more detailed feedback later, but my first impression is that this is moving things a bit in the wrong direction. What we're trying to do right now is get the existing mac WebKit loader code to be almost entirely cross-platform, and then it would make upcalls which issue the actual delegate calls in a platform specific way. The code is already moved down to WebCore (it's in loader/mac now) and is now getting turned into C++.

This approach may be ok, but it builds a lot more on the current temporary approach, and once the final code is in place the specific order of the delegate calls and what happens when may change.
Comment 7 Dave Hyatt 2006-10-12 03:07:55 PDT
Careful with the Image::supportsType method... you pick up SVG (which for now at least is incorrect) by just checking for image/*.
Comment 8 Dex Deacon 2006-10-12 12:43:45 PDT
Created attachment 11051 [details]
Proposed patch

Another small tweak to get it to compile with latest changes.
Comment 9 Dex Deacon 2006-10-13 13:13:35 PDT
Created attachment 11074 [details]
Download support added

I added download support to the previous patch (though I didn't obsolete it because this is much bigger, and it may be better to review in 2 chunks).
Comment 10 Adam Roben (:aroben) 2007-01-26 02:09:06 PST
Comment on attachment 11051 [details]
Proposed patch

Marking obsolete because attachment 11074 [details] is a superset of this patch.
Comment 11 Oliver Hunt 2007-02-16 23:29:21 PST
Comment on attachment 11074 [details]
Download support added

+bool Image::supportsType(const String& mimeType)
 {
     // FIXME: Implement.
+    if (mimeType.startsWith("image/"))
+        return true;
+    
     return false;
 }

Shouldn't link as Image::supportsType is defined in Image.cpp -- you should be using the mimetyperegistry

which may or may not be implemented in windows -- i wrote it a while back, i can't remember how much (if any) effort i put into making it crossplatform
Comment 12 Eric Seidel (no email) 2007-10-01 09:12:35 PDT
*** Bug 11190 has been marked as a duplicate of this bug. ***