Changeset 29432 in webkit


Ignore:
Timestamp:
Jan 12, 2008 4:03:28 AM (16 years ago)
Author:
mjs@apple.com
Message:

Reviewed by Maciej (and also tweaked a little bit).

  • loader/FrameLoader.cpp: (WebCore::FrameLoader::urlSelected): (WebCore::FrameLoader::submitForm): (WebCore::FrameLoader::executeIfJavaScriptURL):
  • loader/FrameLoader.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r29430 r29432  
     12008-01-12  Adam Barth  <hk9565@gmail.com>
     2
     3        Reviewed by Maciej (and also tweaked a little bit).
     4
     5        - more thorough fix for some crashing tests
     6          http://bugs.webkit.org/show_bug.cgi?id=16782
     7
     8        * loader/FrameLoader.cpp:
     9        (WebCore::FrameLoader::urlSelected):
     10        (WebCore::FrameLoader::submitForm):
     11        (WebCore::FrameLoader::executeIfJavaScriptURL):
     12        * loader/FrameLoader.h:
     13
    1142008-01-12  Maciej Stachowiak  <mjs@apple.com>
    215
  • trunk/WebCore/loader/FrameLoader.cpp

    r29421 r29432  
    377377    ResourceRequest request(url, referrer, policy);
    378378   
     379    if (executeIfJavaScriptURL(request.url(), userGesture))
     380        return;
     381
    379382    urlSelected(request, "_self", 0, lockHistory, userGesture);
    380383}
     
    382385void FrameLoader::urlSelected(const ResourceRequest& request, const String& _target, Event* triggeringEvent, bool lockHistory, bool userGesture)
    383386{
    384     if (executeIfJavaScriptURL(request.url(), userGesture))
     387    if (executeIfJavaScriptURL(request.url(), userGesture, false))
    385388        return;
    386389
     
    502505    if (urlString.startsWith("javascript:", false)) {
    503506        m_isExecutingJavaScriptFormAction = true;
    504         executeIfJavaScriptURL(u);
     507        executeIfJavaScriptURL(u, false, false);
    505508        m_isExecutingJavaScriptFormAction = false;
    506509        return;
     
    711714}
    712715
    713 bool FrameLoader::executeIfJavaScriptURL(const KURL& url, bool userGesture)
     716bool FrameLoader::executeIfJavaScriptURL(const KURL& url, bool userGesture, bool replaceDocument)
    714717{
    715718    if (!url.deprecatedString().startsWith("javascript:", false))
     
    727730        currentSecurityOrigin = m_frame->document()->securityOrigin();
    728731
    729     begin(m_URL, true, currentSecurityOrigin);
    730     write(scriptResult);
    731     end();
     732    // FIXME: We should always replace the document, but doing so
     733    //        synchronously can cause crashes:
     734    //        http://bugs.webkit.org/show_bug.cgi?id=16782
     735    if (replaceDocument) {
     736        begin(m_URL, true, currentSecurityOrigin);
     737        write(scriptResult);
     738        end();
     739    }
    732740
    733741    return true;
  • trunk/WebCore/loader/FrameLoader.h

    r29416 r29432  
    321321
    322322        // Returns true if url is a JavaScript URL.
    323         bool executeIfJavaScriptURL(const KURL& url, bool userGesture = false);
     323        bool executeIfJavaScriptURL(const KURL& url, bool userGesture = false, bool replaceDocument = true);
    324324
    325325        KJS::JSValue* executeScript(const String& url, int baseLine, const String& script);
Note: See TracChangeset for help on using the changeset viewer.