From 30b2ba41cd9acb2b415e22ab0907981a29b27fd7 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sat, 3 Mar 2018 14:28:57 +0100 Subject: [PATCH 1/2] Scripts: Send change event when changing input value in completeFormData Fixes incorrectly completing form data on some sites. CCBUG: 391327 --- src/lib/tools/scripts.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/tools/scripts.cpp b/src/lib/tools/scripts.cpp index 150c304d5..01b4a436f 100644 --- a/src/lib/tools/scripts.cpp +++ b/src/lib/tools/scripts.cpp @@ -230,8 +230,10 @@ QString Scripts::completeFormData(const QByteArray &data) " var type = input.type.toLowerCase();" " if (type != 'text' && type != 'password' && type != 'email')" " continue;" - " if (input.name == key)" + " if (input.name == key) {" " input.value = val;" + " input.dispatchEvent(new Event('change'));" + " }" " }" "}" "" From e4c4fd10fc0a1265d71d3291477e970ee388ec88 Mon Sep 17 00:00:00 2001 From: Anmol Gautam Date: Sat, 3 Mar 2018 14:30:50 +0100 Subject: [PATCH 2/2] Clear mouseover state after closing menu in bookmarks toolbar The button was underMouse() after closing the context menu Differential Revision: https://phabricator.kde.org/D10894 --- src/lib/bookmarks/bookmarkstoolbarbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/bookmarks/bookmarkstoolbarbutton.cpp b/src/lib/bookmarks/bookmarkstoolbarbutton.cpp index 06aca3413..90d92de4d 100644 --- a/src/lib/bookmarks/bookmarkstoolbarbutton.cpp +++ b/src/lib/bookmarks/bookmarkstoolbarbutton.cpp @@ -316,7 +316,7 @@ void BookmarksToolbarButton::paintEvent(QPaintEvent* event) option.features &= ~QStyleOptionButton::HasMenu; // Draw button base (only under mouse, this is autoraise button) - if (isDown() || underMouse()) { + if (isDown() || hitButton(mapFromGlobal(QCursor::pos()))) { option.state |= QStyle::State_AutoRaise | QStyle::State_Raised; style()->drawPrimitive(QStyle::PE_PanelButtonTool, &option, &p, this); }