Closed
Bug 323745
Opened 19 years ago
Closed 19 years ago
DOM replaceChild() function is broken for top-level elements
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 297801
People
(Reporter: porton, Unassigned)
Details
(Keywords: regression)
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.8) Gecko/20051118 Debian/1.4.99+1.5rc3.dfsg-1 Firefox/1.5 Build Identifier: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.8) Gecko/20051118 Debian/1.4.99+1.5rc3.dfsg-1 Firefox/1.5 The following XHTML file shows nothing instead of showing "Para" paragraph as it should. The bug is that .replaceChild() function in this context does not work as expected. I have quickly reviewed the DOM2 standard and concluded that it should work accordingly the standard. In any case it should work in our browser. Note that the bug appears in both case if the below file is saved as .html or as .xml (XHTML). <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test</title> <script type="text/javascript"> function on_load() { document.replaceChild(document.documentElement.cloneNode(true), document.documentElement); } </script> </head> <body onload="on_load()"> <p>Para</p> </body> </html> Reproducible: Always Steps to Reproduce: 1. Save the above file either as .html or .xml 2. Open the file with the browser. Actual Results: Empty content area. Expected Results: "Para" paragraph in the content area. So I know no any good method to replace the loaded a HTML or XML document with an other DOM document.
Comment 1•19 years ago
|
||
About your testcase: I see the word Para in 1.0.7 and in trunk but not in the 1.5 release and in branch.
Comment 2•19 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060116 Firefox/1.6a1 ID:2006011623
Comment 3•19 years ago
|
||
1.8b5_2005093011 w 1.8b5_2005093021 f http://tinderbox.mozilla.org/bonsai/cvsquery.cgi?treeid=default&module=AviarySuiteBranchTinderbox&branch=MOZILLA_1_8_BRANCH&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2005-09-30+10%3A00%3A00&maxdate=2005-09-30+21%3A00%3A00&cvsroot=%2Fcvsroot
Comment 4•19 years ago
|
||
So this is a 1.8 branch regression, I tested with a 1.8 branch nightly and recent trunk build, the text is not visible only in a branch build. The node is there, according to DOM inspector, but it's not rendered.
Assignee: nobody → general
Status: UNCONFIRMED → NEW
Component: General → DOM
Ever confirmed: true
Keywords: regression
OS: Linux → All
Product: Firefox → Core
QA Contact: general → ian
Hardware: PC → All
Version: unspecified → 1.8 Branch
Comment 5•19 years ago
|
||
It has also regressed on trunk, but something fixed it: 1.9a1_2006011205 fails 1.9a1_2006011214 works http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=PhoenixTinderbox&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2006-01-12+04%3A00%3A00&maxdate=2006-01-12+14%3A00%3A00&cvsroot=%2Fcvsroot
Comment 6•19 years ago
|
||
So this particular testcase "broke" when we started actually following the DOM spec for manipulation of document child lists (bug 278472). On trunk, this was fixed by the fix for bug 297801. So this is basically a duplicate of bug 297801; marking so. Note that bug 297801 was filed about three months before the fix for bug 278472 was checked in, so things were quite nicely broken even without the help of bug 278472; all that changed is behavior on this specific testcase. If someone wants to figure out how this testcase (which used to work somehow) differs from the one in bug 297801 (which didn't work), that would be nice too. *** This bug has been marked as a duplicate of 297801 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•