Closed
Bug 86755
Opened 24 years ago
Closed 24 years ago
anonymous outlinerbody's database property is null in containing XBL binding's constructor.
Categories
(Core Graveyard :: RDF, defect, P3)
Core Graveyard
RDF
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla0.9.9
People
(Reporter: murphye, Assigned: waterson)
References
Details
(Keywords: testcase)
Attachments
(4 files, 2 obsolete files)
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.1+)
Gecko/20010618
BuildID: 2001061804
The summary says it all.
Reproducible: Always
Steps to Reproduce:
Use the testcase, and view the dump.
| Reporter | ||
Comment 1•24 years ago
|
||
| Reporter | ||
Comment 2•24 years ago
|
||
Also, using the same approach, except with the outliner being in the
<children/>, I get the same result.
| Assignee | ||
Updated•24 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: Windows NT → All
Priority: -- → P3
Hardware: PC → All
Target Milestone: --- → mozilla0.9.3
| Assignee | ||
Comment 3•24 years ago
|
||
Could be pilot error, but I'm having a hard time getting outliner to work _at
all_ as an XBL-ified widget. See bug 87860.
Depends on: 87860
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.3 → mozilla0.9.4
Comment 4•24 years ago
|
||
My suspicion here is that you're accessing .database on outlinerbody before it
exists. I created an example that accesses .database as the result of a button
click, and it was non-null.
Seems like something is fishy here, but it's probably possible to use any number
of hacks to work around the issue.
Resummarizing to reflect this.
Summary: outlinerbody database not present when used in XBL → anonymous outlinerbody's database property is null in containing XBL binding's constructor.
Comment 5•24 years ago
|
||
Yep, this is confusing. This is my hypothesis. I may be wrong.
The problem appears to be because no frame has been created for the outlinerbody
element.
Description:
1) the outliner builder calls |SetView| on the outliner body frame,
2) this in turn calls |SetOutliner| on the outliner builder passing its outliner
box object.
3) |SetOutliner| on the outliner builder calls |GetOutlinerBody| on the outliner
box object passed to it.
4) In the <xbl:constructor/> of a binding containing an anonymous outliner,
|GetOutlinerBody| returns null, as it is unable to get the frame for the
outlinerbody element, as that has not yet been created.
Well that's my debugging fun for the evening!
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.4 → mozilla0.9.5
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.5 → mozilla0.9.6
| Reporter | ||
Comment 6•24 years ago
|
||
I found a good hack for this. Move the code from the binding's constructor to a
method. Then in the document the binding is used in do
window onload="thebinding.theMethod()"
and that will execute the original constructor code after the outliner has
loaded its database.
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.6 → mozilla0.9.7
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.7 → mozilla0.9.8
| Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.8 → mozilla0.9.9
| Assignee | ||
Comment 7•24 years ago
|
||
Yeah, what we need to do here is make nsXULTemplateBuilder (the super-class for
nsXULOutlinerBuilder) inherit from nsIRDFContentModelBuilder. Then we'll just
call nsIRDFContentModelBuilder::SetRootContent when we're in
nsXULDocument::CheckTemplateBuilder, so that the |database| property gets
initialized regardless of whether there's a frame or not.
| Assignee | ||
Comment 8•24 years ago
|
||
The problem was that we weren't adding the database property in the
nsXULOutlinerBuilder until the frame was created and the outliner box object
was being set. I fixed this by getting rid of nsIRDFContentModelBuilder (which
wasn't really necessary), moving those methods to nsIXULTemplateBuilder, and
having the initialization code in nsXULDocument::CheckTemplateBuilder simply
call the `Init' method (formerly `SetRootContent') regardless of whether it was
initializing a content builder or an outliner builder.
I'll attach a test case that can be used to verify the bug.
| Assignee | ||
Comment 9•24 years ago
|
||
Attachment #39211 -
Attachment is obsolete: true
| Assignee | ||
Comment 10•24 years ago
|
||
| Assignee | ||
Comment 11•24 years ago
|
||
Save these files, and JAR them up into a chrome JAR somewhere. Then you'll be
able to run the test and see the `dump' statement in the XBL file spew
something other than `null'.
| Assignee | ||
Comment 12•24 years ago
|
||
Sorry, attachment 66068 [details] [diff] [review] was incomplete (missing diffs from
mozilla/content/build). This patch is complete.
Attachment #66068 -
Attachment is obsolete: true
Comment 13•24 years ago
|
||
Nice work! Now it looks even more consistent.
This patch also fixes some problems I pointed out in bug 120253.
+ // Force an <outlinerchildren> to be created if one isn't
+ // there already.
+ // XXXwaterson why do we have to do this?
I think this is only way how to create an outliner body for the rdfliner.
r=varga
Updated•24 years ago
|
Attachment #66152 -
Flags: review+
| Assignee | ||
Comment 14•24 years ago
|
||
Gotcha. I'll fix the comment to say just that.
Comment 15•24 years ago
|
||
sr=hyatt
| Assignee | ||
Comment 16•24 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•