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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 return WebString(constUnwrap<Document>()->title()); | 152 return WebString(constUnwrap<Document>()->title()); |
153 } | 153 } |
154 | 154 |
155 WebElementCollection WebDocument::all() | 155 WebElementCollection WebDocument::all() |
156 { | 156 { |
157 return WebElementCollection(unwrap<Document>()->all()); | 157 return WebElementCollection(unwrap<Document>()->all()); |
158 } | 158 } |
159 | 159 |
160 void WebDocument::images(WebVector<WebElement>& results) | 160 void WebDocument::images(WebVector<WebElement>& results) |
161 { | 161 { |
162 RefPtr<HTMLCollection> images = unwrap<Document>()->images(); | 162 RefPtrWillBeRawPtr<HTMLCollection> images = unwrap<Document>()->images(); |
163 size_t sourceLength = images->length(); | 163 size_t sourceLength = images->length(); |
164 Vector<WebElement> temp; | 164 Vector<WebElement> temp; |
165 temp.reserveCapacity(sourceLength); | 165 temp.reserveCapacity(sourceLength); |
166 for (size_t i = 0; i < sourceLength; ++i) { | 166 for (size_t i = 0; i < sourceLength; ++i) { |
167 Element* element = images->item(i); | 167 Element* element = images->item(i); |
168 if (element && element->isHTMLElement()) | 168 if (element && element->isHTMLElement()) |
169 temp.append(WebElement(element)); | 169 temp.append(WebElement(element)); |
170 } | 170 } |
171 results.assign(temp); | 171 results.assign(temp); |
172 } | 172 } |
173 | 173 |
174 void WebDocument::forms(WebVector<WebFormElement>& results) const | 174 void WebDocument::forms(WebVector<WebFormElement>& results) const |
175 { | 175 { |
176 RefPtr<HTMLCollection> forms = const_cast<Document*>(constUnwrap<Document>()
)->forms(); | 176 RefPtrWillBeRawPtr<HTMLCollection> forms = const_cast<Document*>(constUnwrap
<Document>())->forms(); |
177 size_t sourceLength = forms->length(); | 177 size_t sourceLength = forms->length(); |
178 Vector<WebFormElement> temp; | 178 Vector<WebFormElement> temp; |
179 temp.reserveCapacity(sourceLength); | 179 temp.reserveCapacity(sourceLength); |
180 for (size_t i = 0; i < sourceLength; ++i) { | 180 for (size_t i = 0; i < sourceLength; ++i) { |
181 Element* element = forms->item(i); | 181 Element* element = forms->item(i); |
182 // Strange but true, sometimes node can be 0. | 182 // Strange but true, sometimes node can be 0. |
183 if (element && element->isHTMLElement()) | 183 if (element && element->isHTMLElement()) |
184 temp.append(WebFormElement(toHTMLFormElement(element))); | 184 temp.append(WebFormElement(toHTMLFormElement(element))); |
185 } | 185 } |
186 results.assign(temp); | 186 results.assign(temp); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 m_private = elem; | 311 m_private = elem; |
312 return *this; | 312 return *this; |
313 } | 313 } |
314 | 314 |
315 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const | 315 WebDocument::operator PassRefPtrWillBeRawPtr<Document>() const |
316 { | 316 { |
317 return toDocument(m_private.get()); | 317 return toDocument(m_private.get()); |
318 } | 318 } |
319 | 319 |
320 } // namespace blink | 320 } // namespace blink |
OLD | NEW |