Last Comment Bug 322513 - Can't getRowCount() in listbox in prefwindow
: Can't getRowCount() in listbox in prefwindow
Status: RESOLVED FIXED
[rft-dl]
: fixed1.8.1, testcase, verified1.8.0.2
Product: Core
Classification: Components
Component: XUL (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Boris Zbarsky [:bz] (Out June 25-July 6)
:
Mentors:
http://bonsai.mozilla.org/cvsblame.cg...
Depends on: 282105
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-05 13:02 PST by Matthew Wilson
Modified: 2008-07-31 03:19 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
XUL file displaying the problem (needs to be loaded as chrome) (865 bytes, application/vnd.mozilla.xul+xml)
2006-01-05 13:03 PST, Matthew Wilson
no flags Details
test extension (1.43 KB, application/x-xpinstall)
2006-01-07 05:56 PST, :Gavin Sharp [email: gavin@gavinsharp.com]
no flags Details

Description Matthew Wilson 2006-01-05 13:02:12 PST
Inside a <prefwindow type="prefwindow">, calling getRowCount() on a listbox returns 0, even when the row count is not 0.

Inside a <prefwindow type="child">, getRowCount() returns the correct result.

(Bug 298632 also refers to a listbox inside a prefwindow, but it is not obvious that it is the same problem.)
Comment 1 Matthew Wilson 2006-01-05 13:03:20 PST
Created attachment 207652 [details]
XUL file displaying the problem (needs to be loaded as chrome)
Comment 2 Matthew Wilson 2006-01-05 13:04:09 PST
Fails in Firefox 1.5 and in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060105 Firefox/1.6a1
Comment 3 :Gavin Sharp [email: gavin@gavinsharp.com] 2006-01-06 13:46:23 PST
Would it be possible for you to narrow down a regression range using the builds at ftp.mozilla.org/archive.mozilla.org ?
Comment 4 Matthew Wilson 2006-01-06 13:49:04 PST
I don't have a build in which it worked. I don't have any evidence that it ever worked since the preference rework. So that sounds like a rather large task.
Comment 5 :Gavin Sharp [email: gavin@gavinsharp.com] 2006-01-06 14:42:26 PST
GetListBoxBody is returning null here:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/xul/base/src/nsListBoxObject.cpp&rev=1.1&mark=106#103
because GetFrame returns null at:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/xul/base/src/nsListBoxObject.cpp&rev=1.1&mark=224#210
because mPresShell is null at:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/xul/base/src/nsBoxObject.cpp&rev=1.52&mark=167#164

I don't know enough about this to know why this is happening.
Comment 6 Boris Zbarsky [:bz] (Out June 25-July 6) 2006-01-06 19:43:26 PST
Hmm... so how do I test?  If I just load the file as -chrome (with a file:// URI) nothing useful happens.

mPresShell can be null for a boxObject generally if the node got removed from the DOM or something...
Comment 7 Matthew Wilson 2006-01-07 01:48:45 PST
> Hmm... so how do I test? 

I included it into an XPI, installed and loaded from chrome.
Comment 8 :Gavin Sharp [email: gavin@gavinsharp.com] 2006-01-07 05:56:21 PST
Created attachment 207813 [details]
test extension

Steps to reproduce:
1) Install this extension in Firefox (click the link, or download the file and drag it to the Firefox Extension Manager, Tools->Extensions).
2) Restart Firefox.
3) Go to chrome://test/content/txul.xul .
4) Click the "Count items" button. See an alert of "0" (bug).
5) Go to chrome://test/content/wxul.xul .
6) Click the "Count items" button. See an alert of "2" (as expected).

Both XUL files are essentially the same as attachment 207652 [details], except that the one from step 5 is a <prefwindow type="child"> whereas the one from step 3 is a <prefwindow type="prefwindow">. <prefwindow type="foo"> behaves the same way as <prefwindow type="prefwindow">, so I think "child" is the only value of the "type" attribute that makes it work. I don't see anything at http://landfill.mozilla.org/mxr-test/seamonkey/search?string=prefwindow&find=css&filter=child that would have an effect on this.
Comment 9 Boris Zbarsky [:bz] (Out June 25-July 6) 2006-01-09 18:39:58 PST
Ah, I see.  This is basically bug 282105.  I think I outlined the right way to fix this in that bug...
Comment 10 Boris Zbarsky [:bz] (Out June 25-July 6) 2006-01-30 13:30:21 PST
Fixed on trunk by bug 282105
Comment 11 Boris Zbarsky [:bz] (Out June 25-July 6) 2006-02-16 14:40:00 PST
Fixed on branches too, by bug 282105
Comment 12 Marcia Knous [:marcia - use ni] 2006-02-16 17:06:19 PST
I was trying to verify this on 1.0.8, but when I try to load the test extension it gives me a chrome registration error. I could use some help with another strategy to verify.
Comment 13 :Gavin Sharp [email: gavin@gavinsharp.com] 2006-02-16 17:21:22 PST
(In reply to comment #12)
> I was trying to verify this on 1.0.8, but when I try to load the test extension
> it gives me a chrome registration error. I could use some help with another
> strategy to verify.

None of the testcases in this bug will run in 1.0.8, because prefwindow didn't exist then. I'm not sure what Boris meant by adding the fixed-aviary/fixed1.7.13 keywords here. At least as summarized, this bug didn't exist on those branches, so I don't think the fact that bug 282105 was checked in on the branches is relevant to this bug.
Comment 14 Jay Patel [:jay] 2006-02-24 17:26:11 PST
v.fixed on 1.8.0 branch with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060224 Firefox/1.5.0.1, installed extension and both xul files show correct row count of 2 (based on steps in comment #8).
Comment 15 Paul Tomlin 2006-03-09 10:54:20 PST
Since I can't access bug #282105, can someone tell me if this will carry over to TB. I'm seeing oddities with prefpanes src'd from a prefwindow not generating menupopups from RDF (most of the time).
Comment 16 Daniel Veditz [:dveditz] 2006-04-04 19:11:22 PDT
Removing aviary/moz17 fixed keywords per comment 13.

Note You need to log in before you can comment on or make changes to this bug.