render: position inset boxes against CSS containers
Reparent inset-positioned absolute boxes to the nearest non-static ancestor and fixed boxes to the initial containing block. Keep auto-axis boxes on the existing static-position path, distinguish fixed from absolute, and blockify positioned inline boxes and floats.
This commit is contained in:
1 parent
d36809058f
commit
6ea1739121
4 files changed
+134
-2
No files matched your search
@@ -434,8 +434,22 @@ fn apply_value(style: &mut LayoutStyle, name: &str, value: &str) {
|
||||
"flex" => parse_flex_shorthand(style, value),
|
||||
"position" => {
|
||||
match value {
|
||||
"absolute" | "fixed" => style.position = Some(taffy::Position::Absolute),
|
||||
"relative" | "sticky" | "static" => style.position = Some(taffy::Position::Relative),
|
||||
"absolute" => {
|
||||
style.position = Some(taffy::Position::Absolute);
|
||||
style.position_fixed = false;
|
||||
}
|
||||
"fixed" => {
|
||||
style.position = Some(taffy::Position::Absolute);
|
||||
style.position_fixed = true;
|
||||
}
|
||||
"relative" | "sticky" => {
|
||||
style.position = Some(taffy::Position::Relative);
|
||||
style.position_fixed = false;
|
||||
}
|
||||
"static" => {
|
||||
style.position = None;
|
||||
style.position_fixed = false;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user