layout: Implement the proper behavior for margin collapse when negative

margins are involved per CSS 2.1 § 8.3.1.

Needed for Acid2 line 12.

r? @kmcallister