Closed Bug 722406 Opened 12 years ago Closed 12 years ago

Cleanup nsHTMLEditor::SetCaretInTableCell

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Details

Attachments

(2 files)

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)
Attachment #592794 - Attachment is patch: true
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+
https://hg.mozilla.org/mozilla-central/rev/657cac6e1019
https://hg.mozilla.org/mozilla-central/rev/0f7aee23bc51
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: