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

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

Issue 2731393004: Use EphemeralRange to construct StaticRange (Closed)
Patch Set: 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
Index: third_party/WebKit/Source/core/editing/EditingUtilities.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
index c4fd9c04fa9072c1e1cc67fcd884951b81944d23..edea774080801741a30f18d0163f52d19d465690 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -2087,14 +2087,17 @@ bool isTextSecurityNode(const Node* node) {
}
const StaticRangeVector* targetRangesForInputEvent(const Node& node) {
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. see http://crbug.com/590369 for more details.
+ node.document().updateStyleAndLayoutIgnorePendingStylesheets();
if (!hasRichlyEditableStyle(node))
return nullptr;
- Range* range = createRange(
+ EphemeralRange range =
yosin_UTC9 2017/03/08 07:35:51 nit: s/EphmeralRange/const EphemeralRange&/ to avo
chongz 2017/03/08 18:31:09 Done.
firstEphemeralRangeOf(node.document()
.frame()
->selection()
- .computeVisibleSelectionInDOMTreeDeprecated()));
- if (!range)
+ .computeVisibleSelectionInDOMTreeDeprecated());
+ if (range.isNull())
return nullptr;
return new StaticRangeVector(1, StaticRange::create(range));
}

Powered by Google App Engine
This is Rietveld 408576698