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

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

Issue 2702403004: Expand FrameSeleciton::start() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T12:32:36 Created 3 years, 10 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
Index: third_party/WebKit/Source/core/editing/FrameSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
index 32f757091bc7672b4cd4d36b70da3af669fd239d..c3a50370f1002c9f13d40face889f2ab41c86829 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -694,7 +694,8 @@ Range* FrameSelection::firstRange() const {
}
bool FrameSelection::isInPasswordField() const {
- TextControlElement* textControl = enclosingTextControl(start());
+ TextControlElement* textControl = enclosingTextControl(
+ computeVisibleSelectionInDOMTreeDeprecated().start());
return isHTMLInputElement(textControl) &&
toHTMLInputElement(textControl)->type() == InputTypeNames::password;
}
@@ -945,7 +946,7 @@ HTMLFormElement* FrameSelection::currentForm() const {
// selection is.
Node* start = document().focusedElement();
if (!start)
- start = this->start().anchorNode();
+ start = computeVisibleSelectionInDOMTreeDeprecated().start().anchorNode();
if (!start)
return 0;
@@ -986,7 +987,7 @@ void FrameSelection::revealSelection(const ScrollAlignment& alignment,
break;
}
- Position start = this->start();
+ Position start = computeVisibleSelectionInDOMTreeDeprecated().start();
DCHECK(start.anchorNode());
if (start.anchorNode() && start.anchorNode()->layoutObject()) {
// FIXME: This code only handles scrolling the startContainer's layer, but
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698