insertBefore doesn't work correctly for children of an XBL binding with non-empty content

RESOLVED FIXED

Status

()

Core
XBL
RESOLVED FIXED
13 years ago
9 years ago

People

(Reporter: Nickolay_Ponomarev, Assigned: bz)

Tracking

({testcase})

Trunk
x86
Windows XP
testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

1.62 KB, application/vnd.mozilla.xul+xml
Details
(Reporter)

Description

13 years ago
If I have a binding with content like this:
    <content>
      <xul:label value="anon label"/>
      <children/>
    </content>

..bound to a box with a few children (button0, button1, etc), then insertBefore
doesn't work properly. For example if I do:
  var item = container.firstChild;
  container.insertBefore(item.nextSibling, item); // shouldn't modify anything

The box's contents becomes: button1, <anon label>, button0, button2, ...
Although DOMi indicates that the tree is not modified.

Moving <children> to be before the label "fixes" the problem. Removing
<children> altogether doesn't, although the displayed order is different.

Filing this under XBL, since I only can reproduce it using a binding with
content. Tested using 20050923, 1.8 branch. This happens with Firefox 1.0 too.
(Reporter)

Comment 1

13 years ago
Created attachment 197294 [details]
testcase

Click the "click me" button to test.
DUP of bug 56758?
More likely a dup of bug 272646
Depends on: 272646
Fixed by checkin for bug 307394.  Added the test to reftest.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Assignee: xbl → bzbarsky
You need to log in before you can comment on or make changes to this bug.