Spinoff from bug 1343977 comment 19: (In reply to Petruta Rasa [QA] [:petruta] from comment #19) > On the other hand, "Show/Hide Toolbars" button from Customize page has a > short flicker on second tap - it becomes white, then gray and back to white. > Also, more rarely, although the pop-up is closed the button remains selected > (pressed). I noticed that the latter scenario (button remains in the pressed state) happens if you long-tap the button when the menu is open. I'm not sure what's causing this bug - it might be platform, it might be front-end. Parking with me until I have a chance to dig into it.
The glitch happens because of the synthetic mouse click that lands on the button. i.e.: - tap once to open: the [open] CSS rule is activated - tap to close: none of the CSS rules are activated - synthetic mouse click happens: the :hover:active rule is activated - mouse click done: none of the CSS rules are activated The CSS rules in question are at . The third step above is what the visual glitch is. If we reduce the second step to 0 length that would probably fix it too.  http://searchfox.org/mozilla-central/rev/ee7cfd05d7d9f83b017dd54c2052a2ec19cbd48b/browser/themes/shared/customizableui/customizeMode.inc.css#177-179
I tried skipping the delay on the single-tap firing, by forcing the code down the path at  but that didn't really help. I can't think of any other way to fix without introducing a new CSS state or something.  http://searchfox.org/mozilla-central/rev/0079c7adf3b329bff579d3bbe6ac7ba2f6218a19/gfx/layers/apz/util/APZEventState.cpp#197