summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/StyledElement.cpp
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-09-30 15:42:16 +0100
committerSteve Block <steveblock@google.com>2010-10-07 10:59:29 +0100
commitbec39347bb3bb5bf1187ccaf471d26247f28b585 (patch)
tree56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /WebCore/dom/StyledElement.cpp
parent90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff)
downloadexternal_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip
external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz
external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
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();
}