Fix for http://bugs.webkit.org/show_bug.cgi?id=14746
<rdar://problem/
5401041> REGRESSION: Form state not saved for forms that submit via HTTPS even if they do not contain a password field
* loader/FrameLoader.cpp: (WebCore::FrameLoader::saveDocumentState): Restore our old behavior that will save form state for secure forms.
This will also match Firefox behavior.
* dom/Document.cpp: Removed secureFormAdded(), secureFormRemoved(), hasSecureForm() which are no longer used.
* dom/Document.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::attach):
(WebCore::HTMLFormElement::parseMappedAttribute):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25064
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-08-13 Adele Peterson <adele@apple.com>
+
+ Reviewed by Brady.
+
+ Fix for http://bugs.webkit.org/show_bug.cgi?id=14746
+ <rdar://problem/5401041> REGRESSION: Form state not saved for forms that submit via HTTPS even if they do not contain a password field
+
+ * loader/FrameLoader.cpp: (WebCore::FrameLoader::saveDocumentState): Restore our old behavior that will save form state for secure forms.
+ This will also match Firefox behavior.
+
+ * dom/Document.cpp: Removed secureFormAdded(), secureFormRemoved(), hasSecureForm() which are no longer used.
+ * dom/Document.h:
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::attach):
+ (WebCore::HTMLFormElement::parseMappedAttribute):
+
2007-08-13 Oliver Hunt <oliver@apple.com>
Reviewed by Maciej.
(*it)->didRestoreFromCache();
}
-void Document::secureFormAdded()
-{
- m_secureForms++;
-}
-
-void Document::secureFormRemoved()
-{
- ASSERT(m_secureForms > 0);
- m_secureForms--;
-}
-
-bool Document::hasSecureForm() const
-{
- return m_secureForms > 0;
-}
-
void Document::setShouldCreateRenderers(bool f)
{
m_createRenderers = f;
void didRestoreFromCache();
- void secureFormAdded();
- void secureFormRemoved();
- bool hasSecureForm() const;
-
void setShouldCreateRenderers(bool);
bool shouldCreateRenderers();
void HTMLFormElement::attach()
{
HTMLElement::attach();
-
- // note we don't deal with calling secureFormRemoved() on detach, because the timing
- // was such that it cleared our state too early
- if (formWouldHaveSecureSubmission(m_url))
- document()->secureFormAdded();
}
void HTMLFormElement::insertedIntoDocument()
void HTMLFormElement::parseMappedAttribute(MappedAttribute *attr)
{
- if (attr->name() == actionAttr) {
- bool oldURLWasSecure = formWouldHaveSecureSubmission(m_url);
+ if (attr->name() == actionAttr)
m_url = parseURL(attr->value());
- bool newURLIsSecure = formWouldHaveSecureSubmission(m_url);
-
- if (m_attached && (oldURLWasSecure != newURLIsSecure))
- if (newURLIsSecure)
- document()->secureFormAdded();
- else
- document()->secureFormRemoved();
- }
else if (attr->name() == targetAttr)
m_target = attr->value();
else if (attr->name() == methodAttr) {
if (m_creatingInitialEmptyDocument)
return;
- // Do not save doc state if the page has a form that would be submitted via https.
- Document* document = m_frame->document();
- ASSERT(document);
-
- if (document->hasSecureForm())
- return;
-
// For a standard page load, we will have a previous item set, which will be used to
// store the form state. However, in some cases we will have no previous item, and
// the current item is the right place to save the state. One example is when we
HistoryItem* item = m_previousHistoryItem ? m_previousHistoryItem.get() : m_currentHistoryItem.get();
if (!item)
return;
-
+
+ Document* document = m_frame->document();
+ ASSERT(document);
+
if (document && item->isCurrentDocument(document)) {
LOG(Loading, "WebCoreLoading %s: saving form state to %p", m_frame->tree()->name().domString().utf8().data(), item);
item->setDocumentState(document->formElementsState());