Changeset 84010 in webkit


Ignore:
Timestamp:
Apr 15, 2011 12:22:34 PM (13 years ago)
Author:
andreas.kling@nokia.com
Message:

2011-04-15 Andreas Kling <kling@webkit.org>

Reviewed by Antonio Gomes.

[Qt] DRT: Block access to external URLs.

  • platform/qt/Skipped: Unskip now passing tests.

2011-04-15 Andreas Kling <kling@webkit.org>

Reviewed by Antonio Gomes.

[Qt] DRT: Block access to external URLs.

Implement the "Blocked access to external URL" behavior for Qt's DRT,
based on what other ports are doing.

Fixes <http://webkit.org/b/57306> and <http://webkit.org/b/58523>.

  • WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83999 r84010  
     12011-04-15  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        [Qt] DRT: Block access to external URLs.
     6
     7        * platform/qt/Skipped: Unskip now passing tests.
     8
    192011-04-15  James Robinson  <jamesr@chromium.org>
    210
  • trunk/LayoutTests/platform/qt/Skipped

    r83886 r84010  
    16491649fast/events/5056619.html
    16501650fast/events/drag-in-frames.html
    1651 fast/loader/null-request-after-willSendRequest.html
    16521651fast/text/international/thai-line-breaks.html
    16531652
     
    32353234plugins/embed-prefers-plugins-for-images.html
    32363235
    3237 # http/tests/uri/username-with-no-hostname.html fails after r82151
    3238 # https://bugs.webkit.org/show_bug.cgi?id=57306
    3239 http/tests/uri/username-with-no-hostname.html
    3240 
    32413236# [Qt]REGRESSION(r82243): fast/events/onsearch-enter.html fails
    32423237# https://bugs.webkit.org/show_bug.cgi?id=57472
     
    34963491inspector/styles/styles-disable-then-enable.html
    34973492
    3498 # [Qt] fast/ruby tests fail
    3499 # https://bugs.webkit.org/show_bug.cgi?id=58523
    3500 fast/ruby/after-block-doesnt-crash.html
    3501 fast/ruby/after-table-doesnt-crash.html
    3502 fast/ruby/before-block-doesnt-crash.html
    3503 fast/ruby/before-table-doesnt-crash.html
    3504 
    35053493# [Qt] fast/transforms/scrollIntoView-transformed.html fails
    35063494# https://bugs.webkit.org/show_bug.cgi?id=58559
  • trunk/Source/WebCore/platform/qt/RenderThemeQt.cpp

    r83837 r84010  
    528528    // FIXME: Check is flawed, since it doesn't take min-width/max-width into account.
    529529    if (renderStyle->width().isIntrinsicOrAuto() && size.width() > 0)
    530         renderStyle->setWidth(Length(size.width(), Fixed));
     530        renderStyle->setMinWidth(Length(size.width(), Fixed));
    531531    if (renderStyle->height().isAuto() && size.height() > 0)
    532         renderStyle->setHeight(Length(size.height(), Fixed));
     532        renderStyle->setMinHeight(Length(size.height(), Fixed));
    533533}
    534534
     
    608608    int paddingLeft = buttonMargin;
    609609    int paddingRight = buttonMargin;
    610     int paddingTop = 1;
    611     int paddingBottom = 0;
     610    int paddingTop = buttonMargin;
     611    int paddingBottom = buttonMargin;
    612612
    613613    // Then check if the style uses layout margins
  • trunk/Source/WebKit/qt/ChangeLog

    r83892 r84010  
     12011-04-15  Andreas Kling  <kling@webkit.org>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        [Qt] DRT: Block access to external URLs.
     6
     7        Implement the "Blocked access to external URL" behavior for Qt's DRT,
     8        based on what other ports are doing.
     9
     10        Fixes <http://webkit.org/b/57306> and <http://webkit.org/b/58523>.
     11
     12        * WebCoreSupport/FrameLoaderClientQt.cpp:
     13        (WebCore::FrameLoaderClientQt::dispatchWillSendRequest):
     14
    1152011-01-26  Ragner Magalhaes  <ragner.magalhaes@openbossa.org>
    216
  • trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp

    r83439 r84010  
    10271027void FrameLoaderClientQt::dispatchWillSendRequest(WebCore::DocumentLoader*, unsigned long identifier, WebCore::ResourceRequest& newRequest, const WebCore::ResourceResponse& redirectResponse)
    10281028{
     1029    KURL url = newRequest.url();
    10291030
    10301031    if (dumpResourceLoadCallbacks)
     
    10341035               (redirectResponse.isNull()) ? "(null)" : qPrintable(drtDescriptionSuitableForTestResult(redirectResponse)));
    10351036
    1036     if (sendRequestReturnsNull)
     1037    if (sendRequestReturnsNull) {
    10371038        newRequest.setURL(QUrl());
     1039        return;
     1040    }
    10381041
    10391042    if (sendRequestReturnsNullOnRedirect && !redirectResponse.isNull()) {
    10401043        printf("Returning null for this redirect\n");
    10411044        newRequest.setURL(QUrl());
     1045        return;
     1046    }
     1047
     1048    if (QWebPagePrivate::drtRun
     1049        && url.protocolInHTTPFamily()
     1050        && url.host() != "127.0.0.1"
     1051        && url.host() != "255.255.255.255"
     1052        && !equalIgnoringCase(url.host(), "localhost")) {
     1053
     1054        printf("Blocked access to external URL %s\n", qPrintable(drtDescriptionSuitableForTestResult(url)));
     1055        newRequest.setURL(QUrl());
     1056        return;
    10421057    }
    10431058
     
    10461061
    10471062    if (QWebPagePrivate::drtRun) {
    1048         QString url = newRequest.url().string();
    1049         if (URLsToRedirect.contains(url))
    1050             newRequest.setURL(QUrl(URLsToRedirect[url]));
     1063        QMap<QString, QString>::const_iterator it = URLsToRedirect.constFind(url.string());
     1064        if (it != URLsToRedirect.constEnd())
     1065            newRequest.setURL(QUrl(it.value()));
    10511066    }
    10521067    // Seems like the Mac code doesn't do anything here by default neither.
    1053     // qDebug() << "FrameLoaderClientQt::dispatchWillSendRequest" << request.isNull() << request.url().string();
     1068    // qDebug() << "FrameLoaderClientQt::dispatchWillSendRequest" << request.isNull() << url;
    10541069}
    10551070
Note: See TracChangeset for help on using the changeset viewer.