Index: Source/core/editing/ApplyStyleCommand.cpp |
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp |
index 64efc3a4f67c9e22b4c5364b9948d85ca1825d59..388e6870c2bae4a3d75fb9365102ba4f03ba95a4 100644 |
--- a/Source/core/editing/ApplyStyleCommand.cpp |
+++ b/Source/core/editing/ApplyStyleCommand.cpp |
@@ -76,7 +76,8 @@ bool isLegacyAppleStyleSpan(const Node* node) |
static bool hasNoAttributeOrOnlyStyleAttribute(const HTMLElement* element, ShouldStyleAttributeBeEmpty shouldStyleAttributeBeEmpty) |
{ |
- if (!element->hasAttributes()) |
+ AttributeCollection attributes = element->attributes(); |
+ if (attributes.isEmpty()) |
return true; |
unsigned matchedAttributes = 0; |
@@ -86,8 +87,8 @@ static bool hasNoAttributeOrOnlyStyleAttribute(const HTMLElement* element, Shoul |
|| !element->inlineStyle() || element->inlineStyle()->isEmpty())) |
matchedAttributes++; |
- ASSERT(matchedAttributes <= element->attributes().size()); |
- return matchedAttributes == element->attributes().size(); |
+ ASSERT(matchedAttributes <= attributes.size()); |
+ return matchedAttributes == attributes.size(); |
} |
bool isStyleSpanOrSpanWithOnlyStyleAttribute(const Element* element) |