Cleanup nsHTMLEditor::SetCaretInTableCell

RESOLVED FIXED in mozilla13

Status

()

Core
Editor
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

Trunk
mozilla13
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

6 years ago
Created attachment 592794 [details] [diff] [review]
Part a: Introduce nsISelection::CollapseNative

Editor often calls nsISelection::Collapse, and increasingly has nsINodes to pass, so it makes sense to allow passing an nsINode directly.
Attachment #592794 - Flags: review?(bugs)
(Assignee)

Updated

6 years ago
Attachment #592794 - Attachment is patch: true
(Assignee)

Comment 1

6 years ago
Created attachment 592795 [details] [diff] [review]
Part b: Cleanup nsHTMLEditor::SetCaretInTableCell
Attachment #592795 - Flags: review?(ehsan)

Comment 2

6 years ago
Comment on attachment 592794 [details] [diff] [review]
Part a: Introduce nsISelection::CollapseNative

update uuid
Attachment #592794 - Flags: review?(bugs) → review+
Comment on attachment 592795 [details] [diff] [review]
Part b: Cleanup nsHTMLEditor::SetCaretInTableCell

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

::: editor/libeditor/html/nsHTMLEditor.cpp
@@ +4038,5 @@
> +  if (!content || !content->IsHTML()) {
> +    return false;
> +  }
> +
> +  // REVIEW NOTE: this didn't handle th before

Noted.  Please remove this comment.  :-)

@@ +4043,5 @@
> +  if (!nsHTMLEditUtils::IsTableElement(content->AsElement())) {
> +    return false;
> +  }
> +
> +  // Find deepest child

This is actually a lie, isn't it?  ;-)  I'd remove this comment, since it's pretty evident what the loop is doing.

@@ +4049,5 @@
> +  while (node->HasChildren()) {
> +    node = node->GetFirstChild();
> +  }
> +
> +  // Set selection at beginning of deepest node

s/deepest/the found/
Attachment #592795 - Flags: review?(ehsan) → review+
(Assignee)

Comment 4

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