mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-12 18:50:08 +00:00
Bug 906979 - Make it possible again to force spell checking on text controls with spellcheck=false; r=roc
This commit is contained in:
parent
3005147418
commit
cb751a0c38
@ -65,6 +65,7 @@
|
||||
#include "nsEditor.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsITextControlElement.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
@ -1268,6 +1269,21 @@ mozInlineSpellChecker::SkipSpellCheckForNode(nsIEditor* aEditor,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Make sure that we can always turn on spell checking for inputs/textareas.
|
||||
// Note that because of the previous check, at this point we know that the
|
||||
// node is editable.
|
||||
if (content->IsInAnonymousSubtree()) {
|
||||
nsCOMPtr<nsIContent> node = content->GetParent();
|
||||
while (node && node->IsInNativeAnonymousSubtree()) {
|
||||
node = node->GetParent();
|
||||
}
|
||||
nsCOMPtr<nsITextControlElement> textControl = do_QueryInterface(node);
|
||||
if (textControl) {
|
||||
*checkSpelling = true;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// Get HTML element ancestor (might be aNode itself, although probably that
|
||||
// has to be a text node in real life here)
|
||||
nsCOMPtr<nsIDOMHTMLElement> htmlElement = do_QueryInterface(content);
|
||||
|
Loading…
x
Reference in New Issue
Block a user