See bug 907495 comment 4. This is a follow-up bug to do the second thing suggested in that comment (add a helper to CSSPixel and make the conversion explicit). As Ms2ger said in bug 907495 comment 9, the code as it is looks fishy now.
Created attachment 796721 [details] [diff] [review] Patch This applies on top of the patch from bug 904533
Created attachment 802550 [details] [diff] [review] Add some margin operators Pretty straightforward extension of the existing code.