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

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

Issue 2710883002: Expand FrameSeleciton::isNone() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-23T16:27:43 rebase to resolve conflict with DOMSelection in r452402 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/DOMSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
index b3c2e3b205ea2611a44d4dca631320125766c83d..4540f0f6369de4b28cfb82f37fc318da948c1a68 100644
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -204,7 +204,10 @@ unsigned DOMSelection::rangeCount() const {
return 0;
if (documentCachedRange())
return 1;
- if (frame()->selection().isNone())
+ if (frame()
+ ->selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .isNone())
return 0;
// Any selection can be adjusted to Range for Document.
if (isSelectionOfDocument())
@@ -463,7 +466,11 @@ void DOMSelection::extend(Node* node,
LOG(FATAL)
<< "Selection has a cached Range, but anchorPosition is null. start="
<< range->startContainer() << " end=" << range->endContainer();
- } else if (frame() && !frame()->selection().isNone()) {
+ } else if (frame() &&
+ !frame()
+ ->selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .isNone()) {
LOG(FATAL) << "FrameSelection is not none, but anchorPosition is null.";
}
}
@@ -649,7 +656,7 @@ void DOMSelection::deleteFromDocument() {
FrameSelection& selection = frame()->selection();
- if (selection.isNone())
+ if (selection.computeVisibleSelectionInDOMTreeDeprecated().isNone())
return;
// TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698