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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 WebVector<WebNode>& result) | 80 WebVector<WebNode>& result) |
81 { | 81 { |
82 Vector<RefPtr<Node> > tempVector; | 82 Vector<RefPtr<Node> > tempVector; |
83 unwrap<HTMLFormElement>()->getNamedElements(name, tempVector); | 83 unwrap<HTMLFormElement>()->getNamedElements(name, tempVector); |
84 result.assign(tempVector); | 84 result.assign(tempVector); |
85 } | 85 } |
86 | 86 |
87 void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& re
sult) const | 87 void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& re
sult) const |
88 { | 88 { |
89 const HTMLFormElement* form = constUnwrap<HTMLFormElement>(); | 89 const HTMLFormElement* form = constUnwrap<HTMLFormElement>(); |
90 Vector<RefPtr<HTMLFormControlElement> > tempVector; | 90 CollectionRoot<Vector<Member<HTMLFormControlElement> > > tempVector; |
91 // FIXME: We should move the for-loop condition into a variable instead of | 91 // FIXME: We should move the for-loop condition into a variable instead of |
92 // re-evaluating size each time. Also, consider refactoring this code so tha
t | 92 // re-evaluating size each time. Also, consider refactoring this code so tha
t |
93 // we don't call form->associatedElements() multiple times. | 93 // we don't call form->associatedElements() multiple times. |
94 for (size_t i = 0; i < form->associatedElements().size(); i++) { | 94 for (size_t i = 0; i < form->associatedElements().size(); i++) { |
95 if (!form->associatedElements()[i]->isFormControlElement()) | 95 if (!form->associatedElements()[i]->isFormControlElement()) |
96 continue; | 96 continue; |
97 HTMLFormControlElement* element = static_cast<HTMLFormControlElement*>(f
orm->associatedElements()[i]); | 97 Handle<HTMLFormControlElement> element(static_cast<HTMLFormControlElemen
t*>(form->associatedElements()[i])); |
98 if (element->hasLocalName(HTMLNames::inputTag) | 98 if (element->hasLocalName(HTMLNames::inputTag) |
99 || element->hasLocalName(HTMLNames::selectTag)) | 99 || element->hasLocalName(HTMLNames::selectTag)) |
100 tempVector.append(element); | 100 tempVector->append(element); |
101 } | 101 } |
102 result.assign(tempVector); | 102 result.assign(*tempVector); |
103 } | 103 } |
104 | 104 |
105 void WebFormElement::finishRequestAutocomplete(WebFormElement::AutocompleteResul
t result) | 105 void WebFormElement::finishRequestAutocomplete(WebFormElement::AutocompleteResul
t result) |
106 { | 106 { |
107 unwrap<HTMLFormElement>()->finishRequestAutocomplete(static_cast<HTMLFormEle
ment::AutocompleteResult>(result)); | 107 unwrap<HTMLFormElement>()->finishRequestAutocomplete(static_cast<HTMLFormEle
ment::AutocompleteResult>(result)); |
108 } | 108 } |
109 | 109 |
110 WebFormElement::WebFormElement(const PassRefPtr<HTMLFormElement>& e) | 110 WebFormElement::WebFormElement(const PassRefPtr<HTMLFormElement>& e) |
111 : WebElement(e) | 111 : WebElement(e) |
112 { | 112 { |
113 } | 113 } |
114 | 114 |
115 WebFormElement& WebFormElement::operator=(const PassRefPtr<HTMLFormElement>& e) | 115 WebFormElement& WebFormElement::operator=(const PassRefPtr<HTMLFormElement>& e) |
116 { | 116 { |
117 m_private = e; | 117 m_private = e; |
118 return *this; | 118 return *this; |
119 } | 119 } |
120 | 120 |
121 WebFormElement::operator PassRefPtr<HTMLFormElement>() const | 121 WebFormElement::operator PassRefPtr<HTMLFormElement>() const |
122 { | 122 { |
123 return static_cast<HTMLFormElement*>(m_private.get()); | 123 return static_cast<HTMLFormElement*>(m_private.get()); |
124 } | 124 } |
125 | 125 |
126 } // namespace WebKit | 126 } // namespace WebKit |
OLD | NEW |