This source file includes following definitions.
- autoComplete
- action
- name
- method
- wasUserSubmitted
- submit
- getNamedElements
- getFormControlElements
- checkValidityWithoutDispatchingEvents
- finishRequestAutocomplete
#include "config.h"
#include "WebFormElement.h"
#include "HTMLNames.h"
#include "WebFormControlElement.h"
#include "WebInputElement.h"
#include "core/html/HTMLFormControlElement.h"
#include "core/html/HTMLFormElement.h"
#include "core/html/HTMLInputElement.h"
#include "public/platform/WebString.h"
#include "public/platform/WebURL.h"
#include "wtf/PassRefPtr.h"
using namespace WebCore;
namespace blink {
bool WebFormElement::autoComplete() const
{
return constUnwrap<HTMLFormElement>()->shouldAutocomplete();
}
WebString WebFormElement::action() const
{
return constUnwrap<HTMLFormElement>()->action();
}
WebString WebFormElement::name() const
{
return constUnwrap<HTMLFormElement>()->name();
}
WebString WebFormElement::method() const
{
return constUnwrap<HTMLFormElement>()->method();
}
bool WebFormElement::wasUserSubmitted() const
{
return constUnwrap<HTMLFormElement>()->wasUserSubmitted();
}
void WebFormElement::submit()
{
unwrap<HTMLFormElement>()->submit();
}
void WebFormElement::getNamedElements(const WebString& name,
WebVector<WebNode>& result)
{
Vector<RefPtr<Element> > tempVector;
unwrap<HTMLFormElement>()->getNamedElements(name, tempVector);
result.assign(tempVector);
}
void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& result) const
{
const HTMLFormElement* form = constUnwrap<HTMLFormElement>();
Vector<RefPtr<HTMLFormControlElement> > formControlElements;
const Vector<FormAssociatedElement*>& associatedElements = form->associatedElements();
for (Vector<FormAssociatedElement*>::const_iterator it = associatedElements.begin(); it != associatedElements.end(); ++it) {
if ((*it)->isFormControlElement())
formControlElements.append(toHTMLFormControlElement(*it));
}
result.assign(formControlElements);
}
bool WebFormElement::checkValidityWithoutDispatchingEvents()
{
return unwrap<HTMLFormElement>()->checkValidityWithoutDispatchingEvents();
}
void WebFormElement::finishRequestAutocomplete(WebFormElement::AutocompleteResult result)
{
unwrap<HTMLFormElement>()->finishRequestAutocomplete(static_cast<HTMLFormElement::AutocompleteResult>(result));
}
WebFormElement::WebFormElement(const PassRefPtr<HTMLFormElement>& e)
: WebElement(e)
{
}
WebFormElement& WebFormElement::operator=(const PassRefPtr<HTMLFormElement>& e)
{
m_private = e;
return *this;
}
WebFormElement::operator PassRefPtr<HTMLFormElement>() const
{
return toHTMLFormElement(m_private.get());
}
}