That's Terrible!

I mean the word "TeRriBLe" will help people remember how this works now :)

--Jet

----- Original Message -----
From: "Daniel Holbert" <dholb...@mozilla.com>
To: dev-platform@lists.mozilla.org
Sent: Wednesday, March 6, 2013 10:24:52 AM
Subject: PSA: nsMargin, gfxMargin, etc. constructor & SizeTo() methods now      
take "top, right, bottom, left"

As of this morning, our Margin C++ classes now take args in the order...
   top, right, bottom, left
...to be consistent with CSS margins and other public APIs. They
formerly took args in the order "left, top, right, bottom".  I made this
switchover in https://bugzilla.mozilla.org/show_bug.cgi?id=843719

So, if you're creating an instance of nsMargin, nsIntMargin, gfxMargin,
or gfx::Margin and you're passing specific values for the sides, or
you're calling SizeTo() on it, be aware of the new order -- it should
now look like:

> nsMargin myMargin(top, right, bottom, left);
and
> myMargin.SizeTo(newTop, newRight, newBottom, newLeft);

This brings these classes into consistency with the ordering used in CSS
properties "margin", "border", and "padding", and in other APIs outside
of CSS, e.g. nsIDOMWindowUtils::nodesFromRect().

Hopefully this improved consistency will make things less confusing.
I've fixed all of the existing callers (there were only ~20 of them,
fortunately), but if you've got in-progress patches that work with
margins, you may need to reorder their args.

Thanks,
~Daniel
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to