summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/StyledElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/dom/StyledElement.cpp')
-rw-r--r--WebCore/dom/StyledElement.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/WebCore/dom/StyledElement.cpp b/WebCore/dom/StyledElement.cpp
index a158e2e..f07fda9 100644
--- a/WebCore/dom/StyledElement.cpp
+++ b/WebCore/dom/StyledElement.cpp
@@ -28,6 +28,7 @@
#include "CSSStyleSelector.h"
#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
+#include "DOMTokenList.h"
#include "Document.h"
#include "HTMLNames.h"
#include <wtf/HashFunctions.h>
@@ -217,12 +218,12 @@ void StyledElement::classAttributeChanged(const AtomicString& newClassString)
}
bool hasClass = i < length;
setHasClass(hasClass);
- if (hasClass)
+ if (hasClass) {
attributes()->setClass(newClassString);
- else {
- if (attributeMap())
- attributeMap()->clearClass();
- }
+ if (DOMTokenList* classList = optionalClassList())
+ classList->reset(newClassString);
+ } else if (attributeMap())
+ attributeMap()->clearClass();
setNeedsStyleRecalc();
dispatchSubtreeModifiedEvent();
}