Closed
Bug 2243
Opened 26 years ago
Closed 25 years ago
{sink} appending text nodes to body does so twice
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
M14
People
(Reporter: tupshin, Assigned: vidur)
References
()
Details
(Whiteboard: [TESTCASE])
Attachments
(2 files)
<body>
<script>
mybody=document.getElementsByTagName('body');
my_text_node=document.createTextNode('this is a test');
mybody[0].appendChild(my_text_node);
mybody[0].appendChild(my_text_node);
</script>
</body>
The above code attempts to append my_text_node to the body element of the
document. Every time the appendChild method is called, the contents of
my_text_node shows up twice. In the above example it shows up four times.
Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
Comment 2•26 years ago
|
||
per leger, assigning QA contacts to all open bugs without QA contacts according
to list at http://bugzilla.mozilla.org/describecomponents.cgi?product=Browser
Additional info - the extra text seems to be inserted at the start of the
document. see http://steveapp.home.mindspring.com/mozillabug/DoubleText.html.
QA contact re-assigned according to the product areas we're currently working
on.
Assignee | ||
Updated•26 years ago
|
Target Milestone: M4 → M5
Assignee | ||
Comment 5•26 years ago
|
||
Troy, the problem occurs because the DOM insertion methods result in immediate
frame construction. This done before the document has finished loading. When the
document does finish loading, the HTMLContentSink does a ContentAppended
notification. Since it didn't know that content had been added by the DOM, it
causes frame construction to reoccur for the new content. Any thoughts?
Assignee | ||
Comment 6•26 years ago
|
||
Good catch! I have a fix in my local tree. Waiting for M4 to branch so I can
check it in for M5.
Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 7•26 years ago
|
||
Fix checked in on 4/13. Content added via the DOM during document loading could
result in multiple frames being created for each element. This was because the
DOM would cause immediate creation of frames and the HTML content sink does
incremental layout. We now update the sink's notion of what's laid out every
time a script is evaluated.
(this was an XP bug)
verified on the M4 builds on RedHat 5.2, MacOS 8.51, and WinNT 4 sp4
(M4 builds have id's 1999-04-1[34])
Assignee | ||
Comment 9•26 years ago
|
||
Not sure how this was verified on M4 when I checked it in on 4/13 into the tip.
Comment 10•26 years ago
|
||
ok, somebody put crack in my cereal.
Comment 11•26 years ago
|
||
sorry about that. i could have sworn it was fixed.
(bad qa engineer!)
Comment 12•26 years ago
|
||
ok, i swear this time.
verified on:
RedHat 5.2 i386 build 1999-04-15-08
WinNT 4.0 sp 4 build 1999-04-15-08
MacOS 8.51 build 1999-04-15-08
Comment 13•26 years ago
|
||
the behavior reappeared recently.
builds tested:
1999-05-17-08 RedHat 5.2 i386 apprunner
1999-05-17-09 MacOS 8.51 apprunner
1999-05-17-08 WinNT 4 sp3 apprunner
new testcase:
same as the old testcase, but add a 'document.write("<br>");' just
before the script closes:
<BODY>
<SCRIPT type="text/javascript">
var oBody = document.getElementsByTagName('BODY').item(0);
var txt1 = document.createTextNode( "this is a test." );
oBody.appendChild( txt1 );
document.write( "<BR>" );
</SCRIPT>
</BODY>
Assignee | ||
Updated•26 years ago
|
Status: REOPENED → ASSIGNED
Target Milestone: M5 → M7
Assignee | ||
Comment 14•26 years ago
|
||
Hmmm....related to bug 6092.
The logic I worked out for the original bug doesn't work for a mixture of
document.written and DOM-added content. Back to the drawing board. *sigh*
Assignee | ||
Comment 15•26 years ago
|
||
Assignee | ||
Comment 16•26 years ago
|
||
Oops, added the attachment ot the wrong bug.
Assignee | ||
Updated•26 years ago
|
Assignee: vidur → peterl
Status: ASSIGNED → NEW
Target Milestone: M7
Assignee | ||
Comment 17•26 years ago
|
||
Peter, this is the bug that I mentioned the other day w.r.t. the way the
HTMLContentSink adds content to the document. I'm reassigning it to you so that
you can keep it in mind when you rework that code. Note that there is code in
the HTMLContentSink (PreEvaluateScript() and PostEvaluateScript()) that attempt
to deal with DOM additions while the document is loading. Unfortunately, they
don't deal with all cases. Let's talk if you have questions about DOM
expectations.
Comment 18•26 years ago
|
||
Updated•26 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M8
Updated•26 years ago
|
Target Milestone: M8 → M9
Comment 19•26 years ago
|
||
*** Bug 6092 has been marked as a duplicate of this bug. ***
Comment 20•26 years ago
|
||
If you try using the mouse to select the text only 1 of them will be highlighted
Updated•26 years ago
|
Whiteboard: [TESTCASE]
Updated•26 years ago
|
Summary: appending text nodes to body does so twice → {sink} appending text nodes to body does so twice
Target Milestone: M9 → M10
Comment 21•26 years ago
|
||
Moving all content sink issues to M14.
Comment 22•26 years ago
|
||
Make that M14.
Comment 23•25 years ago
|
||
Thanks for taking this Vidur. Many of these are likely dups. I haven't marked
them as such to make sure I had the testcases handy...
Assignee | ||
Updated•25 years ago
|
Status: NEW → RESOLVED
Closed: 26 years ago → 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 24•25 years ago
|
||
Fixed with sink changes on 10/26/1999.
Comment 25•25 years ago
|
||
The original bug is not very clear to me. Is the first testcase (supplied by
originator) *supposed* to append the text twice (once for each appendChild)? Or
is it only supposed to append the text once, in spite of how many times it is
appended?
Assignee | ||
Comment 26•25 years ago
|
||
The original test case appended the same text node twice. As a result, it should
only show up once in the content model and on screen.
The revised test case from Peter mixes an append and a document.write. Both
should show up in the content model.
Comment 27•25 years ago
|
||
Coolness.
Marking VERIFIED FIXED on:
- Linux6 2000-02-21-08 Commercial build
- MacOS9 2000-02-21-08 Commercial build
- Win98 2000-02-21-08 Commercial build
Status: RESOLVED → VERIFIED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•