Closed Bug 718170 Opened 12 years ago Closed 12 years ago

Use nsINode in IsEmptyNodeImpl/IsVisTextNode/IsEmptyCell

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Details

Attachments

(3 files)

      No description provided.
Attachment #588611 - Flags: review?(ehsan)
Attachment #588612 - Flags: review?(ehsan)
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+
  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?
s/AsElement()->//
Yes!
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
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: