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

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

Issue 2706033011: Expand FrameSeleciton::rootEditableElement() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T12:50:05 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..87cc575035a736a6c195ccf7d97831fef4e885ba 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -166,7 +166,8 @@ const VisibleSelectionInFlatTree& FrameSelection::selectionInFlatTree() const {
void FrameSelection::moveCaretSelection(const IntPoint& point) {
DCHECK(!document().needsLayoutTreeUpdate());
- Element* const editable = rootEditableElement();
+ Element* const editable =
+ computeVisibleSelectionInDOMTree().rootEditableElement();
if (!editable)
return;
@@ -835,7 +836,8 @@ void FrameSelection::setFocusedNodeIfNeeded() {
if (isNone() || !isFocused())
return;
- if (Element* target = rootEditableElement()) {
+ if (Element* target =
+ computeVisibleSelectionInDOMTreeDeprecated().rootEditableElement()) {
// Walk up the DOM tree to search for a node to focus.
document().updateStyleAndLayoutTreeIgnorePendingStylesheets();
while (target) {
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.h ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698