This is a known bug in Firefox, which has existed for quite some time. It is surprising that it is not fixed after so long. Some reports on Bugzilla say the bug is fixed, but obviously they are wrong.
Some of the reasons I have found for this anomaly are as follows: