| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 HTMLFormControlElement& control = toHTMLFormControlElement(*item); | 208 HTMLFormControlElement& control = toHTMLFormControlElement(*item); |
| 209 if (control.isDisabledFormControl() || control.name().isNull()) | 209 if (control.isDisabledFormControl() || control.name().isNull()) |
| 210 continue; | 210 continue; |
| 211 | 211 |
| 212 FormData* formData = FormData::create(encoding); | 212 FormData* formData = FormData::create(encoding); |
| 213 control.appendToFormData(*formData); | 213 control.appendToFormData(*formData); |
| 214 | 214 |
| 215 for (const auto& entry : formData->entries()) { | 215 for (const auto& entry : formData->entries()) { |
| 216 if (!encodedString->isEmpty()) | 216 if (!encodedString->isEmpty()) |
| 217 encodedString->append('&'); | 217 encodedString->append('&'); |
| 218 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->name(
)); | 218 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->name(
), FormDataEncoder::NormalizeCRLF); |
| 219 encodedString->append('='); | 219 encodedString->append('='); |
| 220 if (&control == textElement) { | 220 if (&control == textElement) { |
| 221 encodedString->append("{searchTerms}", 13); | 221 encodedString->append("{searchTerms}", 13); |
| 222 isElementFound = true; | 222 isElementFound = true; |
| 223 } else { | 223 } else { |
| 224 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->v
alue()); | 224 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->v
alue(), FormDataEncoder::NormalizeCRLF); |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 return isElementFound; | 228 return isElementFound; |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace | 231 } // namespace |
| 232 | 232 |
| 233 WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W
ebInputElement& selectedInputElement) | 233 WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W
ebInputElement& selectedInputElement) |
| 234 { | 234 { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 280 |
| 281 String action(formElement->action()); | 281 String action(formElement->action()); |
| 282 KURL url(formElement->document().completeURL(action.isNull() ? "" : action))
; | 282 KURL url(formElement->document().completeURL(action.isNull() ? "" : action))
; |
| 283 RefPtr<EncodedFormData> formData = EncodedFormData::create(encodedString); | 283 RefPtr<EncodedFormData> formData = EncodedFormData::create(encodedString); |
| 284 url.setQuery(formData->flattenToString()); | 284 url.setQuery(formData->flattenToString()); |
| 285 m_url = url; | 285 m_url = url; |
| 286 m_encoding = String(encoding.name()); | 286 m_encoding = String(encoding.name()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace blink | 289 } // namespace blink |
| OLD | NEW |