Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Unified Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 2734793002: Expand FrameSelection::isInPasswordFiled() into call sites (Closed)
Patch Set: 2017-03-07T11:24:31 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3ce9536e6f79cd350201cd31130bd3514849f93c..2b61524db597a2b16c74803cf17c7e3fc1c1177b 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -283,12 +283,20 @@ bool Editor::canEditRichly() const {
// copy/paste (like divs, or a document body).
bool Editor::canDHTMLCut() {
- return !frame().selection().isInPasswordField() &&
+ // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
+ return !isInPasswordField(
+ frame().selection().computeVisibleSelectionInDOMTree().start()) &&
!dispatchCPPEvent(EventTypeNames::beforecut, DataTransferNumb);
}
bool Editor::canDHTMLCopy() {
- return !frame().selection().isInPasswordField() &&
+ // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
+ return !isInPasswordField(
+ frame().selection().computeVisibleSelectionInDOMTree().start()) &&
!dispatchCPPEvent(EventTypeNames::beforecopy, DataTransferNumb);
}
@@ -317,7 +325,8 @@ bool Editor::canCopy() const {
return true;
FrameSelection& selection = frame().selection();
return selection.computeVisibleSelectionInDOMTreeDeprecated().isRange() &&
- !selection.isInPasswordField();
+ !isInPasswordField(
+ frame().selection().computeVisibleSelectionInDOMTree().start());
}
bool Editor::canPaste() const {
@@ -442,14 +451,22 @@ void Editor::pasteAsFragment(DocumentFragment* pastingFragment,
}
bool Editor::tryDHTMLCopy() {
- if (frame().selection().isInPasswordField())
+ // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
+ if (isInPasswordField(
+ frame().selection().computeVisibleSelectionInDOMTree().start()))
return false;
return !dispatchCPPEvent(EventTypeNames::copy, DataTransferWritable);
}
bool Editor::tryDHTMLCut() {
- if (frame().selection().isInPasswordField())
+ // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
+ if (isInPasswordField(
+ frame().selection().computeVisibleSelectionInDOMTree().start()))
return false;
return !dispatchCPPEvent(EventTypeNames::cut, DataTransferWritable);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698