Closed Bug 216977 Opened 22 years ago Closed 22 years ago

'overflow:hidden' not working correctly on Linux (fine on Windows, DHTML Lemmings)

Categories

(Core :: Web Painting, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: huw-l, Assigned: tor)

References

()

Details

(Keywords: testcase)

Attachments

(3 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030728 Mozilla Firebird/0.6.1 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030728 Mozilla Firebird/0.6.1 DHTML lemmings causes the following error in the javascript console. Error: uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getBoolPref]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: chrome://communicator/content/profile/profileSelection.js :: StartUp :: line 97" data: no] This is coupled with a display error (multiple lemmings) see http://users.pandora.be/wyffels.f/schermafdruklemmings.jpg for an example. Reproducible: Always Steps to Reproduce: 1.load the web page in mozilla1.4 or firebird0.6 on linux 2.navigate to the first level 3.open the javascript console to see the error Actual Results: multiple lemmings resulting in an unplayable game. The developers believe this to be a problem with the browser rather than the javascript.
I need to cut in here as the maker of the script. I don't think the JS error has to do with this problem, nor that it is a JS error at all, but more likely a CSS/HTML render problem. What happens is the following: I create a div with fixed dimensions and overflow:hidden. In that div I create an image, which has a larger width than the containing div. Apperantly the overflow:hidden is ignored and the extended part of the image is visible beyond the div. In windows versions of Mozilla 1.3x and 1.4x this problem is not reproducable, so my guess is it is restricted to linux version but I'm not in a position to verify this myself at the moment. I do have a much simpler testcase though: http://crew.tweakers.net/lemmings/desktop.html notice how I create the elements and attach the css classes div.lemming and img.lemming
Same display error on 1.5a and the latest nightly on Linux. In the JavaScript Console all I get is a bunch of "Error: selected_level is not defined" - but I've never used that before so I might be doing something wrong there. On the other hand, the game isn't unplayable, I got to the 3rd level and then quit :-P
Sorry the JSerror is a red-herring. It's a problem with my profile. Creating a fresh profile has removed the JS error but the rendering problem is still there.
confirming 20030819 (only on Linux, not Win2k), happens in latest nightly build and also GTK2 build. It'd be nice to have someone testing this on Linux PPC, MacOSX or some other platform.
Keywords: testcase
Confirming with Mozilla trunk build 2003-08-22 on Linux. As indicated in Comment #1, this is not a JavaScript problem, but a layout issue. Reassigning to Layout for further triage -
Assignee: rogerl → other
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → Layout
Ever confirmed: true
QA Contact: pschwartau → ian
Summary: DHTML lemmings exhibits a javascript error on linux but not windows → DHTML lemmings exhibits a JavaScript error on Linux but not Windows
Component: Layout → JavaScript Engine
Summary: DHTML lemmings exhibits a JavaScript error on Linux but not Windows → DHTML lemmings display incorrectly on Linux but not Windows
Argh, component accidentally changed. Reassigning (again) to Layout.
Component: JavaScript Engine → Layout
Summary: DHTML lemmings display incorrectly on Linux but not Windows → 'overflow:hidden' not working correctly on Linux (fine on Windows, DHTML Lemmings)
->views, although maybe widget
Assignee: other → roc+moz
Component: Layout → Layout: View Rendering
We really need a reduced, non-DHTML testcase for this.
Priority: -- → P3
reduced non-dhtml testcase: http://crew.tweakers.net/crisp/lemmings/nodhtml.html you should see 1 lemming standing in the upperleft corner; if this is the case than something is wrong in the dynamic addition of elements and setting a class on that element through javascript that has the overflow property set.
confirmed with the latest testcase using Mozilla 1.4 on Slackware 9.0; this is total unexpected behaviour in my humble opinion and can be classified as a major bug.
Found when the problem occurs. In the attachment I have linked 2 images within a div with overflow:hidden. Both these images have width: 256px via the attached class; the first image however is on disk only 128px width so is being resized; that's when the image is visible beyond the div. The second image is also 256px on disk, and in this case the remaining part of the image is not visible beyond the div. For my Lemmings game I had resized all the images by 50% to save bandwidth; that's when the error came up.
Almost certainly a GTK image bug. -> tor
Assignee: roc+moz → tor
This is essentially bug 78497 for the scaled image path. X doesn't allow us to set both a set of clip rectangles and a clip mask, so we need to handle the rectangles by hand.
We should get this thing reviewed in case we want it for 1.5. It's a pretty bad bug; I'm surprised it hasn't been reported more.
Attachment #130778 - Flags: review?(blizzard)
Attachment #130778 - Flags: review?(blizzard) → review+
Attachment #130778 - Flags: superreview?(roc+moz)
+ PRUint8 *scaledRGB = (PRUint8 *)nsMemory::Alloc(3*dstWidth*dstHeight); Need a success check here. out of memory => BOOM + if (NS_SUCCEEDED(clipRgn.GetRects(&rectSet))) { What is this actually supposed to do? it looks like GetRects always succeeds. + nsMemory::Free(scaledRGB); How come this is only called if the CopyRgn succeeded? Shouldn't you check to see if the clip region is really clipping the target rectangle? Otherwise whenever any clip region is set anywhere, we'll crawl through the slow path.
> + PRUint8 *scaledRGB = (PRUint8 *)nsMemory::Alloc(3*dstWidth*dstHeight); > > Need a success check here. out of memory => BOOM Added. > + if (NS_SUCCEEDED(clipRgn.GetRects(&rectSet))) { > > What is this actually supposed to do? it looks like GetRects always succeeds. Test removed. > + nsMemory::Free(scaledRGB); > > How come this is only called if the CopyRgn succeeded? Nesting error. > Shouldn't you check to see if the clip region is really clipping the target > rectangle? Otherwise whenever any clip region is set anywhere, we'll crawl > through the slow path. By the time we've figured out if the clip region matches the target rectangle we would end up executing all the overhead of the "slow" path, since we'll end up with a single rectangle.
Attachment #130778 - Attachment is obsolete: true
Attachment #130866 - Flags: superreview?(roc+moz)
Attachment #130866 - Flags: review?(blizzard)
Comment on attachment 130866 [details] [diff] [review] address roc's comments OK, looks good now. Not sure if we should take it for 1.5; this presumably has been broken for a long time if not forever, and hasn't been a big deal.
Attachment #130866 - Flags: superreview?(roc+moz) → superreview+
Attachment #130866 - Flags: review?(blizzard) → review+
Checked in on trunk.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
+ PRUint8 *scaledRGB = (PRUint8 *)nsMemory::Alloc(3*dstWidth*dstHeight); + + if (!scaledRGB) + return NS_ERROR_FAILURE; why not NS_ERROR_OUT_OF_MEMORY?
Nit 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

Created:
Updated:
Size: