diff options
author | Kristian Monsen <kristianm@google.com> | 2010-09-30 15:42:16 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-10-07 10:59:29 +0100 |
commit | bec39347bb3bb5bf1187ccaf471d26247f28b585 (patch) | |
tree | 56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /WebCore/dom/Element.cpp | |
parent | 90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff) | |
download | external_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/Element.cpp')
-rw-r--r-- | WebCore/dom/Element.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp index 5f53c2d..c408790 100644 --- a/WebCore/dom/Element.cpp +++ b/WebCore/dom/Element.cpp @@ -33,6 +33,7 @@ #include "CSSStyleSelector.h" #include "ClientRect.h" #include "ClientRectList.h" +#include "DOMTokenList.h" #include "DatasetDOMStringMap.h" #include "Document.h" #include "DocumentFragment.h" @@ -578,7 +579,10 @@ void Element::setAttribute(const AtomicString& name, const AtomicString& value, else if (!old && !value.isNull()) m_attributeMap->addAttribute(createAttribute(QualifiedName(nullAtom, localName, nullAtom), value)); else if (old && !value.isNull()) { - old->setValue(value); + if (Attr* attrNode = old->attr()) + attrNode->setValue(value); + else + old->setValue(value); attributeChanged(old); } @@ -608,7 +612,10 @@ void Element::setAttribute(const QualifiedName& name, const AtomicString& value, else if (!old && !value.isNull()) m_attributeMap->addAttribute(createAttribute(name, value)); else if (old) { - old->setValue(value); + if (Attr* attrNode = old->attr()) + attrNode->setValue(value); + else + old->setValue(value); attributeChanged(old); } @@ -651,6 +658,8 @@ void Element::updateAfterAttributeChanged(Attribute* attr) document()->axObjectCache()->selectedChildrenChanged(renderer()); else if (attrName == aria_expandedAttr) document()->axObjectCache()->handleAriaExpandedChange(renderer()); + else if (attrName == aria_hiddenAttr) + document()->axObjectCache()->childrenChanged(renderer()); } void Element::recalcStyleIfNeededAfterAttributeChanged(Attribute* attr) @@ -1565,6 +1574,21 @@ bool Element::webkitMatchesSelector(const String& selector, ExceptionCode& ec) return false; } +DOMTokenList* Element::classList() +{ + ElementRareData* data = ensureRareData(); + if (!data->m_classList) + data->m_classList = DOMTokenList::create(this); + return data->m_classList.get(); +} + +DOMTokenList* Element::optionalClassList() const +{ + if (!hasRareData()) + return 0; + return rareData()->m_classList.get(); +} + DOMStringMap* Element::dataset() { ElementRareData* data = ensureRareData(); |