mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +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:
parent
899622e623
commit
e656e92eaf
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user