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

Issue 181103004: Fixing crash when executing ApplyStyle command. (Closed)

Created:
6 years, 10 months ago by arpitab_
Modified:
6 years, 9 months ago
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Fixing crash when executing InsertOrderedList execCommand. In applyInlineStyleToNodeRange(), a call to removeConflictingInlineStyleFromRun() can modify the start and end Nodes of InlineRunToApplyStyle. For the crash scenario, the start node being set in removeConflictingInlineStyleFromRun() is invalid and further use of it when calling positionToComputeInlineStyleChange() causes a crash. Thus adding a check for startAndEndAreStillInDocument() fixes the crash. However, since for the invalid scenario positionForStyleComputation shall not be set, we should check for it's validity before using the same for creating the StyleChange object. Have added a testcase based on the simplified clusterfuzz testcase added by yoichio in http://crbug.com/343799 which verifies the crash. BUG=343799 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168278

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressing review comments #

Total comments: 2

Patch Set 3 : Fix for crash #

Total comments: 3

Patch Set 4 : Fixing nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -3 lines) Patch
A LayoutTests/editing/execCommand/inserting-ordered-list-crash.html View 1 1 chunk +21 lines, -0 lines 0 comments Download
A LayoutTests/editing/execCommand/inserting-ordered-list-crash-expected.txt View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/editing/ApplyStyleCommand.cpp View 1 2 3 1 chunk +6 lines, -3 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
arpitab_
6 years, 10 months ago (2014-02-26 13:43:31 UTC) #1
yosin_UTC9
ACK w/ small nit for test case. Thanks for fixing! https://codereview.chromium.org/181103004/diff/1/LayoutTests/editing/execCommand/inserting-ordered-list-crash.html File LayoutTests/editing/execCommand/inserting-ordered-list-crash.html (right): https://codereview.chromium.org/181103004/diff/1/LayoutTests/editing/execCommand/inserting-ordered-list-crash.html#newcode14 ...
6 years, 10 months ago (2014-02-27 01:38:39 UTC) #2
arpitab_
Thanks for the review Yoshi, have uploaded another patch fixing the nits. https://codereview.chromium.org/181103004/diff/1/LayoutTests/editing/execCommand/inserting-ordered-list-crash.html File LayoutTests/editing/execCommand/inserting-ordered-list-crash.html ...
6 years, 10 months ago (2014-02-27 06:56:10 UTC) #3
Yuta Kitamura
https://codereview.chromium.org/181103004/diff/20001/LayoutTests/editing/execCommand/inserting-ordered-list-crash.html File LayoutTests/editing/execCommand/inserting-ordered-list-crash.html (right): https://codereview.chromium.org/181103004/diff/20001/LayoutTests/editing/execCommand/inserting-ordered-list-crash.html#newcode6 LayoutTests/editing/execCommand/inserting-ordered-list-crash.html:6: > What's up with this bracket? Is this necessary? ...
6 years, 10 months ago (2014-02-27 07:48:14 UTC) #4
arpitab_
Separating out the crash issue [http://crbug.com/343799] and the incorrect selection after executing the InsertOrderedList command ...
6 years, 9 months ago (2014-02-28 11:49:41 UTC) #5
arpitab_
https://codereview.chromium.org/181103004/diff/40001/LayoutTests/editing/execCommand/inserting-ordered-list-crash.html File LayoutTests/editing/execCommand/inserting-ordered-list-crash.html (right): https://codereview.chromium.org/181103004/diff/40001/LayoutTests/editing/execCommand/inserting-ordered-list-crash.html#newcode6 LayoutTests/editing/execCommand/inserting-ordered-list-crash.html:6: > Required for reproducing the crash.
6 years, 9 months ago (2014-02-28 14:02:55 UTC) #6
yosin_UTC9
https://codereview.chromium.org/181103004/diff/40001/Source/core/editing/ApplyStyleCommand.cpp File Source/core/editing/ApplyStyleCommand.cpp (right): https://codereview.chromium.org/181103004/diff/40001/Source/core/editing/ApplyStyleCommand.cpp#newcode822 Source/core/editing/ApplyStyleCommand.cpp:822: if (!runs[i].positionForStyleComputation.isNull()) nit: We can use |Position::isNotNull()| here.
6 years, 9 months ago (2014-03-03 02:06:45 UTC) #7
arpitab_
https://codereview.chromium.org/181103004/diff/40001/Source/core/editing/ApplyStyleCommand.cpp File Source/core/editing/ApplyStyleCommand.cpp (right): https://codereview.chromium.org/181103004/diff/40001/Source/core/editing/ApplyStyleCommand.cpp#newcode822 Source/core/editing/ApplyStyleCommand.cpp:822: if (!runs[i].positionForStyleComputation.isNull()) On 2014/03/03 02:06:45, Yoshi wrote: > nit: ...
6 years, 9 months ago (2014-03-03 05:59:59 UTC) #8
Yuta Kitamura
lgtm
6 years, 9 months ago (2014-03-03 06:04:52 UTC) #9
arpitab_
The CQ bit was checked by a.bah@samsung.com
6 years, 9 months ago (2014-03-03 06:08:46 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/a.bah@samsung.com/181103004/60001
6 years, 9 months ago (2014-03-03 06:09:00 UTC) #11
commit-bot: I haz the power
6 years, 9 months ago (2014-03-03 08:44:15 UTC) #12
Message was sent while issue was closed.
Change committed as 168278

Powered by Google App Engine
This is Rietveld 408576698