Re: [dev-servo] Abstract-dimension geometry for CSS Writing Modes

2014-07-04 Thread Ms2ger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/04/2014 05:30 PM, Simon Sapin wrote: > On 26/05/14 22:52, Patrick Walton wrote: >> (In general, I find that single-letter abbreviations read better >> when squished up next to the word they go with, without >> underscores. Just personal preferenc

Re: [dev-servo] Abstract-dimension geometry for CSS Writing Modes

2014-07-04 Thread Simon Sapin
On 26/05/14 22:52, Patrick Walton wrote: (In general, I find that single-letter abbreviations read better when squished up next to the word they go with, without underscores. Just personal preference, I guess.) Gecko does this, but with camel case: BStart, IEnd, BEnd, IStart. (Meaning "start s

Re: [dev-servo] Abstract-dimension geometry for CSS Writing Modes

2014-05-27 Thread Patrick Walton
On 5/27/14 11:04 AM, Simon Sapin wrote: On 27/05/2014 18:14, Patrick Walton wrote: On 5/26/14 3:11 PM, Simon Sapin wrote: I’m fine with that, but I’m more interested in the signature than the naming. That is, which of these (or others) to have, for each private field? fn(&self) -> T fn(&mut se

Re: [dev-servo] Abstract-dimension geometry for CSS Writing Modes

2014-05-27 Thread Simon Sapin
On 27/05/2014 18:14, Patrick Walton wrote: On 5/26/14 3:11 PM, Simon Sapin wrote: I’m fine with that, but I’m more interested in the signature than the naming. That is, which of these (or others) to have, for each private field? fn(&self) -> T fn(&mut self, T) fn(&'a mut self) -> &'a mut T Hm

Re: [dev-servo] Abstract-dimension geometry for CSS Writing Modes

2014-05-27 Thread Patrick Walton
On 5/26/14 3:11 PM, Simon Sapin wrote: I’m fine with that, but I’m more interested in the signature than the naming. That is, which of these (or others) to have, for each private field? fn(&self) -> T fn(&mut self, T) fn(&'a mut self) -> &'a mut T Hmm. My gut tells me the first and the third.

Re: [dev-servo] Abstract-dimension geometry for CSS Writing Modes

2014-05-26 Thread Simon Sapin
On 26/05/2014 22:52, Patrick Walton wrote: On 5/26/14 2:44 PM, Simon Sapin wrote: Unlike C++, Rust does not have method overloading so the accessors are much more verbose. `nscoord ISize(WritingMode aWritingMode) const` overloaded with `nscoord& ISize(WritingMode aWritingMode)` becomes `get_i_si

Re: [dev-servo] Abstract-dimension geometry for CSS Writing Modes

2014-05-26 Thread Patrick Walton
On 5/26/14 2:52 PM, Patrick Walton wrote: (In general, I find that single-letter abbreviations read better when squished up next to the word they go with, without underscores. Just personal preference, I guess.) Compare e.g. "xrange" in Python versus a hypothetical "x_range". I think "xrange"

Re: [dev-servo] Abstract-dimension geometry for CSS Writing Modes

2014-05-26 Thread Patrick Walton
On 5/26/14 2:44 PM, Simon Sapin wrote: Unlike C++, Rust does not have method overloading so the accessors are much more verbose. `nscoord ISize(WritingMode aWritingMode) const` overloaded with `nscoord& ISize(WritingMode aWritingMode)` becomes `get_i_size(&self, mode: WritingMode) -> T` and `set_

[dev-servo] Abstract-dimension geometry for CSS Writing Modes

2014-05-26 Thread Simon Sapin
In preparation for CSS Writing Modes and porting all of our layout code, I started adding geometry primitives in abstract dimensions. Permanent link as of this writing: https://github.com/SimonSapin/servo/compare/d6caf26 Link tracking the branch: https://github.com/SimonSapin/servo/compare/abst