Closed
Bug 467775
Opened 16 years ago
Closed 16 years ago
XUL template creating nested elements instead of siblings
Categories
(Core :: XUL, defect, P2)
Core
XUL
Tracking
()
RESOLVED
FIXED
People
(Reporter: glazou, Assigned: enndeakin)
References
Details
(Keywords: fixed1.9.1, regression)
Attachments
(3 files)
(deleted),
application/octet-stream
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
patch
|
smaug
:
review+
sicking
:
superreview+
|
Details | Diff | Splinter Review |
A bug appeared on my mac between a build of BlueGriffon based off FF3.0.4 and a build based on mozilla-central's trunk. A sqlite database that seemed to be correctly created and used in a sqlite-based xul template with FF3.0.4 is horked with mozilla-central's trunk.
I have isolated the bug and created a small XPI for Firefox/Shiretoko. Step to reproduce the bug, please make sure you use two different profiles for FF304 and Shiretoko:
1. install the attached xpi
2. open Tools > Template bug
(notice the file tplbug.sqlite that appeared in your profile)
4. the resulting dialog is perfectly ok on FF304 and horked on Shiretoko ; the
former shows correctly the list of names in the database, the latter shows
a very high corrupted list with only one visible entry.
5. now use Shiretoko on the profile you used in FF304 and open
Tools >Templatebug ; notice this time the dialog is ok !
6. now use FF304 on the profile you used in Shiretoko and open the dialog,
notice the dialog is horked
7. furthermore, the files tplbug.sqlite in the two profiles differ...
(warning, this extensions sets pref extension.tplbug.firstRun ; make sure
to reset it if you need to clear your profile or recreate the sqlite database).
Reporter | ||
Comment 1•16 years ago
|
||
Confirming on PC/WinXP too with FF304 and Shiretoko, fresh build from today.
OS: Mac OS X → All
Hardware: Macintosh → All
Comment 2•16 years ago
|
||
Just to clarify - how is the database horked - does it not open, or what?
Reporter | ||
Comment 3•16 years ago
|
||
(In reply to comment #2)
> Just to clarify - how is the database horked - does it not open, or what?
yes it does open. Sqlite Manager also sees/handles correctly the database.
Could be a sqlite-based template bug after all.
Comment 4•16 years ago
|
||
Yeah, I'm not seeing anything here that indicates that it is a storage or sqlite bug
Updated•16 years ago
|
Component: Storage → XUL
Product: Toolkit → Core
QA Contact: storage → xptoolkit.widgets
Comment 5•16 years ago
|
||
I'm going to investigate on the template part..
Reporter | ||
Comment 6•16 years ago
|
||
Ok, DOMI shows the problem... Listitems created by the template are created nested instead of being siblings !!! So the database does not seem to be guilty here. I'll update the title of the bug.
Reporter | ||
Comment 7•16 years ago
|
||
flagging blocker191
Flags: blocking1.9.1?
Summary: sqlite database apparently horked on creation → XUL template creating nested elements instead of siblings
Comment 8•16 years ago
|
||
I made some tests with a simple database and a simple template (I'm not reusing the xpi of Daniel) and I have same issue.
I investigated and it seems that the bug appears since the landing of the patch for bug 450990. And it appears only with sqlite datasources (apparently, it is ok with rdf datasources).
So I think there is a bug in the query processor for storage, or perhaps in the content builder.
I take this bug.
Assignee: nobody → laurent
Status: NEW → ASSIGNED
Comment 9•16 years ago
|
||
Could we get some tests too please so this doesn't break again in the future?
Assignee | ||
Comment 10•16 years ago
|
||
It looks offhand like http://mxr.mozilla.org/mozilla-central/source/content/xul/templates/src/nsXULContentBuilder.cpp#752 should be calling and checking MayProcessChildren like http://mxr.mozilla.org/mozilla-central/source/content/xul/templates/src/nsXULContentBuilder.cpp#1028 does.
Assignee | ||
Comment 11•16 years ago
|
||
Laurent, this should fix this bug. Are you writing some tests for this?
Comment 12•16 years ago
|
||
Yes Neil, I began to create tests and I will add them to those you already made for bug 378893. I'm going to test your patch, thanks Neil :-)
Comment 13•16 years ago
|
||
Neil, this patch works for me :-) See my patch for bug 378893 to have tests.
Assignee | ||
Updated•16 years ago
|
Attachment #351420 -
Flags: superreview?(jonas)
Attachment #351420 -
Flags: review?(jonas)
Assignee | ||
Comment 14•16 years ago
|
||
Comment on attachment 351420 [details] [diff] [review]
something like this
This patch just ensures that GetMayProcessChildren, which always returns false for storage templates, is called in both cases.
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P2
Comment on attachment 351420 [details] [diff] [review]
something like this
I can't really say I know this code well enough to review. Don't know who does though :(
Attachment #351420 -
Flags: superreview?(jonas)
Attachment #351420 -
Flags: superreview+
Attachment #351420 -
Flags: review?(jonas)
Attachment #351420 -
Flags: review?
Reporter | ||
Comment 16•16 years ago
|
||
FWIW, patch tested in BlueGriffon and works just fine.
Updated•16 years ago
|
Whiteboard: [needs review]
Assignee | ||
Updated•16 years ago
|
Assignee: laurent → enndeakin
Assignee | ||
Updated•16 years ago
|
Attachment #351420 -
Flags: review? → review?(Olli.Pettay)
Comment 17•16 years ago
|
||
Comment on attachment 351420 [details] [diff] [review]
something like this
> nsXULContentBuilder::CreateContainerContents(nsIContent* aElement,
> nsIXULTemplateResult* aResult,
> PRBool aForceCreation,
> PRBool aNotify,
> PRBool aNotifyAtEnd)
> {
> if (!aForceCreation && !IsOpen(aElement))
> return NS_OK;
>+
>+ // don't generate children if recursion or child processing isn't allowed
>+ if (aResult != mRootResult) {
>+ if (mFlags & eDontRecurse)
>+ return NS_OK;
>+
>+ PRBool mayProcessChildren;
>+ nsresult rv = aResult->GetMayProcessChildren(&mayProcessChildren);
>+ if (NS_FAILED(rv) || !mayProcessChildren)
>+ return rv;
>+ }
Use 4 space indentation everywhere, not mixture of 2 and 4.
Attachment #351420 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Updated•16 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•16 years ago
|
Keywords: fixed1.9.1
Whiteboard: [needs review]
You need to log in
before you can comment on or make changes to this bug.
Description
•