Bug 50724 - WebFrameProxy::canShowMIMEType should return true for PDF MIME types in the main frame
Summary: WebFrameProxy::canShowMIMEType should return true for PDF MIME types in the m...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-08 16:57 PST by Anders Carlsson
Modified: 2010-12-09 00:35 PST (History)
3 users (show)

See Also:


Attachments
Patch (3.13 KB, patch)
2010-12-08 16:58 PST, Anders Carlsson
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2010-12-08 16:57:53 PST
WebFrameProxy::canShowMIMEType should return true for PDF MIME types in the main frame
Comment 1 Anders Carlsson 2010-12-08 16:58:52 PST
Created attachment 75987 [details]
Patch
Comment 2 Darin Adler 2010-12-08 17:04:01 PST
Comment on attachment 75987 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=75987&action=review

> WebKit2/UIProcess/WebFrameProxy.cpp:96
> +        Vector<String> mimeTypes = WebContext::pdfAndPostScriptMIMETypes();
> +        for (size_t i = 0; i < mimeTypes.size(); ++i) {
> +            if (equalIgnoringCase(mimeTypes[i], mimeType))
> +                return true;
> +        }

Seems really ugly to write out the loop like this. One benefit of using a set is that you don’t need to write the loop. You should factor the loop into a helper function so it’s easier to see what the code is doing.
Comment 3 Anders Carlsson 2010-12-08 17:09:40 PST
Committed r73569: <http://trac.webkit.org/changeset/73569>
Comment 4 WebKit Review Bot 2010-12-09 00:35:02 PST
http://trac.webkit.org/changeset/73569 might have broken GTK Linux 32-bit Release
The following tests are not passing:
fast/css/input-search-padding.html
fast/css/text-input-with-webkit-border-radius.html
fast/forms/box-shadow-override.html
fast/forms/control-restrict-line-height.html
fast/forms/input-appearance-height.html
fast/forms/placeholder-pseudo-style.html
fast/forms/placeholder-set-value.html
fast/forms/search-cancel-button-style-sharing.html
fast/forms/search-placeholder-value-changed.html
fast/forms/search-rtl.html
fast/forms/search-styled.html
fast/forms/search-transformed.html
fast/forms/search-vertical-alignment.html
fast/forms/search-zoomed.html
fast/forms/searchfield-heights.html