https://bugs.webkit.org/show_bug.cgi?id=51159
Permit any URL with a local scheme to set a user style sheet. Allow qrc
resource URLs as arguments to QWebSettings::setUserStyleSheetUrl().
Patch by Jarred Nicholls <jarred@sencha.com> on 2011-09-20
Reviewed by Kenneth Rohde Christiansen.
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
* platform/qt/KURLQt.cpp:
(WebCore::KURL::fileSystemPath):
Source/WebKit/qt: [Qt] Permit qrc resources to load in QWebSettings::setUserStyleSheetUrl()
https://bugs.webkit.org/show_bug.cgi?id=51159
Permit any URL with a local scheme to set a user style sheet. Allow qrc
resource URLs as arguments to QWebSettings::setUserStyleSheetUrl().
New test case makes sure a qrc URL will properly load a user stylesheet.
Patch by Jarred Nicholls <jarred@sencha.com> on 2011-09-20
Reviewed by Kenneth Rohde Christiansen.
(tst_QWebPage::userStyleSheetFromQrcUrl):
* tests/qwebpage/tst_qwebpage.qrc:
Tools: [Qt] Permit qrc resources to load in QWebSettings::setUserStyleSheetUrl()
https://bugs.webkit.org/show_bug.cgi?id=51159
Permit any URL with a local scheme to set a user style sheet. Allow qrc
resource URLs as arguments to QWebSettings::setUserStyleSheetUrl().
Add DRT/WKTR qrc resource to test loading user style sheets from a qrc URL.
Patch by Jarred Nicholls <jarred@sencha.com> on 2011-09-20
Reviewed by Kenneth Rohde Christiansen.
* DumpRenderTree/qt/DumpRenderTree.pro:
* DumpRenderTree/qt/DumpRenderTree.qrc: Added.
* DumpRenderTree/qt/resources/user.css: Added.
(body):
* WebKitTestRunner/qt/WebKitTestRunner.pro:
* WebKitTestRunner/qt/WebKitTestRunner.qrc: Added.
* WebKitTestRunner/qt/resources/user.css: Added.
(body):
LayoutTests: [Qt] Permit qrc resources to load in QWebSettings::setUserStyleSheetUrl()
https://bugs.webkit.org/show_bug.cgi?id=51159
Permit any URL with a local scheme to set a user style sheet. Allow qrc
resource URLs as arguments to QWebSettings::setUserStyleSheetUrl().
New platform layout test since user style sheet is testable from DRT.
Patch by Jarred Nicholls <jarred@sencha.com> on 2011-09-20
Reviewed by Kenneth Rohde Christiansen.
* platform/qt/fast/loader/user-stylesheet-qrc-path-expected.txt: Added.
* platform/qt/fast/loader/user-stylesheet-qrc-path.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95548
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-09-20 Jarred Nicholls <jarred@sencha.com>
+
+ [Qt] Permit qrc resources to load in QWebSettings::setUserStyleSheetUrl()
+ https://bugs.webkit.org/show_bug.cgi?id=51159
+
+ Permit any URL with a local scheme to set a user style sheet. Allow qrc
+ resource URLs as arguments to QWebSettings::setUserStyleSheetUrl().
+
+ New platform layout test since user style sheet is testable from DRT.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * platform/qt/fast/loader/user-stylesheet-qrc-path-expected.txt: Added.
+ * platform/qt/fast/loader/user-stylesheet-qrc-path.html: Added.
+
2011-09-20 Dmitry Lomov <dslomov@google.com>
[Chromium] Rebaseline expectationd and file WK68445.
--- /dev/null
+This tests that a qrc URL is properly loaded as a user style sheet.
+
+PASS 50px rgb(255, 255, 0)
--- /dev/null
+<p>
+ This tests that a qrc URL is properly loaded as a user style sheet.
+</p>
+<script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.setUserStyleSheetEnabled(true);
+ layoutTestController.setUserStyleSheetLocation('qrc:///resources/user.css');
+
+ var computedStyle = getComputedStyle(document.body),
+ result = computedStyle.fontSize == '50px' && computedStyle.backgroundColor == 'rgb(255, 255, 0)',
+ message = (result ? 'PASS' : 'FAIL') + ' ' + computedStyle.fontSize + ' ' + computedStyle.backgroundColor;
+
+ document.write(message);
+ } else {
+ document.write("This test can only be run in DumpRenderTree.");
+ }
+</script>
+2011-09-20 Jarred Nicholls <jarred@sencha.com>
+
+ [Qt] Permit qrc resources to load in QWebSettings::setUserStyleSheetUrl()
+ https://bugs.webkit.org/show_bug.cgi?id=51159
+
+ Permit any URL with a local scheme to set a user style sheet. Allow qrc
+ resource URLs as arguments to QWebSettings::setUserStyleSheetUrl().
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * page/Page.cpp:
+ (WebCore::Page::userStyleSheetLocationChanged):
+ * platform/qt/KURLQt.cpp:
+ (WebCore::KURL::fileSystemPath):
+
2011-09-20 Csaba Osztrogonác <ossy@webkit.org>
[Qt][Mac] Buildfix after r95513.
#include "RenderTheme.h"
#include "RenderWidget.h"
#include "RuntimeEnabledFeatures.h"
+#include "SchemeRegistry.h"
#include "Settings.h"
#include "SharedBuffer.h"
#include "SpeechInput.h"
// FIXME: Eventually we will move to a model of just being handed the sheet
// text instead of loading the URL ourselves.
KURL url = m_settings->userStyleSheetLocation();
- if (url.isLocalFile())
+
+ // Allow any local file URL scheme to be loaded.
+ if (SchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol()))
m_userStyleSheetPath = url.fileSystemPath();
else
m_userStyleSheetPath = String();
String KURL::fileSystemPath() const
{
- if (!isValid() || !protocolIs("file"))
+ if (!isValid())
return String();
- return static_cast<QUrl>(*this).toLocalFile();
+ if (isLocalFile())
+ return static_cast<QUrl>(*this).toLocalFile();
+
+ // A valid qrc resource path begins with a colon.
+ if (protocolIs("qrc"))
+ return ":" + path();
+
+ return String();
}
}
+2011-09-20 Jarred Nicholls <jarred@sencha.com>
+
+ [Qt] Permit qrc resources to load in QWebSettings::setUserStyleSheetUrl()
+ https://bugs.webkit.org/show_bug.cgi?id=51159
+
+ Permit any URL with a local scheme to set a user style sheet. Allow qrc
+ resource URLs as arguments to QWebSettings::setUserStyleSheetUrl().
+
+ New test case makes sure a qrc URL will properly load a user stylesheet.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ (tst_QWebPage::userStyleSheetFromQrcUrl):
+ * tests/qwebpage/tst_qwebpage.qrc:
+
2011-09-20 Adenilson Cavalcanti <adenilson.silva@openbossa.org>
[Qt] resizeToContent seems to trigger infinite resize on some pages
void acceptNavigationRequestWithNewWindow();
void userStyleSheet();
void userStyleSheetFromLocalFileUrl();
+ void userStyleSheetFromQrcUrl();
void loadHtml5Video();
void modified();
void contextMenuCrash();
QCOMPARE(networkManager->requestedUrls.at(0), QUrl("http://does.not/exist.png"));
}
+void tst_QWebPage::userStyleSheetFromQrcUrl()
+{
+ TestNetworkManager* networkManager = new TestNetworkManager(m_page);
+ m_page->setNetworkAccessManager(networkManager);
+
+ m_page->settings()->setUserStyleSheetUrl(QUrl("qrc:///resources/user.css"));
+ m_view->setHtml("<p>hello world</p>");
+ QVERIFY(::waitForSignal(m_view, SIGNAL(loadFinished(bool))));
+
+ QVERIFY(networkManager->requestedUrls.count() >= 1);
+ QCOMPARE(networkManager->requestedUrls.at(0), QUrl("http://does.not/exist.png"));
+}
+
void tst_QWebPage::loadHtml5Video()
{
#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA
<file>resources/framedindex.html</file>
<file>resources/content.html</file>
<file>resources/script.html</file>
+ <file>resources/user.css</file>
</qresource>
</RCC>
+2011-09-20 Jarred Nicholls <jarred@sencha.com>
+
+ [Qt] Permit qrc resources to load in QWebSettings::setUserStyleSheetUrl()
+ https://bugs.webkit.org/show_bug.cgi?id=51159
+
+ Permit any URL with a local scheme to set a user style sheet. Allow qrc
+ resource URLs as arguments to QWebSettings::setUserStyleSheetUrl().
+
+ Add DRT/WKTR qrc resource to test loading user style sheets from a qrc URL.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/DumpRenderTree.qrc: Added.
+ * DumpRenderTree/qt/resources/user.css: Added.
+ (body):
+ * WebKitTestRunner/qt/WebKitTestRunner.pro:
+ * WebKitTestRunner/qt/WebKitTestRunner.qrc: Added.
+ * WebKitTestRunner/qt/resources/user.css: Added.
+ (body):
+
2011-09-20 Leandro Pereira <leandro@profusion.mobi>
ChangeLogEntry class should contain a list of touched files
DEFINES += USE_SYSTEM_MALLOC=1
DEFINES -= QT_ASCII_CAST_WARNINGS
+
+RESOURCES = DumpRenderTree.qrc
\ No newline at end of file
--- /dev/null
+<RCC>
+ <qresource prefix="/">
+ <file>resources/user.css</file>
+ </qresource>
+</RCC>
--- /dev/null
+body {
+ font-size: 50px;
+ background-color: rgb(255, 255, 0);
+}
\ No newline at end of file
include(../../../Source/JavaScriptCore/JavaScriptCore.pri)
prependJavaScriptCoreLib(../../JavaScriptCore)
+
+RESOURCES = WebKitTestRunner.qrc
\ No newline at end of file
--- /dev/null
+<RCC>
+ <qresource prefix="/">
+ <file>resources/user.css</file>
+ </qresource>
+</RCC>
--- /dev/null
+body {
+ font-size: 50px;
+ background-color: rgb(255, 255, 0);
+}
\ No newline at end of file