mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 743819 - Only re-spellcheck new nodes on insertions, not everything; r=ehsan
This commit is contained in:
parent
4847455e2c
commit
e754f176cf
@ -9250,7 +9250,4 @@ nsHTMLEditRules::DocumentModifiedWorker()
|
||||
|
||||
// Try to recreate the bogus node if needed.
|
||||
CreateBogusNodeIfNeeded(selection);
|
||||
|
||||
// Reset the spell checker
|
||||
mEditor->SyncRealTimeSpell();
|
||||
}
|
||||
|
@ -3506,14 +3506,14 @@ NS_IMETHODIMP nsHTMLEditor::InsertTextImpl(const nsAString& aStringToInsert,
|
||||
void
|
||||
nsHTMLEditor::ContentAppended(nsIDocument *aDocument, nsIContent* aContainer,
|
||||
nsIContent* aFirstNewContent,
|
||||
PRInt32 /* unused */)
|
||||
PRInt32 aIndexInContainer)
|
||||
{
|
||||
ContentInserted(aDocument, aContainer, aFirstNewContent, 0);
|
||||
ContentInserted(aDocument, aContainer, aFirstNewContent, aIndexInContainer);
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLEditor::ContentInserted(nsIDocument *aDocument, nsIContent* aContainer,
|
||||
nsIContent* aChild, PRInt32 /* unused */)
|
||||
nsIContent* aChild, PRInt32 aIndexInContainer)
|
||||
{
|
||||
if (!aChild) {
|
||||
return;
|
||||
@ -3531,6 +3531,16 @@ nsHTMLEditor::ContentInserted(nsIDocument *aDocument, nsIContent* aContainer,
|
||||
return;
|
||||
}
|
||||
mRules->DocumentModified();
|
||||
|
||||
// Update spellcheck for only the newly-inserted node (bug 743819)
|
||||
if (mInlineSpellChecker) {
|
||||
nsRefPtr<nsRange> range = new nsRange();
|
||||
nsresult res = range->Set(aContainer, aIndexInContainer,
|
||||
aContainer, aIndexInContainer + 1);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
mInlineSpellChecker->SpellCheckRange(range);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user