| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 } // namespace | 224 } // namespace |
| 225 | 225 |
| 226 WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W
ebInputElement& selectedInputElement) | 226 WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W
ebInputElement& selectedInputElement) |
| 227 { | 227 { |
| 228 HTMLFormElement* formElement = static_cast<HTMLFormElement*>(form); | 228 HTMLFormElement* formElement = static_cast<HTMLFormElement*>(form); |
| 229 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(selectedInpu
tElement); | 229 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(selectedInpu
tElement); |
| 230 | 230 |
| 231 // Only consider forms that GET data. | 231 // Only consider forms that GET data. |
| 232 // Allow HTTPS only when an input element is provided. | 232 // Allow HTTPS only when an input element is provided. |
| 233 if (equalIgnoringCase(formElement->getAttribute(methodAttr), "post") | 233 if (equalIgnoringASCIICase(formElement->getAttribute(methodAttr), "post") |
| 234 || (!isHTTPFormSubmit(*formElement) && !inputElement)) | 234 || (!isHTTPFormSubmit(*formElement) && !inputElement)) |
| 235 return; | 235 return; |
| 236 | 236 |
| 237 WTF::TextEncoding encoding; | 237 WTF::TextEncoding encoding; |
| 238 getFormEncoding(*formElement, &encoding); | 238 getFormEncoding(*formElement, &encoding); |
| 239 if (!encoding.isValid()) { | 239 if (!encoding.isValid()) { |
| 240 // Need a valid encoding to encode the form elements. | 240 // Need a valid encoding to encode the form elements. |
| 241 // If the encoding isn't found webkit ends up replacing the params with | 241 // If the encoding isn't found webkit ends up replacing the params with |
| 242 // empty strings. So, we don't try to do anything here. | 242 // empty strings. So, we don't try to do anything here. |
| 243 return; | 243 return; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 273 | 273 |
| 274 String action(formElement->action()); | 274 String action(formElement->action()); |
| 275 KURL url(formElement->document().completeURL(action.isNull() ? "" : action))
; | 275 KURL url(formElement->document().completeURL(action.isNull() ? "" : action))
; |
| 276 RefPtr<EncodedFormData> formData = EncodedFormData::create(encodedString); | 276 RefPtr<EncodedFormData> formData = EncodedFormData::create(encodedString); |
| 277 url.setQuery(formData->flattenToString()); | 277 url.setQuery(formData->flattenToString()); |
| 278 m_url = url; | 278 m_url = url; |
| 279 m_encoding = String(encoding.name()); | 279 m_encoding = String(encoding.name()); |
| 280 } | 280 } |
| 281 | 281 |
| 282 } // namespace blink | 282 } // namespace blink |
| OLD | NEW |