diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/html/HTMLOutputElement.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/html/HTMLOutputElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLOutputElement.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Source/WebCore/html/HTMLOutputElement.cpp b/Source/WebCore/html/HTMLOutputElement.cpp index 5c02c5e96..c8a80bb03 100644 --- a/Source/WebCore/html/HTMLOutputElement.cpp +++ b/Source/WebCore/html/HTMLOutputElement.cpp @@ -34,28 +34,26 @@ #include "ExceptionCodePlaceholder.h" #include "HTMLFormElement.h" #include "HTMLNames.h" -#include <wtf/NeverDestroyed.h> namespace WebCore { -using namespace HTMLNames; - inline HTMLOutputElement::HTMLOutputElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form) : HTMLFormControlElement(tagName, document, form) , m_isDefaultValueMode(true) , m_isSetTextContentInProgress(false) , m_defaultValue("") + , m_tokens(DOMSettableTokenList::create()) { } -Ref<HTMLOutputElement> HTMLOutputElement::create(const QualifiedName& tagName, Document& document, HTMLFormElement* form) +PassRefPtr<HTMLOutputElement> HTMLOutputElement::create(const QualifiedName& tagName, Document& document, HTMLFormElement* form) { - return adoptRef(*new HTMLOutputElement(tagName, document, form)); + return adoptRef(new HTMLOutputElement(tagName, document, form)); } const AtomicString& HTMLOutputElement::formControlType() const { - static NeverDestroyed<const AtomicString> output("output", AtomicString::ConstructFromLiteral); + DEFINE_STATIC_LOCAL(const AtomicString, output, ("output", AtomicString::ConstructFromLiteral)); return output; } @@ -66,13 +64,22 @@ bool HTMLOutputElement::supportsFocus() const void HTMLOutputElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { - if (name == forAttr) { - if (m_tokens) - m_tokens->attributeValueChanged(value); - } else + if (name == HTMLNames::forAttr) + setFor(value); + else HTMLFormControlElement::parseAttribute(name, value); } +DOMSettableTokenList* HTMLOutputElement::htmlFor() const +{ + return m_tokens.get(); +} + +void HTMLOutputElement::setFor(const String& value) +{ + m_tokens->setValue(value); +} + void HTMLOutputElement::childrenChanged(const ChildChange& change) { HTMLFormControlElement::childrenChanged(change); @@ -127,13 +134,6 @@ void HTMLOutputElement::setDefaultValue(const String& value) setTextContentInternal(value); } -DOMTokenList& HTMLOutputElement::htmlFor() -{ - if (!m_tokens) - m_tokens = std::make_unique<AttributeDOMTokenList>(*this, forAttr); - return *m_tokens; -} - void HTMLOutputElement::setTextContentInternal(const String& value) { ASSERT(!m_isSetTextContentInProgress); |