Your Googlefu is weak. Searching for "firefox scroll touchpad" gives several results near the top. A Bugzilla case which explains that its actually the touchpad driver itself. It decides on what keycodes to send based on what the current app is.

Somebody says to update your drivers and another says to change the button mapping.