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

Issue 1219723004: Make "insertHTML" execCommand not to crash on TEXTAREA (Closed)

Created:
5 years, 5 months ago by yosin_UTC9
Modified:
5 years, 5 months ago
Reviewers:
yoichio, hajimehoshi
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Make "insertHTML" execCommand not to crash on TEXTAREA This patch changes "insertHTML" execCommand on TEXTAREA not to crash when inserted HTML containing text. The root cause of issue 504886 is calling |plainText()| with null |Range| object in |ReplacementFragment| constructor. This null |Range| object is comes from |VisibleSelection::selectionFromContentsOfNode()| with HTML fragment without text content, e.g. "<b></b>", "<span>", and so on, which returns empty seleciton. BUG=504886 TEST=LayoutTests/editing/inserting/insert-html-to-textarea-crash.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=198037

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -0 lines) Patch
A LayoutTests/editing/inserting/insert-html-to-textarea-crash.html View 1 chunk +9 lines, -0 lines 0 comments Download
A + LayoutTests/editing/inserting/insert-html-to-textarea-crash-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/core/editing/ReplaceSelectionCommand.cpp View 1 chunk +1 line, -1 line 2 comments Download

Messages

Total messages: 8 (2 generated)
yosin_UTC9
PTAL
5 years, 5 months ago (2015-06-30 04:42:13 UTC) #2
hajimehoshi
https://codereview.chromium.org/1219723004/diff/1/Source/core/editing/ReplaceSelectionCommand.cpp File Source/core/editing/ReplaceSelectionCommand.cpp (right): https://codereview.chromium.org/1219723004/diff/1/Source/core/editing/ReplaceSelectionCommand.cpp#newcode185 Source/core/editing/ReplaceSelectionCommand.cpp:185: String text = range ? plainText(range.get(), static_cast<TextIteratorBehavior>(TextIteratorEmitsOriginalText | TextIteratorIgnoresStyleVisibility)) ...
5 years, 5 months ago (2015-06-30 05:02:55 UTC) #3
yosin_UTC9
https://codereview.chromium.org/1219723004/diff/1/Source/core/editing/ReplaceSelectionCommand.cpp File Source/core/editing/ReplaceSelectionCommand.cpp (right): https://codereview.chromium.org/1219723004/diff/1/Source/core/editing/ReplaceSelectionCommand.cpp#newcode185 Source/core/editing/ReplaceSelectionCommand.cpp:185: String text = range ? plainText(range.get(), static_cast<TextIteratorBehavior>(TextIteratorEmitsOriginalText | TextIteratorIgnoresStyleVisibility)) ...
5 years, 5 months ago (2015-06-30 05:04:54 UTC) #4
hajimehoshi
lgtm
5 years, 5 months ago (2015-06-30 05:05:45 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1219723004/1
5 years, 5 months ago (2015-06-30 05:21:05 UTC) #7
commit-bot: I haz the power
5 years, 5 months ago (2015-06-30 05:55:24 UTC) #8
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://src.chromium.org/viewvc/blink?view=rev&revision=198037

Powered by Google App Engine
This is Rietveld 408576698