| Index: Source/core/html/HTMLInputElement.cpp
|
| diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
|
| index ab81796e20251134050b8a56de6f02cbdcfbfae9..5bfc1bb63500c09a6fb49a68f82a2e722a5cefe3 100644
|
| --- a/Source/core/html/HTMLInputElement.cpp
|
| +++ b/Source/core/html/HTMLInputElement.cpp
|
| @@ -92,12 +92,13 @@ using namespace HTMLNames;
|
| class ListAttributeTargetObserver : IdTargetObserver {
|
| WTF_MAKE_FAST_ALLOCATED;
|
| public:
|
| - static PassOwnPtr<ListAttributeTargetObserver> create(const AtomicString& id, HTMLInputElement*);
|
| + static PassOwnPtr<ListAttributeTargetObserver> create(const AtomicString& id, Handle<HTMLInputElement>);
|
| virtual void idTargetChanged() OVERRIDE;
|
|
|
| private:
|
| - ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*);
|
| + ListAttributeTargetObserver(const AtomicString& id, Handle<HTMLInputElement>);
|
|
|
| + // FIXME(oilpan): Move ListAttributeTargetObserver to the heap and use a Member.
|
| HTMLInputElement* m_element;
|
| };
|
| #endif
|
| @@ -131,7 +132,7 @@ HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* docum
|
| , m_wasModifiedByUser(false)
|
| , m_canReceiveDroppedFiles(false)
|
| , m_hasTouchEventHandler(false)
|
| - , m_inputType(InputType::createText(this))
|
| + , m_inputType(InputType::createText(Handle<HTMLInputElement>(this)))
|
| {
|
| ASSERT(hasTagName(inputTag) || hasTagName(isindexTag));
|
| #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
|
| @@ -140,11 +141,11 @@ HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* docum
|
| ScriptWrappable::init(this);
|
| }
|
|
|
| -PassRefPtr<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form, bool createdByParser)
|
| +Result<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form, bool createdByParser)
|
| {
|
| - RefPtr<HTMLInputElement> inputElement = adoptRef(new HTMLInputElement(tagName, document, form, createdByParser));
|
| + Handle<HTMLInputElement> inputElement = adoptNode(new HTMLInputElement(tagName, document, form, createdByParser));
|
| inputElement->ensureUserAgentShadowRoot();
|
| - return inputElement.release();
|
| + return inputElement;
|
| }
|
|
|
| HTMLImageLoader* HTMLInputElement::imageLoader()
|
| @@ -167,7 +168,7 @@ HTMLInputElement::~HTMLInputElement()
|
| // setForm(0) may register this to a document-level radio button group.
|
| // We should unregister it to avoid accessing a deleted object.
|
| if (isRadioButton())
|
| - document()->formController()->checkedRadioButtons().removeButton(this);
|
| + document()->formController()->checkedRadioButtons().removeButton(Handle<HTMLInputElement>(this));
|
| if (m_hasTouchEventHandler)
|
| document()->didRemoveEventTargetNode(this);
|
| }
|
| @@ -448,7 +449,7 @@ void HTMLInputElement::setType(const String& type)
|
|
|
| void HTMLInputElement::updateType()
|
| {
|
| - OwnPtr<InputType> newType = InputType::create(this, fastGetAttribute(typeAttr));
|
| + OwnPtr<InputType> newType = InputType::create(Handle<HTMLInputElement>(this), fastGetAttribute(typeAttr));
|
| bool hadType = m_hasType;
|
| m_hasType = true;
|
| if (m_inputType->formControlType() == newType->formControlType())
|
| @@ -856,7 +857,7 @@ void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
|
| setNeedsStyleRecalc();
|
|
|
| if (CheckedRadioButtons* buttons = checkedRadioButtons())
|
| - buttons->updateCheckedState(this);
|
| + buttons->updateCheckedState(Handle<HTMLInputElement>(this));
|
| if (renderer() && renderer()->style()->hasAppearance())
|
| renderer()->theme()->stateChanged(renderer(), CheckedState);
|
| setNeedsValidityCheck();
|
| @@ -1262,11 +1263,6 @@ Vector<String> HTMLInputElement::acceptFileExtensions()
|
| return parseAcceptAttribute(fastGetAttribute(acceptAttr), isValidFileExtension);
|
| }
|
|
|
| -String HTMLInputElement::accept() const
|
| -{
|
| - return fastGetAttribute(acceptAttr);
|
| -}
|
| -
|
| String HTMLInputElement::alt() const
|
| {
|
| return fastGetAttribute(altAttr);
|
| @@ -1459,7 +1455,7 @@ void HTMLInputElement::didMoveToNewDocument(Document* oldDocument)
|
|
|
| if (oldDocument) {
|
| if (isRadioButton())
|
| - oldDocument->formController()->checkedRadioButtons().removeButton(this);
|
| + oldDocument->formController()->checkedRadioButtons().removeButton(Handle<HTMLInputElement>(this));
|
| if (m_hasTouchEventHandler)
|
| oldDocument->didRemoveEventTargetNode(this);
|
| }
|
| @@ -1486,7 +1482,7 @@ void HTMLInputElement::requiredAttributeChanged()
|
| {
|
| HTMLTextFormControlElement::requiredAttributeChanged();
|
| if (CheckedRadioButtons* buttons = checkedRadioButtons())
|
| - buttons->requiredAttributeChanged(this);
|
| + buttons->requiredAttributeChanged(Handle<HTMLInputElement>(this));
|
| m_inputType->requiredAttributeChanged();
|
| }
|
|
|
| @@ -1525,7 +1521,7 @@ HTMLDataListElement* HTMLInputElement::dataList() const
|
| void HTMLInputElement::resetListAttributeTargetObserver()
|
| {
|
| if (inDocument())
|
| - m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fastGetAttribute(listAttr), this);
|
| + m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fastGetAttribute(listAttr), Handle<HTMLInputElement>(this));
|
| else
|
| m_listAttributeTargetObserver = nullptr;
|
| }
|
| @@ -1748,15 +1744,15 @@ bool HTMLInputElement::isInRequiredRadioButtonGroup()
|
| {
|
| ASSERT(isRadioButton());
|
| if (CheckedRadioButtons* buttons = checkedRadioButtons())
|
| - return buttons->isInRequiredGroup(this);
|
| + return buttons->isInRequiredGroup(Handle<HTMLInputElement>(this));
|
| return false;
|
| }
|
|
|
| -HTMLInputElement* HTMLInputElement::checkedRadioButtonForGroup() const
|
| +Result<HTMLInputElement> HTMLInputElement::checkedRadioButtonForGroup() const
|
| {
|
| if (CheckedRadioButtons* buttons = checkedRadioButtons())
|
| return buttons->checkedButtonForGroup(name());
|
| - return 0;
|
| + return nullptr;
|
| }
|
|
|
| CheckedRadioButtons* HTMLInputElement::checkedRadioButtons() const
|
| @@ -1773,13 +1769,13 @@ CheckedRadioButtons* HTMLInputElement::checkedRadioButtons() const
|
| inline void HTMLInputElement::addToRadioButtonGroup()
|
| {
|
| if (CheckedRadioButtons* buttons = checkedRadioButtons())
|
| - buttons->addButton(this);
|
| + buttons->addButton(Handle<HTMLInputElement>(this));
|
| }
|
|
|
| inline void HTMLInputElement::removeFromRadioButtonGroup()
|
| {
|
| if (CheckedRadioButtons* buttons = checkedRadioButtons())
|
| - buttons->removeButton(this);
|
| + buttons->removeButton(Handle<HTMLInputElement>(this));
|
| }
|
|
|
| unsigned HTMLInputElement::height() const
|
| @@ -1803,14 +1799,14 @@ void HTMLInputElement::setWidth(unsigned width)
|
| }
|
|
|
| #if ENABLE(DATALIST_ELEMENT)
|
| -PassOwnPtr<ListAttributeTargetObserver> ListAttributeTargetObserver::create(const AtomicString& id, HTMLInputElement* element)
|
| +PassOwnPtr<ListAttributeTargetObserver> ListAttributeTargetObserver::create(const AtomicString& id, Handle<HTMLInputElement> element)
|
| {
|
| return adoptPtr(new ListAttributeTargetObserver(id, element));
|
| }
|
|
|
| -ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement* element)
|
| +ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id, Handle<HTMLInputElement> element)
|
| : IdTargetObserver(element->treeScope()->idTargetObserverRegistry(), id)
|
| - , m_element(element)
|
| + , m_element(element.raw())
|
| {
|
| }
|
|
|
| @@ -1903,4 +1899,9 @@ PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer()
|
| }
|
| #endif
|
|
|
| +void HTMLInputElement::acceptHeapVisitor(Visitor* visitor) const
|
| +{
|
| + HTMLTextFormControlElement::acceptHeapVisitor(visitor);
|
| +}
|
| +
|
| } // namespace
|
|
|