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

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

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 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 | « Source/core/dom/TextLinkColors.cpp ('k') | Source/core/editing/EditingStyle.cpp » ('j') | 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 3b8e62d48c8d10f64be4e9560b9b8172b3956cc4..d773b8a65df4093f87f81c55a301d08369d01a52 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -414,7 +414,7 @@ void ApplyStyleCommand::applyRelativeFontStyleChange(EditingStyle* style)
RefPtrWillBeRawPtr<MutableStylePropertySet> inlineStyle = copyStyleOrCreateEmpty(element->inlineStyle());
float currentFontSize = computedFontSize(node);
float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node) + style->fontSizeDelta());
- RefPtrWillBeRawPtr<CSSValue> value = inlineStyle->getPropertyCSSValue(CSSPropertyFontSize);
+ NullableCSSValue value = inlineStyle->getPropertyCSSValue(CSSPropertyFontSize);
if (value) {
element->removeInlineStyleProperty(CSSPropertyFontSize);
currentFontSize = computedFontSize(node);
@@ -1544,12 +1544,13 @@ float ApplyStyleCommand::computedFontSize(Node* node)
if (!style)
return 0;
- RefPtrWillBeRawPtr<CSSPrimitiveValue> value = static_pointer_cast<CSSPrimitiveValue>(style->getPropertyCSSValue(CSSPropertyFontSize));
+ NullableCSSValue value = style->getPropertyCSSValue(CSSPropertyFontSize);
if (!value)
return 0;
- ASSERT(value->primitiveType() == CSSPrimitiveValue::CSS_PX);
- return value->getFloatValue();
+ CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(*value);
+ ASSERT(primitiveValue.primitiveType() == CSSPrimitiveValue::CSS_PX);
+ return primitiveValue.getFloatValue();
}
void ApplyStyleCommand::joinChildTextNodes(ContainerNode* node, const Position& start, const Position& end)
« no previous file with comments | « Source/core/dom/TextLinkColors.cpp ('k') | Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698