| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010, 2011, 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2010, 2011, 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 typedef HashMap<String, unsigned> FormSignatureToNextIndexMap; | 310 typedef HashMap<String, unsigned> FormSignatureToNextIndexMap; |
| 311 FormToKeyMap m_formToKeyMap; | 311 FormToKeyMap m_formToKeyMap; |
| 312 FormSignatureToNextIndexMap m_formSignatureToNextIndexMap; | 312 FormSignatureToNextIndexMap m_formSignatureToNextIndexMap; |
| 313 }; | 313 }; |
| 314 | 314 |
| 315 static inline void recordFormStructure(const HTMLFormElement& form, StringBuilde
r& builder) | 315 static inline void recordFormStructure(const HTMLFormElement& form, StringBuilde
r& builder) |
| 316 { | 316 { |
| 317 // 2 is enough to distinguish forms in webkit.org/b/91209#c0 | 317 // 2 is enough to distinguish forms in webkit.org/b/91209#c0 |
| 318 const size_t namedControlsToBeRecorded = 2; | 318 const size_t namedControlsToBeRecorded = 2; |
| 319 const FormAssociatedElement::List& controls = form.associatedElements(); | 319 const FormAssociatedElement::List& controls = form.associatedElements(); |
| 320 builder.append(" ["); | 320 builder.appendLiteral(" ["); |
| 321 for (size_t i = 0, namedControls = 0; i < controls.size() && namedControls <
namedControlsToBeRecorded; ++i) { | 321 for (size_t i = 0, namedControls = 0; i < controls.size() && namedControls <
namedControlsToBeRecorded; ++i) { |
| 322 if (!controls[i]->isFormControlElementWithState()) | 322 if (!controls[i]->isFormControlElementWithState()) |
| 323 continue; | 323 continue; |
| 324 HTMLFormControlElementWithState* control = toHTMLFormControlElementWithS
tate(controls[i]); | 324 HTMLFormControlElementWithState* control = toHTMLFormControlElementWithS
tate(controls[i]); |
| 325 if (!ownerFormForState(*control)) | 325 if (!ownerFormForState(*control)) |
| 326 continue; | 326 continue; |
| 327 AtomicString name = control->name(); | 327 AtomicString name = control->name(); |
| 328 if (name.isEmpty()) | 328 if (name.isEmpty()) |
| 329 continue; | 329 continue; |
| 330 namedControls++; | 330 namedControls++; |
| 331 builder.append(name); | 331 builder.append(name); |
| 332 builder.append(" "); | 332 builder.append(' '); |
| 333 } | 333 } |
| 334 builder.append("]"); | 334 builder.append(']'); |
| 335 } | 335 } |
| 336 | 336 |
| 337 static inline String formSignature(const HTMLFormElement& form) | 337 static inline String formSignature(const HTMLFormElement& form) |
| 338 { | 338 { |
| 339 KURL actionURL = form.getURLAttribute(actionAttr); | 339 KURL actionURL = form.getURLAttribute(actionAttr); |
| 340 // Remove the query part because it might contain volatile parameters such | 340 // Remove the query part because it might contain volatile parameters such |
| 341 // as a session key. | 341 // as a session key. |
| 342 if (!actionURL.isEmpty()) | 342 if (!actionURL.isEmpty()) |
| 343 actionURL.setQuery(String()); | 343 actionURL.setQuery(String()); |
| 344 | 344 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 { | 560 { |
| 561 m_documentState->addControl(&control); | 561 m_documentState->addControl(&control); |
| 562 } | 562 } |
| 563 | 563 |
| 564 void FormController::unregisterStatefulFormControl(HTMLFormControlElementWithSta
te& control) | 564 void FormController::unregisterStatefulFormControl(HTMLFormControlElementWithSta
te& control) |
| 565 { | 565 { |
| 566 m_documentState->removeControl(&control); | 566 m_documentState->removeControl(&control); |
| 567 } | 567 } |
| 568 | 568 |
| 569 } // namespace blink | 569 } // namespace blink |
| OLD | NEW |