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

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

Issue 181103004: Fixing crash when executing ApplyStyle command. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing nit Created 6 years, 10 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/execCommand/inserting-ordered-list-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/ApplyStyleCommand.cpp
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp
index 966eea4a23de22c26d4cc6a017be3c59dd033627..f7dd21db1684af7e159669ba6a0879068b8d0450 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -812,13 +812,16 @@ void ApplyStyleCommand::applyInlineStyleToNodeRange(EditingStyle* style, PassRef
for (size_t i = 0; i < runs.size(); i++) {
removeConflictingInlineStyleFromRun(style, runs[i].start, runs[i].end, runs[i].pastEndNode);
- runs[i].positionForStyleComputation = positionToComputeInlineStyleChange(runs[i].start, runs[i].dummyElement);
+ if (runs[i].startAndEndAreStillInDocument())
+ runs[i].positionForStyleComputation = positionToComputeInlineStyleChange(runs[i].start, runs[i].dummyElement);
}
document().updateLayoutIgnorePendingStylesheets();
- for (size_t i = 0; i < runs.size(); i++)
- runs[i].change = StyleChange(style, runs[i].positionForStyleComputation);
+ for (size_t i = 0; i < runs.size(); i++) {
+ if (runs[i].positionForStyleComputation.isNotNull())
+ runs[i].change = StyleChange(style, runs[i].positionForStyleComputation);
+ }
for (size_t i = 0; i < runs.size(); i++) {
InlineRunToApplyStyle& run = runs[i];
« no previous file with comments | « LayoutTests/editing/execCommand/inserting-ordered-list-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698