Note: There are a few cases of duplicates in user autocompletion which are being worked on.

nsHTMLEditor::IsEmptyNodeImpl checks if the parent is a form widget instead of the child

RESOLVED FIXED in mozilla12

Status

()

Core
Editor
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ms2ger, Assigned: jhk)

Tracking

Trunk
mozilla12
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [good first bug][mentor=ehsan][lang=c++])

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
<http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/html/nsHTMLEditor.cpp#4958> has

4921   while (child)
4923     nsCOMPtr<nsIDOMNode> node = child;
4959           else if (nsHTMLEditUtils::IsFormWidget(aNode))
4960           { // break out if we find we aren't empty
4961             *outIsEmptyNode = false;
4962             return NS_OK;
4963           }

where it probably wants to check nsHTMLEditUtils::IsFormWidget(node). Ehsan, could you confirm?
(Reporter)

Comment 1

6 years ago
In fact, there's an early return for nsHTMLEditUtils::IsFormWidget(aNode) at line 4904.
(In reply to Ms2ger from comment #0)
> <http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/html/
> nsHTMLEditor.cpp#4958> has
> 
> 4921   while (child)
> 4923     nsCOMPtr<nsIDOMNode> node = child;
> 4959           else if (nsHTMLEditUtils::IsFormWidget(aNode))
> 4960           { // break out if we find we aren't empty
> 4961             *outIsEmptyNode = false;
> 4962             return NS_OK;
> 4963           }
> 
> where it probably wants to check nsHTMLEditUtils::IsFormWidget(node). Ehsan,
> could you confirm?

Yes, you're right.
Whiteboard: [good first bug][mentor=ehsan]

Updated

6 years ago
Whiteboard: [good first bug][mentor=ehsan] → [good first bug][mentor=ehsan][lang=c++]
(Assignee)

Comment 3

6 years ago
Created attachment 587274 [details] [diff] [review]
Patch
Assignee: nobody → jigneshhk1992
Attachment #587274 - Flags: review?(Ms2ger)
(Reporter)

Comment 4

6 years ago
Comment on attachment 587274 [details] [diff] [review]
Patch

Thanks, looks good.
Attachment #587274 - Flags: superreview?(ehsan)
Attachment #587274 - Flags: review?(Ms2ger)
Attachment #587274 - Flags: review+
Comment on attachment 587274 [details] [diff] [review]
Patch

Looks great, Jignesh, thanks a lot!  Do you have try server access?  Have you tested this patch on the try server?
Attachment #587274 - Flags: superreview?(ehsan) → superreview+
(Assignee)

Comment 6

6 years ago
> Do you have try server access?  Have
> you tested this patch on the try server?

No. I have applied for try access and will get it soon :).

Thanks!
(Reporter)

Comment 7

6 years ago
https://tbpl.mozilla.org/?tree=Try&rev=2289a605627e
(Reporter)

Comment 8

6 years ago
Thanks for the patch!

https://hg.mozilla.org/mozilla-central/rev/c42d08fdec34
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.