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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 class FormElementKey { | 85 class FormElementKey { |
86 public: | 86 public: |
87 FormElementKey(StringImpl* = 0, StringImpl* = 0); | 87 FormElementKey(StringImpl* = 0, StringImpl* = 0); |
88 ~FormElementKey(); | 88 ~FormElementKey(); |
89 FormElementKey(const FormElementKey&); | 89 FormElementKey(const FormElementKey&); |
90 FormElementKey& operator=(const FormElementKey&); | 90 FormElementKey& operator=(const FormElementKey&); |
91 | 91 |
92 StringImpl* name() const { return m_name; } | 92 StringImpl* name() const { return m_name; } |
93 StringImpl* type() const { return m_type; } | 93 StringImpl* type() const { return m_type; } |
94 | 94 |
95 // Hash table deleted values, which are only constructed and never copied or d
estroyed. | 95 // Hash table deleted values, which are only constructed and never copied or |
| 96 // destroyed. |
96 FormElementKey(WTF::HashTableDeletedValueType) | 97 FormElementKey(WTF::HashTableDeletedValueType) |
97 : m_name(hashTableDeletedValue()) {} | 98 : m_name(hashTableDeletedValue()) {} |
98 bool isHashTableDeletedValue() const { | 99 bool isHashTableDeletedValue() const { |
99 return m_name == hashTableDeletedValue(); | 100 return m_name == hashTableDeletedValue(); |
100 } | 101 } |
101 | 102 |
102 private: | 103 private: |
103 void ref() const; | 104 void ref() const; |
104 void deref() const; | 105 void deref() const; |
105 | 106 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 map.clear(); | 515 map.clear(); |
515 } | 516 } |
516 | 517 |
517 void FormController::willDeleteForm(HTMLFormElement* form) { | 518 void FormController::willDeleteForm(HTMLFormElement* form) { |
518 if (m_formKeyGenerator) | 519 if (m_formKeyGenerator) |
519 m_formKeyGenerator->willDeleteForm(form); | 520 m_formKeyGenerator->willDeleteForm(form); |
520 } | 521 } |
521 | 522 |
522 void FormController::restoreControlStateFor( | 523 void FormController::restoreControlStateFor( |
523 HTMLFormControlElementWithState& control) { | 524 HTMLFormControlElementWithState& control) { |
524 // We don't save state of a control with shouldSaveAndRestoreFormControlState(
) | 525 // We don't save state of a control with |
525 // == false. But we need to skip restoring process too because a control in | 526 // shouldSaveAndRestoreFormControlState() == false. But we need to skip |
526 // another form might have the same pair of name and type and saved its state. | 527 // restoring process too because a control in another form might have the same |
| 528 // pair of name and type and saved its state. |
527 if (!control.shouldSaveAndRestoreFormControlState()) | 529 if (!control.shouldSaveAndRestoreFormControlState()) |
528 return; | 530 return; |
529 if (ownerFormForState(control)) | 531 if (ownerFormForState(control)) |
530 return; | 532 return; |
531 FormControlState state = takeStateForFormElement(control); | 533 FormControlState state = takeStateForFormElement(control); |
532 if (state.valueSize() > 0) | 534 if (state.valueSize() > 0) |
533 control.restoreFormControlState(state); | 535 control.restoreFormControlState(state); |
534 } | 536 } |
535 | 537 |
536 void FormController::restoreControlStateIn(HTMLFormElement& form) { | 538 void FormController::restoreControlStateIn(HTMLFormElement& form) { |
(...skipping 27 matching lines...) Expand all Loading... |
564 HTMLFormControlElementWithState& control) { | 566 HTMLFormControlElementWithState& control) { |
565 m_documentState->addControl(&control); | 567 m_documentState->addControl(&control); |
566 } | 568 } |
567 | 569 |
568 void FormController::unregisterStatefulFormControl( | 570 void FormController::unregisterStatefulFormControl( |
569 HTMLFormControlElementWithState& control) { | 571 HTMLFormControlElementWithState& control) { |
570 m_documentState->removeControl(&control); | 572 m_documentState->removeControl(&control); |
571 } | 573 } |
572 | 574 |
573 } // namespace blink | 575 } // namespace blink |
OLD | NEW |