Add some GetPriorNode/GetNextNode overloads that take nsINode

RESOLVED FIXED in mozilla15

Status

()

Core
Editor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

Trunk
mozilla15
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 619395 [details] [diff] [review]
Patch v1
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+
(Assignee)

Comment 2

5 years ago
https://hg.mozilla.org/mozilla-central/rev/e82ffc8184f7
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.