#include "config.h"
#include "core/html/HTMLFormControlElementWithState.h"
-#include "core/frame/Frame.h"
#include "core/frame/FrameHost.h"
+#include "core/frame/LocalFrame.h"
#include "core/html/HTMLFormElement.h"
#include "core/html/forms/FormController.h"
+#include "core/loader/FrameLoaderClient.h"
#include "core/page/Chrome.h"
#include "core/page/ChromeClient.h"
-namespace WebCore {
+namespace blink {
HTMLFormControlElementWithState::HTMLFormControlElementWithState(const QualifiedName& tagName, Document& doc, HTMLFormElement* f)
: HTMLFormControlElement(tagName, doc, f)
Node::InsertionNotificationRequest HTMLFormControlElementWithState::insertedInto(ContainerNode* insertionPoint)
{
if (insertionPoint->inDocument() && !containingShadowRoot())
- document().formController()->registerStatefulFormControl(*this);
+ document().formController().registerStatefulFormControl(*this);
return HTMLFormControlElement::insertedInto(insertionPoint);
}
void HTMLFormControlElementWithState::removedFrom(ContainerNode* insertionPoint)
{
if (insertionPoint->inDocument() && !containingShadowRoot() && !insertionPoint->containingShadowRoot())
- document().formController()->unregisterStatefulFormControl(*this);
+ document().formController().unregisterStatefulFormControl(*this);
HTMLFormControlElement::removedFrom(insertionPoint);
}
// selection before the document is active (or even in a frame).
if (!document().isActive())
return;
- document().frame()->host()->chrome().client().formStateDidChange(this);
+ document().frame()->loader().client()->didUpdateCurrentHistoryItem();
}
bool HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState() const
{
// We don't save/restore control state in a form with autocomplete=off.
- return inActiveDocument() && shouldAutocomplete();
+ return inDocument() && shouldAutocomplete();
}
FormControlState HTMLFormControlElementWithState::saveFormControlState() const
void HTMLFormControlElementWithState::finishParsingChildren()
{
HTMLFormControlElement::finishParsingChildren();
- document().formController()->restoreControlStateFor(*this);
+ document().formController().restoreControlStateFor(*this);
}
bool HTMLFormControlElementWithState::isFormControlElementWithState() const