Closed
Bug 869006
Opened 11 years ago
Closed 11 years ago
Comment should be constructable
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: erik, Assigned: baku)
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 2 obsolete files)
3.98 KB,
patch
|
Ms2ger
:
review+
|
Details | Diff | Splinter Review |
http://dom.spec.whatwg.org/#comment Make Comment constructable so that one can do "new Comment('abc')" instead of "document.createComment('abc')"
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → amarchesini
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #747919 -
Flags: review?(Ms2ger)
Comment 2•11 years ago
|
||
Comment on attachment 747919 [details] [diff] [review] patch Review of attachment 747919 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/base/src/Comment.cpp @@ +64,5 @@ > +Comment::Constructor(const GlobalObject& aGlobal, const nsAString& aData, > + ErrorResult& aRv) > +{ > + nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.Get()); > + nsRefPtr<Comment> comment = new Comment(window->GetDoc()->NodeInfoManager()); Null-check window and window->GetDoc() ::: content/base/test/test_bug869006.html @@ +20,5 @@ > + > +/** Test for Bug 869006 **/ > + > +var c = new Comment(); > +ok(c, "Comment has been created without content"); Test c.data. @@ +23,5 @@ > +var c = new Comment(); > +ok(c, "Comment has been created without content"); > + > +c = new Comment('foo'); > +ok(c, "Comment has been created"); Here too
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #747919 -
Attachment is obsolete: true
Attachment #747919 -
Flags: review?(Ms2ger)
Attachment #747928 -
Flags: review?(Ms2ger)
![]() |
||
Comment 4•11 years ago
|
||
Once you know window and doc are not null, why not just call createComment on the doc?
Assignee | ||
Comment 5•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=78c025a6f8e5
Assignee | ||
Comment 6•11 years ago
|
||
green on try
Attachment #747928 -
Attachment is obsolete: true
Attachment #747928 -
Flags: review?(Ms2ger)
Attachment #748022 -
Flags: review?(Ms2ger)
Assignee | ||
Updated•11 years ago
|
Summary: Comment should be consructable → Comment should be constructable
Comment 7•11 years ago
|
||
Comment on attachment 748022 [details] [diff] [review] patch Review of attachment 748022 [details] [diff] [review]: ----------------------------------------------------------------- lgtm
Attachment #748022 -
Flags: review?(Ms2ger) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 8•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3411817d911f
Flags: in-testsuite+
Keywords: checkin-needed
Comment 9•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3411817d911f
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Updated•11 years ago
|
Keywords: dev-doc-needed
Comment 10•10 years ago
|
||
Docs: https://developer.mozilla.org/en-US/docs/Web/API/Comment https://developer.mozilla.org/en-US/docs/Web/API/Comment.Comment and https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/24
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•