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

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

Issue 1377963004: Use FrameSelection::selectedText where possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 92dd256df027e44a2e9287c4f38f813934812ae8..c803ca02d39517a011b6ab908f2f836fffc73636 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -1118,6 +1118,8 @@ static String extractSelectedHTMLAlgorithm(const FrameSelection& selection)
{
const VisibleSelectionTemplate<Strategy> visibleSelection = selection.visibleSelection<Strategy>();
const EphemeralRangeTemplate<Strategy> range = visibleSelection.toNormalizedEphemeralRange();
+ if (range.isNull())
+ return String();
return createMarkup(range.startPosition(), range.endPosition(), AnnotateForInterchange, ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
}
@@ -1128,9 +1130,9 @@ String FrameSelection::selectedHTMLForClipboard() const
return extractSelectedHTMLAlgorithm<EditingInComposedTreeStrategy>(*this);
}
-String FrameSelection::selectedText() const
+String FrameSelection::selectedText(TextIteratorBehavior behavior) const
{
- return extractSelectedText(*this, TextIteratorDefaultBehavior);
+ return extractSelectedText(*this, behavior);
}
String FrameSelection::selectedTextForClipboard() const

Powered by Google App Engine
This is Rietveld 408576698