Closed Bug 750064 Opened 12 years ago Closed 12 years ago

Add some GetPriorNode/GetNextNode overloads that take nsINode

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Details

Attachments

(1 file)

Attached patch Patch v1Splinter Review
      No description provided.
Attachment #619395 - Flags: review?(ehsan)
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
Attachment #619395 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/e82ffc8184f7
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: