| Index: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
|
| index 1e9624648685cc427e3049534186dbf33101a584..c0f3e0c6d2cd7a36900d216d5d35552d262fe1b4 100644
|
| --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
|
| @@ -76,12 +76,16 @@ bool isPositionInTextArea(const Position& position) {
|
| static bool isSpellCheckingEnabledFor(const Position& position) {
|
| if (position.isNull())
|
| return false;
|
| - // TODO(tkent): The following password type check should be done in
|
| - // HTMLElement::spellcheck(). crbug.com/371567
|
| if (TextControlElement* textControl = enclosingTextControl(position)) {
|
| - if (isHTMLInputElement(textControl) &&
|
| - toHTMLInputElement(textControl)->type() == InputTypeNames::password)
|
| - return false;
|
| + if (isHTMLInputElement(textControl)) {
|
| + HTMLInputElement& input = toHTMLInputElement(*textControl);
|
| + // TODO(tkent): The following password type check should be done in
|
| + // HTMLElement::spellcheck(). crbug.com/371567
|
| + if (input.type() == InputTypeNames::password)
|
| + return false;
|
| + if (!input.isFocusedElementInDocument())
|
| + return false;
|
| + }
|
| }
|
| if (HTMLElement* element =
|
| Traversal<HTMLElement>::firstAncestorOrSelf(*position.anchorNode())) {
|
|
|