Changeset 74801 in webkit


Ignore:
Timestamp:
Dec 30, 2010 11:31:00 AM (13 years ago)
Author:
yael.aharon@nokia.com
Message:

REGRESSION: fast/dom/cssTarget-crash.html fails
https://bugs.webkit.org/show_bug.cgi?id=20342

Reviewed by Adam Barth.

WebCore:

Do not reload the page when submitting a form, using "GET" method, and the
form action url matches the location url, except for the fragment.

Test: fast/forms/submit-change-fragment.html

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::shouldScrollToAnchor):

  • loader/FrameLoader.h:

LayoutTests:

  • fast/forms/submit-change-fragment-expected.txt: Added.
  • fast/forms/submit-change-fragment.html: Added.
  • platform/mac/Skipped:
  • platform/qt/Skipped:
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r74796 r74801  
     12010-12-30  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        REGRESSION: fast/dom/cssTarget-crash.html fails
     6        https://bugs.webkit.org/show_bug.cgi?id=20342
     7
     8        * fast/forms/submit-change-fragment-expected.txt: Added.
     9        * fast/forms/submit-change-fragment.html: Added.
     10        * platform/mac/Skipped:
     11        * platform/qt/Skipped:
     12
    1132010-12-30  Philippe Normand  <pnormand@igalia.com>
    214
  • trunk/LayoutTests/platform/mac/Skipped

    r74270 r74801  
    3535# Skip because fix for https://bugs.webkit.org/show_bug.cgi?id=26770 was reverted
    3636compositing/animation/animated-composited-inside-hidden.html
    37 
    38 # https://bugs.webkit.org/show_bug.cgi?id=20342 REGRESSION: fast/dom/cssTarget-crash.html fails
    39 fast/dom/cssTarget-crash.html
    4037
    4138# https://bugs.webkit.org/show_bug.cgi?id=21916 Pixel test doesn't repaint entire view so result is corrupted by previous test
  • trunk/LayoutTests/platform/qt/Skipped

    r74789 r74801  
    25142514fast/events/5056619.html
    25152515fast/events/drag-in-frames.html
    2516 fast/dom/cssTarget-crash.html
    25172516fast/loader/null-request-after-willSendRequest.html
    25182517fast/text/international/thai-line-breaks.html
  • trunk/WebCore/ChangeLog

    r74800 r74801  
     12010-12-30  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        REGRESSION: fast/dom/cssTarget-crash.html fails
     6        https://bugs.webkit.org/show_bug.cgi?id=20342
     7
     8        Do not reload the page when submitting a form, using "GET" method, and the
     9        form action url matches the location url, except for the fragment.
     10     
     11        Test: fast/forms/submit-change-fragment.html
     12
     13        * loader/FrameLoader.cpp:
     14        (WebCore::FrameLoader::loadURL):
     15        (WebCore::FrameLoader::loadWithDocumentLoader):
     16        (WebCore::FrameLoader::shouldScrollToAnchor):
     17        * loader/FrameLoader.h:
     18
    1192010-12-30  Darin Adler  <darin@apple.com>
    220
  • trunk/WebCore/loader/FrameLoader.cpp

    r74426 r74801  
    13201320
    13211321    bool sameURL = shouldTreatURLAsSameAsCurrent(newURL);
     1322    const String& httpMethod = request.httpMethod();
    13221323   
    13231324    // Make sure to do scroll to anchor processing even if the URL is
    13241325    // exactly the same so pages with '#' links and DHTML side effects
    13251326    // work properly.
    1326     if (shouldScrollToAnchor(isFormSubmission, newLoadType, newURL)) {
     1327    if (shouldScrollToAnchor(isFormSubmission, httpMethod, newLoadType, newURL)) {
    13271328        oldDocumentLoader->setTriggeringAction(action);
    13281329        policyChecker()->stopCheck();
     
    14431444
    14441445    const KURL& newURL = loader->request().url();
    1445 
    1446     if (shouldScrollToAnchor(isFormSubmission, policyChecker()->loadType(), newURL)) {
     1446    const String& httpMethod = loader->request().httpMethod();
     1447
     1448    if (shouldScrollToAnchor(isFormSubmission,  httpMethod, policyChecker()->loadType(), newURL)) {
    14471449        RefPtr<DocumentLoader> oldDocumentLoader = m_documentLoader;
    14481450        NavigationAction action(newURL, policyChecker()->loadType(), isFormSubmission);
     
    28192821}
    28202822
    2821 bool FrameLoader::shouldScrollToAnchor(bool isFormSubmission, FrameLoadType loadType, const KURL& url)
     2823bool FrameLoader::shouldScrollToAnchor(bool isFormSubmission, const String& httpMethod, FrameLoadType loadType, const KURL& url)
    28222824{
    28232825    // Should we do anchor navigation within the existing content?
    28242826
    2825     // We don't do this if we are submitting a form, explicitly reloading,
     2827    // We don't do this if we are submitting a form with method other than "GET", explicitly reloading,
    28262828    // currently displaying a frameset, or if the URL does not have a fragment.
    28272829    // These rules were originally based on what KHTML was doing in KHTMLPart::openURL.
     
    28292831    // FIXME: What about load types other than Standard and Reload?
    28302832
    2831     return !isFormSubmission
     2833    return (!isFormSubmission || equalIgnoringCase(httpMethod, "GET"))
    28322834        && loadType != FrameLoadTypeReload
    28332835        && loadType != FrameLoadTypeReloadFromOrigin
  • trunk/WebCore/loader/FrameLoader.h

    r73486 r74801  
    367367    void continueFragmentScrollAfterNavigationPolicy(const ResourceRequest&, bool shouldContinue);
    368368
    369     bool shouldScrollToAnchor(bool isFormSubmission, FrameLoadType, const KURL&);
     369    bool shouldScrollToAnchor(bool isFormSubmission, const String& httpMethod, FrameLoadType, const KURL&);
    370370
    371371    void checkLoadCompleteForThisFrame();
Note: See TracChangeset for help on using the changeset viewer.