Closed
Bug 869006
Opened 12 years ago
Closed 12 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•12 years ago
|
Assignee: nobody → amarchesini
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #747919 -
Flags: review?(Ms2ger)
Comment 2•12 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•12 years ago
|
||
Attachment #747919 -
Attachment is obsolete: true
Attachment #747919 -
Flags: review?(Ms2ger)
Attachment #747928 -
Flags: review?(Ms2ger)
![]() |
||
Comment 4•12 years ago
|
||
Once you know window and doc are not null, why not just call createComment on the doc?
Assignee | ||
Comment 5•12 years ago
|
||
Assignee | ||
Comment 6•12 years ago
|
||
green on try
Attachment #747928 -
Attachment is obsolete: true
Attachment #747928 -
Flags: review?(Ms2ger)
Attachment #748022 -
Flags: review?(Ms2ger)
Assignee | ||
Updated•12 years ago
|
Summary: Comment should be consructable → Comment should be constructable
Comment 7•12 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•12 years ago
|
Keywords: checkin-needed
Comment 8•12 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Comment 9•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Updated•12 years ago
|
Keywords: dev-doc-needed
Comment 10•12 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
•