backout b56da878caed and 8487d4305be3 (bug 901360) from Aurora for regressions a=mfinkle