Closed Bug 6553 Opened 25 years ago Closed 24 years ago

Image badge icons don't show on Mac (LoadIconImage must do an asynchronous load)

Categories

(Core :: Networking, defect, P3)

PowerPC
Mac System 9.x
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: elig, Assigned: sfraser_bugs)

References

()

Details

(Keywords: platform-parity, regression, Whiteboard: [nsbeta3+] [fix in hand])

Attachments

(1 file)

* TITLE/SUMMARY
[PP] Broken image icon only displayed on Win32

(I thought I wrote this up earlier, but can't find a bug report...)

* STEPS TO REPRODUCE
0) Launch Apprunner
1) View http://www.prometheus-music.com/gecko/bug694.html (a page with a link to
a broken image, with pre-specified dimensions; HTML snippet below)

* RESULT
 - What happened

	On Win32, a box appears, containing an image icon (x86/res/gfx/icon_0.gif)
is displayed in the upper-left hand corner of the rectangle, followed by the ALT
text..

	On Linux and Mac OS, the box appears, but lacking the image icon.

 - What was expected

	Consistency cross-platform, or at least a reason for the difference. ;)

* REGRESSION

 - Occurs On
        Win32 Apprunner (5.15.99 AM optimized build [NT 4, Service Pack 3])

 - Doesn't Occur On
        Mac OS Apprunner (5.15.99 AM optimized build)
        Linux Apprunner (5.15.99 AM optimized build)

* HTML SNIPPET

<img src="bla.gif" width=200 height=200 alt="blu">

* CONFIGURATIONS TESTED

- [Mac] Power Mac 8500/120 (233 Mhz 604e), 64 MB RAM (VM on; 1 MB of VM used),
1024x768 (Thousands of Colors), Mac OS 8.6

- [Win32] Vectra VL (233 Mhz P2), 96 MB RAM, 800x600 (True Color), NT 4.0 SP3.

- [Linux] Vectra VL (266 Mhz P2), 96 MB RAM.
This bug is one of many related to alternate text of images. All these bugs
have been marked. To find related bugs, search the description field for the
string "[ALT]".
Assignee: beard → kmcclusk
This is explicitly unsupported on XP_MAC and XP_UNIX. Take a look at:

http://lxr.mozilla.org/seamonkey/source/gfx/src/nsDeviceContext.cpp#345

It unconditionally returns NS_ERROR_FAILURE on XP_MAC and XP_UNIX when trying to
load the broken icon image. Annoying.
Thank you, Patrick!

<pretending to understand the source code> So...should this be deferred until
Necko, or will netlib continue not have a separate thread on Unix/Mac OS after
the rewrite?
Component: Compositor → Networking Library
Summary: [PP] Broken image icon only displayed on Win32 → [PP] LoadIconImage doesn't work on unic or mac yet
As per comments above, updating the bug summary. I have also set the component
to NetLib, but have not reassigned the bug.

The code snippet in question is the following:

 NS_IMETHODIMP DeviceContextImpl::LoadIconImage(PRInt32 aId, nsIImage*& aImage)
 {
   // XXX synchronous image loading doesn't work on unix or mac yet
   // because netlib is not in its own thread.
 #if defined(XP_UNIX) || defined(XP_MAC)
   return NS_ERROR_FAILURE;
 #endif
 // ...etc...
 }

I am quoting it here because by the time this is fixed, line numbers are almost
guarenteed to have changed.

(Note that although the _broken_ image icon should never be used -- see bug
5764 and bug 3268 -- the "downloading" image icon will still be wanted, so this
method is not going to be decomissioned and this bug still needs to be fixed.)

The following test page may also be useful:
   http://www.bath.ac.uk/%7Epy8ieh/internet/eviltests/IMGalt2.html
Status: NEW → ASSIGNED
Target Milestone: M9
Target Milestone: M9 → M10
Changing all Networking Library/Browser bugs to Networking-Core component for
Browser.

Occasionally, Bugzilla will burp and cause Verified bugs to reopen when I do
this in a bulk change.  If this happens, I will fix. ;-)
Now that Necko has landed, need to remove the
 #if defined(XP_UNIX) || defined(XP_MAC)
   return NS_ERROR_FAILURE;
 #endif
and try it on Unix and Mac. I
Ramiro, could you try removing the XP_UNIX check and run on Linux? Now that
NetLib is landed, supposedly LoadIconImage should work.

Don and Patric could you do the same on Mac?

NS_IMETHODIMP DeviceContextImpl::LoadIconImage(PRInt32 aId, nsIImage*& aImage)
 {
   // XXX synchronous image loading doesn't work on unix or mac yet
   // because netlib is not in its own thread.
 #if defined(XP_UNIX) || defined(XP_MAC)
   return NS_ERROR_FAILURE;
 #endif
 // ...etc...
 }
Target Milestone: M10 → M11
Moving to M11
Tried removing the code which returns with NS_ERROR_FAILURE on Linux and Mac.

The testcases
http://www.prometheus-music.com/gecko/bug694.html,
http://www.bath.ac.uk/%7Epy8ieh/internet/eviltests/IMGalt2.html

appears the same on Linux and WIN32.
The Mac crashes.
Assignee: kmcclusk → dcone
Status: ASSIGNED → NEW
Removed #ifdef XP_UNIX in DeviceContextImpl::LoadIconImage which prevented it
from loading an icon under Unix. Now that necko has landed LoadIconImage is
working on Linux.

Mac is still not working.
Don, I'm reassigning to you for the Mac issue.
Status: NEW → ASSIGNED
Target Milestone: M11 → M12
Summary: [PP] LoadIconImage doesn't work on unic or mac yet → [PP] LoadIconImage doesn't work on UNIX or Mac yet
Target Milestone: M12 → M13
Bulk move of all Networking-Core (to be deleted component) bugs to new
Networking component.
Assignee: dcone → kmcclusk
Status: ASSIGNED → NEW
this does not work on Windows or the Mac.  I think this is an XP problem at the
moment.  Kevin do you know who this belongs to, to get this broken image to
load.
Assignee: kmcclusk → dcone
It is working on WIN32.

nsDeviceContext.cpp still contains a XP_MAC define which always returns
NS_ERROR_FAILURE.

NS_IMETHODIMP DeviceContextImpl::LoadIconImage(PRInt32 aId, nsIImage*& aImage)
{
  // XXX synchronous image loading doesn't work on mac yet
#if defined(XP_MAC) || defined(XP_BEOS)
  return NS_ERROR_FAILURE;
#endif
  nsresult  result;
Status: NEW → ASSIGNED
Target Milestone: M13 → M14
*** Bug 24559 has been marked as a duplicate of this bug. ***
I tried removing the defined(XP_MAC), and things seemed to work just fine on Mac. 
I got badge icons for broken images, and live was relatively good.
Hardware: PC → Macintosh
Keywords: pp
kmcclusk/dcone: are we ok to enable this on Mac? What more testing do we need?
Took out the ifdef
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Ian, 

Eli suggested that I reassign this report to you since you are QA owner for ALT 
text-like bugs.
QA Contact: petersen → py8ieh=bugzilla
Ok, Eli, since you suggested to petersen that I should QA verify this bug, I'm
going to have to take you up on your offer of cross-platform verifications! :-)

Could you give me a screenshot of how this page:
   http://www.bath.ac.uk/%7Epy8ieh/internet/eviltests/IMGalt2.html
...looks, after 10 seconds, using the latest Mac builds?
(The time limit is important, after 60 seconds the page should change quite a
bit because that's how long it will take for the images to register as broken.)

If you have access to a Unix machine (Linux, Solaris, whatever) then an
equivalent screenshot on those platforms would be nice too. 

Cheers!
Ian, that's a long page with a lot of test cases; I don't think it'll fit on my 
monitor. ;) 

Are there particular sections that's you'd like screen shots of? I've attached 
the top test case from the 2000012808 Mac OS build.

Will find out how to do a Linux screen capture and attach (unless anyone else 
would like to do so sooner.)
Eli:
I believe Simon file a bug or two that
relates to the icon problem. You might
want to scan those 2 as well. 
Wish I could remember the bug #'s for you. :(

-p
The only other bug related to this problem was that the icon_0.gif/icon_1.gif 
files weren't being installed on Mac. I fixed that.
Eli: It's the top test case which I meant, so that's fine, thanks.
Looks fixed to me, unless someone sees another problem.
VERIFIED.
Status: RESOLVED → VERIFIED
Reopening. This change on Mac has caused a slew of nasty bugs
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
So the change to fix this on Mac has caused the following bugs which I'm marking 
dependent on this.
Blocks: 25948
Blocks: 25695
I don't understand.  When I run the test case this bug is fixed.
What are the other bugs? Did this cause those bugs?  If not, then this bug 
should be closed.  If it did then I will put the ifdef back in and research 
whats is going on, or give this bug to the person who owns these other issues.
OK, I'm going to turn off LoadIconImage() on Mac again, until we can resolve 
these problems.

The main issue here is that it is illegal to do a synchronous load of the GIF 
file on the main thread. Trying to do this causes event and timing problems which 
manifest themselves in the problems observed.

Loading the GIF file must be asynchronous. Valeski has a necko interface that is 
soon to be checked in that makes such loading easier, by responding to a callback 
that gets called when all the data is available.
Adjusting summary. The interface you need, when valeski checks it in, is 
nsIStreamLoader.

ImageNetContextSyncImpl should probably be removed entirely while this is fixed.
Hardware: Macintosh → All
Summary: [PP] LoadIconImage doesn't work on UNIX or Mac yet → [PP] LoadIconImage must do an asynchronous load
Simon.. do you want this bug.. you seem to know more about the correct solution 
than me.
Assignee: dcone → sfraser
Status: REOPENED → NEW
No, I don't want this bug. You need to come up with a way to load the image icon 
GIF asynchronously, on all platforms.
Reassign back. This ain't my bag, baby.
Assignee: sfraser → dcone
There are two async load options (nsIStreamLoader, and nsIStreamListener).
Summary: [PP] LoadIconImage must do an asynchronous load → LoadIconImage must do an asynchronous load
Target Milestone: M14 → M15
Status: NEW → ASSIGNED
Target Milestone: M15 → M17
Target Milestone: M17 → M18
Nominating for nsbeta2. It is a regression that image badges don't show for 
unloaded and broken image on Mac. This is also a platform parity issue.
Keywords: nsbeta2
Summary: LoadIconImage must do an asynchronous load → Image badge icons don't show on Mac (LoadIconImage must do an asynchronous load)
valeski: is the kind of sync loading done in mozilla/gfx/
nsImageNetContextSync.cpp, ImageNetContextSyncImpl::GetURL() OK to do now? Or is 
this still bad?
if you want to use nsImageContextSync loading to solve this bug, you'll 
need to wait for 22103 to be fixed. If you're sure you're only loading files 
from disk, you *might* be able to get away w/ nsImageContextSync without the 
22103 fix (note: I have a patch in 22103 that *should* make everything ok).
[nsbeta2-]
Keywords: regression
Whiteboard: [nsbeta2-]
I turned on badge icons on Mac in nsDeviceContext, and they show up before images 
load just fine. So the sync loading problems seem to be better. I think we can 
just change that #ifdef.
This bug has been marked future because we have determined that it is not 
critical for netscape 6.0.  If you feel this is an error, or if it blocks your 
work in some way -- please attach your concern to the bug for reconsideration.
Target Milestone: M18 → Future
Taking the bug. I've been running with this on in my tree for ages now, and 
everything works fine.
Assignee: dcone → sfraser
Status: ASSIGNED → NEW
OS: Windows NT → Mac System 9.0
Hardware: All → Macintosh
Target Milestone: Future → M18
setting to nsbeta3
Keywords: nsbeta2nsbeta3
Whiteboard: [nsbeta2-] → fix in hand
setting to nsbeta3+, who reviewed?
Whiteboard: fix in hand → nsbeta3+ [fix in hand]
adding brackets to status whiteboard
Whiteboard: nsbeta3+ [fix in hand] → [nsbeta3+] [fix in hand]
Fixed, yeah.
Status: NEW → RESOLVED
Closed: 25 years ago24 years ago
Resolution: --- → FIXED
Updating QA Contact.
QA Contact: py8ieh=bugzilla → paw
Clicking on this link http://www.prometheus-music.com/gecko/bug694.html results 
in the text "blu" showing up in the left hand corner. Nothing else appears.
Reopening
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
This occurs in mac build 2000090508 and Windows build 2000091104 and Linux build 
2000091106
The image badge icon shows correctly while the image is loading (it flashes up on 
Mac). The broken image icon does not show once the image has been found to be 
missing; that's an old layout bug, bug 41924.
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Saw it on mac. Verifying in build 2000091120
Status: RESOLVED → VERIFIED
OS: Mac System 9.x
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: