[webkit-qt] Qtwebkit 5.212 Alpha 4 stylesheet issue
Ramakanth Kesireddy
rama.kesi at gmail.com
Wed Sep 9 22:12:47 PDT 2020
Hello Konstantin,
Thanks a lot for your feedback.
After debugging on target, we found adding the QWebview to
layout(highlighted in made a difference to show the scrollbar applied using
css webkit scrollbar on target.
With this change, the css stylesheet of the scrollbar from path is applied.
m_reportLayout = new QHBoxLayout(this);
m_reportLayout->setSizeConstraint( QLayout::SetMinAndMaxSize );
m_webView = new QWebView();
m_webView->setContextMenuPolicy( Qt::NoContextMenu );
m_webView->settings()->setUserStyleSheetUrl( QUrl::fromLocalFile(
stylesheetPath ) );
m_webView->settings()->setDefaultTextEncoding( "utf-8" );
QFile file ("scrolltest_page.html");
if (file.exists())
{
file.open(QIODevice::ReadOnly);
QByteArray htmlArr = file.readAll();
QString htmlStr = QString::fromUtf8(htmlArr);
qDebug()<<"width:"<<m_webView->page()->mainFrame()->contentsSize().width()<<"height:"<<m_webView->page()->mainFrame()->contentsSize().height();
m_webView->setHtml(htmlStr);
connect(m_webView, SIGNAL(loadFinished(bool)), this,
SLOT(pageLoaded(bool)));
file.close();
}
m_reportLayout->addWidget( m_webView );
Could you please let me know your feedback if this is expected as without
adding layout works fine on ubuntu?
Your help in this is greatly appreciated.
Best Regards,
Ramakanth
On Wed, Sep 9, 2020 at 10:47 AM Ramakanth Kesireddy <rama.kesi at gmail.com>
wrote:
>
>
> On Tue, Sep 8, 2020 at 3:20 PM Konstantin Tokarev <annulen at yandex.ru>
> wrote:
>
>>
>>
>> 08.09.2020, 12:30, "Ramakanth Kesireddy" <rama.kesi at gmail.com>:
>> > HI Konstantin,
>> >
>> > Thanks for your mail.
>> > Not sure if the other issue reported #908 is similar to the one I
>> raised in github https://github.com/qtwebkit/qtwebkit/issues/1021
>>
>> No it is not, as it talks about qtwebkit-dev branch.
>>
>> >
>> > Here is the configuration used for Webkit(qtwebkit_git.bb) through
>> yocto. It does built with -DCMAKE_BUILD_TYPE=Release.
>> >
>> > DEPENDS += "qtbase qtdeclarative icu ruby-native sqlite3 glib-2.0
>> libxslt gperf-native bison-native flex-native"
>> >
>> > # Patches from https://github.com/meta-qt5/qtwebkit/commits/b5.13
>> > # 5.13.meta-qt5.1
>> >
>> > SRC_URI[md5sum] = "fdfdf1a716059bcf225ec7658e757469"
>> > SRC_URI = "\
>> >
>> https://github.com/qtwebkit/qtwebkit/archive/qtwebkit-5.212.0-alpha4.tar.gz
>> \
>> >
>> file://qt5_qtwebkit_0001-QtTestBrowser-Fix-build-with-launcherwindow-moc.patch
>> \
>> >
>> file://qt5_qtwebkit_0001-QtTestBrowser-Fix-build-with-QT_NO_OPENGL.patch \
>> >
>> file://0002-generate-bytecode-files-Add-support-for-Python-2.7.patch \
>> > file://qt5_qtwebkit_fix-nossl.patch \
>> >
>> file://0005-PlatformQt.cmake-Do-not-generate-hardcoded-include-p.patch \
>> >
>> file://0001-PlatformQt.cmake-Fix-include-paths-for-cross-compile.patch \
>> > "
>> >
>> > EXTRA_OECMAKE += " \
>> > -DPORT=Qt \
>> > -DCROSS_COMPILE=ON \
>> > -DECM_MKSPECS_INSTALL_DIR=${libdir}${QT_DIR_NAME}/mkspecs/modules \
>> > -DQML_INSTALL_DIR=${OE_QMAKE_PATH_QML} \
>> > -DPYTHON_EXECUTABLE=`which python3` \
>> > "
>> >
>> > EXTRA_OECMAKE_<productname> += " \
>> > -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Linux
>> -DCMAKE_SYSTEM_PROCESSOR=arm \
>> > -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
>> -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
>> -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
>> > -DENABLE_WEBKIT2=OFF -DENABLE_OPENGL=OFF \
>> > -DENABLE_GEOLOCATION=OFF -DENABLE_DEVICE_ORIENTATION=OFF
>> -DENABLE_VIDEO=OFF -DENABLE_WEB_AUDIO=OFF -DUSE_LIBHYPHEN=OFF \
>> > -DPORT=Qt \
>> > -DECM_MKSPECS_INSTALL_DIR=${libdir}${QT_DIR_NAME}/mkspecs/modules \
>> > -DCROSS_COMPILE=ON \
>> > "
>> >
>> > Are we missing anything in the configuration as I
>> see -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY being missed(hope it
>> shouldnot impact)?
>>
>> Generally, present or missing build options don't trigger rendering bugs.
>>
>> There is one more thing I can think about: if your target CPU is
>> Cortex-A53, it requires adding -DWTF_CPU_ARM64_CORTEXA53=ON when doing
>> cross-compilation, otherwise bugs may occur. (CPU type is autodetected in
>> host-based builds but cross build cannot know where will it be run)
>>
>> It is not applicable as out target CPU is Cortex-A9.
>> >
>> > Further, the below qtwebkit unit tests fail only on target.
>> >
>> > 1)qtwebkit/tests/webkitwidgets/qwebview( 2 failed tests)
>> > FAIL! : tst_QWebView::innerOuterRect() Compared values are not the same
>> > Actual (innerWidth.toInt()): 426
>> > Expected (geometry.width()) : 640
>> > Loc: [tst_qwebview.cpp(539)]
>> >
>> > FAIL! : tst_QWebView::focusInputTypes()
>> 'webView.testAttribute(Qt::WA_InputMethodEnabled)' returned FALSE. ()
>> >
>> > 2)qtwebkit/tests/webkitwidgets/qwebpage( 1 failed test)
>> > FAIL! : tst_QWebPage::userStyleSheetFromLocalFileUrl()
>> '::waitForSignal(m_view, SIGNAL(loadFinished(bool)))' returned FALSE. ()
>> > Loc: [tst_qwebpage.cpp(615)]
>> >
>> > Tried only referencing the css from qrc and images separately which
>> work fine on ubuntu but not on target. Didnot try including images loaded
>> from css using qrc:/images.
>>
>> FWIW, spamming the same information over and over again doesn't help to
>> resolve problem. Please report only changes in your findings if there are
>> any, I have no interest in comparing your emails between each other to find
>> difference.
>>
>> Sorry for spamming same information. Here is the additional patch which
>> had been applied when compared to meta-qt5 Qtwebkit yocto patches. Hope
>> that doesnot impacts the rendering issue of scrollbar using css.
>>
> Source/JavaScriptCore/generate-bytecode-files | 3 ++-
>
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Source/JavaScriptCore/generate-bytecode-files
> b/Source/JavaScriptCore/generate-bytecode-files
> index c5dab429c..d745b3eb2 100644
> --- a/Source/JavaScriptCore/generate-bytecode-files
> +++ b/Source/JavaScriptCore/generate-bytecode-files
> @@ -115,6 +115,7 @@ if name == "main":
>
> bytecodeJSONFile = args[0]
> bytecodeFile = openOrExit(bytecodeJSONFile, "rb")
>
>
> -
>
> bytecodeFileDecode = openOrExit(bytecodeJSONFile, "r")
> sha1Hash = hashFile(bytecodeFile)
>
> hFileHashString = "// SHA1Hash: {0}\n".format(sha1Hash)
> @@ -163,7 +164,7 @@ if name == "main":
> initBytecodesFile = openOrExit(initASMFileName, "w")
>
> try:
>
>
> -
>
> bytecodeSections = json.load(bytecodeFile, encoding = "utf-8")
>
>
>
> -
>
> bytecodeSections = json.load(bytecodeFileDecode)
>
> except:
> print("Unexpected error parsing {0}: {1}".format(bytecodeJSONFile,
> sys.exc_info()))
>
> --
> 2.27.0
>
>
>> >
>> > Debugged the below sample code snippet on target:
>> >
>> > m_webView = new QWebView(this);
>> > m_webView->setContextMenuPolicy( Qt::NoContextMenu );
>> > QWebSettings::globalSettings()->setUserStyleSheetUrl(
>> QUrl::fromLocalFile(stylesheetPath) );//Tried with m_webview as well
>> > QWebSettings::globalSettings()->setDefaultTextEncoding( "utf-8" );
>> > m_webView->settings()->setDefaultTextEncoding( "utf-8" );
>> > m_webView->page()->setPreferredContentsSize(QSize(480, 640));
>> >
>> > QFile file ("scrolltest_page.html");
>> > if (file.exists())
>> > {
>> > file.open(QIODevice::ReadOnly);
>> > QByteArray htmlArr = file.readAll();
>> > QString htmlStr = QString::fromUtf8(htmlArr);
>> >
>> qDebug()<<"width:"<<m_webView->page()->mainFrame()->contentsSize().width()<<"height:"<<m_webView->page()->mainFrame()->contentsSize().height();
>> >
>> > m_webView->setHtml(htmlStr);
>> > connect(m_webView, SIGNAL(loadFinished(bool)), this,
>> SLOT(pageLoaded(bool)));
>> > file.close();
>> >
>> > }
>> >
>> > The page loaded returns true even if scrollbar is not visible on target
>> and the sizes set are correct as per debug prints.
>>
>> When I mentioned debug prints I've meant ones in QtWebKit code itself, of
>> course you likely won't find anything useful outside.
>> BTW, what scroll bars are missing? If that's about scrollbar of main
>> frame, does it reproduce when QWebView is not fullscreen?
>>
> Yes scrollbars are missing for the mainframe and it does reproduce
> when QWebView is not fullscreen. Do you want me to try reproducing if
> default scrollbar is visible
> incase webkit scrollbar stylesheet is not set using css?
>
>>
>> >
>> > Could you please suggest to put any specific debug print which would
>> indicate the stylesheet set is not proper or missing any global
>> QWebsettings to initialize or disable QNetworkAccessManager on target
>> >
>> > for local storage html or css?
>>
>> Did you run web inspector? Are css rules loaded correctly? If they are,
>> debug prints should be placed in WebCore around code which is related to
>> scrollbar, e.g. ScrollbarThemeQt/QStyle, ScrollbarTheme, RenderScrollbar.
>>
> Not yet. Shall update the results with webinspector.
>
>>
>> --
>> Regards,
>> Konstantin
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20200910/b6481b58/attachment-0001.htm>
More information about the webkit-qt
mailing list