Created attachment 8505513[details][diff][review]
Patch v2
Addressed review comments and added some changes in nsLineLayout.cpp which I had as a separate patch originally and forgot to include before.
I made FloatMarginISize more readable slightly differently from how you suggested, but I hope you like this way too.