Changeset 53060 in webkit


Ignore:
Timestamp:
Jan 10, 2010 8:09:02 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-10 Robert Hogan <robert@roberthogan.net>

Reviewed by Adam Barth.

[Qt] Add enableXSSAuditor support to QWebSettings and DRT.

https://bugs.webkit.org/show_bug.cgi?id=33419

  • platform/qt/Skipped:

2010-01-10 Robert Hogan <robert@roberthogan.net>

Reviewed by Adam Barth.

[Qt] Add enableXSSAuditor support to QWebSettings and DRT.

https://bugs.webkit.org/show_bug.cgi?id=33419

  • Api/qwebsettings.cpp: (QWebSettingsPrivate::apply):
  • Api/qwebsettings.h:

2010-01-10 Robert Hogan <robert@roberthogan.net>

Reviewed by Adam Barth.

[Qt] Add enableXSSAuditor support to QWebSettings and DRT.

https://bugs.webkit.org/show_bug.cgi?id=33419

  • DumpRenderTree/qt/DumpRenderTreeQt.cpp: (WebCore::WebPage::WebPage): (WebCore::WebPage::resetSettings): (WebCore::DumpRenderTree::createWindow):
  • DumpRenderTree/qt/LayoutTestControllerQt.cpp: (LayoutTestController::setXSSAuditorEnabled):
  • DumpRenderTree/qt/LayoutTestControllerQt.h:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r53058 r53060  
     12010-01-10  Robert Hogan  <robert@roberthogan.net>
     2
     3        Reviewed by Adam Barth.
     4
     5        [Qt] Add enableXSSAuditor support to QWebSettings and DRT.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=33419
     8
     9        * platform/qt/Skipped:
     10
    1112010-01-10  Adam Barth  <abarth@webkit.org>
    212
  • trunk/LayoutTests/platform/qt/Skipped

    r53048 r53060  
    197197# Missing layoutTestController.setWillSendRequestReturnsNullOnRedirect()
    198198http/tests/misc/will-send-request-returns-null-on-redirect.html
    199 
    200 # Missing layoutTestController.setXSSAuditorEnabled()
    201 http/tests/security/xssAuditor
    202199
    203200# Missing layoutTestController.evaluateScriptInIsolatedWorld()
  • trunk/WebKit/qt/Api/qwebsettings.cpp

    r53048 r53060  
    205205        value = attributes.value(QWebSettings::LocalStorageEnabled,
    206206                                      global->attributes.value(QWebSettings::LocalStorageEnabled));
    207                                                                                                                                  
    208207        settings->setLocalStorageEnabled(value);
    209208
     
    211210                                      global->attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls));
    212211        settings->setAllowUniversalAccessFromFileURLs(value);
     212
     213        value = attributes.value(QWebSettings::XSSAuditorEnabled,
     214                                      global->attributes.value(QWebSettings::XSSAuditorEnabled));
     215        settings->setXSSAuditorEnabled(value);
     216
    213217        settings->setUsesPageCache(WebCore::pageCache()->capacity());
    214218    } else {
     
    355359        QWebSettings::LocalStorageEnabled instead.
    356360    \value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are allowed to access remote urls.
     361    \value XSSAuditorEnabled Specifies whether load requests should be monitored for cross-site scripting attempts.
    357362*/
    358363
  • trunk/WebKit/qt/Api/qwebsettings.h

    r53048 r53060  
    6868#endif
    6969        LocalContentCanAccessRemoteUrls,
    70         DnsPrefetchEnabled
     70        DnsPrefetchEnabled,
     71        XSSAuditorEnabled
    7172    };
    7273    enum WebGraphic {
  • trunk/WebKit/qt/ChangeLog

    r53048 r53060  
     12010-01-10  Robert Hogan  <robert@roberthogan.net>
     2
     3        Reviewed by Adam Barth.
     4
     5        [Qt] Add enableXSSAuditor support to QWebSettings and DRT.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=33419
     8
     9        * Api/qwebsettings.cpp:
     10        (QWebSettingsPrivate::apply):
     11        * Api/qwebsettings.h:
     12
    1132010-01-09  Daniel Bates  <dbates@webkit.org>
    214
  • trunk/WebKitTools/ChangeLog

    r53054 r53060  
     12010-01-10  Robert Hogan  <robert@roberthogan.net>
     2
     3        Reviewed by Adam Barth.
     4
     5        [Qt] Add enableXSSAuditor support to QWebSettings and DRT.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=33419
     8
     9        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
     10        (WebCore::WebPage::WebPage):
     11        (WebCore::WebPage::resetSettings):
     12        (WebCore::DumpRenderTree::createWindow):
     13        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
     14        (LayoutTestController::setXSSAuditorEnabled):
     15        * DumpRenderTree/qt/LayoutTestControllerQt.h:
     16
    1172010-01-10  Adam Barth  <abarth@webkit.org>
    218
  • trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp

    r53048 r53060  
    160160    // After each layout test, reset the settings that may have been changed by
    161161    // layoutTestController.overridePreference() or similar.
    162 
    163162    settings()->resetFontSize(QWebSettings::DefaultFontSize);
    164163    settings()->resetAttribute(QWebSettings::JavascriptCanOpenWindows);
     
    168167    settings()->resetAttribute(QWebSettings::OfflineWebApplicationCacheEnabled);
    169168    settings()->resetAttribute(QWebSettings::LocalContentCanAccessRemoteUrls);
     169
     170    // globalSettings must be reset explicitly.
     171    m_drt->layoutTestController()->setXSSAuditorEnabled(false);
     172
    170173    QWebSettings::setMaximumPagesInCache(0); // reset to default
    171174}
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp

    r53048 r53060  
    3535#include <QDir>
    3636#include <QLocale>
     37#include <qwebsettings.h>
    3738
    3839extern void qt_dump_editing_callbacks(bool b);
     
    298299}
    299300
     301void LayoutTestController::setXSSAuditorEnabled(bool enable)
     302{
     303    // Set XSSAuditorEnabled globally so that windows created by the test inherit it too.
     304    // resetSettings() will call this to reset the page and global setting to false again.
     305    // Needed by http/tests/security/xssAuditor/link-opens-new-window.html
     306    QWebSettings* globalSettings = QWebSettings::globalSettings();
     307    globalSettings->setAttribute(QWebSettings::XSSAuditorEnabled, enable);
     308    m_drt->webPage()->settings()->setAttribute(QWebSettings::XSSAuditorEnabled, enable);
     309}
     310
    300311bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString& animationName,
    301312                                                               double time,
  • trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h

    r53048 r53060  
    116116    void setWindowIsKey(bool isKey);
    117117    void setMainFrameIsFirstResponder(bool isFirst);
     118    void setXSSAuditorEnabled(bool enable);
    118119
    119120    bool pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId);
Note: See TracChangeset for help on using the changeset viewer.