Closed Bug 1408829 Opened 2 years ago Closed 2 years ago

Make spellCheckAfterEditorChange as noscript

Categories

(Core :: DOM: Editor, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox58 --- wontfix
firefox59 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

Details

Attachments

(1 file)

No addons (searching from DXR), comm-central and bluegriffon don't use spellCheckAfterEditorChange from script.  So we should change it to noscript to reduce QI (from nsIDOMNode to nsINode).
/No addons/Adddons/
Priority: -- → P3
Comment on attachment 8932774 [details]
Bug 1408829 - Make spellCheckAfterEditorChange as noscript.

https://reviewboard.mozilla.org/r/203834/#review209312

::: extensions/spellcheck/src/mozInlineSpellChecker.cpp:450
(Diff revision 1)
> -  *aRange = nullptr;
> -  nsCOMPtr<nsINode> documentNode = do_QueryInterface(aDocument);
> -  RefPtr<nsRange> range = new nsRange(documentNode);
> +  nsCOMPtr<nsIDocument> document = GetDocument();
> +  if (NS_WARN_IF(!document)) {
> +    return nullptr;
> +  }
>  
> -  nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
> +  RefPtr<nsRange> range = new nsRange(document);

Hmm, just doing |nsRange(aNode)| should return same result. However, it's okay to keep current behavior.
Attachment #8932774 - Flags: review?(masayuki) → review+
Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/a43aa3c928c8
Make spellCheckAfterEditorChange as noscript. r=masayuki
https://hg.mozilla.org/mozilla-central/rev/a43aa3c928c8
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.