Closed
Bug 155504
Opened 23 years ago
Closed 23 years ago
[FIXr]appendChild during document.write appends twice
Categories
(Core :: DOM: Core & HTML, defect, P1)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.4beta
People
(Reporter: jruderman, Assigned: bzbarsky)
References
(
URL
)
Details
Attachments
(1 file)
|
3.54 KB,
patch
|
hjtoi-bugzilla
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
Click the URL link above, which is:
javascript:x=window.open(); x.document.write("foo");
x.document.body.appendChild(x.document.createTextNode("bar")); void 0
Result: foobarbar
Expected: foobar
Workaround: call document.close() before calling appendChild.
Works as expected in IE.
Comment 1•23 years ago
|
||
The DOM ends up being correct here, but we end up showing "bar" twice. Peterv,
the sink context stack n' all that must not be flushed/synced properly here,
wanna have a look?
| Reporter | ||
Comment 2•23 years ago
|
||
Forgot to mention: selecting the second "bar" with the mouse actually selects
the first "bar".
| Assignee | ||
Comment 4•23 years ago
|
||
So the problem, imo, is that the sink's treatment of notifications is just
totally whacked. In particular, it assumes that if it's not in a script then
any notifications that are generated are caused by itself. This is patently
incorrect if another window/frame accesses the DOM during parsing (as here).
(And why exactly does the sink not call BeginUpdate itself? Not quite clear on
what the deal is there...)
| Assignee | ||
Comment 5•23 years ago
|
||
| Assignee | ||
Updated•23 years ago
|
Attachment #121069 -
Flags: superreview?(jst)
Attachment #121069 -
Flags: review?(heikki)
Updated•23 years ago
|
Attachment #121069 -
Flags: review?(heikki) → review+
Comment 6•23 years ago
|
||
Comment on attachment 121069 [details] [diff] [review]
This fixes this bug for me...
Hmm, this seems strangely correct to me, but it still scares me a bit (knowing
how many regressions we've had from messing with this code over the years).
sr=jst
Attachment #121069 -
Flags: superreview?(jst) → superreview+
| Assignee | ||
Comment 7•23 years ago
|
||
taking
Assignee: dom_bugs → bzbarsky
OS: Windows 2000 → All
Priority: -- → P1
Hardware: PC → All
Summary: appendChild during document.write appends twice → [FIXr]appendChild during document.write appends twice
Target Milestone: --- → mozilla1.4beta
| Assignee | ||
Comment 8•23 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•