Use nsINode in IsEmptyNodeImpl/IsVisTextNode/IsEmptyCell

RESOLVED FIXED in mozilla12

Status

()

Core
Editor
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

Trunk
mozilla12
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Assignee)

Description

6 years ago
Created attachment 588611 [details] [diff] [review]
Part a: IsEmptyNodeImpl
Attachment #588611 - Flags: review?(ehsan)
(Assignee)

Comment 1

6 years ago
Created attachment 588612 [details] [diff] [review]
Part b: IsVisTextNode
Attachment #588612 - Flags: review?(ehsan)
(Assignee)

Comment 2

6 years ago
Created attachment 588613 [details] [diff] [review]
Part c: IsEmptyCell
Attachment #588613 - Flags: review?(ehsan)
Attachment #588611 - Flags: review?(ehsan) → review+
Comment on attachment 588612 [details] [diff] [review]
Part b: IsVisTextNode

Review of attachment 588612 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/public/nsISelectionController.idl
@@ +50,5 @@
>  interface nsIDOMNode;
>  interface nsISelection;
>  interface nsISelectionDisplay;
>  
>  [scriptable, uuid(cf30315f-b65d-44c3-8c57-557e36d18fd2)]

Rev the uuid please.

::: editor/libeditor/html/nsHTMLEditRules.cpp
@@ +2443,5 @@
>              arrayOfNodes.RemoveObjectAt(0);
>              // If something visible is deleted, no need to join.
>              // Visible means all nodes except non-visible textnodes and breaks.
>              if (join && origCollapsed) {
> +              nsCOMPtr<nsINode> node = do_QueryInterface(somenode);

Couldn't you cast directly to nsIContent?
Attachment #588612 - Flags: review?(ehsan) → review+
Attachment #588613 - Flags: review?(ehsan) → review+
(Assignee)

Comment 4

6 years ago
  nsCOMPtr<nsIContent> content = do_QueryInterface(somenode);
  if (!content) {
    join = false;
  } else if (content->NodeType() == nsIDOMNode::TEXT_NODE) {
    mHTMLEditor->IsVisTextNode(content,
                               &join, true);
  } else {
    join = content->AsElement()->IsHTML(nsGkAtoms::br) &&
           !mHTMLEditor->IsVisBreak(somenode);
  }

then?
(Assignee)

Comment 5

6 years ago
s/AsElement()->//
Yes!
(Assignee)

Comment 7

6 years ago
https://hg.mozilla.org/mozilla-central/rev/46fce3248ec9
https://hg.mozilla.org/mozilla-central/rev/677e38a3838c
https://hg.mozilla.org/mozilla-central/rev/70991ab26e20
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.