Changeset 25064 in webkit


Ignore:
Timestamp:
Aug 13, 2007 6:52:01 PM (17 years ago)
Author:
adele
Message:

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):
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r25063 r25064  
     12007-08-13  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Brady.
     4
     5        Fix for http://bugs.webkit.org/show_bug.cgi?id=14746
     6        <rdar://problem/5401041> REGRESSION: Form state not saved for forms that submit via HTTPS even if they do not contain a password field
     7
     8        * loader/FrameLoader.cpp: (WebCore::FrameLoader::saveDocumentState): Restore our old behavior that will save form state for secure forms.
     9          This will also match Firefox behavior.
     10
     11        * dom/Document.cpp: Removed secureFormAdded(), secureFormRemoved(), hasSecureForm() which are no longer used.
     12        * dom/Document.h:
     13        * html/HTMLFormElement.cpp:
     14        (WebCore::HTMLFormElement::attach):
     15        (WebCore::HTMLFormElement::parseMappedAttribute):
     16
    1172007-08-13  Oliver Hunt  <oliver@apple.com>
    218
  • trunk/WebCore/dom/Document.cpp

    r25002 r25064  
    27382738}
    27392739
    2740 void Document::secureFormAdded()
    2741 {
    2742     m_secureForms++;
    2743 }
    2744 
    2745 void Document::secureFormRemoved()
    2746 {
    2747     ASSERT(m_secureForms > 0);
    2748     m_secureForms--;
    2749 }
    2750 
    2751 bool Document::hasSecureForm() const
    2752 {
    2753     return m_secureForms > 0;
    2754 }
    2755 
    27562740void Document::setShouldCreateRenderers(bool f)
    27572741{
  • trunk/WebCore/dom/Document.h

    r25002 r25064  
    798798    void didRestoreFromCache();
    799799
    800     void secureFormAdded();
    801     void secureFormRemoved();
    802     bool hasSecureForm() const;
    803 
    804800    void setShouldCreateRenderers(bool);
    805801    bool shouldCreateRenderers();
  • trunk/WebCore/html/HTMLFormElement.cpp

    r24541 r25064  
    8686{
    8787    HTMLElement::attach();
    88 
    89     // note we don't deal with calling secureFormRemoved() on detach, because the timing
    90     // was such that it cleared our state too early
    91     if (formWouldHaveSecureSubmission(m_url))
    92         document()->secureFormAdded();
    9388}
    9489
     
    494489void HTMLFormElement::parseMappedAttribute(MappedAttribute *attr)
    495490{
    496     if (attr->name() == actionAttr) {
    497         bool oldURLWasSecure = formWouldHaveSecureSubmission(m_url);
     491    if (attr->name() == actionAttr)
    498492        m_url = parseURL(attr->value());
    499         bool newURLIsSecure = formWouldHaveSecureSubmission(m_url);
    500 
    501         if (m_attached && (oldURLWasSecure != newURLIsSecure))
    502             if (newURLIsSecure)
    503                 document()->secureFormAdded();
    504             else
    505                 document()->secureFormRemoved();
    506     }
    507493    else if (attr->name() == targetAttr)
    508494        m_target = attr->value();
  • trunk/WebCore/loader/FrameLoader.cpp

    r24934 r25064  
    38353835        return;
    38363836
    3837     // Do not save doc state if the page has a form that would be submitted via https.
    3838     Document* document = m_frame->document();
    3839     ASSERT(document);
    3840        
    3841     if (document->hasSecureForm())
    3842         return;
    3843          
    38443837    // For a standard page load, we will have a previous item set, which will be used to
    38453838    // store the form state.  However, in some cases we will have no previous item, and
     
    38563849    if (!item)
    38573850        return;
    3858        
     3851
     3852    Document* document = m_frame->document();
     3853    ASSERT(document);
     3854   
    38593855    if (document && item->isCurrentDocument(document)) {
    38603856        LOG(Loading, "WebCoreLoading %s: saving form state to %p", m_frame->tree()->name().domString().utf8().data(), item);
Note: See TracChangeset for help on using the changeset viewer.