Closed
Bug 276880
Opened 20 years ago
Closed 20 years ago
[FIXr]accessing textContent property of dynamically created node not yet inserted into the document causes NS_ERROR_FAILURE error
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
VERIFIED
FIXED
mozilla1.8alpha6
People
(Reporter: martin.honnen, Assigned: bzbarsky)
References
Details
Attachments
(2 files)
1.77 KB,
text/html
|
Details | |
982 bytes,
patch
|
peterv
:
review+
peterv
:
superreview+
|
Details | Diff | Splinter Review |
The W3C DOM Level 3 Core specification in <http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-textContent> defines a property textContent for nodes and according to https://bugzilla.mozilla.org/show_bug.cgi?id=210451 Christopher A. Aillon implemented that property in Mozilla. However when I try to access that property on a dynamically created node (in the test case an element node) that has not yet been inserted into the document then Mozilla throws an error: Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOM3Node.textContent]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://localhost/javascript/test2005010302.html :: testReading :: line 12" data: no] Source File: http://localhost/javascript/test2005010302.html Line: 12 That happens with both Mozilla 1.7.5 (the latest release at the time of this bug report) as well as with the current nightly (which is Mozilla 1.8a6 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a6) Gecko/20050102). I do not see anything in the DOM specification that suggests that accessing the property on a node not inserted into the document should cause an error therefore I file this bug. I am going to attach the test case next.
Reporter | ||
Comment 1•20 years ago
|
||
Comment 2•20 years ago
|
||
Maybe nsNode3Tearoff::GetTextContent should use GetOwnerDocument instead of GetDocument?
Summary: accessing textContent property of dynamically created node not yet inserted into the document causes NS_ERROR_FAILURE error → accessing textContent property of dynamically created node not yet inserted into the document causes NS_ERROR_FAILURE error
Assignee | ||
Comment 3•20 years ago
|
||
Assignee: general → bzbarsky
Status: NEW → ASSIGNED
Attachment #170163 -
Flags: superreview?(peterv)
Attachment #170163 -
Flags: review?(peterv)
Assignee | ||
Updated•20 years ago
|
Summary: accessing textContent property of dynamically created node not yet inserted into the document causes NS_ERROR_FAILURE error → [FIX]accessing textContent property of dynamically created node not yet inserted into the document causes NS_ERROR_FAILURE error
Target Milestone: --- → mozilla1.8beta
Updated•20 years ago
|
Attachment #170163 -
Flags: superreview?(peterv)
Attachment #170163 -
Flags: superreview+
Attachment #170163 -
Flags: review?(peterv)
Attachment #170163 -
Flags: review+
Assignee | ||
Updated•20 years ago
|
Summary: [FIX]accessing textContent property of dynamically created node not yet inserted into the document causes NS_ERROR_FAILURE error → [FIXr]accessing textContent property of dynamically created node not yet inserted into the document causes NS_ERROR_FAILURE error
Assignee | ||
Comment 4•20 years ago
|
||
Fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.8beta → mozilla1.8alpha6
Reporter | ||
Comment 5•20 years ago
|
||
Verified that test case https://bugzilla.mozilla.org/attachment.cgi?id=170158 now works with Mozilla 1.8a6 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a6) Gecko/20050105).
Status: RESOLVED → VERIFIED
Comment 6•19 years ago
|
||
*** Bug 296101 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•