The default bug view has changed. See this FAQ.

sizeToContent() not always working

NEW
Unassigned

Status

()

Core
General
--
major
9 years ago
6 years ago

People

(Reporter: Ramiro Aparicio, Unassigned)

Tracking

({regression})

Trunk
x86
Windows XP
regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9) Gecko/2008052906 Firefox/3.0

I am a extension developer and I got a bug report for this, I thought that I was not calling sizeToContent() in some situation but it seems FF3 has some problems with setting false and element in XUL and resizing as it does not resize correctly.

I have tested adding it to a setTimeout to see if that helps and nothing.

Reproducible: Always

Steps to Reproduce:
1. Install Foxgame (probably it can be found a minimal case but this is what I have) from http://www.foxgame.org/foxgame.xpi
2. Open Tools -> Add-ons -> Foxgame Options.
3. Select 4 tab "Messages"
4. In the bottom click on Add, and in the new dialog check "From"
Actual Results:  
The from textarea is shown but the window is not resized even after a window.sizeToContent() call.

Expected Results:  
It should have resized the dialog.
If after that you select "Spy Report" it resizes without problem, but not only that, if you select back "PM" now checking/unchecking resizes as it should.

I have tried it on a FF3 RC2 protable clean installation, my reports are that this happens in RC1 and RC2 but I have not tested it on other version / OS.
(Reporter)

Comment 1

9 years ago
Created attachment 325167 [details]
"testcase"

It's the code of the dialog giving problems, it is not working as is as it uses DTD-entities and external javascript files, but removing calls and entities should show the same behavior.
Created attachment 325198 [details]
screenshot of the problem
This was caused by Bug 300030.
Blocks: 300030
Status: UNCONFIRMED → NEW
Component: General → General
Ever confirmed: true
Keywords: regression
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk

Comment 4

9 years ago
I've seen the same issue while working on the Firefox extension FoxClocks. Previous release versions of Firefox (<= 2.x) are unaffected.

To reproduce: call window.sizeToContent() where no resizing is necessary - subsequent calls to window.sizeToContent() then fail. Thus the behaviour can seem intermittent. (Corollary: workaround is to call window.sizeToContent() only when resizing will occur, e.g. on hiding/unhiding an element.)

Comment 5

9 years ago
The workaround doesn't seems to work in all cases either. I call sizeToContent once ever in the beginning of my javascript and it makes the window as small as possible making the entire page disappear. The window has plenty of content at that point and should have resized. Was introduced in FF3 as it works fine in FF1&2  
Summary: sizeToContent() not allways working → sizeToContent() not always working

Comment 6

9 years ago
Some of our users confirm this as well:
http://bugs.code.downthemall.net/trac/ticket/731

Was supposed to be fixed by: bug 371508

Comment 7

9 years ago
This bug breaks the popup window feature of my extension, Text-to-Image, on Windows XP, Windows Vista, and Linux (Firefox 3.1 builds only).

In either case, a zero height/width popup is created that is either invisible, unresizable, or only as large as the window header.

Comment 8

9 years ago
If sizeToContent is called when the size already fit to the content, then all next calls to sizeToContent will not work.

If you get ride of this test :
http://mxr.mozilla.org/mozilla-central/source/xpfe/appshell/src/nsXULWindow.cpp#1714

sizeToContent has the correct behavior.

I don't know why, but I think we are on to something.

Comment 9

9 years ago
Created attachment 349968 [details]
minimal test case

Open this xul dialog page :
Click on hide, then show, then hide, then show, ... it works.
But click twice on hide or show, it stops working.

Updated

8 years ago
Duplicate of this bug: 466886

Updated

8 years ago
Depends on: 465448

Comment 11

8 years ago
Seems to work know. Resolved ?
Yes, it seems to work for me in current trunk build with the testcases.
However, the FoxGame extension gives me problems trying out if it works there. I get js errors in the error console, so I can't really test the extension.
Paul, you mean this seems to work now that bug 465448 is fixed?

Comment 13

7 years ago
Still broken:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6

Comment 14

6 years ago
Since 7.0b1 candidate .resizeBy is also broken, and it's always!

Nothing in dev toolbar or firebug.
You need to log in before you can comment on or make changes to this bug.