Last Comment Bug 750064 - Add some GetPriorNode/GetNextNode overloads that take nsINode
: Add some GetPriorNode/GetNextNode overloads that take nsINode
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla15
Assigned To: :Ms2ger
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-29 07:18 PDT by :Ms2ger
Modified: 2012-05-05 10:28 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (11.93 KB, patch)
2012-04-29 07:18 PDT, :Ms2ger
ehsan: review+
Details | Diff | Review

Description :Ms2ger 2012-04-29 07:18:34 PDT
Created attachment 619395 [details] [diff] [review]
Patch v1
Comment 1 :Ehsan Akhgari (busy, don't ask for review please) 2012-04-30 10:58:14 PDT
Comment on attachment 619395 [details] [diff] [review]
Patch v1

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

::: editor/libeditor/base/nsEditor.cpp
@@ +3187,5 @@
> +  // look before it.
> +  if (!aOffset || aParentNode->NodeType() == nsIDOMNode::TEXT_NODE) {
> +    if (aNoBlockCrossing && IsBlockNode(aParentNode)) {
> +      // If we aren't allowed to cross blocks, don't look before this block.
> +      return NULL;

Nit: nsnull.

@@ +3195,4 @@
>    }
>  
>    // else look before the child at 'aOffset'
> +  if (nsIContent* child = aParentNode->GetChildAt(aOffset)) {

Please avoid assigning to variables inside if conditions.

@@ +3262,4 @@
>      }
> +
> +    if (!IsDescendantOfBody(resultNode)) {
> +      return NULL;

Nit: nsnull.

::: editor/libeditor/base/nsEditor.h
@@ +463,5 @@
>                          bool         bNoBlockCrossing = false,
>                          nsIContent  *aActiveEditorRoot = nsnull);
> +  nsIContent* GetPriorNode(nsINode* aCurrentNode, bool aEditableNode,
> +                           bool aNoBlockCrossing = false,
> +                           nsIContent* aActiveEditorRoot = NULL);

Nit: nsnull

@@ +476,5 @@
> +  nsIContent* GetPriorNode(nsINode* aParentNode,
> +                           PRInt32 aOffset,
> +                           bool aEditableNode,
> +                           bool aNoBlockCrossing = false,
> +                           nsIContent* aActiveEditorRoot = NULL);

Nit: nsnull

@@ +507,5 @@
> +  nsIContent* GetNextNode(nsINode* aParentNode,
> +                          PRInt32 aOffset,
> +                          bool aEditableNode,
> +                          bool aNoBlockCrossing = false,
> +                          nsIContent* aActiveEditorRoot = NULL);

Nit: nsnull

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