RESOLVED FIXED 5572
Implement textContent property
https://bugs.webkit.org/show_bug.cgi?id=5572
Summary Implement textContent property
Anders Carlsson
Reported Monday, October 31, 2005 6:44:15 PM UTC
In DOM3, nodes have a textContent property. This should be implemented in order to pass more of the DOM3 test cases.
Attachments
Implement textContent (18.57 KB, patch)
2005-10-31 10:45 PST, Anders Carlsson
darin: review-
Address comments (18.51 KB, patch)
2005-11-01 00:42 PST, Anders Carlsson
darin: review+
Anders Carlsson
Comment 1 Monday, October 31, 2005 6:45:11 PM UTC
Created attachment 4542 [details] Implement textContent
Eric Seidel (no email)
Comment 2 Monday, October 31, 2005 7:00:06 PM UTC
Looks great! I think i'd like a secondary approval from hyatt, darin or mjs though.
Darin Adler
Comment 3 Tuesday, November 1, 2005 2:28:28 AM UTC
Comment on attachment 4542 [details] Implement textContent The check of value->isNull() in TextContent makes me think two things: 1) I'd like a helper routine that creates a DOMString that handles the JavaScript null case in this way. I'm sure there are other functions like this one elsewhere in the DOM. 2) What about undefined? Should undefined set the text contents to "undefined"? If not, then it should be isUndefinedOrNull() rather than isNull(). I think the code in NodeImpl::textContent and setTextContent cries out for either a switch statement or a virtual function. The code here is not the same as in setInnerText, but it should be. If they shared code, then we would have the empty text check in both places (setInnerText currently lacks it). The check of text.isNull() should be a check of text.isEmpty() I believe (unless I'm missing something).
Anders Carlsson
Comment 4 Tuesday, November 1, 2005 8:42:06 AM UTC
(In reply to comment #3) > (From update of attachment 4542 [details] [edit]) > The check of value->isNull() in TextContent makes me think two things: > > 1) I'd like a helper routine that creates a DOMString that handles the > JavaScript null case in this way. I'm sure there are other functions like this > one elsewhere in the DOM. I can't find any other functions like this so I think I'll just let it be. > > 2) What about undefined? Should undefined set the text contents to "undefined"? > If not, then it should be isUndefinedOrNull() rather than isNull(). > I think it makes more sense to set the text to "undefined". This is what Mozilla does. > I think the code in NodeImpl::textContent and setTextContent cries out for > either a switch statement or a virtual function. > Yeah, I've changed it to do that. > The code here is not the same as in setInnerText, but it should be. If they > shared code, then we would have the empty text check in both places > (setInnerText currently lacks it). > They should not be the same. setInnerText should ideally do parsing (converting \n to <br> for example) but setTextContent shouldn't do that so I'd rather have them separate functions. > The check of text.isNull() should be a check of text.isEmpty() I believe > (unless I'm missing something). > Yeah, that's correct. I've changed it.
Anders Carlsson
Comment 5 Tuesday, November 1, 2005 8:42:41 AM UTC
Created attachment 4547 [details] Address comments
Darin Adler
Comment 6 Tuesday, November 1, 2005 4:37:40 PM UTC
Comment on attachment 4547 [details] Address comments r=me
Lucas Forschler
Comment 7 Wednesday, February 6, 2019 5:03:28 PM UTC
Mass moving XML DOM bugs to the "DOM" Component.
Note You need to log in before you can comment on or make changes to this bug.