mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 743819 - Only re-spellcheck new nodes on insertions, not everything; r=ehsan
This commit is contained in:
parent
4d832b0653
commit
3f9b2b76b7
@ -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