2008-02-04 Matt Perry <mpComplete@gmail.com>
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Feb 2008 08:16:17 +0000 (08:16 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Feb 2008 08:16:17 +0000 (08:16 +0000)
commit657712df68f2ec5c5d29009e426a113168019b06
treed1431146ac0bb772a2b0878c8ce3409cb480a7fc
parent2e9a00d124c7120430c43270fc406a1cba10cc00
2008-02-04  Matt Perry  <mpComplete@gmail.com>

        Reviewed by Darin Adler.

        Fix for http://bugs.webkit.org/show_bug.cgi?id=14959
        No back forward entry added for pages created in javascript

        A new HistoryItem is created for calls to Document::open.  Calls to
        Document::write save the written data to a SharedBuffer that is also
        stored on the HistoryItem.  When the user navigates back to a
        HistoryItem that has a valid buffer, that data is used for the page
        content.

        Tests: http/tests/navigation/document-open-adds-history-item.html
               http/tests/navigation/document-open-delayed-adds-history-item.html
               http/tests/navigation/document-open-new-window-adds-history-item.html
               http/tests/navigation/document-open-replace-no-history-item.html

        * bindings/js/JSHTMLDocumentCustom.cpp:
        (WebCore::JSHTMLDocument::open):
        * dom/Document.cpp:
        (WebCore::Document::open):
        (WebCore::Document::write):
        (WebCore::Document::clear):
        * dom/Document.h:
        * history/HistoryItem.cpp:
        (WebCore::HistoryItem::HistoryItem):
        (WebCore::HistoryItem::substituteData):
        (WebCore::HistoryItem::setSubstituteData):
        * history/HistoryItem.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::didExplicitOpen):
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::reloadAllowingStaleData):
        (WebCore::FrameLoader::reload):
        (WebCore::FrameLoader::shouldTreatURLAsSameAsCurrent):
        (WebCore::FrameLoader::loadItem):
        * loader/FrameLoader.h:

2008-02-04  Matt Perry  <mpComplete@gmail.com>

        Reviewed by Darin Adler.

        Test cases for fix to http://bugs.webkit.org/show_bug.cgi?id=14959
        No back forward entry added for pages created in javascript.

        * http/tests/navigation/document-open-adds-history-item-expected.txt: Added.
        * http/tests/navigation/document-open-adds-history-item.html: Added.
        * http/tests/navigation/document-open-delayed-adds-history-item-expected.txt: Added.
        * http/tests/navigation/document-open-delayed-adds-history-item.html: Added.
        * http/tests/navigation/document-open-new-window-adds-history-item-expected.txt: Added.
        * http/tests/navigation/document-open-new-window-adds-history-item.html: Added.
        * http/tests/navigation/document-open-replace-no-history-item-expected.txt: Added.
        * http/tests/navigation/document-open-replace-no-history-item.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29998 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/navigation/document-open-adds-history-item-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/document-open-adds-history-item.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/document-open-delayed-adds-history-item-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/document-open-delayed-adds-history-item.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/document-open-new-window-adds-history-item-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/document-open-new-window-adds-history-item.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/document-open-replace-no-history-item-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/navigation/document-open-replace-no-history-item.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/resources/document-open-page-2.html [new file with mode: 0644]
LayoutTests/http/tests/navigation/resources/document-open.js [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bindings/js/JSHTMLDocumentCustom.cpp
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/history/HistoryItem.cpp
WebCore/history/HistoryItem.h
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoader.h