Commit 3d8b64f1 authored by darin@apple.com's avatar darin@apple.com

WebCore:

2008-06-14  Darin Adler  <darin@apple.com>

        Rubber stamped by Sam.

        - renamed HTMLGenericFormElement to HTMLFormControlElement

        * GNUmakefile.am:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreSources.bkl:
        * html/HTMLButtonElement.cpp:
        (WebCore::HTMLButtonElement::HTMLButtonElement):
        (WebCore::HTMLButtonElement::parseMappedAttribute):
        (WebCore::HTMLButtonElement::defaultEventHandler):
        * html/HTMLButtonElement.h:
        * html/HTMLFieldSetElement.cpp:
        (WebCore::HTMLFieldSetElement::HTMLFieldSetElement):
        * html/HTMLFieldSetElement.h:
        * html/HTMLFormCollection.cpp:
        (WebCore::HTMLFormCollection::item):
        (WebCore::HTMLFormCollection::getNamedFormItem):
        (WebCore::HTMLFormCollection::updateNameCache):
        * html/HTMLFormControlElement.cpp: Copied from WebCore/html/HTMLGenericFormElement.cpp.
        * html/HTMLFormControlElement.h: Copied from WebCore/html/HTMLGenericFormElement.h.
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::formData):
        (WebCore::HTMLFormElement::submit):
        (WebCore::HTMLFormElement::formElementIndex):
        (WebCore::HTMLFormElement::registerFormElement):
        (WebCore::HTMLFormElement::removeFormElement):
        (WebCore::HTMLFormElement::elementForAlias):
        (WebCore::HTMLFormElement::addElementAlias):
        (WebCore::HTMLFormElement::getNamedElements):
        (WebCore::HTMLFormElement::CheckedRadioButtons::addButton):
        (WebCore::HTMLFormElement::CheckedRadioButtons::removeButton):
        * html/HTMLFormElement.h:
        * html/HTMLGenericFormElement.cpp: Removed.
        * html/HTMLGenericFormElement.h: Removed.
        * html/HTMLInputElement.h:
        * html/HTMLIsIndexElement.cpp:
        (WebCore::HTMLIsIndexElement::parseMappedAttribute):
        * html/HTMLKeygenElement.cpp:
        (WebCore::HTMLKeygenElement::parseMappedAttribute):
        * html/HTMLLegendElement.cpp:
        (WebCore::HTMLLegendElement::HTMLLegendElement):
        * html/HTMLLegendElement.h:
        * html/HTMLOptGroupElement.cpp:
        (WebCore::HTMLOptGroupElement::HTMLOptGroupElement):
        (WebCore::HTMLOptGroupElement::insertBefore):
        (WebCore::HTMLOptGroupElement::replaceChild):
        (WebCore::HTMLOptGroupElement::removeChild):
        (WebCore::HTMLOptGroupElement::appendChild):
        (WebCore::HTMLOptGroupElement::removeChildren):
        (WebCore::HTMLOptGroupElement::childrenChanged):
        (WebCore::HTMLOptGroupElement::parseMappedAttribute):
        (WebCore::HTMLOptGroupElement::attach):
        (WebCore::HTMLOptGroupElement::detach):
        * html/HTMLOptGroupElement.h:
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::HTMLOptionElement):
        (WebCore::HTMLOptionElement::attach):
        (WebCore::HTMLOptionElement::detach):
        (WebCore::HTMLOptionElement::parseMappedAttribute):
        (WebCore::HTMLOptionElement::childrenChanged):
        (WebCore::HTMLOptionElement::disabled):
        (WebCore::HTMLOptionElement::insertedIntoDocument):
        * html/HTMLOptionElement.h:
        * html/HTMLSelectElement.h:
        * html/HTMLTextAreaElement.h:
        * page/Frame.cpp:
        (WebCore::scanForForm):
        (WebCore::Frame::currentForm):
        * page/mac/FrameMac.mm:
        * rendering/RenderFieldset.cpp:
        (WebCore::RenderFieldset::RenderFieldset):
        * rendering/RenderFieldset.h:
        * rendering/RenderLegend.cpp:
        (WebCore::RenderLegend::RenderLegend):
        * rendering/RenderLegend.h:
        * rendering/RenderTextControl.cpp:
        (WebCore::RenderTextControl::createInnerTextStyle):
        (WebCore::RenderTextControl::updateFromElement):
        (WebCore::RenderTextControl::subtreeHasChanged):
        (WebCore::RenderTextControl::selectionChanged):

WebKit/mac:

2008-06-14  Darin Adler  <darin@apple.com>

        Rubber stamped by Sam.

        - renamed HTMLGenericFormElement to HTMLFormControlElement

        * WebView/WebHTMLRepresentation.mm:
        (-[WebHTMLRepresentation elementWithName:inForm:]):
        (-[WebHTMLRepresentation controlsInForm:]):

WebKit/win:

2008-06-14  Darin Adler  <darin@apple.com>

        Rubber stamped by Sam.

        - renamed HTMLGenericFormElement to HTMLFormControlElement

        * WebFrame.cpp:
        (WebFrame::elementWithName):
        (WebFrame::controlsInForm):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bae71f70
2008-06-14 Darin Adler <darin@apple.com>
Rubber stamped by Sam.
- renamed HTMLGenericFormElement to HTMLFormControlElement
* GNUmakefile.am:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreSources.bkl:
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::HTMLButtonElement):
(WebCore::HTMLButtonElement::parseMappedAttribute):
(WebCore::HTMLButtonElement::defaultEventHandler):
* html/HTMLButtonElement.h:
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::HTMLFieldSetElement):
* html/HTMLFieldSetElement.h:
* html/HTMLFormCollection.cpp:
(WebCore::HTMLFormCollection::item):
(WebCore::HTMLFormCollection::getNamedFormItem):
(WebCore::HTMLFormCollection::updateNameCache):
* html/HTMLFormControlElement.cpp: Copied from WebCore/html/HTMLGenericFormElement.cpp.
* html/HTMLFormControlElement.h: Copied from WebCore/html/HTMLGenericFormElement.h.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::formData):
(WebCore::HTMLFormElement::submit):
(WebCore::HTMLFormElement::formElementIndex):
(WebCore::HTMLFormElement::registerFormElement):
(WebCore::HTMLFormElement::removeFormElement):
(WebCore::HTMLFormElement::elementForAlias):
(WebCore::HTMLFormElement::addElementAlias):
(WebCore::HTMLFormElement::getNamedElements):
(WebCore::HTMLFormElement::CheckedRadioButtons::addButton):
(WebCore::HTMLFormElement::CheckedRadioButtons::removeButton):
* html/HTMLFormElement.h:
* html/HTMLGenericFormElement.cpp: Removed.
* html/HTMLGenericFormElement.h: Removed.
* html/HTMLInputElement.h:
* html/HTMLIsIndexElement.cpp:
(WebCore::HTMLIsIndexElement::parseMappedAttribute):
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::parseMappedAttribute):
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::HTMLLegendElement):
* html/HTMLLegendElement.h:
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::HTMLOptGroupElement):
(WebCore::HTMLOptGroupElement::insertBefore):
(WebCore::HTMLOptGroupElement::replaceChild):
(WebCore::HTMLOptGroupElement::removeChild):
(WebCore::HTMLOptGroupElement::appendChild):
(WebCore::HTMLOptGroupElement::removeChildren):
(WebCore::HTMLOptGroupElement::childrenChanged):
(WebCore::HTMLOptGroupElement::parseMappedAttribute):
(WebCore::HTMLOptGroupElement::attach):
(WebCore::HTMLOptGroupElement::detach):
* html/HTMLOptGroupElement.h:
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::HTMLOptionElement):
(WebCore::HTMLOptionElement::attach):
(WebCore::HTMLOptionElement::detach):
(WebCore::HTMLOptionElement::parseMappedAttribute):
(WebCore::HTMLOptionElement::childrenChanged):
(WebCore::HTMLOptionElement::disabled):
(WebCore::HTMLOptionElement::insertedIntoDocument):
* html/HTMLOptionElement.h:
* html/HTMLSelectElement.h:
* html/HTMLTextAreaElement.h:
* page/Frame.cpp:
(WebCore::scanForForm):
(WebCore::Frame::currentForm):
* page/mac/FrameMac.mm:
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::RenderFieldset):
* rendering/RenderFieldset.h:
* rendering/RenderLegend.cpp:
(WebCore::RenderLegend::RenderLegend):
* rendering/RenderLegend.h:
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::createInnerTextStyle):
(WebCore::RenderTextControl::updateFromElement):
(WebCore::RenderTextControl::subtreeHasChanged):
(WebCore::RenderTextControl::selectionChanged):
2008-06-14 Sam Weinig <sam@webkit.org>
Windows build fix.
......@@ -756,7 +756,7 @@ webcore_sources += \
WebCore/html/HTMLFrameElement.cpp \
WebCore/html/HTMLFrameOwnerElement.cpp \
WebCore/html/HTMLFrameSetElement.cpp \
WebCore/html/HTMLGenericFormElement.cpp \
WebCore/html/HTMLFormControlElement.cpp \
WebCore/html/HTMLHeadElement.cpp \
WebCore/html/HTMLHeadingElement.cpp \
WebCore/html/HTMLHRElement.cpp \
......
......@@ -635,7 +635,7 @@ SOURCES += \
html/HTMLFrameElement.cpp \
html/HTMLFrameOwnerElement.cpp \
html/HTMLFrameSetElement.cpp \
html/HTMLGenericFormElement.cpp \
html/HTMLFormControlElement.cpp \
html/HTMLHeadElement.cpp \
html/HTMLHeadingElement.cpp \
html/HTMLHRElement.cpp \
......
......@@ -12592,7 +12592,7 @@
>
</File>
<File
RelativePath="..\html\HTMLGenericFormElement.cpp"
RelativePath="..\html\HTMLFormControlElement.cpp"
>
<FileConfiguration
Name="Release_PGO|Win32"
......@@ -12604,7 +12604,7 @@
</FileConfiguration>
</File>
<File
RelativePath="..\html\HTMLGenericFormElement.h"
RelativePath="..\html\HTMLFormControlElement.h"
>
</File>
<File
......
......@@ -2082,8 +2082,8 @@
A81369CB097374F600D74463 /* HTMLIsIndexElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81369AF097374F500D74463 /* HTMLIsIndexElement.cpp */; };
A81369CC097374F600D74463 /* HTMLInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369B0097374F500D74463 /* HTMLInputElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
A81369CD097374F600D74463 /* HTMLInputElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81369B1097374F500D74463 /* HTMLInputElement.cpp */; };
A81369CE097374F600D74463 /* HTMLGenericFormElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369B2097374F500D74463 /* HTMLGenericFormElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
A81369CF097374F600D74463 /* HTMLGenericFormElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81369B3097374F500D74463 /* HTMLGenericFormElement.cpp */; };
A81369CE097374F600D74463 /* HTMLFormControlElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369B2097374F500D74463 /* HTMLFormControlElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
A81369CF097374F600D74463 /* HTMLFormControlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81369B3097374F500D74463 /* HTMLFormControlElement.cpp */; };
A81369D0097374F600D74463 /* HTMLFormElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369B4097374F500D74463 /* HTMLFormElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
A81369D1097374F600D74463 /* HTMLFormElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81369B5097374F500D74463 /* HTMLFormElement.cpp */; };
A81369D2097374F600D74463 /* HTMLButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369B6097374F500D74463 /* HTMLButtonElement.h */; };
......@@ -6382,8 +6382,8 @@
A81369AF097374F500D74463 /* HTMLIsIndexElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLIsIndexElement.cpp; sourceTree = "<group>"; };
A81369B0097374F500D74463 /* HTMLInputElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLInputElement.h; sourceTree = "<group>"; };
A81369B1097374F500D74463 /* HTMLInputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLInputElement.cpp; sourceTree = "<group>"; };
A81369B2097374F500D74463 /* HTMLGenericFormElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLGenericFormElement.h; sourceTree = "<group>"; };
A81369B3097374F500D74463 /* HTMLGenericFormElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLGenericFormElement.cpp; sourceTree = "<group>"; };
A81369B2097374F500D74463 /* HTMLFormControlElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLFormControlElement.h; sourceTree = "<group>"; };
A81369B3097374F500D74463 /* HTMLFormControlElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLFormControlElement.cpp; sourceTree = "<group>"; };
A81369B4097374F500D74463 /* HTMLFormElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLFormElement.h; sourceTree = "<group>"; };
A81369B5097374F500D74463 /* HTMLFormElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLFormElement.cpp; sourceTree = "<group>"; };
A81369B6097374F500D74463 /* HTMLButtonElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLButtonElement.h; sourceTree = "<group>"; };
......@@ -10528,8 +10528,8 @@
A871DE220A152AC800B12A68 /* HTMLFrameSetElement.cpp */,
A871DE1C0A152AC800B12A68 /* HTMLFrameSetElement.h */,
855542960AA4938800BA89F2 /* HTMLFrameSetElement.idl */,
A81369B3097374F500D74463 /* HTMLGenericFormElement.cpp */,
A81369B2097374F500D74463 /* HTMLGenericFormElement.h */,
A81369B3097374F500D74463 /* HTMLFormControlElement.cpp */,
A81369B2097374F500D74463 /* HTMLFormControlElement.h */,
A871DE190A152AC800B12A68 /* HTMLHeadElement.cpp */,
A871DE210A152AC800B12A68 /* HTMLHeadElement.h */,
A80E7AB10A19D1F1007FB8C5 /* HTMLHeadElement.idl */,
......@@ -14100,7 +14100,7 @@
14FFE31D0AE1963300136BF5 /* HTMLFrameElementBase.h in Headers */,
93E241FF0B2B4E4000C732A1 /* HTMLFrameOwnerElement.h in Headers */,
A871DE280A152AC800B12A68 /* HTMLFrameSetElement.h in Headers */,
A81369CE097374F600D74463 /* HTMLGenericFormElement.h in Headers */,
A81369CE097374F600D74463 /* HTMLFormControlElement.h in Headers */,
A8EA7CAF0A192B9C00A8EF5F /* HTMLHRElement.h in Headers */,
A871DE2D0A152AC800B12A68 /* HTMLHeadElement.h in Headers */,
A8EA7CB80A192B9C00A8EF5F /* HTMLHeadingElement.h in Headers */,
......@@ -15808,7 +15808,7 @@
14FFE31E0AE1963300136BF5 /* HTMLFrameElementBase.cpp in Sources */,
93E2425F0B2B509500C732A1 /* HTMLFrameOwnerElement.cpp in Sources */,
A871DE2E0A152AC800B12A68 /* HTMLFrameSetElement.cpp in Sources */,
A81369CF097374F600D74463 /* HTMLGenericFormElement.cpp in Sources */,
A81369CF097374F600D74463 /* HTMLFormControlElement.cpp in Sources */,
A8EA7CB30A192B9C00A8EF5F /* HTMLHRElement.cpp in Sources */,
A871DE250A152AC800B12A68 /* HTMLHeadElement.cpp in Sources */,
A8EA7CAE0A192B9C00A8EF5F /* HTMLHeadingElement.cpp in Sources */,
......@@ -493,7 +493,7 @@ This file contains the list of files needed to build WebCore.
html/HTMLFrameElementBase.cpp
html/HTMLFrameOwnerElement.cpp
html/HTMLFrameSetElement.cpp
html/HTMLGenericFormElement.cpp
html/HTMLFormControlElement.cpp
html/HTMLHRElement.cpp
html/HTMLHeadElement.cpp
html/HTMLHeadingElement.cpp
......
......@@ -39,7 +39,7 @@ using namespace EventNames;
using namespace HTMLNames;
HTMLButtonElement::HTMLButtonElement(Document* doc, HTMLFormElement* form)
: HTMLGenericFormElement(buttonTag, doc, form)
: HTMLFormControlElement(buttonTag, doc, form)
, m_type(SUBMIT)
, m_activeSubmit(false)
{
......@@ -92,7 +92,7 @@ void HTMLButtonElement::parseMappedAttribute(MappedAttribute* attr)
} else if (attr->name() == onblurAttr) {
setHTMLEventListener(blurEvent, attr);
} else
HTMLGenericFormElement::parseMappedAttribute(attr);
HTMLFormControlElement::parseMappedAttribute(attr);
}
void HTMLButtonElement::defaultEventHandler(Event* evt)
......@@ -135,7 +135,7 @@ void HTMLButtonElement::defaultEventHandler(Event* evt)
}
}
HTMLGenericFormElement::defaultEventHandler(evt);
HTMLFormControlElement::defaultEventHandler(evt);
}
bool HTMLButtonElement::isSuccessfulSubmitButton() const
......
......@@ -24,11 +24,11 @@
#ifndef HTMLButtonElement_h
#define HTMLButtonElement_h
#include "HTMLGenericFormElement.h"
#include "HTMLFormControlElement.h"
namespace WebCore {
class HTMLButtonElement : public HTMLGenericFormElement {
class HTMLButtonElement : public HTMLFormControlElement {
public:
HTMLButtonElement(Document*, HTMLFormElement* = 0);
virtual ~HTMLButtonElement();
......
......@@ -35,7 +35,7 @@ namespace WebCore {
using namespace HTMLNames;
HTMLFieldSetElement::HTMLFieldSetElement(Document *doc, HTMLFormElement *f)
: HTMLGenericFormElement(fieldsetTag, doc, f)
: HTMLFormControlElement(fieldsetTag, doc, f)
{
}
......
......@@ -26,7 +26,7 @@
#ifndef HTMLFieldSetElement_h
#define HTMLFieldSetElement_h
#include "HTMLGenericFormElement.h"
#include "HTMLFormControlElement.h"
namespace WebCore {
class RenderStyle;
......@@ -38,7 +38,7 @@ class HTMLFormElement;
class Document;
class Node;
class HTMLFieldSetElement : public HTMLGenericFormElement {
class HTMLFieldSetElement : public HTMLFormControlElement {
public:
HTMLFieldSetElement(Document*, HTMLFormElement* = 0);
virtual ~HTMLFieldSetElement();
......
......@@ -23,7 +23,7 @@
#include "config.h"
#include "HTMLFormCollection.h"
#include "HTMLGenericFormElement.h"
#include "HTMLFormControlElement.h"
#include "HTMLFormElement.h"
#include "HTMLImageElement.h"
#include "HTMLNames.h"
......@@ -77,7 +77,7 @@ Node* HTMLFormCollection::item(unsigned index) const
info()->elementsArrayPosition = 0;
}
Vector<HTMLGenericFormElement*>& l = static_cast<HTMLFormElement*>(base())->formElements;
Vector<HTMLFormControlElement*>& l = static_cast<HTMLFormElement*>(base())->formElements;
unsigned currentIndex = info()->position;
for (unsigned i = info()->elementsArrayPosition; i < l.size(); i++) {
......@@ -108,7 +108,7 @@ Element* HTMLFormCollection::getNamedFormItem(const QualifiedName& attrName, con
bool foundInputElements = false;
for (unsigned i = 0; i < form->formElements.size(); ++i) {
HTMLGenericFormElement* e = form->formElements[i];
HTMLFormControlElement* e = form->formElements[i];
if (e->isEnumeratable()) {
bool found;
if (caseSensitive)
......@@ -200,7 +200,7 @@ void HTMLFormCollection::updateNameCache() const
HTMLFormElement* f = static_cast<HTMLFormElement*>(base());
for (unsigned i = 0; i < f->formElements.size(); ++i) {
HTMLGenericFormElement* e = f->formElements[i];
HTMLFormControlElement* e = f->formElements[i];
if (e->isEnumeratable()) {
const AtomicString& idAttrVal = e->getAttribute(idAttr);
const AtomicString& nameAttrVal = e->getAttribute(nameAttr);
......
......@@ -23,7 +23,7 @@
*/
#include "config.h"
#include "HTMLGenericFormElement.h"
#include "HTMLFormControlElement.h"
#include "Document.h"
#include "EventHandler.h"
......@@ -42,7 +42,7 @@ namespace WebCore {
using namespace EventNames;
using namespace HTMLNames;
HTMLGenericFormElement::HTMLGenericFormElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f)
HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f)
: HTMLElement(tagName, doc)
, m_form(f)
, m_disabled(false)
......@@ -55,13 +55,13 @@ HTMLGenericFormElement::HTMLGenericFormElement(const QualifiedName& tagName, Doc
m_form->registerFormElement(this);
}
HTMLGenericFormElement::~HTMLGenericFormElement()
HTMLFormControlElement::~HTMLFormControlElement()
{
if (m_form)
m_form->removeFormElement(this);
}
void HTMLGenericFormElement::parseMappedAttribute(MappedAttribute *attr)
void HTMLFormControlElement::parseMappedAttribute(MappedAttribute *attr)
{
if (attr->name() == nameAttr) {
// Do nothing.
......@@ -85,7 +85,7 @@ void HTMLGenericFormElement::parseMappedAttribute(MappedAttribute *attr)
HTMLElement::parseMappedAttribute(attr);
}
void HTMLGenericFormElement::attach()
void HTMLFormControlElement::attach()
{
ASSERT(!attached());
......@@ -98,7 +98,7 @@ void HTMLGenericFormElement::attach()
renderer()->updateFromElement();
}
void HTMLGenericFormElement::insertedIntoTree(bool deep)
void HTMLFormControlElement::insertedIntoTree(bool deep)
{
if (!m_form) {
// This handles the case of a new form element being created by
......@@ -123,7 +123,7 @@ static inline Node* findRoot(Node* n)
return root;
}
void HTMLGenericFormElement::removedFromTree(bool deep)
void HTMLFormControlElement::removedFromTree(bool deep)
{
// If the form and element are both in the same tree, preserve the connection to the form.
// Otherwise, null out our form and remove ourselves from the form's list of elements.
......@@ -140,38 +140,38 @@ void HTMLGenericFormElement::removedFromTree(bool deep)
HTMLElement::removedFromTree(deep);
}
const AtomicString& HTMLGenericFormElement::name() const
const AtomicString& HTMLFormControlElement::name() const
{
const AtomicString& n = getAttribute(nameAttr);
return n.isNull() ? emptyAtom : n;
}
void HTMLGenericFormElement::setName(const AtomicString &value)
void HTMLFormControlElement::setName(const AtomicString &value)
{
setAttribute(nameAttr, value);
}
void HTMLGenericFormElement::onChange()
void HTMLFormControlElement::onChange()
{
dispatchHTMLEvent(changeEvent, true, false);
}
bool HTMLGenericFormElement::disabled() const
bool HTMLFormControlElement::disabled() const
{
return m_disabled;
}
void HTMLGenericFormElement::setDisabled(bool b)
void HTMLFormControlElement::setDisabled(bool b)
{
setAttribute(disabledAttr, b ? "" : 0);
}
void HTMLGenericFormElement::setReadOnly(bool b)
void HTMLFormControlElement::setReadOnly(bool b)
{
setAttribute(readonlyAttr, b ? "" : 0);
}
void HTMLGenericFormElement::recalcStyle(StyleChange change)
void HTMLFormControlElement::recalcStyle(StyleChange change)
{
HTMLElement::recalcStyle(change);
......@@ -179,7 +179,7 @@ void HTMLGenericFormElement::recalcStyle(StyleChange change)
renderer()->updateFromElement();
}
bool HTMLGenericFormElement::isFocusable() const
bool HTMLFormControlElement::isFocusable() const
{
if (disabled() || !renderer() ||
(renderer()->style() && renderer()->style()->visibility() != VISIBLE) ||
......@@ -188,7 +188,7 @@ bool HTMLGenericFormElement::isFocusable() const
return true;
}
bool HTMLGenericFormElement::isKeyboardFocusable(KeyboardEvent* event) const
bool HTMLFormControlElement::isKeyboardFocusable(KeyboardEvent* event) const
{
if (isFocusable())
if (document()->frame())
......@@ -196,32 +196,32 @@ bool HTMLGenericFormElement::isKeyboardFocusable(KeyboardEvent* event) const
return false;
}
bool HTMLGenericFormElement::isMouseFocusable() const
bool HTMLFormControlElement::isMouseFocusable() const
{
return false;
}
void HTMLGenericFormElement::setTabIndex(int value)
void HTMLFormControlElement::setTabIndex(int value)
{
setAttribute(tabindexAttr, String::number(value));
}
short HTMLGenericFormElement::tabIndex() const
short HTMLFormControlElement::tabIndex() const
{
return Element::tabIndex();
}
bool HTMLGenericFormElement::supportsFocus() const
bool HTMLFormControlElement::supportsFocus() const
{
return isFocusable() || (!disabled() && !document()->haveStylesheetsLoaded());
}
HTMLFormElement* HTMLGenericFormElement::virtualForm() const
HTMLFormElement* HTMLFormControlElement::virtualForm() const
{
return m_form;
}
void HTMLGenericFormElement::removeFromForm()
void HTMLFormControlElement::removeFromForm()
{
if (!m_form)
return;
......@@ -230,7 +230,7 @@ void HTMLGenericFormElement::removeFromForm()
}
HTMLFormControlElementWithState::HTMLFormControlElementWithState(const QualifiedName& tagName, Document* doc, HTMLFormElement* f)
: HTMLGenericFormElement(tagName, doc, f)
: HTMLFormControlElement(tagName, doc, f)
{
doc->registerFormElementWithState(this);
}
......@@ -243,18 +243,18 @@ HTMLFormControlElementWithState::~HTMLFormControlElementWithState()
void HTMLFormControlElementWithState::willMoveToNewOwnerDocument()
{
document()->unregisterFormElementWithState(this);
HTMLGenericFormElement::willMoveToNewOwnerDocument();
HTMLFormControlElement::willMoveToNewOwnerDocument();
}
void HTMLFormControlElementWithState::didMoveToNewOwnerDocument()
{
document()->registerFormElementWithState(this);
HTMLGenericFormElement::didMoveToNewOwnerDocument();
HTMLFormControlElement::didMoveToNewOwnerDocument();
}
void HTMLFormControlElementWithState::finishParsingChildren()
{
HTMLGenericFormElement::finishParsingChildren();
HTMLFormControlElement::finishParsingChildren();
Document* doc = document();
if (doc->hasStateForNewFormElements()) {
String state;
......
......@@ -21,8 +21,8 @@
*
*/
#ifndef HTMLGenericFormElement_h
#define HTMLGenericFormElement_h
#ifndef HTMLFormControlElement_h
#define HTMLFormControlElement_h
#include "HTMLElement.h"
......@@ -31,11 +31,10 @@ namespace WebCore {
class FormDataList;
class HTMLFormElement;
// FIXME: Rename this class to HTMLFormControlElement.
class HTMLGenericFormElement : public HTMLElement {
class HTMLFormControlElement : public HTMLElement {
public:
HTMLGenericFormElement(const QualifiedName& tagName, Document*, HTMLFormElement*);
virtual ~HTMLGenericFormElement();
HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*);
virtual ~HTMLFormControlElement();
virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
virtual int tagPriority() const { return 1; }
......@@ -105,7 +104,7 @@ private:
mutable bool m_valueMatchesRenderer;
};
class HTMLFormControlElementWithState : public HTMLGenericFormElement {
class HTMLFormControlElementWithState : public HTMLFormControlElement {
public:
HTMLFormControlElementWithState(const QualifiedName& tagName, Document*, HTMLFormElement*);
virtual ~HTMLFormControlElementWithState();
......
......@@ -238,7 +238,7 @@ PassRefPtr<FormData> HTMLFormElement::formData(const char* boundary) const
RefPtr<FormData> result = FormData::create();
for (unsigned i = 0; i < formElements.size(); ++i) {
HTMLGenericFormElement* control = formElements[i];
HTMLFormControlElement* control = formElements[i];
FormDataList list(encoding);
if (!control->disabled() && control->appendFormData(list, m_multipart)) {
......@@ -436,12 +436,12 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton)
m_insubmit = true;
HTMLGenericFormElement* firstSuccessfulSubmitButton = 0;
HTMLFormControlElement* firstSuccessfulSubmitButton = 0;
bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
frame->loader()->clearRecordedFormValues();
for (unsigned i = 0; i < formElements.size(); ++i) {
HTMLGenericFormElement* control = formElements[i];
HTMLFormControlElement* control = formElements[i];
if (control->hasLocalName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(control);
if (input->isTextField()) {
......@@ -568,7 +568,7 @@ template<class T, size_t n> static void removeFromVector(Vector<T*, n> & vec, T*
}
}
unsigned HTMLFormElement::formElementIndex(HTMLGenericFormElement* e)
unsigned HTMLFormElement::formElementIndex(HTMLFormControlElement* e)
{
// Check for the special case where this element is the very last thing in
// the form's tree of children; we don't want to walk the entire tree in that
......@@ -581,21 +581,21 @@ unsigned HTMLFormElement::formElementIndex(HTMLGenericFormElement* e)
return i;
if (node->isHTMLElement()
&& static_cast<HTMLElement*>(node)->isGenericFormElement()
&& static_cast<HTMLGenericFormElement*>(node)->form() == this)
&& static_cast<HTMLFormControlElement*>(node)->form() == this)
++i;
}
}
return formElements.size();
}
void HTMLFormElement::registerFormElement(HTMLGenericFormElement* e)
void HTMLFormElement::registerFormElement(HTMLFormControlElement* e)
{
document()->checkedRadioButtons().removeButton(e);
m_checkedRadioButtons.addButton(e);
formElements.insert(formElementIndex(e), e);
}
void HTMLFormElement::removeFormElement(HTMLGenericFormElement* e)
void HTMLFormElement::removeFormElement(HTMLFormControlElement* e)
{
m_checkedRadioButtons.removeButton(e);
removeFromVector(formElements, e);
......@@ -676,14 +676,14 @@ void HTMLFormElement::setTarget(const String &value)
setAttribute(targetAttr, value);
}
PassRefPtr<HTMLGenericFormElement> HTMLFormElement::elementForAlias(const AtomicString& alias)
PassRefPtr<HTMLFormControlElement> HTMLFormElement::elementForAlias(const AtomicString& alias)
{
if (alias.isEmpty() || !m_elementAliases)
return 0;
return m_elementAliases->get(alias.impl());
}
void HTMLFormElement::addElementAlias(HTMLGenericFormElement* element, const AtomicString& alias)
void HTMLFormElement::addElementAlias(HTMLFormControlElement* element, const AtomicString& alias)
{
if (alias.isEmpty())
return;
......@@ -697,7 +697,7 @@ void HTMLFormElement::getNamedElements(const AtomicString& name, Vector<RefPtr<N
elements()->namedItems(name, namedItems);
// see if we have seen something with this name before
RefPtr<HTMLGenericFormElement> aliasElem;
RefPtr<HTMLFormControlElement> aliasElem;
if (aliasElem = elementForAlias(name)) {
bool found = false;
for (unsigned n = 0; n < namedItems.size(); n++) {
......@@ -712,10 +712,10 @@ void HTMLFormElement::getNamedElements(const AtomicString& name, Vector<RefPtr<N
}
// name has been accessed, remember it
if (namedItems.size() && aliasElem != namedItems.first())
addElementAlias(static_cast<HTMLGenericFormElement*>(namedItems.first().get()), name);
addElementAlias(static_cast<HTMLFormControlElement*>(namedItems.first().get()), name);
}
void HTMLFormElement::CheckedRadioButtons::addButton(HTMLGenericFormElement* element)
void HTMLFormElement::CheckedRadioButtons::addButton(HTMLFormControlElement* element)
{
// We only want to add radio buttons.
if (!element->isRadioButton())
......@@ -754,7 +754,7 @@ HTMLInputElement* HTMLFormElement::CheckedRadioButtons::checkedButtonForGroup(co
return m_nameToCheckedRadioButtonMap->get(name.impl());
}
void HTMLFormElement::CheckedRadioButtons::removeButton(HTMLGenericFormElement* element)
void HTMLFormElement::CheckedRadioButtons::removeButton(HTMLFormControlElement* element)
{
if (element->name().isEmpty() || !m_nameToCheckedRadioButtonMap)
return;
......
......@@ -33,7 +33,7 @@ namespace WebCore {
class Event;
class FormData;
class HTMLGenericFormElement;
class HTMLFormControlElement;
class HTMLImageElement;
class HTMLInputElement;
class HTMLFormCollection;
......@@ -69,8 +69,8 @@ public:
virtual void parseMappedAttribute(MappedAttribute*);