Fix automatic scrolling of chat window
ClosedPublic

Authored by nowicki on Oct 23 2018, 9:35 AM.

Details

Summary

Around Chromium 60/61 google has deprecated use of
document.body.scrollTop in favour of
document.scrollingElement.scrollTop, which is why auto scrolling broke
with Qt 5.10 (shipped with Chromium 61).

https://bugs.chromium.org/p/chromium/issues/detail?id=766938

In addition to that there seems to be some name clash with the
scrollToBottom() function as the implementation inside Template.html
was never called. A simple rename fixed the problem.

Related Bug: https://bugs.kde.org/show_bug.cgi?id=388082

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
nowicki requested review of this revision.Oct 23 2018, 9:35 AM
nowicki created this revision.
nowicki edited the summary of this revision. (Show Details)
nowicki updated this revision to Diff 44100.Oct 23 2018, 9:52 AM

Fix one more occurrence of document.body.scrollTop.

Thanks

Do you have commit access?

Is the change safe enough (e.g. known to work on Qt-5.9)? What is the reason to rename the function (scrollToBottom->scrollChatToBottom)?

Is the change safe enough (e.g. known to work on Qt-5.9)?

According to this documentation:

https://developer.mozilla.org/en-US/docs/Web/API/Document/scrollingElement

the document.scrollingElement property is supported since Chrome/Chromium 44. Qt 5.9 shipped with Chromium 56.

I did not test this in practice yet as I don't have a Qt 5.9 system available.

What is the reason to rename the function (scrollToBottom->scrollChatToBottom)?

The clash is with the definition found in data/styles/renkoo.AdiumMessageStyle/Contents/Resources/Footer.html

Do you have commit access?

I'm a developer/maintainer for one of the KDE PIM sub-components, so I guess I should :)

This revision is now accepted and ready to land.Oct 23 2018, 11:01 AM
This revision was automatically updated to reflect the committed changes.