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]; |