| Index: third_party/WebKit/Source/core/editing/Editor.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
|
| index e4e310ba992fcf14ebfbcff1c3287c593e68e7e1..00be47ddd064b6e42079e02b2811908908def864 100644
|
| --- a/third_party/WebKit/Source/core/editing/Editor.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/Editor.cpp
|
| @@ -30,6 +30,7 @@
|
| #include "core/CSSPropertyNames.h"
|
| #include "core/EventNames.h"
|
| #include "core/HTMLNames.h"
|
| +#include "core/InputTypeNames.h"
|
| #include "core/clipboard/DataObject.h"
|
| #include "core/clipboard/DataTransfer.h"
|
| #include "core/clipboard/Pasteboard.h"
|
| @@ -135,6 +136,15 @@ InputEvent::EventIsComposing isComposingFromCommand(
|
| return InputEvent::EventIsComposing::NotComposing;
|
| }
|
|
|
| +bool isInPasswordFieldWithUnrevealedPassword(const Position& position) {
|
| + TextControlElement* textControl = enclosingTextControl(position);
|
| + if (!isHTMLInputElement(textControl))
|
| + return false;
|
| + HTMLInputElement* input = toHTMLInputElement(textControl);
|
| + return (input->type() == InputTypeNames::password) &&
|
| + !input->shouldRevealPassword();
|
| +}
|
| +
|
| } // anonymous namespace
|
|
|
| Editor::RevealSelectionScope::RevealSelectionScope(Editor* editor)
|
| @@ -325,7 +335,7 @@ bool Editor::canCopy() const {
|
| return true;
|
| FrameSelection& selection = frame().selection();
|
| return selection.computeVisibleSelectionInDOMTreeDeprecated().isRange() &&
|
| - !isInPasswordField(
|
| + !isInPasswordFieldWithUnrevealedPassword(
|
| frame().selection().computeVisibleSelectionInDOMTree().start());
|
| }
|
|
|
|
|