Index: Source/core/editing/EditorCommand.cpp |
diff --git a/Source/core/editing/EditorCommand.cpp b/Source/core/editing/EditorCommand.cpp |
index 50c269e292b058d13724991b98d80e32971454f9..b907af0758bbb2f2799ce46dc3c3e1d93522ee82 100644 |
--- a/Source/core/editing/EditorCommand.cpp |
+++ b/Source/core/editing/EditorCommand.cpp |
@@ -135,23 +135,24 @@ static bool executeApplyStyle(LocalFrame& frame, EditorCommandSource source, Edi |
// FIXME: executeToggleStyleInList does not handle complicated cases such as <b><u>hello</u>world</b> properly. |
// This function must use Editor::selectionHasStyle to determine the current style but we cannot fix this |
// until https://bugs.webkit.org/show_bug.cgi?id=27818 is resolved. |
-static bool executeToggleStyleInList(LocalFrame& frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, CSSValue* value) |
+static bool executeToggleStyleInList(LocalFrame& frame, EditorCommandSource source, EditAction action, CSSPropertyID propertyID, CSSValue value) |
{ |
RefPtrWillBeRawPtr<EditingStyle> selectionStyle = EditingStyle::styleAtSelectionStart(frame.selection().selection()); |
if (!selectionStyle || !selectionStyle->style()) |
return false; |
- RefPtrWillBeRawPtr<CSSValue> selectedCSSValue = selectionStyle->style()->getPropertyCSSValue(propertyID); |
+ NullableCSSValue selectedCSSValue = selectionStyle->style()->getPropertyCSSValue(propertyID); |
String newStyle("none"); |
Timothy Loh
2015/06/02 00:42:04
looks like the previous code expected this to be n
|
- if (selectedCSSValue->isValueList()) { |
- RefPtrWillBeRawPtr<CSSValueList> selectedCSSValueList = toCSSValueList(selectedCSSValue.get()); |
+ if (selectedCSSValue && selectedCSSValue->isValueList()) { |
+ RefPtrWillBeRawPtr<CSSValueList> selectedCSSValueList = toCSSValueList(selectedCSSValue); |
if (!selectedCSSValueList->removeAll(value)) |
selectedCSSValueList->append(value); |
if (selectedCSSValueList->length()) |
newStyle = selectedCSSValueList->cssText(); |
- } else if (selectedCSSValue->cssText() == "none") |
- newStyle = value->cssText(); |
+ } else if (selectedCSSValue && selectedCSSValue->cssText() == "none") { |
+ newStyle = value.cssText(); |
+ } |
// FIXME: We shouldn't be having to convert new style into text. We should have setPropertyCSSValue. |
RefPtrWillBeRawPtr<MutableStylePropertySet> newMutableStyle = MutableStylePropertySet::create(); |