summaryrefslogtreecommitdiffstats
path: root/WebCore/wml/WMLOptGroupElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/wml/WMLOptGroupElement.cpp')
-rw-r--r--WebCore/wml/WMLOptGroupElement.cpp39
1 files changed, 16 insertions, 23 deletions
diff --git a/WebCore/wml/WMLOptGroupElement.cpp b/WebCore/wml/WMLOptGroupElement.cpp
index 3658cf6..d70731c 100644
--- a/WebCore/wml/WMLOptGroupElement.cpp
+++ b/WebCore/wml/WMLOptGroupElement.cpp
@@ -24,10 +24,12 @@
#include "WMLOptGroupElement.h"
#include "Document.h"
+#include "MappedAttribute.h"
#include "HTMLNames.h"
#include "NodeRenderStyle.h"
#include "RenderStyle.h"
#include "WMLNames.h"
+#include "WMLSelectElement.h"
namespace WebCore {
@@ -42,7 +44,7 @@ WMLOptGroupElement::~WMLOptGroupElement()
{
}
-const AtomicString& WMLOptGroupElement::type() const
+const AtomicString& WMLOptGroupElement::formControlType() const
{
DEFINE_STATIC_LOCAL(const AtomicString, optgroup, ("optgroup"));
return optgroup;
@@ -50,7 +52,7 @@ const AtomicString& WMLOptGroupElement::type() const
bool WMLOptGroupElement::insertBefore(PassRefPtr<Node> newChild, Node* refChild, ExceptionCode& ec, bool shouldLazyAttach)
{
- bool result = WMLElement::insertBefore(newChild, refChild, ec, shouldLazyAttach);
+ bool result = WMLFormControlElement::insertBefore(newChild, refChild, ec, shouldLazyAttach);
if (result)
recalcSelectOptions();
return result;
@@ -58,7 +60,7 @@ bool WMLOptGroupElement::insertBefore(PassRefPtr<Node> newChild, Node* refChild,
bool WMLOptGroupElement::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec, bool shouldLazyAttach)
{
- bool result = WMLElement::replaceChild(newChild, oldChild, ec, shouldLazyAttach);
+ bool result = WMLFormControlElement::replaceChild(newChild, oldChild, ec, shouldLazyAttach);
if (result)
recalcSelectOptions();
return result;
@@ -66,7 +68,7 @@ bool WMLOptGroupElement::replaceChild(PassRefPtr<Node> newChild, Node* oldChild,
bool WMLOptGroupElement::removeChild(Node* oldChild, ExceptionCode& ec)
{
- bool result = WMLElement::removeChild(oldChild, ec);
+ bool result = WMLFormControlElement::removeChild(oldChild, ec);
if (result)
recalcSelectOptions();
return result;
@@ -74,7 +76,7 @@ bool WMLOptGroupElement::removeChild(Node* oldChild, ExceptionCode& ec)
bool WMLOptGroupElement::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bool shouldLazyAttach)
{
- bool result = WMLElement::appendChild(newChild, ec, shouldLazyAttach);
+ bool result = WMLFormControlElement::appendChild(newChild, ec, shouldLazyAttach);
if (result)
recalcSelectOptions();
return result;
@@ -82,17 +84,15 @@ bool WMLOptGroupElement::appendChild(PassRefPtr<Node> newChild, ExceptionCode& e
bool WMLOptGroupElement::removeChildren()
{
- bool result = WMLElement::removeChildren();
+ bool result = WMLFormControlElement::removeChildren();
if (result)
recalcSelectOptions();
return result;
}
-// FIXME: Activate once WMLSelectElement is available
-#if 0
-static inline WMLElement* ownerSelectElement()
+static inline WMLSelectElement* ownerSelectElement(Element* element)
{
- Node* select = parentNode();
+ Node* select = element->parentNode();
while (select && !select->hasTagName(selectTag))
select = select->parentNode();
@@ -101,25 +101,21 @@ static inline WMLElement* ownerSelectElement()
return static_cast<WMLSelectElement*>(select);
}
-#endif
void WMLOptGroupElement::accessKeyAction(bool)
{
- // FIXME: Activate once WMLSelectElement is available
-#if 0
- WMLSelectElement* select = ownerSelectElement();
+ WMLSelectElement* select = ownerSelectElement(this);
if (!select || select->focused())
return;
// send to the parent to bring focus to the list box
select->accessKeyAction(false);
-#endif
}
void WMLOptGroupElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
recalcSelectOptions();
- WMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
+ WMLFormControlElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
}
void WMLOptGroupElement::parseMappedAttribute(MappedAttribute* attr)
@@ -129,7 +125,7 @@ void WMLOptGroupElement::parseMappedAttribute(MappedAttribute* attr)
return;
}
- WMLElement::parseMappedAttribute(attr);
+ WMLFormControlElement::parseMappedAttribute(attr);
recalcSelectOptions();
}
@@ -137,13 +133,13 @@ void WMLOptGroupElement::attach()
{
if (parentNode()->renderStyle())
setRenderStyle(styleForRenderer());
- WMLElement::attach();
+ WMLFormControlElement::attach();
}
void WMLOptGroupElement::detach()
{
m_style.clear();
- WMLElement::detach();
+ WMLFormControlElement::detach();
}
void WMLOptGroupElement::setRenderStyle(PassRefPtr<RenderStyle> style)
@@ -170,11 +166,8 @@ String WMLOptGroupElement::groupLabelText() const
void WMLOptGroupElement::recalcSelectOptions()
{
- // FIXME: Activate once WMLSelectElement is available
-#if 0
- if (WMLSelectElement* select = ownerSelectElement())
+ if (WMLSelectElement* select = ownerSelectElement(this))
select->setRecalcListItems();
-#endif
}
}