add builder methods to NodeMask

This commit is contained in:
Evan Almloff committed 2022-04-16 17:22:03 -05:00
1 parent 436c6a02f7
commit b9c2664089
7 files changed
+45 -172

No files matched your search

+2 -6
View File
@@ -37,12 +37,8 @@ impl ChildDepState for StretchLayout {
type Ctx = Rc<RefCell<Stretch>>;
type DepState = Self;
// todo: update mask
const NODE_MASK: NodeMask = NodeMask::new(
AttributeMask::Static(SORTED_LAYOUT_ATTRS),
false,
false,
true,
);
const NODE_MASK: NodeMask =
NodeMask::new_with_attrs(AttributeMask::Static(SORTED_LAYOUT_ATTRS)).with_text();
/// Setup the layout
fn reduce<'a>(
+1 -1
View File
@@ -50,7 +50,7 @@ impl ParentDepState for StyleModifier {
type DepState = Self;
// todo: seperate each attribute into it's own class
const NODE_MASK: NodeMask =
NodeMask::new(AttributeMask::Static(SORTED_STYLE_ATTRS), true, true, false);
NodeMask::new_with_attrs(AttributeMask::Static(SORTED_STYLE_ATTRS)).with_element();
fn reduce(&mut self, node: NodeView, parent: Option<&Self::DepState>, _: &Self::Ctx) -> bool {
let mut new = StyleModifier::default();