Closed Bug 570837 Opened 10 years ago Closed 10 years ago

have 64 bits of frame state

Categories

(Core :: Layout, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

Attachments

(4 files, 1 obsolete file)

roc and I are both running into a need for more frame state bits.  In the past I'd proposed moving class-private bits into their own word for blocks so we could squeeze a few more bits out, but that's more work than I have time for right now, and it probably won't get us enough bits to last very long anyway.

So here's a series of patches to have 64 bits of frame state.
The main change here is to define all state bits using macros.  This makes the definitions of the bits much more readable (a problem that would get worse with 64-bit... imagine distinguishing 0x80000000000000 and 0x800000000000000), and also makes it easy to find all the places that define frame state bits.

However, it's strictly necessary here so that we don't break places that do mState &= ~NS_FRAME_... or similar.


There's also one fix replacing RemoveStateBits(0xffffffff) with RemoveStateBits(~nsFrameState(0)).
Attachment #449974 - Flags: review?(roc)
Attached patch patch 2: add a FIXME (obsolete) — Splinter Review
Should really look into this, but add a FIXME for now.
Attachment #449975 - Flags: review?(roc)
In order to do patch 1, I needed to find everything that was set as a frame state bit.  Once I had that list, it was easy enough to figure out which ones were unused.  This removes them.
Attachment #449976 - Flags: review?(roc)
Regarding patch 2:

The current value of NS_STATE_NEED_LAYOUT comes from bug 54710; see bug 54710 comment 7 and bug 54710 comment 8.  That was September 2000.

NS_STATE_IS_HORIZONTAL and NS_STATE_IS_ROOT have had their current values since March 2000, but NS_STATE_BOX_CHILD_RESERVED wasn't explicitly noted until 2007.

Then again, nsTextBoxFrame inherits from nsLeafBoxFrame (not nsBoxFrame), so maybe this is totally irrelevant and I should just remove the comment.  But the comments in bug 54710 suggest that maybe it's not irrelevant.
Can we just change it to an unused bit and remove the comment?
I can change it to NS_BOX_CHILD_RESERVED.
You mean NS_STATE_BOX_CHILD_RESERVED? That sounds fine.
Attachment #449975 - Attachment is obsolete: true
Attachment #450028 - Flags: review?(roc)
Attachment #449975 - Flags: review?(roc)
Comment on attachment 450028 [details] [diff] [review]
patch 2: fix potentially-overlapping bit

I'll consider comment 8 to be r=roc on this.
Attachment #450028 - Flags: review?(roc) → review+
Depends on: 571059
Depends on: 571211
You need to log in before you can comment on or make changes to this bug.