Index: Source/core/editing/EditingStyle.cpp |
diff --git a/Source/core/editing/EditingStyle.cpp b/Source/core/editing/EditingStyle.cpp |
index 0d555c04bde1cfc481cbaed227d431cc1525763c..eaee4c96f0619f4b97b386fbaab27d297c494dcf 100644 |
--- a/Source/core/editing/EditingStyle.cpp |
+++ b/Source/core/editing/EditingStyle.cpp |
@@ -290,12 +290,13 @@ void HTMLAttributeEquivalent::addToStyle(Element* element, EditingStyle* style) |
PassRefPtrWillBeRawPtr<CSSValue> HTMLAttributeEquivalent::attributeValueAsCSSValue(Element* element) const |
{ |
ASSERT(element); |
- if (!element->hasAttribute(m_attrName)) |
+ const AtomicString& value = element->getAttribute(m_attrName); |
+ if (value.isNull()) |
return nullptr; |
RefPtr<MutableStylePropertySet> dummyStyle; |
dummyStyle = MutableStylePropertySet::create(); |
- dummyStyle->setProperty(m_propertyID, element->getAttribute(m_attrName)); |
+ dummyStyle->setProperty(m_propertyID, value); |
return dummyStyle->getPropertyCSSValue(m_propertyID); |
} |
@@ -319,10 +320,11 @@ HTMLFontSizeEquivalent::HTMLFontSizeEquivalent() |
PassRefPtrWillBeRawPtr<CSSValue> HTMLFontSizeEquivalent::attributeValueAsCSSValue(Element* element) const |
{ |
ASSERT(element); |
- if (!element->hasAttribute(m_attrName)) |
+ const AtomicString& value = element->getAttribute(m_attrName); |
+ if (value.isNull()) |
return nullptr; |
CSSValueID size; |
- if (!HTMLFontElement::cssValueFromFontSizeNumber(element->getAttribute(m_attrName), size)) |
+ if (!HTMLFontElement::cssValueFromFontSizeNumber(value, size)) |
return nullptr; |
return CSSPrimitiveValue::createIdentifier(size); |
} |