WebCore:
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Jul 2008 23:34:32 +0000 (23:34 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Jul 2008 23:34:32 +0000 (23:34 +0000)
commit8da7df0d01eb4f57b43df941a04256682757811f
treea6812334953df65bce3dec9e232d57831d89fc66
parent2e2d5f6582e720e0ea6cd070a3bc7a8cf255002f
WebCore:

2008-07-28  Brady Eidson  <beidson@apple.com>

        Reviewed by Sam Weinig

        Test: security/autocomplete-cleared-on-back.html

        <rdar://problem/6093281> - autocomplete="off" should work when going back

        Taken care of in two ways:
        1 - Listening for the page cache notification to clear the form, in cases where the page
            is being restored from the page cache
        2 - Not saving such form elements when doing the normal "save state" to a history item,
            for cases with no page cache

        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::~HTMLFormElement):
        (WebCore::HTMLFormElement::parseMappedAttribute):
        (WebCore::HTMLFormElement::didRestoreFromCache):
        (WebCore::HTMLFormElement::willMoveToNewOwnerDocument):
        (WebCore::HTMLFormElement::didMoveToNewOwnerDocument):
        * html/HTMLFormElement.h:

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::~HTMLInputElement):
        (WebCore::HTMLInputElement::setInputType):
        (WebCore::HTMLInputElement::saveState):
        (WebCore::HTMLInputElement::parseMappedAttribute):
        (WebCore::HTMLInputElement::needsCacheCallback):
        (WebCore::HTMLInputElement::registerForCacheCallbackIfNeeded): Only register if the type or attribute
          indicate we should.
        (WebCore::HTMLInputElement::unregisterForCacheCallbackIfNeeded): Only unregister if both the type
          and attribute are clear of needing registration.
        (WebCore::HTMLInputElement::didRestoreFromCache):
        (WebCore::HTMLInputElement::willMoveToNewOwnerDocument):
        (WebCore::HTMLInputElement::didMoveToNewOwnerDocument):
        * html/HTMLInputElement.h:

LayoutTests:

2008-07-28  Brady Eidson  <beidson@apple.com>

        Reviewed by Sam Weinig

        <rdar://problem/6093281> - autocomplete="off" should work when going back

        * security/autocomplete-cleared-on-back-expected.txt: Added.
        * security/autocomplete-cleared-on-back.html: Added.
        * security/resources: Added.
        * security/resources/autocomplete-cleared-on-back2.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/security/autocomplete-cleared-on-back-expected.txt [new file with mode: 0644]
LayoutTests/security/autocomplete-cleared-on-back.html [new file with mode: 0644]
LayoutTests/security/resources/autocomplete-cleared-on-back2.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLFormElement.h
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLInputElement.h