Changeset 21738 in webkit


Ignore:
Timestamp:
May 24, 2007 4:48:02 PM (17 years ago)
Author:
adele
Message:

LayoutTests:

Reviewed by Darin.

Test for <rdar://problem/5211921> Form values sometimes get transposed (iGoogle)

  • fast/history/redirect-load-no-form-restoration-expected.txt: Added.
  • fast/history/redirect-load-no-form-restoration.html: Added.
  • fast/history/resources/redirect-load.html: Added.

WebCore:

Reviewed by Darin.

Fix for <rdar://problem/5211921> Form values sometimes get transposed (iGoogle)

Test: fast/history/redirect-load-no-form-restoration.html

  • history/HistoryItem.cpp: (WebCore::HistoryItem::setURL): Clear the document state when the url changes for a HistoryItem. (WebCore::HistoryItem::isCurrentDocument): Added. Compares the HistoryItem url to the document's url. This might not be the best way to do this, but it works for now.
  • history/HistoryItem.h:
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::saveDocumentState): Only set the document (and form) state if the document is current for the history item.
Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r21734 r21738  
     12007-05-24  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        Test for <rdar://problem/5211921> Form values sometimes get transposed (iGoogle)
     6
     7        * fast/history/redirect-load-no-form-restoration-expected.txt: Added.
     8        * fast/history/redirect-load-no-form-restoration.html: Added.
     9        * fast/history/resources/redirect-load.html: Added.
     10
    1112007-05-24  Mitz Pettel  <mitz@webkit.org>
    212
  • trunk/WebCore/ChangeLog

    r21734 r21738  
     12007-05-24  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        Fix for <rdar://problem/5211921> Form values sometimes get transposed (iGoogle)
     6
     7        Test: fast/history/redirect-load-no-form-restoration.html
     8
     9        * history/HistoryItem.cpp:
     10        (WebCore::HistoryItem::setURL): Clear the document state when the url changes for a HistoryItem.
     11        (WebCore::HistoryItem::isCurrentDocument): Added. Compares the HistoryItem url to the document's url.  This might not be the best way to do this, but it works for now.
     12        * history/HistoryItem.h:
     13        * loader/FrameLoader.cpp: (WebCore::FrameLoader::saveDocumentState): Only set the document (and form) state if the document is current for the history item.
     14
    1152007-05-24  Mitz Pettel  <mitz@webkit.org>
    216
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r21721 r21738  
    1143211432                        isa = PBXProject;
    1143311433                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
    11434                         compatibilityVersion = "Xcode 2.4";
    1143511434                        hasScannedForEncodings = 1;
    1143611435                        knownRegions = (
     
    1144711446                        projectDirPath = "";
    1144811447                        projectRoot = "";
    11449                         shouldCheckCompatibility = 1;
    1145011448                        targets = (
    1145111449                                93F198A508245E59001E9ABC /* WebCore */,
  • trunk/WebCore/history/HistoryItem.cpp

    r21464 r21738  
    2727#include "HistoryItem.h"
    2828
     29#include "Document.h"
    2930#include "CachedPage.h"
    3031#include "FrameLoader.h"
     
    203204    setURLString(url.url());
    204205    setCachedPage(0);
     206    clearDocumentState();
    205207}
    206208
     
    382384}
    383385
     386bool HistoryItem::isCurrentDocument(Document* doc) const
     387{
     388    // FIXME: We should find a better way to check if this is the current document.
     389    return urlString() == doc->URL();
     390}
     391
    384392void HistoryItem::mergeAutoCompleteHints(HistoryItem* otherItem)
    385393{
  • trunk/WebCore/history/HistoryItem.h

    r21464 r21738  
    4545namespace WebCore {
    4646
     47class Document;
    4748class CachedPage;
    4849class Image;
     
    127128    void setLastVisitedTime(double);
    128129   
     130    bool isCurrentDocument(Document*) const;
     131   
    129132#if PLATFORM(MAC)
    130133    id viewState() const;
  • trunk/WebCore/loader/FrameLoader.cpp

    r21724 r21738  
    37663766       
    37673767    if (document->hasSecureForm())
    3768          return;
     3768        return;
    37693769         
    37703770    // For a standard page load, we will have a previous item set, which will be used to
     
    37833783        return;
    37843784       
    3785     if (document) {
    3786         LOG(Loading, "WebCoreLoading %s: saving form state to %p", ((String&)m_frame->tree()->name()).ascii().data(), item);
     3785    if (document && item->isCurrentDocument(document)) {
     3786        LOG(Loading, "WebCoreLoading %s: saving form state to %p", m_frame->tree()->name().domString().utf8().data(), item);
    37873787        item->setDocumentState(document->formElementsState());
    37883788    }
Note: See TracChangeset for help on using the changeset viewer.