mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Tweak contain bitflag definition order to avoid static constructors
This has no behavior change otherwise. The STRICT definition depended on SIZE, which was defined later. That's fine in Rust, but in C++ it causes the initialization to be dynamic because it doesn't have the definition of SIZE yet (ugh). This is the fix for the regression, though the following patch turns on constexpr support in cbindgen, which would've caught this at build-time, and guarantees that we don't have extra static constructors. Differential Revision: https://phabricator.services.mozilla.com/D144316
This commit is contained in:
parent
3b174e376e
commit
3eed093e33
1 changed files with 4 additions and 4 deletions
|
@ -1346,12 +1346,12 @@ bitflags! {
|
|||
const LAYOUT = 1 << 2;
|
||||
/// `paint` variant, turns on paint containment
|
||||
const PAINT = 1 << 3;
|
||||
/// `strict` variant, turns on all types of containment
|
||||
const STRICT = 1 << 4 | Contain::LAYOUT.bits | Contain::PAINT.bits | Contain::SIZE.bits;
|
||||
/// 'size' variant, turns on size containment
|
||||
const SIZE = 1 << 4 | Contain::INLINE_SIZE.bits | Contain::BLOCK_SIZE.bits;
|
||||
/// `content` variant, turns on layout and paint containment
|
||||
const CONTENT = 1 << 5 | Contain::LAYOUT.bits | Contain::PAINT.bits;
|
||||
/// 'size' variant, turns on size containment
|
||||
const SIZE = 1 << 6 | Contain::INLINE_SIZE.bits | Contain::BLOCK_SIZE.bits;
|
||||
/// `strict` variant, turns on all types of containment
|
||||
const STRICT = 1 << 6 | Contain::LAYOUT.bits | Contain::PAINT.bits | Contain::SIZE.bits;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue