Closed Bug 302569 Opened 19 years ago Closed 19 years ago

moz-icon urls broken on Mac OS X

Categories

(Core :: Graphics: ImageLib, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8beta4

People

(Reporter: mscott, Assigned: mscott)

References

Details

(Keywords: fixed1.8)

Attachments

(1 file)

today's trunk build. 7/27

mozicons don't seem to be working in Mac OS X.

read a message with attachments. Notice that we don't draw a 16x16 icon to the
left of the attachment name anymore.

Weird, I can hack the CSS to make the attachment field use a background image
for the moz-icon and that draws just fine. So the problem may not be with
moz-icon but with how we are trying to display the icon inside that widget.
Status: NEW → ASSIGNED
Target Milestone: --- → Thunderbird1.1
For the Mac

nsIconChannel::AsyncOpen calls imgRequest::OnStartRequest. OnStartRequest
cancels the image load if there are no image listeners associated with the load.

http://lxr.mozilla.org/mozilla/source/modules/libpr0n/src/imgRequest.cpp#709

Our image frame code calls AsyncOpen on the icon channel and then it adds an
image listener after that routine returns. Hence the listener is added too late
and the image is canceled.

This effects Firefox as well.

Summary: Attachment icons not rendered on Mac OS X → moz-icon urls broken on Mac OS X
Attached patch the fixSplinter Review
The fix is to rework the mac implementation of the moz-icon output stream to
look more like windows. Using an input stream pump. This means the call to
OnStartRequest now happens after the AyncOpen call has returned to the caller,
so we no longer generate an error, which canceled the image load.

I'm not sure what changed on the trunk that broke this but this implementation
is much better than what we used to do and it fixes the problem.
Attachment #192563 - Flags: review?(pavlov)
Comment on attachment 192563 [details] [diff] [review]
the fix

I'd like to get biesi to review this change as well since he made the original
change for the windows implementation to use an in put stream pump.
Attachment #192563 - Flags: superreview?(pavlov)
Attachment #192563 - Flags: review?(pavlov)
Attachment #192563 - Flags: review?(cbiesinger)
Comment on attachment 192563 [details] [diff] [review]
the fix

very nice

+    // Store our real listener
+	mListener = aListener;
+    // Add ourself to the load group, if available

The mListener assignment seems wrongly indented.

+nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, PRBool
nonBlocking)
   {

as is this bracket

+  nsCAutoString filePath;
+  nsresult rv = ExtractIconInfoFromUrl(getter_AddRefs(fileloc),
&desiredImageSize, contentType, filePath);

why filePath? It looks like it really is the extension? (hm... similar in the
windows code... but it overwrites filePath with the path from the nsILocalFile
if it has one? I don't know why it does that...) It looks like this code would
be better just naming this fileExt, though.

+    PRUint32 written;
+	rv = outStream->Write(iconBuffer.get(), iconSize, &written);

indentation is wrong here...

Looks like you can also remove mLoadAttributes from the header file.

looks good otherwise, r=biesi
Attachment #192563 - Flags: review?(cbiesinger) → review+
Attachment #192563 - Flags: superreview?(pavlov) → superreview+
Comment on attachment 192563 [details] [diff] [review]
the fix

We need this to fix a regression from 1.0 on Mac OS X. This regression is in
Firefox and Thunderbird. The mime type icons for mail attachments and in the
browser prefs / downloads UI are no longer getting drawn because of this bug.
Attachment #192563 - Flags: approval1.8b4?
fixed on the trunk
Attachment #192563 - Flags: approval1.8b4? → approval1.8b4+
fixed on the branch
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: Mail Window Front End → ImageLib
Flags: review+
Keywords: fixed1.8
Product: Thunderbird → Core
Target Milestone: Thunderbird1.1 → ---
Target Milestone: --- → mozilla1.8beta4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: