Closed Bug 845055 Opened 12 years ago Closed 12 years ago

"mimeType is null" in Page Info's makePreview()

Categories

(Firefox :: Page Info Window, defect)

defect
Not set
minor

Tracking

()

VERIFIED FIXED
Firefox 22

People

(Reporter: jruderman, Assigned: yosy101)

References

(Blocks 1 open bug)

Details

(Keywords: testcase)

Attachments

(2 files)

Attached file testcase (deleted) —
1. Load the testcase. 2. Open the Page Info window (press Cmd+I) JavaScript error: chrome://browser/content/pageinfo/pageInfo.js, line 987: mimeType is null I'm guessing this is a regression from bug 792968 (similar to bug 797430). https://hg.mozilla.org/mozilla-central/rev/9e32aa6fe544#l5.50 changed: > - (item instanceof HTMLObjectElement && /^image\//.test(mimeType)) || isBG) && isProtocolAllowed) { > + (item instanceof HTMLObjectElement && mimeType.startsWith("image/")) || isBG) && isProtocolAllowed) {
Confirmed on Windows, too.
OS: Mac OS X → All
Hardware: x86_64 → All
Yosy, can you fix this regression from your patch?
Assignee: nobody → yosy101
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #2) > Yosy, can you fix this regression from your patch? Hi, I don't have the firefox source code, I will download and compile it and will post a patch
Attached patch Patch (deleted) — Splinter Review
Attachment #720096 - Flags: review?(dao)
> - (item instanceof HTMLObjectElement && mimeType.startsWith("image/")) || isBG) && isProtocolAllowed) { . + (item instanceof HTMLObjectElement && mimeType !== null && mimeType.startsWith("image/")) || isBG) && isProtocolAllowed) { Does it work if you just use "&& mimeType" instead of "&& mimeType !== null" ?
(In reply to Philip Chee from comment #5) > > - (item instanceof HTMLObjectElement && mimeType.startsWith("image/")) || isBG) && isProtocolAllowed) { > . + (item instanceof HTMLObjectElement && mimeType !== null && > mimeType.startsWith("image/")) || isBG) && isProtocolAllowed) { > > Does it work if you just use "&& mimeType" instead of "&& mimeType !== null" > ? What is the difference?
>> Does it work if you just use "&& mimeType" instead of "&& mimeType !== null" ? > What is the difference? It's shorter and easier to read and makes use of Javascript truthy/falsy behaviour: <http://james.padolsey.com/javascript/truthy-falsey/>
Comment on attachment 720096 [details] [diff] [review] Patch Yes, please remove "!== null". r=me with that change. Thanks!
Attachment #720096 - Flags: review?(dao) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:23.0) Gecko/20130428 Firefox/23.0 Mozilla/5.0 (X11; Linux x86_64; rv:23.0) Gecko/20130428 Firefox/23.0 Verified as fixed on Windows 7 x64 and Ubuntu 12.04 x86_64 with latest Nightly 23.0a1 (Build ID: 20130429030926)
Status: RESOLVED → VERIFIED
Blocks: fuzz-keys
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: