[webkit-qt] Qtwebkit 5.212 setuserstylesheet() is taking 7seconds time first time on startup

Ramakanth Kesireddy rama.kesi at gmail.com
Wed Dec 2 21:44:44 PST 2020


Hello Konstantin,

Thanks a lot for your mail. Could you please provide your feedback on the
below questions:

Do we need to initialize QWebcore to load the stylesheet fast for the first
time?
No. However, stylesheet may work faster if it's referenced as CSS file from
page itself instead of being user stylesheet (e.g. using file:/ or qrc:/
url).

Question: Is there any API to reference the CSS file from page as the html
is set dynamically using webview->setHtml() instead of setuserstylesheet?
Does it helps if we use QByteArray
instead m_webView->settings()->setUserStyleSheetUrl(
QUrl("data:text/css;charset=utf-8;base64," + css.toBase64())); where css
being QByteArray object of the stylesheet?

 In UI app, user stylesheet is being set from child or worker pthread where
QApplication instance is created unlike sample app. Not sure if it makes
any difference in applying the stylesheet though.
QWebSettings must be used in the same thread where QWebPage/QWebView were
created, it is not thread-safe.

Question: Both QWebSettings and QWebView are created in the same thread but
am not sure if there is any synchronous operation going on for the first
time
as next time, it returns from the QWebSetting source code if location is
set before.

Inorder to debug further in Qtwebkit sources and use QWebInspector with
UIApp, do we need to use Debug mode in cmake build type?
No, inspector is intended to be fully functional in release builds.

Question: Where can we view or verify the QWebInspector output after
setting the below codes in application source?
QWebPage *page =
page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
QWebInspector *inspector = new QWebInspector;
inspector->setPage(page);

Thanks and Regards,
Ramakanth

On Thu, Dec 3, 2020 at 12:10 AM Konstantin Tokarev <annulen at yandex.ru>
wrote:

>
>
> 02.12.2020, 13:11, "Ramakanth Kesireddy" <rama.kesi at gmail.com>:
> > Hi,
> >
> > Do we need to initialize QWebcore to load the stylesheet fast for the
> first time?
>
> No. However, stylesheet may work faster if it's referenced as CSS file
> from page itself instead of being user stylesheet (e.g. using file:/ or
> qrc:/ url).
>
> >
> > In UI app, user stylesheet is being set from child or worker pthread
> where QApplication instance is created unlike sample app. Not sure if it
> makes any difference in applying the stylesheet though.
>
> QWebSettings must be used in the same thread where QWebPage/QWebView were
> created, it is not thread-safe.
>
> >
> > Inorder to debug further in Qtwebkit sources and use QWebInspector with
> UIApp, do we need to use Debug mode in cmake build type?
>
> No, inspector is intended to be fully functional in release builds.
>
>
> --
> Regards,
> Konstantin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20201203/1e44cde6/attachment.htm>


More information about the webkit-qt mailing list