Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 * | 22 * |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #include "config.h" | 25 #include "config.h" |
| 26 #include "core/html/HTMLFormControlElementWithState.h" | 26 #include "core/html/HTMLFormControlElementWithState.h" |
| 27 | 27 |
| 28 #include "core/frame/FrameHost.h" | 28 #include "core/frame/FrameHost.h" |
| 29 #include "core/frame/LocalFrame.h" | 29 #include "core/frame/LocalFrame.h" |
| 30 #include "core/html/HTMLFormElement.h" | 30 #include "core/html/HTMLFormElement.h" |
| 31 #include "core/html/forms/FormController.h" | 31 #include "core/html/forms/FormController.h" |
| 32 #include "core/loader/FrameLoaderClient.h" | |
| 32 #include "core/page/Chrome.h" | 33 #include "core/page/Chrome.h" |
| 33 #include "core/page/ChromeClient.h" | 34 #include "core/page/ChromeClient.h" |
| 34 | 35 |
| 35 namespace WebCore { | 36 namespace WebCore { |
| 36 | 37 |
| 37 HTMLFormControlElementWithState::HTMLFormControlElementWithState(const Qualified Name& tagName, Document& doc, HTMLFormElement* f) | 38 HTMLFormControlElementWithState::HTMLFormControlElementWithState(const Qualified Name& tagName, Document& doc, HTMLFormElement* f) |
| 38 : HTMLFormControlElement(tagName, doc, f) | 39 : HTMLFormControlElement(tagName, doc, f) |
| 39 { | 40 { |
| 40 } | 41 } |
| 41 | 42 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 63 return true; | 64 return true; |
| 64 return form()->shouldAutocomplete(); | 65 return form()->shouldAutocomplete(); |
| 65 } | 66 } |
| 66 | 67 |
| 67 void HTMLFormControlElementWithState::notifyFormStateChanged() | 68 void HTMLFormControlElementWithState::notifyFormStateChanged() |
| 68 { | 69 { |
| 69 // This can be called during fragment parsing as a result of option | 70 // This can be called during fragment parsing as a result of option |
| 70 // selection before the document is active (or even in a frame). | 71 // selection before the document is active (or even in a frame). |
| 71 if (!document().isActive()) | 72 if (!document().isActive()) |
| 72 return; | 73 return; |
| 73 document().frame()->loader().markDocumentStateDirty(); | 74 document().frame()->loader().client()->didUpdateCurrentHistoryItem(); |
| 74 } | 75 } |
| 75 | 76 |
| 76 bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() con st | 77 bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() con st |
| 77 { | 78 { |
| 78 // We don't save/restore control state in a form with autocomplete=off. | 79 // We don't save/restore control state in a form with autocomplete=off. |
| 79 return inActiveDocument() && shouldAutocomplete(); | 80 return inDocument() && shouldAutocomplete(); |
|
Nate Chapin
2014/04/17 21:16:25
Remove the active check because we might be genera
abarth-chromium
2014/04/17 23:41:24
Ok.
| |
| 80 } | 81 } |
| 81 | 82 |
| 82 FormControlState HTMLFormControlElementWithState::saveFormControlState() const | 83 FormControlState HTMLFormControlElementWithState::saveFormControlState() const |
| 83 { | 84 { |
| 84 return FormControlState(); | 85 return FormControlState(); |
| 85 } | 86 } |
| 86 | 87 |
| 87 void HTMLFormControlElementWithState::finishParsingChildren() | 88 void HTMLFormControlElementWithState::finishParsingChildren() |
| 88 { | 89 { |
| 89 HTMLFormControlElement::finishParsingChildren(); | 90 HTMLFormControlElement::finishParsingChildren(); |
| 90 document().formController().restoreControlStateFor(*this); | 91 document().formController().restoreControlStateFor(*this); |
| 91 } | 92 } |
| 92 | 93 |
| 93 bool HTMLFormControlElementWithState::isFormControlElementWithState() const | 94 bool HTMLFormControlElementWithState::isFormControlElementWithState() const |
| 94 { | 95 { |
| 95 return true; | 96 return true; |
| 96 } | 97 } |
| 97 | 98 |
| 98 } // namespace Webcore | 99 } // namespace Webcore |
| OLD | NEW |