| Index: Source/core/dom/Element.cpp
|
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
|
| index ced2bd06440792fe0a24dbe5deac5b25b4f45e55..a4d2253ef8f179410d823cbbf79026283e95bf46 100644
|
| --- a/Source/core/dom/Element.cpp
|
| +++ b/Source/core/dom/Element.cpp
|
| @@ -3432,8 +3432,9 @@ void Element::synchronizeStyleAttributeInternal() const
|
| ASSERT(elementData());
|
| ASSERT(elementData()->m_styleAttributeIsDirty);
|
| elementData()->m_styleAttributeIsDirty = false;
|
| - if (const StylePropertySet* inlineStyle = this->inlineStyle())
|
| - const_cast<Element*>(this)->setSynchronizedLazyAttribute(styleAttr, inlineStyle->asText());
|
| + const StylePropertySet* inlineStyle = this->inlineStyle();
|
| + const_cast<Element*>(this)->setSynchronizedLazyAttribute(styleAttr,
|
| + inlineStyle ? AtomicString(inlineStyle->asText()) : nullAtom);
|
| }
|
|
|
| CSSStyleDeclaration* Element::style()
|
| @@ -3456,6 +3457,13 @@ MutableStylePropertySet* Element::ensureMutableInlineStyle()
|
| return toMutableStylePropertySet(inlineStyle);
|
| }
|
|
|
| +void Element::clearMutableInlineStyleIfEmpty()
|
| +{
|
| + if (ensureMutableInlineStyle()->isEmpty()) {
|
| + ensureUniqueElementData()->m_inlineStyle.clear();
|
| + }
|
| +}
|
| +
|
| PropertySetCSSStyleDeclaration* Element::inlineStyleCSSOMWrapper()
|
| {
|
| if (!inlineStyle() || !inlineStyle()->hasCSSOMWrapper())
|
| @@ -3564,7 +3572,7 @@ bool Element::removeInlineStyleProperty(CSSPropertyID propertyID)
|
| void Element::removeAllInlineStyleProperties()
|
| {
|
| ASSERT(isStyledElement());
|
| - if (!inlineStyle() || inlineStyle()->isEmpty())
|
| + if (!inlineStyle())
|
| return;
|
| ensureMutableInlineStyle()->clear();
|
| inlineStyleChanged();
|
|
|