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
--- a/gfx/layers/apz/util/ActiveElementManager.cpp
+++ b/gfx/layers/apz/util/ActiveElementManager.cpp
@@ -119,17 +119,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();