Closed Bug 801404 Opened 12 years ago Closed 12 years ago

DocumentType.textContent needs to be null, not ""

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: ayg, Assigned: ayg)

References

Details

Attachments

(1 file)

data:text/html,<!DOCTYPE html> <script> document.documentElement.textContent = typeof document.doctype.textContent + " " + document.doctype.textContent; </script> Should be "object null" per spec and all other browsers. Is actually "string ". I stared at the code for a while and didn't figure out what the problem was, until Ms2ger helpfully pointed out that nsGenericDOMDataNode::GetTextContent's call to GetValue() actually called a non-virtual method of nsGenericDOMDataNode by that name, not the virtual method that was overridden in derived classes. I don't suppose we can get the compiler to emit warnings when a non-virtual method is defined with the same name as a method in a base or derived class, by any chance? This will be tested by <http://w3c-test.org/webapps/DOMCore/tests/approved/Node-properties.html> as soon as I update it upstream and it gets synced back down to us, so marking in-testsuite+.
Flags: in-testsuite+
Attached patch Patch (deleted) — Splinter Review
This is quite unlikely to break any tests, but I figured a one-platform run would be reasonable anyway: https://tbpl.mozilla.org/?tree=Try&rev=0e5a32245865
Attachment #671209 - Flags: review?(bzbarsky)
Comment on attachment 671209 [details] [diff] [review] Patch This conflicts with the patch in bug 773780. Please coordinate with Peter what order we want to do this in? Personally, I'd prefer people stop bitrotting his patch so he can land it... ;)
This patch is trivial and not very important, so if he's actively working on his patch, he can go ahead and land first. It's not exactly much effort for me to rewrite this from scratch if need be.
Depends on: 773780
Comment on attachment 671209 [details] [diff] [review] Patch Please do this on top of Peter's patch.
Attachment #671209 - Flags: review?(bzbarsky) → review-
Test now passes -- someone fixed this at some point.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: