Closed Bug 414568 Opened 13 years ago Closed 13 years ago

Duplicate content created with xml template

Categories

(Core :: XUL, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: enndeakin, Assigned: enndeakin)

Details

Attachments

(3 files, 1 obsolete file)

fix
1.07 KB, patch
smaug
: review+
peterv
: superreview+
mtschrep
: approval1.9+
Details | Diff | Splinter Review
267 bytes, text/xml
Details
544 bytes, application/vnd.mozilla.xul+xml
Details
Attached file testcase (obsolete) —
The menuitem content in this XUL template is created twice.
Attached patch fixSplinter Review
The problem occurs because a call to nsXULElement::GetChildCount occurs while processing the template query which in turn calls nsXULElement::EnsureContentsGenerated which ends up trying to build the template again, causing two sets of content to be output.

This patch clears the lazy state before parsing the query.
Attachment #300021 - Flags: superreview?(peterv)
Attachment #300021 - Flags: review?(Olli.Pettay)
The testcases seems to work here; I get a menu which has three different items.
Do I need to run it locally or as chrome?
Attachment #300018 - Attachment is obsolete: true
Attached file real broken testcase
Bah, looks like you need to save the test locally, or run from chrome.
Status: NEW → ASSIGNED
ok, I can reproduce this only when run locally as chrome. (-chrome)
Comment on attachment 300021 [details] [diff] [review]
fix

I was wondering whether GetChildCount would return wrong value with this change, but as far as I see no. The query part isn't generated.
Attachment #300021 - Flags: review?(Olli.Pettay) → review+
Flags: blocking1.9?
Neil - why is this nomed for blocking?
Actually, this doesn't need to be blocking.
Flags: blocking1.9?
Attachment #300021 - Flags: superreview?(peterv) → superreview+
Comment on attachment 300021 [details] [diff] [review]
fix

Test will be added after bug 378893 is in
Attachment #300021 - Flags: approval1.9?
Attachment #300021 - Flags: approval1.9? → approval1.9+
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.