Changeset 30001 in webkit


Ignore:
Timestamp:
Feb 5, 2008 1:34:18 AM (16 years ago)
Author:
ap@webkit.org
Message:

Pretend that r29998 never happened.

Location:
trunk
Files:
10 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r29998 r30001  
    1 2008-02-04  Matt Perry  <mpComplete@gmail.com>
    2 
    3         Reviewed by Darin Adler.
    4 
    5         Test cases for fix to http://bugs.webkit.org/show_bug.cgi?id=14959
    6         No back forward entry added for pages created in javascript.
    7 
    8         * http/tests/navigation/document-open-adds-history-item-expected.txt: Added.
    9         * http/tests/navigation/document-open-adds-history-item.html: Added.
    10         * http/tests/navigation/document-open-delayed-adds-history-item-expected.txt: Added.
    11         * http/tests/navigation/document-open-delayed-adds-history-item.html: Added.
    12         * http/tests/navigation/document-open-new-window-adds-history-item-expected.txt: Added.
    13         * http/tests/navigation/document-open-new-window-adds-history-item.html: Added.
    14         * http/tests/navigation/document-open-replace-no-history-item-expected.txt: Added.
    15         * http/tests/navigation/document-open-replace-no-history-item.html: Added.
    16 
    1712008-02-04  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
    182
  • trunk/WebCore/ChangeLog

    r30000 r30001  
    66
    77        * ChangeLog: Point out revision 30,000.
    8 
    9 2008-02-04  Matt Perry  <mpComplete@gmail.com>
    10 
    11         Reviewed by Darin Adler.
    12 
    13         Fix for http://bugs.webkit.org/show_bug.cgi?id=14959
    14         No back forward entry added for pages created in javascript
    15 
    16         A new HistoryItem is created for calls to Document::open.  Calls to
    17         Document::write save the written data to a SharedBuffer that is also
    18         stored on the HistoryItem.  When the user navigates back to a
    19         HistoryItem that has a valid buffer, that data is used for the page
    20         content.
    21 
    22         Tests: http/tests/navigation/document-open-adds-history-item.html
    23                http/tests/navigation/document-open-delayed-adds-history-item.html
    24                http/tests/navigation/document-open-new-window-adds-history-item.html
    25                http/tests/navigation/document-open-replace-no-history-item.html
    26 
    27         * bindings/js/JSHTMLDocumentCustom.cpp:
    28         (WebCore::JSHTMLDocument::open):
    29         * dom/Document.cpp:
    30         (WebCore::Document::open):
    31         (WebCore::Document::write):
    32         (WebCore::Document::clear):
    33         * dom/Document.h:
    34         * history/HistoryItem.cpp:
    35         (WebCore::HistoryItem::HistoryItem):
    36         (WebCore::HistoryItem::substituteData):
    37         (WebCore::HistoryItem::setSubstituteData):
    38         * history/HistoryItem.h:
    39         * loader/FrameLoader.cpp:
    40         (WebCore::FrameLoader::didExplicitOpen):
    41         (WebCore::FrameLoader::load):
    42         (WebCore::FrameLoader::reloadAllowingStaleData):
    43         (WebCore::FrameLoader::reload):
    44         (WebCore::FrameLoader::shouldTreatURLAsSameAsCurrent):
    45         (WebCore::FrameLoader::loadItem):
    46         * loader/FrameLoader.h:
    478
    4892008-02-04  Mark Rowe  <mrowe@apple.com>
  • trunk/WebCore/bindings/js/JSHTMLDocumentCustom.cpp

    r29998 r30001  
    110110
    111111    // In the case of two parameters or fewer, do a normal document open.
    112 
    113     String mimeType;
    114     if (!args[0]->isUndefined()) {
    115         mimeType = String(args[0]->toString(exec)).lower();
    116         // Anything other than text/html is treated as plaintext.
    117         if (mimeType != "text/html")
    118             mimeType = "text/plain";
    119     } else
    120         mimeType = "text/html";
    121 
    122     bool replace = equalIgnoringCase("replace", String(args[1]->toString(exec)));
    123 
    124     static_cast<HTMLDocument*>(impl())->open(mimeType, replace);
     112    static_cast<HTMLDocument*>(impl())->open();
    125113    return jsUndefined();
    126114}
  • trunk/WebCore/dom/Document.cpp

    r29998 r30001  
    2727#include "AXObjectCache.h"
    2828#include "CDATASection.h"
    29 #include "CString.h"
    3029#include "CSSHelper.h"
    3130#include "CSSStyleSelector.h"
     
    5554#include "FrameTree.h"
    5655#include "FrameView.h"
    57 #include "HistoryItem.h"
    5856#include "HTMLBodyElement.h"
    5957#include "HTMLDocument.h"
     
    13521350void Document::open()
    13531351{
    1354     // This method is called by various places in the WebCore code.  Arguments
    1355     // chosen for legacy reasons.
    1356     open("text/html", true);
    1357 }
    1358 
    1359 void Document::open(const String& mimeType, bool replace)
    1360 {
    1361     // Calling open() during an onload handler is like a redirect, so we should not add a new
    1362     // history item.
    1363     if (m_processingLoadEvent)
    1364         replace = true;
    1365 
    13661352    // This is work that we should probably do in clear(), but we can't have it
    13671353    // happen when implicitOpen() is called unless we reorganize Frame code.
     
    13801366            m_frame->loader()->stopAllLoaders();
    13811367    }
    1382 
     1368   
    13831369    implicitOpen();
    13841370
    1385     if (m_frame) {
    1386         m_textWrittenByScript = new SharedBuffer;
    1387         m_frame->loader()->didExplicitOpen(mimeType, replace, m_textWrittenByScript.get());
    1388     }
     1371    if (m_frame)
     1372        m_frame->loader()->didExplicitOpen();
    13891373}
    13901374
     
    16131597        printf("Beginning a document.write at %d\n", elapsedTime());
    16141598#endif
    1615 
     1599   
    16161600    if (!m_tokenizer) {
    1617         open("text/html", false);
     1601        open();
    16181602        ASSERT(m_tokenizer);
    16191603        if (!m_tokenizer)
     
    16221606    }
    16231607    m_tokenizer->write(text, false);
    1624 
    1625     if (m_textWrittenByScript)
    1626         m_textWrittenByScript->append(reinterpret_cast<const char*>(text.characters()),
    1627                                       text.length() * sizeof(UChar));
    1628 
     1608   
    16291609#ifdef INSTRUMENT_LAYOUT_SCHEDULING
    16301610    if (!ownerElement())
    16311611        printf("Ending a document.write at %d\n", elapsedTime());
    1632 #endif
     1612#endif   
    16331613}
    16341614
     
    16591639    delete m_tokenizer;
    16601640    m_tokenizer = 0;
    1661 
    1662     m_textWrittenByScript = 0;
    16631641
    16641642    removeChildren();
  • trunk/WebCore/dom/Document.h

    r29998 r30001  
    3333#include "HTMLCollection.h"
    3434#include "HTMLFormElement.h"
    35 #include "SharedBuffer.h"
    3635#include "StringHash.h"
    3736#include "Timer.h"
     
    351350
    352351    void open();
    353     void open(const String& mimeType, bool replace);
    354352    void implicitOpen();
    355353    void close();
     
    929927    bool m_isXHTML;
    930928
    931     // Contains the text written to the document by script, eg through document.write().
    932     RefPtr<SharedBuffer> m_textWrittenByScript;
    933 
    934929    unsigned m_numNodeLists;
    935930
  • trunk/WebCore/history/HistoryItem.cpp

    r29998 r30001  
    122122    , m_formReferrer(item.m_formReferrer)
    123123    , m_rssFeedReferrer(item.m_rssFeedReferrer)
    124     , m_substituteData(item.m_substituteData)
    125124{
    126125    if (item.m_formData)
     
    367366}
    368367
    369 const SubstituteData& HistoryItem::substituteData() const
    370 {
    371     return m_substituteData;
    372 }
    373 
    374 void HistoryItem::setSubstituteData(const SubstituteData& substituteData)
    375 {
    376     m_substituteData = substituteData;
    377 }
    378 
    379368void HistoryItem::setFormInfoFromRequest(const ResourceRequest& request)
    380369{
  • trunk/WebCore/history/HistoryItem.h

    r29998 r30001  
    3434#include <wtf/RefCounted.h>
    3535#include "StringHash.h"
    36 #include "SubstituteData.h"
    3736#include <wtf/HashMap.h>
    3837#include <wtf/OwnPtr.h>
     
    9594    String formReferrer() const;
    9695    String rssFeedReferrer() const;
    97     const SubstituteData& substituteData() const;
    9896   
    9997    int visitCount() const;
     
    120118    void setRSSFeedReferrer(const String&);
    121119    void setVisitCount(int);
    122     void setSubstituteData(const SubstituteData&);
    123120
    124121    void addChildItem(PassRefPtr<HistoryItem>);
     
    179176    String m_rssFeedReferrer;
    180177
    181     SubstituteData m_substituteData;
    182 
    183178    // PageCache controls these fields.
    184179    HistoryItem* m_next;
  • trunk/WebCore/loader/FrameLoader.cpp

    r29998 r30001  
    697697}
    698698
    699 void FrameLoader::didExplicitOpen(const String& mimeType, bool replace, SharedBuffer* buffer)
     699void FrameLoader::didExplicitOpen()
    700700{
    701701    m_isComplete = false;
     
    712712    if (m_frame->document()->url() != "about:blank")
    713713        m_URL = m_frame->document()->url();
    714  
    715     bool isItemNew = false;
    716 
    717     // Add a HistoryItem for this open.
    718     RefPtr<HistoryItem> item;
    719     if (replace && m_currentHistoryItem)
    720         item = m_currentHistoryItem;
    721     else {
    722         isItemNew = true;
    723         item = new HistoryItem(m_URL, m_frame->tree()->name(), m_frame->tree()->parent() ? m_frame->tree()->parent()->tree()->name() : "", "");
    724         item->setIsTargetItem(true);
    725         m_previousHistoryItem = m_currentHistoryItem;
    726         m_currentHistoryItem = item;
    727     }
    728 
    729     // Create an alternate URL to distinguish this as a generated page.
    730     KURL generatedURL("webkitgenerated:" + m_frame->document()->url());
    731 
    732     item->setSubstituteData(SubstituteData(buffer, mimeType, "UTF-16", m_URL, generatedURL));
    733 
    734     if (isItemNew)
    735         if (Page* page = m_frame->page())
    736             page->backForwardList()->addItem(item);
    737714}
    738715
     
    21012078void FrameLoader::load(const ResourceRequest& request, const NavigationAction& action, FrameLoadType type, PassRefPtr<FormState> formState)
    21022079{
    2103     load(request, action, type, formState, SubstituteData());
    2104 }
    2105 
    2106 void FrameLoader::load(const ResourceRequest& request, const NavigationAction& action, FrameLoadType type, PassRefPtr<FormState> formState, const SubstituteData& substituteData)
    2107 {
    2108     RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request, substituteData);
     2080    RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request, SubstituteData());
    21092081
    21102082    loader->setTriggeringAction(action);
     
    23072279    request.setCachePolicy(ReturnCacheDataElseLoad);
    23082280
    2309     RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request, m_currentHistoryItem->substituteData());
    2310     setProvisionalHistoryItem(m_currentHistoryItem);
    2311 
     2281    RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(request, SubstituteData());
    23122282    setPolicyDocumentLoader(loader.get());
    23132283
     
    23342304        initialRequest = ResourceRequest(unreachableURL);
    23352305   
    2336     RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(initialRequest, m_currentHistoryItem->substituteData());
    2337     setProvisionalHistoryItem(m_currentHistoryItem);
     2306    RefPtr<DocumentLoader> loader = m_client->createDocumentLoader(initialRequest, SubstituteData());
    23382307
    23392308    ResourceRequest& request = loader->request();
     
    38213790    if (!m_currentHistoryItem)
    38223791        return false;
    3823     if (m_currentHistoryItem->substituteData().isValid())
    3824         return url == m_currentHistoryItem->substituteData().responseURL();
    38253792    return url == m_currentHistoryItem->url() || url == m_currentHistoryItem->originalURL();
    38263793}
     
    41324099            }
    41334100
    4134             load(request, action, loadType, 0, item->substituteData());
     4101            load(request, action, loadType, 0);
    41354102        }
    41364103    }
  • trunk/WebCore/loader/FrameLoader.h

    r29998 r30001  
    155155        void load(const ResourceRequest&, const String& frameName);
    156156        void load(const ResourceRequest&, const NavigationAction&, FrameLoadType, PassRefPtr<FormState>);
    157         void load(const ResourceRequest&, const NavigationAction&, FrameLoadType, PassRefPtr<FormState>, const SubstituteData&);
    158157       
    159158        void load(DocumentLoader*);
     
    290289        bool closeURL();
    291290
    292         void didExplicitOpen(const String& mimeType, bool replace, SharedBuffer*);
     291        void didExplicitOpen();
    293292
    294293        KURL iconURL();
Note: See TracChangeset for help on using the changeset viewer.