Last Comment Bug 718170 - Use nsINode in IsEmptyNodeImpl/IsVisTextNode/IsEmptyCell
: Use nsINode in IsEmptyNodeImpl/IsVisTextNode/IsEmptyCell
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla12
Assigned To: :Ms2ger (⌚ UTC+1/+2)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-14 01:10 PST by :Ms2ger (⌚ UTC+1/+2)
Modified: 2012-01-25 07:34 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Part a: IsEmptyNodeImpl (20.73 KB, patch)
2012-01-14 01:10 PST, :Ms2ger (⌚ UTC+1/+2)
ehsan: review+
Details | Diff | Splinter Review
Part b: IsVisTextNode (13.64 KB, patch)
2012-01-14 01:11 PST, :Ms2ger (⌚ UTC+1/+2)
ehsan: review+
Details | Diff | Splinter Review
Part c: IsEmptyCell (5.09 KB, patch)
2012-01-14 01:11 PST, :Ms2ger (⌚ UTC+1/+2)
ehsan: review+
Details | Diff | Splinter Review

Description :Ms2ger (⌚ UTC+1/+2) 2012-01-14 01:10:54 PST
Created attachment 588611 [details] [diff] [review]
Part a: IsEmptyNodeImpl
Comment 1 :Ms2ger (⌚ UTC+1/+2) 2012-01-14 01:11:31 PST
Created attachment 588612 [details] [diff] [review]
Part b: IsVisTextNode
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2012-01-14 01:11:59 PST
Created attachment 588613 [details] [diff] [review]
Part c: IsEmptyCell
Comment 3 :Ehsan Akhgari 2012-01-16 10:25:13 PST
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?
Comment 4 :Ms2ger (⌚ UTC+1/+2) 2012-01-16 10:39:02 PST
  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?
Comment 5 :Ms2ger (⌚ UTC+1/+2) 2012-01-16 10:42:12 PST
s/AsElement()->//
Comment 6 :Ehsan Akhgari 2012-01-16 10:46:34 PST
Yes!

Note You need to log in before you can comment on or make changes to this bug.