summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/StyledElement.cpp
diff options
context:
space:
mode:
authorLeon Clarke <leonclarke@google.com>2010-07-15 12:03:35 +0100
committerLeon Clarke <leonclarke@google.com>2010-07-20 16:57:23 +0100
commite458d70a0d18538346f41b503114c9ebe6b2ce12 (patch)
tree86f1637deca2c524432a822e5fcedd4bef221091 /WebCore/dom/StyledElement.cpp
parentf43eabc081f7ce6af24b9df4953498a3cd6ca24d (diff)
downloadexternal_webkit-e458d70a0d18538346f41b503114c9ebe6b2ce12.zip
external_webkit-e458d70a0d18538346f41b503114c9ebe6b2ce12.tar.gz
external_webkit-e458d70a0d18538346f41b503114c9ebe6b2ce12.tar.bz2
Merge WebKit at r63173 : Initial merge by git.
Change-Id: Ife5af0c7c6261fbbc8ae6bc08c390efa9ef10b44
Diffstat (limited to 'WebCore/dom/StyledElement.cpp')
-rw-r--r--WebCore/dom/StyledElement.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/WebCore/dom/StyledElement.cpp b/WebCore/dom/StyledElement.cpp
index 994b084..9b22f1d 100644
--- a/WebCore/dom/StyledElement.cpp
+++ b/WebCore/dom/StyledElement.cpp
@@ -148,8 +148,8 @@ void StyledElement::attributeChanged(Attribute* attr, bool preserveDecls)
if (attr->decl() && !preserveDecls) {
attr->setDecl(0);
setNeedsStyleRecalc();
- if (namedAttrMap)
- mappedAttributes()->declRemoved();
+ if (attributeMap())
+ attributeMap()->declRemoved();
}
bool checkDecl = true;
@@ -158,8 +158,8 @@ void StyledElement::attributeChanged(Attribute* attr, bool preserveDecls)
if (preserveDecls) {
if (attr->decl()) {
setNeedsStyleRecalc();
- if (namedAttrMap)
- mappedAttributes()->declAdded();
+ if (attributeMap())
+ attributeMap()->declAdded();
checkDecl = false;
}
} else if (!attr->isNull() && entry != eNone) {
@@ -167,8 +167,8 @@ void StyledElement::attributeChanged(Attribute* attr, bool preserveDecls)
if (decl) {
attr->setDecl(decl);
setNeedsStyleRecalc();
- if (namedAttrMap)
- mappedAttributes()->declAdded();
+ if (attributeMap())
+ attributeMap()->declAdded();
checkDecl = false;
} else
needToParse = true;
@@ -191,8 +191,8 @@ void StyledElement::attributeChanged(Attribute* attr, bool preserveDecls)
attr->decl()->setMappedState(entry, attr->name(), attr->value());
attr->decl()->setParent(0);
attr->decl()->setNode(0);
- if (namedAttrMap)
- mappedAttributes()->declAdded();
+ if (attributeMap())
+ attributeMap()->declAdded();
}
updateAfterAttributeChanged(attr);
@@ -215,12 +215,13 @@ void StyledElement::classAttributeChanged(const AtomicString& newClassString)
if (!isClassWhitespace(characters[i]))
break;
}
- setHasClass(i < length);
- if (namedAttrMap) {
- if (i < length)
- mappedAttributes()->setClass(newClassString);
- else
- mappedAttributes()->clearClass();
+ bool hasClass = i < length;
+ setHasClass(hasClass);
+ if (hasClass)
+ attributes()->setClass(newClassString);
+ else {
+ if (attributeMap())
+ attributeMap()->clearClass();
}
setNeedsStyleRecalc();
dispatchSubtreeModifiedEvent();
@@ -230,13 +231,13 @@ void StyledElement::parseMappedAttribute(Attribute* attr)
{
if (isIdAttributeName(attr->name())) {
setHasID(!attr->isNull());
- if (namedAttrMap) {
+ if (attributeMap()) {
if (attr->isNull())
- namedAttrMap->setIdForStyleResolution(nullAtom);
+ attributeMap()->setIdForStyleResolution(nullAtom);
else if (document()->inCompatMode())
- namedAttrMap->setIdForStyleResolution(attr->value().lower());
+ attributeMap()->setIdForStyleResolution(attr->value().lower());
else
- namedAttrMap->setIdForStyleResolution(attr->value());
+ attributeMap()->setIdForStyleResolution(attr->value());
}
setNeedsStyleRecalc();
} else if (attr->name() == classAttr)