Closed Bug 78497 Opened 24 years ago Closed 23 years ago

transparent images within absolute positioned div not clipped

Categories

(Core :: Web Painting, defect, P2)

x86
Linux
defect

Tracking

()

VERIFIED FIXED
Future

People

(Reporter: simon, Assigned: tor)

References

()

Details

(Keywords: platform-parity)

Attachments

(3 files, 1 obsolete file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.3-22mdk i686; en-US; rv:0.8.1+) Gecko/20010430 BuildID: 2001043021 If clipping a div that has say 5 images in a line widthwise and you want to see the middle 3 images, it wont clip at all. I've tried the various overflow options. I'm using the xbdhtml cross browser code (netscapes). Under NS4/IE it allows me a 'viewport' onto the div, but mozilla shows everything that should be clipped off - it also activates hyperlinks for the incorrect images. Reproducible: Always Steps to Reproduce: 1. Use html like following: <div id=buttons style="position:absolute; overflow:hidden"> <table cellpadding=0 cellspacing=0 border=0> <tr> <td><a href="link1.html"> <img src="images/button.gif" width=100 height=82> </a></td> <td><a href="link2.html"> <img src="images/button2.gif" width=100 height=82> </a></td> </tr> </table> </div> 2. Set a rect clip to view just the first image and clip the second off. elt = document.getElementById("buttons") elt.style.clip = 'rect(' + cliptop + ' ' + clipright + ' ' + clipbottom + ' ' + clipleft +')'; 3. Fire up browser and be dissapointed! Text works fine, images don't. Actual Results: Shows all images in div, complete with mouse over events Expected Results: Show clipped region only Text clipping fine. Tried transparent/non-transparent - both fail. NS4 and IE fine.
Simon, could you attach a testcase? That will greatly expedite the fixing of this bug.
Hi, sorry about not having an attachment - It's the first time I've seen bugzilla! I've set up a test page: http://www.mintsource.org Under NS4, you see 3 images at a time, on mozilla all are showed. Cheers!
For the record-- the images are clipped properly on Win98 Build 2001050104 (only three show at a time). The hyperlinks are still active on images outside the clipping area though; I don't know if this is correct behavior or not.
MacOS Build 2001032613 - 0.8.1 does the same thing as the Win98 Build 2001050104, images are clipped but hyperlinks not clipped off.
Images appear clipped correctly too under the May 8th build. Reporter, you may want to pull a fresh build.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Still having the same problem under Linux build 2001051108. I'll check out the mac etc builds when I get back to the office. I am suprised more people aren't tripping over this, is this a duplicate of a different bug? This'll break quite a few of the dhtml sites I know.
Target Milestone: --- → mozilla0.9.3
Target Milestone: mozilla0.9.3 → mozilla0.9.4
Specifying a z-index for abosulte positioned div fails. The default stacking order determined by element declaration on page is not being overridden. This can be seen when requiring an absolute positioned div to pop up above its relative position i.e. negative top values.
Summary: images within absolute positioned div not clipped → images within absolute positioned div not clipped - z-index ordering broken
Target Milestone: mozilla0.9.4 → mozilla0.9.5
Moving to Mozilla0.9.6
Target Milestone: mozilla0.9.5 → mozilla0.9.6
New URL for testing - moved the test files under bugzilla subdirectory. Changed platform and OS to all, since all platforms I've tested show at least some of the problems described.
OS: Linux → All
Hardware: PC → All
Status: NEW → ASSIGNED
Target Milestone: mozilla0.9.6 → mozilla0.9.8
Works for me on WINNT, build 2001111903. Fails on Linux. Looks like it's an issue with clipping images on Linux.
OS: All → Linux
Hardware: All → PC
The behaviours need to be clipped off as well as the images. I have no Windows to test whether images only are clipped.
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Target Milestone: mozilla0.9.9 → mozilla1.0.1
Bulk moving Mozilla1.01 bugs to future-P1. I will pull from the future-P1 list to schedule bugs for post Mozilla1.0 milestones
Priority: -- → P1
Target Milestone: mozilla1.0.1 → Future
I retested with windows, and it's definitely only the image display that's being clipped. Behaviours are left unclipped and also the scrollbar appears, implying that space is being allocated for clipped off elements. I updated the test page to http://www.mintsource.org/bugzilla btw. Cheers!
I'm definitely seeing this on current linux... I'll attempt to reduce this unholy hell of javascript to a reasonable size...
Attached file Testcase
The problem is that opaque images are being clipped fine, but images with transparency (I use a GIF here, but PNG does the same thing) are not clipped correctly. In all cases, clicking outside the clip area does not trigger links.
Summary: images within absolute positioned div not clipped - z-index ordering broken → transparent images within absolute positioned div not clipped
Priority: P1 → P2
*** Bug 158615 has been marked as a duplicate of this bug. ***
This is apparently linux-only. This bug makes using clip in mozilla somewhat painful... It looks like it just does not work.
Keywords: pp
hmm, this will probably break some site functionality, as clipped images are being used more and more. Can't think of a major site atm though.
Not Linux only - I have had a report that it also affects (at least) the Irix version. I'm surprised this bug is only marked to be fixed at some "future" date, seeing as it will effectively prevent Mozilla from working with several DHTML libraries and create an unholy mess at other sites using dynamic content! I really want to support Moz with my own API (Gamelib - a library for people wishing to write arcade games and windowing systems using javascript) but this is a serious problem. I have worked around other problems, but this is a sticker! I also wonder why Netscape 6 on Linux is not affected by the bug?!
"Linux only" means "GTK port only" in this context.... (though it may be a problem in the Xlib and QT ports too; if I find someone using them I'll ask).
tor is the image king! he can fix anything!
The test page http://www.mintsource.org/bugzilla looks OK to me (3 images in view) using Mozilla 1.1b (Build ID 2002072104), Win95. When I hit the scroll_left or scroll_right button, scrolling and clipping happens. Glenn
Yeah, that's because it affects the *nix versions, not Windows. See the comments a few inches above your last one.
*** Bug 62543 has been marked as a duplicate of this bug. ***
This is not a views bug. This is an image bug. nsImageGTK simply ignores clipping when painting images with 1-bit alpha. Look here: http://lxr.mozilla.org/seamonkey/source/gfx/src/gtk/nsImageGTK.cpp#776 You can see that the 1-bit case creates a new GC and is just ignoring any clip region that may have been set on aContext. Unfortunately there doesn't seem to be a way to combine a clip mask with a clip region in GDK, so the 1-bit case will have to take another path. Over to tor.
Assignee: kmcclusk → tor
Severity: normal → major
Status: ASSIGNED → NEW
You need a call to FreeRects in there.
Attached patch plug memory leakSplinter Review
Attachment #99582 - Attachment is obsolete: true
Comment on attachment 99697 [details] [diff] [review] plug memory leak r=pavlov
Attachment #99697 - Flags: review+
Checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified fixed, linux/gtkfe. Testcases work fine.
Status: RESOLVED → VERIFIED
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

Created:
Updated:
Size: