Closed
Bug 1405039
Opened 7 years ago
Closed 7 years ago
Avoid using nsINode::GetChildAt() in HTMLEditor::GetSelectedElement()
Categories
(Core :: DOM: Editor, enhancement)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
Attachments
(1 file)
4.07 KB,
patch
|
masayuki
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•7 years ago
|
||
Attachment #8914405 -
Flags: review?(masayuki)
Comment 2•7 years ago
|
||
Comment on attachment 8914405 [details] [diff] [review]
Avoid using nsINode::GetChildAt() in HTMLEditor::GetSelectedElement()
>+nsIContent*
>+Selection::GetChildAtFocusOffset()
>+{
>+ if (!mAnchorFocusRange)
>+ return nullptr;
Put {}.
>@@ -2374,26 +2374,20 @@ HTMLEditor::GetSelectedElement(const nsAString& aTagName,
> }
>
> if (!bNodeFound) {
> if (isLinkTag) {
> // Link tag is a special case - we return the anchor node
> // found for any selection that is totally within a link,
> // included a collapsed selection (just a caret in a link)
> nsCOMPtr<nsINode> anchorNode = selection->GetAnchorNode();
>- int32_t anchorOffset = -1;
>- if (anchorNode) {
>- anchorOffset = selection->AnchorOffset();
>- }
>+ nsIContent* anchorChild = selection->GetChildAtAnchorOffset();
>
> nsCOMPtr<nsINode> focusNode = selection->GetFocusNode();
>- int32_t focusOffset = -1;
>- if (focusNode) {
>- focusOffset = selection->FocusOffset();
>- }
>+ nsIContent* focusChild = selection->GetChildAtAnchorOffset();
GetChildAtFocusOffset()?
Attachment #8914405 -
Flags: review?(masayuki) → review+
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/259952e0c0b0
Avoid using nsINode::GetChildAt() in HTMLEditor::GetSelectedElement(); r=masayuki
Comment 4•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Updated•6 years ago
|
Assignee: nobody → ehsan
You need to log in
before you can comment on or make changes to this bug.
Description
•