| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 void WebFormElement::submit() | 73 void WebFormElement::submit() |
| 74 { | 74 { |
| 75 unwrap<HTMLFormElement>()->submit(); | 75 unwrap<HTMLFormElement>()->submit(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void WebFormElement::getNamedElements(const WebString& name, | 78 void WebFormElement::getNamedElements(const WebString& name, |
| 79 WebVector<WebNode>& result) | 79 WebVector<WebNode>& result) |
| 80 { | 80 { |
| 81 Vector<RefPtr<Element> > tempVector; | 81 Vector<RefPtr<Element> > tempVector; |
| 82 unwrap<HTMLFormElement>()->getNamedElements(name, tempVector); | 82 unwrap<HTMLFormElement>()->getNamedElements(name, tempVector); |
| 83 #if ENABLE(OILPAN) |
| 84 // FIXME: The second argument of HTMLFormElement::getNamedElements should be |
| 85 // HeapVector<Member<Element>>. |
| 86 Vector<WebNode> tempVector2; |
| 87 tempVector2.reserveCapacity(tempVector.size()); |
| 88 for (size_t i = 0; i < tempVector.size(); ++i) |
| 89 tempVector2.append(WebNode(tempVector[i].get())); |
| 90 result.assign(tempVector2); |
| 91 #else |
| 83 result.assign(tempVector); | 92 result.assign(tempVector); |
| 93 #endif |
| 84 } | 94 } |
| 85 | 95 |
| 86 void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& re
sult) const | 96 void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& re
sult) const |
| 87 { | 97 { |
| 88 const HTMLFormElement* form = constUnwrap<HTMLFormElement>(); | 98 const HTMLFormElement* form = constUnwrap<HTMLFormElement>(); |
| 89 Vector<RefPtr<HTMLFormControlElement> > formControlElements; | 99 Vector<WebFormControlElement> formControlElements; |
| 90 | 100 |
| 91 const Vector<FormAssociatedElement*>& associatedElements = form->associatedE
lements(); | 101 const Vector<FormAssociatedElement*>& associatedElements = form->associatedE
lements(); |
| 92 for (Vector<FormAssociatedElement*>::const_iterator it = associatedElements.
begin(); it != associatedElements.end(); ++it) { | 102 for (Vector<FormAssociatedElement*>::const_iterator it = associatedElements.
begin(); it != associatedElements.end(); ++it) { |
| 93 if ((*it)->isFormControlElement()) | 103 if ((*it)->isFormControlElement()) |
| 94 formControlElements.append(toHTMLFormControlElement(*it)); | 104 formControlElements.append(toHTMLFormControlElement(*it)); |
| 95 } | 105 } |
| 96 result.assign(formControlElements); | 106 result.assign(formControlElements); |
| 97 } | 107 } |
| 98 | 108 |
| 99 bool WebFormElement::checkValidity() | 109 bool WebFormElement::checkValidity() |
| 100 { | 110 { |
| 101 return unwrap<HTMLFormElement>()->checkValidity(); | 111 return unwrap<HTMLFormElement>()->checkValidity(); |
| 102 } | 112 } |
| 103 | 113 |
| 104 void WebFormElement::finishRequestAutocomplete(WebFormElement::AutocompleteResul
t result) | 114 void WebFormElement::finishRequestAutocomplete(WebFormElement::AutocompleteResul
t result) |
| 105 { | 115 { |
| 106 unwrap<HTMLFormElement>()->finishRequestAutocomplete(static_cast<HTMLFormEle
ment::AutocompleteResult>(result)); | 116 unwrap<HTMLFormElement>()->finishRequestAutocomplete(static_cast<HTMLFormEle
ment::AutocompleteResult>(result)); |
| 107 } | 117 } |
| 108 | 118 |
| 109 WebFormElement::WebFormElement(const PassRefPtr<HTMLFormElement>& e) | 119 WebFormElement::WebFormElement(const PassRefPtrWillBeRawPtr<HTMLFormElement>& e) |
| 110 : WebElement(e) | 120 : WebElement(e) |
| 111 { | 121 { |
| 112 } | 122 } |
| 113 | 123 |
| 114 WebFormElement& WebFormElement::operator=(const PassRefPtr<HTMLFormElement>& e) | 124 WebFormElement& WebFormElement::operator=(const PassRefPtrWillBeRawPtr<HTMLFormE
lement>& e) |
| 115 { | 125 { |
| 116 m_private = e; | 126 m_private = e; |
| 117 return *this; | 127 return *this; |
| 118 } | 128 } |
| 119 | 129 |
| 120 WebFormElement::operator PassRefPtr<HTMLFormElement>() const | 130 WebFormElement::operator PassRefPtrWillBeRawPtr<HTMLFormElement>() const |
| 121 { | 131 { |
| 122 return toHTMLFormElement(m_private.get()); | 132 return toHTMLFormElement(m_private.get()); |
| 123 } | 133 } |
| 124 | 134 |
| 125 } // namespace blink | 135 } // namespace blink |
| OLD | NEW |