Bug 1005630 - Port |Bug 999260 and Bug 1003812| to SeaMonkey. r=jcranmer a=bustagefix on a CLOSED TREE