On Friday 2011-09-16 23:05 -0700, fantasai wrote:
> On 09/15/2011 12:23 PM, fantasai wrote:
> >I'm working on a patch that requires adding data to nsReflowStatus,
> >but trying to understand how all the bits fit together makes my
> >head spin, particularly the NS_INLINE_BREAK parts...
> >
> >Are there non-historical reasons why we're using macros instead of a
> >bitfield? Can I change things to make it more understandable? What are
> >the constraints on changing nsReflowStatus (other than "don't change
> >existing behavior")? Are there files other than nsIFrame.h that define
> >nsReflowStatus bits?

I agree the current code is confusing, and agree fewer macros would
probably help.

I'd note that you don't want to use PRBool with a :1 bitfield, since
PRBool is a signed type (and therefore a bitfield with one bit holds
the values 0 and -1, or something nasty like that).  Use
PRPackedBool instead (which is unsigned).

I'd also note it's definitely worth keeping some of the existing
comments above the macros (and merging them into your new struct
definition).

> Here's kindof what I was thinking to change it to. This would involve
> touching lots of files... alternatively I could just rearrange the
> NS_INLINE_BREAK macros to make that part easier to understand. Thoughts?

Can it be done in more than one step so the pieces are easier to
review?

>   // Note: Line breaks are currently handled as clears.

Why is this?  Are you renaming the current *_BREAK_* stuff to clear
and then introducing new break stuff?

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla Corporation               http://www.mozilla.com/   𝄂
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to