Closed Bug 270517 Opened 20 years ago Closed 20 years ago

Drawing quirks with mouseover images in XUL

Categories

(Core :: XUL, defect)

defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla1.8beta1

People

(Reporter: pkwarren, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

In recent builds, I have been noticing drawing quirks with mouseover images in
the user interface, like the browser/mailnews/editor/addressbook/chatzilla
buttons in the bottom left and the search button and home button on the toolbar.
When an image is not already loaded in cache, it seems the following occurs:

1) User hovers over image with the mouse.
2) Image is resized to 0,0 size.
3) Image is loaded into cache.
4) Image is drawn again with the correct size.

This process is pretty easily seen on older machines. What I would expect to
happen is the following:

1) User hovers over image with the mouse.
2) Image remains the same size and is drawn with the old image until the new
image is fully loaded.
3) The new image is drawn over the old image.

I have found if I remove the following line from nsImageBoxFrame.cpp, the
behavior improves slightly (there is flashing between painting the old image,
painting no image, and painting the new image but it does not resize):

http://tinyurl.com/6ztc5
(In reply to comment #0)
> 1) User hovers over image with the mouse.
> 2) Image is resized to 0,0 size.
> 3) Image is loaded into cache.
> 4) Image is drawn again with the correct size.

I meant to say: 

- User hovers over XUL element containing image with the mouse.
- The new hovered image starts loading.
- The XUL element is resized to 0x0 size and redrawn (shrinking the button
containing the image in the case of XUL toolbarbuttons) while the image loads.
- The new hovered image is completely loaded and the XUL element is resized to
include the new image size and redrawn.
So the right thing to do may be to size to (0,0) only if we're not starting a
new image load or the new image load failed....
*** Bug 279435 has been marked as a duplicate of this bug. ***
Attached patch PatchSplinter Review
I can't actually reproduce the problem, so could someone who can reproduce it
test this patch, please?
Assignee: nobody → bzbarsky
Target Milestone: --- → mozilla1.8beta
(In reply to comment #4)
> Created an attachment (id=173343) [edit]
> Patch
> 
> I can't actually reproduce the problem, so could someone who can reproduce it
> test this patch, please?

It worked for me.
Attachment #173343 - Flags: superreview?(dbaron)
Attachment #173343 - Flags: review?(dbaron)
Attachment #173343 - Flags: superreview?(dbaron)
Attachment #173343 - Flags: superreview+
Attachment #173343 - Flags: review?(dbaron)
Attachment #173343 - Flags: review+
Fixed.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
I can verify that this is now fixed with a trunk build from today.
Status: RESOLVED → VERIFIED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: