Bug 34802 - [Qt] REGRESSION: QWebSettings::setUserStyleSheetUrl is not working with a data URL (Base64)
Summary: [Qt] REGRESSION: QWebSettings::setUserStyleSheetUrl is not working with a dat...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Diego Gonzalez
URL:
Keywords: Qt
Depends on:
Blocks:
 
Reported: 2010-02-10 08:14 PST by Chenca
Modified: 2010-02-26 08:53 PST (History)
8 users (show)

See Also:


Attachments
Fix documentation (1.79 KB, patch)
2010-02-24 12:03 PST, Diego Gonzalez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chenca 2010-02-10 08:14:49 PST
This simple test case is not working anymore.

#include <QApplication>
#include <QWebView>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QWebView view;

    //p { background-color: red };
    QUrl css("data:text/css;charset=utf-8;base64,cCB7IGJhY2tncm91bmQtY29sb3I6IHJlZCB9Ow==;");

    view.page()->settings()->setUserStyleSheetUrl(css);
    view.setHtml("<html><body><p>RED TEST</p></body></html>");

    view.show();
    app.exec();

    return 0;
}
Comment 1 Diego Gonzalez 2010-02-11 15:38:04 PST
The last ; int the base64 code (cCB7IGJhY2tncm91bmQtY29sb3I6IHJlZCB9Ow==;) is break the decoding. Removing the ; the style is applied.

I seems ; is not part the data: pattern according:
http://tools.ietf.org/html/rfc2397
http://en.wikipedia.org/wiki/Data_URI_scheme

but off course we can treat this type of error on Qt side or maybe in WebCore.

Suggestions?
Comment 2 Simon Hausmann 2010-02-12 04:33:57 PST
(In reply to comment #1)
> The last ; int the base64 code (cCB7IGJhY2tncm91bmQtY29sb3I6IHJlZCB9Ow==;) is
> break the decoding. Removing the ; the style is applied.
> 
> I seems ; is not part the data: pattern according:
> http://tools.ietf.org/html/rfc2397
> http://en.wikipedia.org/wiki/Data_URI_scheme
> 
> but off course we can treat this type of error on Qt side or maybe in WebCore.
> 
> Suggestions?

Whoops, sounds like at least the API docs need fixing :-).

Maybe the semicolon slipped in accidentially.

It would be nice if QUrl could detect this, but otherwise I don't think there's much we can or should do. It's technically invalid input.
Comment 3 Diego Gonzalez 2010-02-24 12:03:41 PST
Created attachment 49420 [details]
Fix documentation

Fix the documentation. Maybe after a Qt bug could be opened to QUrl treat this sittuation
Comment 4 Simon Hausmann 2010-02-26 00:56:12 PST
Comment on attachment 49420 [details]
Fix documentation

Thanks Diego!
Comment 5 WebKit Commit Bot 2010-02-26 08:53:29 PST
Comment on attachment 49420 [details]
Fix documentation

Clearing flags on attachment: 49420

Committed r55288: <http://trac.webkit.org/changeset/55288>
Comment 6 WebKit Commit Bot 2010-02-26 08:53:33 PST
All reviewed patches have been landed.  Closing bug.