Commit 64f8aa0
authored
Compute content size, padding and border for each node (#573)
* Add content_size field to Layout struct
* Add scroll_width and scroll_height methods to Layout struct
* Add content_size field to LayoutOutput struct
* Implement content size computation for flexbox
* Implement content size computation for CSS Grid
* Add Overflow::Clip style
* Add tests for scroll width/height
* Use naive dimensions for scroll size tests
* Round content size
* Print content size in print_tree function
* Trim text content of text nodes in generated tests
* Remove caching run_mode exception for leaf layout
* Leaf layout: always compute content size when run mode is PerformLayout
* Set content_size of root node
* Flexbox: compute correct content size
* Grid: compute correct content size
* Block: compute correct content size
* Remove unsupported non-breaking spaces from leaf tests
* Document feature flags
* Add content_size feature flag
* Feature flag Flexbox content_size implementation
* Feature flag Grid content_size implementation
* Feature flag content_size assertions in gentests
* Add benchmark feature flag for content size
* Simplify f32_min and f32_max implementations
* Enable content_size feature by default
* Fixup: format fixtures
* Fix clippy lints
* Introduce Size::has_non_zero_area method
* Remove commented code from test_helper script
* Refactor main/cross -> x/y conversion
* Fully feature flag content size computation
* Disable content_size feature by default
* Fix Taffy.layout method when rounding is disabled
* Use absolute difference when comparing unrounded values in gentests
* Output scrollbar size in layout
* Fix content_size feature flag in print tree function
* Update scroll_width/scroll_height methods to take into account space taken up by scrollbars
* Specialise cache for perform_layout and run_mode steps
* Fix typo: it's -> its
* Add padding and border fields to Layout struct
* Use border in scroll width/height calculation
* Make content_size a default feature
* Document content size code1 parent 70b3571 commit 64f8aa0
1,014 files changed
Lines changed: 82073 additions & 4251 deletions
File tree
- .github/workflows
- benches
- scripts/gentest
- src
- src
- compute
- common
- grid
- style
- tree
- util
- test_fixtures
- flex
- leaf
- tests
- generated
- blockflex
- blockgrid
- block
- flex
- gridflex
- grid
- leaf
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
26 | 32 | | |
| 33 | + | |
27 | 34 | | |
| 35 | + | |
28 | 36 | | |
29 | | - | |
30 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
31 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
32 | 54 | | |
| 55 | + | |
33 | 56 | | |
34 | | - | |
35 | 57 | | |
36 | 58 | | |
37 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| |||
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
256 | | - | |
| 260 | + | |
| 261 | + | |
257 | 262 | | |
258 | 263 | | |
259 | 264 | | |
260 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
261 | 270 | | |
262 | 271 | | |
263 | 272 | | |
264 | 273 | | |
265 | 274 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
271 | 285 | | |
272 | 286 | | |
273 | 287 | | |
| |||
867 | 881 | | |
868 | 882 | | |
869 | 883 | | |
| 884 | + | |
| 885 | + | |
870 | 886 | | |
871 | 887 | | |
872 | 888 | | |
| |||
879 | 895 | | |
880 | 896 | | |
881 | 897 | | |
882 | | - | |
| 898 | + | |
883 | 899 | | |
884 | 900 | | |
885 | 901 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
287 | 291 | | |
288 | 292 | | |
289 | 293 | | |
| |||
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
296 | 304 | | |
297 | 305 | | |
298 | 306 | | |
| |||
303 | 311 | | |
304 | 312 | | |
305 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
306 | 318 | | |
307 | 319 | | |
308 | 320 | | |
| |||
0 commit comments