OSDN Git Service

am 3c54ece0: am 5dc34a85: activeDocumentLoader() causes crash in WebCoreFrameBridge.cpp
[android-x86/external-webkit.git] / WebCore / css / CSSStyleDeclaration.cpp
index a35f817..404a978 100644 (file)
@@ -118,6 +118,12 @@ CSSRule* CSSStyleDeclaration::parentRule() const
     return (parent() && parent()->isRule()) ? static_cast<CSSRule*>(parent()) : 0;
 }
 
+bool CSSStyleDeclaration::cssPropertyMatches(const CSSProperty* property) const
+{
+    RefPtr<CSSValue> value = getPropertyCSSValue(property->id());
+    return value && value->cssText() == property->value()->cssText();
+}
+
 void CSSStyleDeclaration::diff(CSSMutableStyleDeclaration* style) const
 {
     if (!style)
@@ -128,8 +134,7 @@ void CSSStyleDeclaration::diff(CSSMutableStyleDeclaration* style) const
         CSSMutableStyleDeclaration::const_iterator end = style->end();
         for (CSSMutableStyleDeclaration::const_iterator it = style->begin(); it != end; ++it) {
             const CSSProperty& property = *it;
-            RefPtr<CSSValue> value = getPropertyCSSValue(property.id());
-            if (value && (value->cssText() == property.value()->cssText()))
+            if (cssPropertyMatches(&property))
                 propertiesToRemove.append(property.id());
         }
     }