Details
Description
Consider the following simple case:
QWidget *root = new QWidget(this); root->setStyleSheet("background:red"); root->setAutoFillBackground(true); setCentralWidget(root); QWebView* web = new QWebView(root); web->setHtml("<html><head><style>body {background-color: transparent;}" "h1 {background-color: #00ff00;}</style></head>" "<body><h1>This is heading 1</h1></body></html>", QUrl("http://localhost")); web->move(0, 0); web->show();
This works just fine with WebView, now do the same with WebEngine:
QWidget *root = new QWidget(this); root->setStyleSheet("background:red"); root->setAutoFillBackground(true); setCentralWidget(root); QWebEngineView* web = new QWebEngineView(root); web->setHtml("<html><head><style>body {background-color: transparent;}" "h1 {background-color: #00ff00;}</style></head>" "<body><h1>This is heading 1</h1></body></html>", QUrl("http://localhost")); web->move(0, 0); web->show();
It renders a white block as background instead. This seems like a regression with webengine.
I did some commit spelunking and found this:
https://qt.gitorious.org/qt/qtwebengine/commit/622f613bc4d41f9d3784fc0249e71ce0d3102a97
So I reverted that change and recompiled Qt to try. But that didn't seem to help, I still get the same white background block.
At this point I am not concerned about having a local change with Qt so if there is a workaround that can be easily applied to WebEngine locally I would be happy to try that.