diff options
Diffstat (limited to 'WebCore/html/HTMLOptGroupElement.cpp')
-rw-r--r-- | WebCore/html/HTMLOptGroupElement.cpp | 60 |
1 files changed, 9 insertions, 51 deletions
diff --git a/WebCore/html/HTMLOptGroupElement.cpp b/WebCore/html/HTMLOptGroupElement.cpp index 90156da..091e0f2 100644 --- a/WebCore/html/HTMLOptGroupElement.cpp +++ b/WebCore/html/HTMLOptGroupElement.cpp @@ -2,7 +2,7 @@ * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) * (C) 2001 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. * (C) 2006 Alexey Proskuryakov (ap@nypop.com) * * This library is free software; you can redistribute it and/or @@ -37,13 +37,17 @@ namespace WebCore { using namespace HTMLNames; -HTMLOptGroupElement::HTMLOptGroupElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f) - : HTMLFormControlElement(tagName, doc, f) - , m_style(0) +inline HTMLOptGroupElement::HTMLOptGroupElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form) + : HTMLFormControlElement(tagName, document, form) { ASSERT(hasTagName(optgroupTag)); } +PassRefPtr<HTMLOptGroupElement> HTMLOptGroupElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form) +{ + return adoptRef(new HTMLOptGroupElement(tagName, document, form)); +} + bool HTMLOptGroupElement::supportsFocus() const { return HTMLElement::supportsFocus(); @@ -61,43 +65,13 @@ const AtomicString& HTMLOptGroupElement::formControlType() const return optgroup; } -bool HTMLOptGroupElement::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& ec, bool shouldLazyAttach) -{ - bool result = HTMLFormControlElement::insertBefore(newChild, refChild, ec, shouldLazyAttach); - return result; -} - -bool HTMLOptGroupElement::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec, bool shouldLazyAttach) -{ - bool result = HTMLFormControlElement::replaceChild(newChild, oldChild, ec, shouldLazyAttach); - return result; -} - -bool HTMLOptGroupElement::removeChild(Node* oldChild, ExceptionCode& ec) -{ - bool result = HTMLFormControlElement::removeChild(oldChild, ec); - return result; -} - -bool HTMLOptGroupElement::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bool shouldLazyAttach) -{ - bool result = HTMLFormControlElement::appendChild(newChild, ec, shouldLazyAttach); - return result; -} - -bool HTMLOptGroupElement::removeChildren() -{ - bool result = HTMLFormControlElement::removeChildren(); - return result; -} - void HTMLOptGroupElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) { recalcSelectOptions(); HTMLFormControlElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); } -void HTMLOptGroupElement::parseMappedAttribute(MappedAttribute* attr) +void HTMLOptGroupElement::parseMappedAttribute(Attribute* attr) { HTMLFormControlElement::parseMappedAttribute(attr); recalcSelectOptions(); @@ -112,22 +86,6 @@ void HTMLOptGroupElement::recalcSelectOptions() static_cast<HTMLSelectElement*>(select)->setRecalcListItems(); } -String HTMLOptGroupElement::label() const -{ - return getAttribute(labelAttr); -} - -void HTMLOptGroupElement::setLabel(const String &value) -{ - setAttribute(labelAttr, value); -} - -bool HTMLOptGroupElement::checkDTD(const Node* newChild) -{ - // Make sure to keep this in sync with <select> (other than not allowing an optgroup). - return newChild->isTextNode() || newChild->hasTagName(HTMLNames::optionTag) || newChild->hasTagName(HTMLNames::hrTag) || newChild->hasTagName(HTMLNames::scriptTag); -} - void HTMLOptGroupElement::attach() { if (parentNode()->renderStyle()) |