| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 190 |
| 191 HTMLFormControlElement& control = toHTMLFormControlElement(*item); | 191 HTMLFormControlElement& control = toHTMLFormControlElement(*item); |
| 192 if (control.isDisabledFormControl() || control.name().isNull()) | 192 if (control.isDisabledFormControl() || control.name().isNull()) |
| 193 continue; | 193 continue; |
| 194 | 194 |
| 195 FormData* formData = FormData::create(encoding); | 195 FormData* formData = FormData::create(encoding); |
| 196 control.appendToFormData(*formData); | 196 control.appendToFormData(*formData); |
| 197 | 197 |
| 198 for (const auto& entry : formData->entries()) { | 198 for (const auto& entry : formData->entries()) { |
| 199 if (!encodedString->isEmpty()) | 199 if (!encodedString->isEmpty()) |
| 200 encodedString->append('&'); | 200 encodedString->push_back('&'); |
| 201 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->name(), | 201 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->name(), |
| 202 FormDataEncoder::NormalizeCRLF); | 202 FormDataEncoder::NormalizeCRLF); |
| 203 encodedString->append('='); | 203 encodedString->push_back('='); |
| 204 if (&control == textElement) { | 204 if (&control == textElement) { |
| 205 encodedString->append("{searchTerms}", 13); | 205 encodedString->append("{searchTerms}", 13); |
| 206 isElementFound = true; | 206 isElementFound = true; |
| 207 } else { | 207 } else { |
| 208 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->value(), | 208 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->value(), |
| 209 FormDataEncoder::NormalizeCRLF); | 209 FormDataEncoder::NormalizeCRLF); |
| 210 } | 210 } |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 return isElementFound; | 213 return isElementFound; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 266 |
| 267 String action(formElement->action()); | 267 String action(formElement->action()); |
| 268 KURL url(formElement->document().completeURL(action.isNull() ? "" : action)); | 268 KURL url(formElement->document().completeURL(action.isNull() ? "" : action)); |
| 269 RefPtr<EncodedFormData> formData = EncodedFormData::create(encodedString); | 269 RefPtr<EncodedFormData> formData = EncodedFormData::create(encodedString); |
| 270 url.setQuery(formData->flattenToString()); | 270 url.setQuery(formData->flattenToString()); |
| 271 m_url = url; | 271 m_url = url; |
| 272 m_encoding = String(encoding.name()); | 272 m_encoding = String(encoding.name()); |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace blink | 275 } // namespace blink |
| OLD | NEW |