Bug 1367765 - Do not set the 'active' content state flag on scrollbar thumbs in ActiveElementManager. r=rhunt
authorBotond Ballo <botond@mozilla.com>
Wed, 06 Sep 2017 18:49:31 -0400
changeset 430098 a90f4d33dc80e1209492a3183da9d9a52935628b
parent 430097 aaf870ea6e87ce8420eee59d4467fea345884c94
child 430099 21e6767af2852d98ac4b6082b34f3f642aeb7699
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhunt
bugs1367765
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1367765 - Do not set the 'active' content state flag on scrollbar thumbs in ActiveElementManager. r=rhunt Unlike regular content, scrollbar thumbs use a different mechanism for triggering their 'active' style, and no one will clear this flag if ActiveElementManager sets it. MozReview-Commit-ID: AfloVYRkvQA
gfx/layers/apz/util/ActiveElementManager.cpp
--- a/gfx/layers/apz/util/ActiveElementManager.cpp
+++ b/gfx/layers/apz/util/ActiveElementManager.cpp
@@ -118,17 +118,22 @@ ActiveElementManager::HandleTouchEndEven
 {
   AEM_LOG("Touch end event, aWasClick: %d\n", aWasClick);
 
   // If the touch was a click, make mTarget :active right away.
   // nsEventStateManager will reset the active element when processing
   // the mouse-down event generated by the click.
   CancelTask();
   if (aWasClick) {
-    SetActive(mTarget);
+    // Scrollbar thumbs use a different mechanism for their active
+    // highlight (the "active" attribute), so don't set the active state
+    // on them because nothing will clear it.
+    if (!(mTarget && mTarget->IsXULElement(nsGkAtoms::thumb))) {
+      SetActive(mTarget);
+    }
   } else {
     // We might reach here if mCanBePan was false on touch-start and
     // so we set the element active right away. Now it turns out the
     // action was not a click so we need to reset the active element.
     ResetActive();
   }
 
   ResetTouchBlockState();