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

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

Issue 1124863003: Harden changing font style over unknown elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clean up the test Created 5 years, 7 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/style/apply-style-crash3-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 f141674f0dccd60e523740a9a121876654c30416..2da7751ff24cbc956d28ed4abef81f559e37868d 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -372,8 +372,12 @@ void ApplyStyleCommand::applyRelativeFontStyleChange(EditingStyle* style)
if (startNode == beyondEnd)
return;
- if (startNode->isTextNode() && start.deprecatedEditingOffset() >= caretMaxOffset(startNode)) // Move out of text node if range does not include its characters.
+ if (startNode->isTextNode() && start.deprecatedEditingOffset() >= caretMaxOffset(startNode)) {
+ // Move out of text node if range does not include its characters.
startNode = NodeTraversal::next(*startNode);
+ if (!startNode)
+ return;
+ }
// Store away font size before making any changes to the document.
// This ensures that changes to one node won't effect another.
« no previous file with comments | « LayoutTests/editing/style/apply-style-crash3-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698