mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/CSS: Use a bitfield for Containment flags
Shrinks the struct down from 5 bytes to 1.
This commit is contained in:
parent
3916e33276
commit
bbfc3a0f5e
Notes:
github-actions[bot]
2025-09-30 21:07:06 +00:00
Author: https://github.com/AtkinsSJ
Commit: bbfc3a0f5e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6350
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 5 additions and 6 deletions
|
|
@ -72,12 +72,11 @@ struct ObjectPosition {
|
|||
|
||||
// https://drafts.csswg.org/css-contain-2/#containment-types
|
||||
struct Containment {
|
||||
// FIXME: It'd be nice if this was a single-byte bitfield instead of some bools.
|
||||
bool size_containment = false;
|
||||
bool inline_size_containment = false;
|
||||
bool layout_containment = false;
|
||||
bool style_containment = false;
|
||||
bool paint_containment = false;
|
||||
bool size_containment : 1 { false };
|
||||
bool inline_size_containment : 1 { false };
|
||||
bool layout_containment : 1 { false };
|
||||
bool style_containment : 1 { false };
|
||||
bool paint_containment : 1 { false };
|
||||
|
||||
bool is_empty() const { return !(size_containment || inline_size_containment || layout_containment || style_containment || paint_containment); }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue