Changeset 30571 in webkit


Ignore:
Timestamp:
Feb 25, 2008 9:33:47 AM (16 years ago)
Author:
Darin Adler
Message:

WebCore:

Reviewed by Anders.
Based on a patch by Tim Steele <timsteele41@gmail.com>.

Test: fast/loader/meta-refresh-anchor-click.html

  • loader/FrameLoader.cpp: (WebCore::FrameLoader::load): When load type is FrameLoadTypeRedirectWithLockedHistory, always do a real load. This makes sure that meta refresh loads are treated as real loads rather than anchor scrolls. Also tweaked formatting a bit. (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy): This function is an alternate way to complete a load, so it needs to start the redirection timer if redirection has already been scheduled.

LayoutTests:

Reviewed by Anders.

  • fast/loader/meta-refresh-anchor-click-expected.txt: Added.
  • fast/loader/meta-refresh-anchor-click.html: Added.
  • fast/loader/resources/meta-refresh-subframe.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r30563 r30571  
     12008-02-25  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Anders.
     4
     5        - test for http://bugs.webkit.org/show_bug.cgi?id=17186
     6          Fragment navigation within a page permanently cancels meta refresh
     7
     8        * fast/loader/meta-refresh-anchor-click-expected.txt: Added.
     9        * fast/loader/meta-refresh-anchor-click.html: Added.
     10        * fast/loader/resources/meta-refresh-subframe.html: Added.
     11
    1122008-02-25  Johnny Ding  <johnnyding.webkit@gmail.com>
    213
  • trunk/WebCore/ChangeLog

    r30570 r30571  
     12008-02-25  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Anders.
     4        Based on a patch by Tim Steele <timsteele41@gmail.com>.
     5
     6        - fix http://bugs.webkit.org/show_bug.cgi?id=17186
     7          Fragment navigation within a page permanently cancels meta refresh
     8
     9        Test: fast/loader/meta-refresh-anchor-click.html
     10
     11        * loader/FrameLoader.cpp:
     12        (WebCore::FrameLoader::load): When load type is FrameLoadTypeRedirectWithLockedHistory,
     13        always do a real load. This makes sure that meta refresh loads are treated as real loads
     14        rather than anchor scrolls. Also tweaked formatting a bit.
     15        (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy): This function is
     16        an alternate way to complete a load, so it needs to start the redirection timer if
     17        redirection has already been scheduled.
     18
    1192008-02-25  Dan Bernstein  <mitz@apple.com>
    220
  • trunk/WebCore/loader/FrameLoader.cpp

    r30549 r30571  
    20122012    // work properly.
    20132013    if (!isFormSubmission
    2014         && newLoadType != FrameLoadTypeReload
    2015         && newLoadType != FrameLoadTypeSame
    2016         && !shouldReload(newURL, url())
    2017         // We don't want to just scroll if a link from within a
    2018         // frameset is trying to reload the frameset into _top.
    2019         && !m_frame->isFrameSet()) {
     2014            && newLoadType != FrameLoadTypeRedirectWithLockedHistory
     2015            && newLoadType != FrameLoadTypeReload
     2016            && newLoadType != FrameLoadTypeSame
     2017            && !shouldReload(newURL, url())
     2018            && !m_frame->isFrameSet()) {
    20202019
    20212020        // Just do anchor navigation within the existing content.
     
    20232022        // We don't do this if we are submitting a form, explicitly reloading,
    20242023        // currently displaying a frameset, or if the new URL does not have a fragment.
    2025         // These rules are based on what KHTML was doing in KHTMLPart::openURL.
     2024
     2025        // These rules were originally based on what KHTML was doing in KHTMLPart::openURL.
    20262026       
    20272027        // FIXME: What about load types other than Standard and Reload?
     
    20322032            callContinueFragmentScrollAfterNavigationPolicy, this);
    20332033    } else {
    2034         // must grab this now, since this load may stop the previous load and clear this flag
     2034        // must grab m_quickRedirectComing now, since this load may stop the previous load and clear this flag.
    20352035        bool isRedirect = m_quickRedirectComing;
    20362036        load(request, action, newLoadType, formState);
     
    20392039            if (m_provisionalDocumentLoader)
    20402040                m_provisionalDocumentLoader->setIsClientRedirect(true);
    2041         } else if (sameURL)
     2041        } else if (sameURL) {
    20422042            // Example of this case are sites that reload the same URL with a different cookie
    20432043            // driving the generated content, or a master frame with links that drive a target
    20442044            // frame, where the user has clicked on the same link repeatedly.
    20452045            m_loadType = FrameLoadTypeSame;
     2046        }
    20462047    }
    20472048}
     
    31483149void FrameLoader::tokenizerProcessedData()
    31493150{
    3150 //    ASSERT(m_frame->page());
    3151 //    ASSERT(m_frame->document());
    3152 
    31533151    checkCompleted();
    31543152}
     
    33953393void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, bool shouldContinue)
    33963394{
    3397     // FIXME:
    3398     // some functions check m_quickRedirectComing, and others check for
    3399     // FrameLoadTypeRedirectWithLockedHistory. 
     3395    // FIXME: Some functions check m_quickRedirectComing, and others check for
     3396    // FrameLoadTypeRedirectWithLockedHistory; need to unify these. 
    34003397    bool isRedirect = m_quickRedirectComing || m_policyLoadType == FrameLoadTypeRedirectWithLockedHistory;
    34013398    m_quickRedirectComing = false;
     
    34243421    scrollToAnchor(url);
    34253422   
    3426     if (!isRedirect)
     3423    if (!isRedirect) {
    34273424        // This will clear previousItem from the rest of the frame tree that didn't
    34283425        // doing any loading. We need to make a pass on this now, since for anchor nav
    34293426        // we'll not go through a real load and reach Completed state.
    34303427        checkLoadComplete();
     3428    }
    34313429 
    34323430    m_client->dispatchDidChangeLocationWithinPage();
    34333431    m_client->didFinishLoad();
     3432
     3433    if (m_scheduledRedirection && !m_redirectionTimer.isActive())
     3434        startRedirectionTimer();
    34343435}
    34353436
Note: See TracChangeset for help on using the changeset viewer.