Closed Bug 289943 Opened 19 years ago Closed 19 years ago

Scaled image not correctly restored after leaving :hover

Categories

(Core :: Web Painting, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: pe1chl, Assigned: roc)

Details

(Keywords: testcase)

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050217
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050217

See the demo URL.  Hover over the 3 large squares on the left, which causes a
menu to pop-up (created with CSS :hover, always nice to impress IE fans).
When leaving one menu, the underlying image is not correctly restored.
Other pages on the same site, where there is no image map on the covered image,
show no problem.
Works OK in 1.7.6, broken in 1.8b.

Reproducible: Always

Steps to Reproduce:
Attached file testcase (obsolete) —
this testcase exhibits the bug for me with current CVS/gtk2.  On load, "bar"
appears inside the image with a white background (should be orange).  After
covering up the white background area and exposing it, it looks fine (orange
background).
FWIW, this WORKSFORME with a gtk1 build
oh, and the image is scaled by a pixel.  The bug doesn't show up if it's not scaled.

==> views (?)
Assignee: general → roc
Status: UNCONFIRMED → NEW
Component: General → Layout: View Rendering
Ever confirmed: true
Keywords: testcase
Product: Mozilla Application Suite → Core
QA Contact: general → ian
Version: unspecified → Trunk
Attached file testcase v2
oops.  img should actually point at a valid image.
Attachment #180455 - Attachment is obsolete: true
(In reply to comment #3)
> FWIW, this WORKSFORME with a gtk1 build
> oh, and the image is scaled by a pixel.  The bug doesn't show up if it's not
scaled.
> 
> ==> views (?)

Thanks for finding that!  I had done many comparisons between pages on the site
and found only the presence of a map as a factor causing this bug.
But now it actually turns out to be not because of the map but because of the
scaling.  When I set the picture size correctly on the original site, it works OK.

Changing the summary.  Removing reference to original site (as it will be
fixed).  Attachment "testcase v2" still shows the problem.
Summary: Image which has image map not correctly restored after leaving :hover → Scaled image not correctly restored after leaving :hover
Attached patch fixSplinter Review
The XlibStretchRect code has some problems. When startColumn is nonzero and
we're only stretching horizontally, we get into trouble because
XlibStretchHorizontal uses "x1 - startColumn + offsetX" as the destination x
coordinate (where x1 is the offset within the image after scaling). It should
be using just x1 + offsetX. So I've pulled the -startColumn part out to the
caller for use just in the stretchVertical case, where it is needed. There's a
similar issue with the vertical coordinate used. Also, the !skipVertical code
doesn't handle dstOrigX correctly, so I fixed that too.
Attachment #180551 - Flags: superreview?(tor)
Attachment #180551 - Flags: review?(tor)
Attachment #180551 - Flags: superreview?(tor)
Attachment #180551 - Flags: superreview+
Attachment #180551 - Flags: review?(tor)
Attachment #180551 - Flags: review+
Comment on attachment 180551 [details] [diff] [review]
fix

fairly straightforward fix to some fairly broken GTK1/2 image stretching code.
This could fix a variety of bugs.
Attachment #180551 - Flags: approval1.8b2?
Attachment #180551 - Flags: approval1.8b2? → approval1.8b2+
checked in
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: