Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
fc48cf3
Float layout WIP
nicoburns Aug 30, 2024
a55876f
Setup BFC inheritance
nicoburns Nov 11, 2024
7b0398d
Float Tests 1
nicoburns Oct 20, 2024
30284d9
WIP
nicoburns Sep 13, 2025
296f9b2
Root BFCs contain floats
nicoburns Sep 22, 2025
788a34f
Float positioning logic WIP
nicoburns Sep 24, 2025
a480330
Implement the clear property for floated boxes
nicoburns Sep 29, 2025
20219af
Initial impl of find_content_slot + block ifc child placement
nicoburns Sep 29, 2025
957e8d4
Account for top-margin when creating block subcontext
nicoburns Sep 30, 2025
6ab339b
Account for style size when creating root BFC
nicoburns Sep 30, 2025
5894370
WIP
nicoburns Sep 30, 2025
9e7f363
Fixup type s/left/bottom/ (block abspos)
nicoburns Oct 14, 2025
7816007
Fixup fmt
nicoburns Oct 15, 2025
c96c936
Fixup float y_offset
nicoburns Oct 15, 2025
188f5ae
Track content-box insets separately from border-box insets
nicoburns Oct 15, 2025
3e82233
Fixup root block_ctx width
nicoburns Oct 15, 2025
0857e7a
Fallback to indefinite bfc width
nicoburns Oct 15, 2025
c325f90
Move FloatDirection type to style module
nicoburns Oct 23, 2025
215e96a
Implement simple intrinsic sizing contributions for floats-in-block
nicoburns Oct 24, 2025
ff0b417
Fix horizontal fit check
nicoburns Oct 24, 2025
2829739
Fix warnings and document functions
nicoburns Oct 29, 2025
65f67a9
Track whether a float context contains any floats
nicoburns Nov 3, 2025
2354567
find_content_slot fast path in case of no active floats
nicoburns Nov 3, 2025
569166d
Fix build with float feature disabled
nicoburns Nov 3, 2025
359ee34
Fix top-margins being counted twice for independent block children
nicoburns Nov 3, 2025
11e3c9b
Fix test build
nicoburns Nov 3, 2025
f4c8092
Make some helper method public
nicoburns Nov 5, 2025
0e36724
Disable float tests
nicoburns Nov 10, 2025
84a1785
Make independent Block Formatting Contexts suppress margin collapsing
nicoburns Nov 10, 2025
ef0acc0
Apply top margins to IFC block children
nicoburns Nov 10, 2025
ded8d8b
Format floats tests
nicoburns Nov 10, 2025
b33d09d
Fix clippy::derivable_impls Default lints
nicoburns Nov 10, 2025
eb70b3b
Fix some clippy lints
nicoburns Nov 10, 2025
f7074ae
Compute y_margin offset (top-margin accounting for collapsing) for
nicoburns Nov 10, 2025
00d01fb
Remove commented code
nicoburns Nov 10, 2025
4267843
Fix doc warnings
nicoburns Nov 10, 2025
e55f34a
Start documenting private float internals
nicoburns Nov 10, 2025
149faad
Refactor and document float implementation
nicoburns Nov 10, 2025
ecc67b1
Allow mut lint
nicoburns Nov 10, 2025
7b1e28a
Remove lint reason for MSRV reasons
nicoburns Nov 10, 2025
d695679
Add serde derives to float styles
nicoburns Nov 10, 2025
6166713
Make is_bfc_root function available with float feature disabled
nicoburns Nov 10, 2025
251118e
Fix TaffyTree with floats disabled
nicoburns Nov 10, 2025
e9eac43
Add FloatIntrinsicWidthCalculator
nicoburns Nov 10, 2025
703e9b9
Teach the float and clear properties to the test generator
nicoburns Nov 10, 2025
2d0f702
Make floated_content_height_contribution public
nicoburns Nov 11, 2025
90e269e
Force BFC to be independent if it is a scroll container
nicoburns Nov 11, 2025
fff4ea6
Add +1 to clear logic
nicoburns Nov 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ default = [
"flexbox",
"grid",
"block_layout",
"float_layout",
"calc",
"content_size",
"detailed_layout_info",
Expand All @@ -48,6 +49,8 @@ default = [

## Enables the Block layout algorithm. See [`compute_block_layout`](crate::compute_block_layout).
block_layout = []
## Enables the Float layout algorithm. This is a sub-feature of block layout.
float_layout = []
## Enables the Flexbox layout algorithm. See [`compute_flexbox_layout`](crate::compute_flexbox_layout).
flexbox = []
## Enables the CSS Grid layout algorithm. See [`compute_grid_layout`](crate::compute_grid_layout).
Expand Down
21 changes: 21 additions & 0 deletions scripts/gentest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,25 @@ fn generate_node(ident: &str, node: &Value) -> TokenStream {
_ => quote!(),
};

let float = match style["cssFloat"] {
Value::String(ref value) => match value.as_ref() {
"left" => quote!(float: taffy::style::Float::Left,),
"right" => quote!(float: taffy::style::Float::Right,),
_ => quote!(),
},
_ => quote!(),
};

let clear = match style["clear"] {
Value::String(ref value) => match value.as_ref() {
"left" => quote!(clear: taffy::style::Clear::Left,),
"right" => quote!(clear: taffy::style::Clear::Right,),
"both" => quote!(clear: taffy::style::Clear::Right,),
_ => quote!(),
},
_ => quote!(),
};

let flex_direction = match style["flexDirection"] {
Value::String(ref value) => match value.as_ref() {
"row-reverse" => quote!(flex_direction: taffy::style::FlexDirection::RowReverse,),
Expand Down Expand Up @@ -646,6 +665,8 @@ fn generate_node(ident: &str, node: &Value) -> TokenStream {
#box_sizing
#direction
#position
#float
#clear
#text_align
#flex_direction
#flex_wrap
Expand Down
3 changes: 3 additions & 0 deletions scripts/gentest/test_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ function describeElement(e) {

writingMode: parseEnum(e.style.writingMode),

cssFloat: parseEnum(e.style.cssFloat),
clear: parseEnum(e.style.clear),

textAlign: parseEnum(e.style.textAlign),

flexDirection: parseEnum(e.style.flexDirection),
Expand Down
Loading