1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

WebScrollBarManager: Fix height of vertical scrollbar when horizontal is visible

Also fix warnings in console when trying to access null document.documentElement
This commit is contained in:
David Rosca 2017-01-26 20:56:52 +01:00
parent 899622e623
commit e656e92eaf

View File

@ -136,8 +136,8 @@ void WebScrollBarManager::addWebView(WebView *view)
connect(view->page(), &WebPage::contentsSizeChanged, this, [=]() {
const QString source = QL1S("var out = {"
"vertical: window.innerWidth > document.documentElement.clientWidth,"
"horizontal: window.innerHeight > document.documentElement.clientHeight"
"vertical: document.documentElement && window.innerWidth > document.documentElement.clientWidth,"
"horizontal: document.documentElement && window.innerHeight > document.documentElement.clientHeight"
"};out;");
QPointer<WebView> p(view);
@ -214,7 +214,8 @@ QSize WebScrollBarManager::viewportSize(WebView *view, int thickness) const
if (data->vscrollbarVisible) {
viewport.setWidth(viewport.width() - thickness);
} else if (data->hscrollbarVisible) {
}
if (data->hscrollbarVisible) {
viewport.setHeight(viewport.height() - thickness);
}