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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 if (control->isDisabledFormControl() || control->name().isNull()) | 207 if (control->isDisabledFormControl() || control->name().isNull()) |
208 continue; | 208 continue; |
209 | 209 |
210 FormDataList dataList(*encoding); | 210 FormDataList dataList(*encoding); |
211 if (!control->appendFormData(dataList, false)) | 211 if (!control->appendFormData(dataList, false)) |
212 continue; | 212 continue; |
213 | 213 |
214 const Vector<FormDataList::Item>& items = dataList.items(); | 214 const Vector<FormDataList::Item>& items = dataList.items(); |
215 | 215 |
216 for (Vector<FormDataList::Item>::const_iterator j(items.begin()); j != i
tems.end(); ++j) { | 216 for (Vector<FormDataList::Item>::const_iterator j(items.begin()); j != i
tems.end(); ++j) { |
217 // Handle ISINDEX / <input name=isindex> specially, but only if it's | 217 if (!encodedString->isEmpty()) |
218 // the first entry. | 218 encodedString->append('&'); |
219 if (!encodedString->isEmpty() || j->data() != "isindex") { | 219 FormDataBuilder::encodeStringAsFormData(*encodedString, j->data()); |
220 if (!encodedString->isEmpty()) | 220 encodedString->append('='); |
221 encodedString->append('&'); | |
222 FormDataBuilder::encodeStringAsFormData(*encodedString, j->data(
)); | |
223 encodedString->append('='); | |
224 } | |
225 ++j; | 221 ++j; |
226 if (control == textElement) { | 222 if (control == textElement) { |
227 encodedString->append("{searchTerms}", 13); | 223 encodedString->append("{searchTerms}", 13); |
228 isElementFound = true; | 224 isElementFound = true; |
229 } else | 225 } else |
230 FormDataBuilder::encodeStringAsFormData(*encodedString, j->data(
)); | 226 FormDataBuilder::encodeStringAsFormData(*encodedString, j->data(
)); |
231 } | 227 } |
232 } | 228 } |
233 return isElementFound; | 229 return isElementFound; |
234 } | 230 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 283 |
288 String action(formElement->action()); | 284 String action(formElement->action()); |
289 KURL url(formElement->document().completeURL(action.isNull() ? "" : action))
; | 285 KURL url(formElement->document().completeURL(action.isNull() ? "" : action))
; |
290 RefPtr<FormData> formData = FormData::create(encodedString); | 286 RefPtr<FormData> formData = FormData::create(encodedString); |
291 url.setQuery(formData->flattenToString()); | 287 url.setQuery(formData->flattenToString()); |
292 m_url = url; | 288 m_url = url; |
293 m_encoding = String(encoding.name()); | 289 m_encoding = String(encoding.name()); |
294 } | 290 } |
295 | 291 |
296 } // namespace blink | 292 } // namespace blink |
OLD | NEW |