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

Unified Diff: Source/core/editing/ReplaceSelectionCommand.cpp

Issue 1219723004: Make "insertHTML" execCommand not to crash on TEXTAREA (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « LayoutTests/editing/inserting/insert-html-to-textarea-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ReplaceSelectionCommand.cpp
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp
index 0975edaaacbaed5c06674840e5429380726a0829..30db418951bdd358c5046a915224a3e09be37505 100644
--- a/Source/core/editing/ReplaceSelectionCommand.cpp
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp
@@ -182,7 +182,7 @@ ReplacementFragment::ReplacementFragment(Document* document, DocumentFragment* f
}
RefPtrWillBeRawPtr<Range> range = VisibleSelection::selectionFromContentsOfNode(holder.get()).toNormalizedRange();
- String text = plainText(range.get(), static_cast<TextIteratorBehavior>(TextIteratorEmitsOriginalText | TextIteratorIgnoresStyleVisibility));
+ String text = range ? plainText(range.get(), static_cast<TextIteratorBehavior>(TextIteratorEmitsOriginalText | TextIteratorIgnoresStyleVisibility)) : emptyString();
hajimehoshi 2015/06/30 05:02:55 Does this mean plainText always accept non-null ra
yosin_UTC9 2015/06/30 05:04:54 Another patch will remove |plainText(Range*)| API
removeInterchangeNodes(holder.get());
removeUnrenderedNodes(holder.get());
« no previous file with comments | « LayoutTests/editing/inserting/insert-html-to-textarea-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698