tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 788HTML 740Markdown 12TOML 62536 Definitions

⎇ 477ff4aff498cbae4cdfbf0cda1ee5b04c784f08 tests/generated/grid/grid_absolute_resolved_insets.rs Rust · 578 lines · 23.7 KB History Who touched what raw

Absolute Insets should be resolved against the container size minus border (#666) 477ff4aff · Julia Ortiz ·

1#[test]
2fn grid_absolute_resolved_insets() {
3    #[allow(unused_imports)]
4    use taffy::{prelude::*, tree::Layout, TaffyTree};
5    let mut taffy: TaffyTree<crate::TextMeasure> = TaffyTree::new();
6    let node00 = taffy
7        .new_leaf(taffy::style::Style {
8            position: taffy::style::Position::Absolute,
9            inset: taffy::geometry::Rect {
10                left: taffy::style::LengthPercentageAuto::Auto,
11                right: auto(),
12                top: taffy::style::LengthPercentageAuto::Auto,
13                bottom: auto(),
14            },
15            ..Default::default()
16        })
17        .unwrap();
18    let node01 = taffy
19        .new_leaf(taffy::style::Style {
20            position: taffy::style::Position::Absolute,
21            inset: taffy::geometry::Rect {
22                left: taffy::style::LengthPercentageAuto::Length(0f32),
23                right: auto(),
24                top: taffy::style::LengthPercentageAuto::Length(0f32),
25                bottom: auto(),
26            },
27            ..Default::default()
28        })
29        .unwrap();
30    let node02 = taffy
31        .new_leaf(taffy::style::Style {
32            position: taffy::style::Position::Absolute,
33            inset: taffy::geometry::Rect {
34                left: taffy::style::LengthPercentageAuto::Percent(1f32),
35                right: auto(),
36                top: taffy::style::LengthPercentageAuto::Percent(1f32),
37                bottom: auto(),
38            },
39            ..Default::default()
40        })
41        .unwrap();
42    let node03 = taffy
43        .new_leaf(taffy::style::Style {
44            position: taffy::style::Position::Absolute,
45            inset: taffy::geometry::Rect {
46                left: auto(),
47                right: taffy::style::LengthPercentageAuto::Percent(1f32),
48                top: auto(),
49                bottom: taffy::style::LengthPercentageAuto::Percent(1f32),
50            },
51            ..Default::default()
52        })
53        .unwrap();
54    let node04 = taffy
55        .new_leaf(taffy::style::Style {
56            position: taffy::style::Position::Absolute,
57            inset: taffy::geometry::Rect {
58                left: taffy::style::LengthPercentageAuto::Length(30f32),
59                right: auto(),
60                top: taffy::style::LengthPercentageAuto::Length(30f32),
61                bottom: auto(),
62            },
63            ..Default::default()
64        })
65        .unwrap();
66    let node05 = taffy
67        .new_leaf(taffy::style::Style {
68            position: taffy::style::Position::Absolute,
69            size: taffy::geometry::Size {
70                width: taffy::style::Dimension::Percent(1f32),
71                height: taffy::style::Dimension::Percent(1f32),
72            },
73            inset: taffy::geometry::Rect {
74                left: taffy::style::LengthPercentageAuto::Length(0f32),
75                right: auto(),
76                top: taffy::style::LengthPercentageAuto::Length(0f32),
77                bottom: auto(),
78            },
79            ..Default::default()
80        })
81        .unwrap();
82    let node0 = taffy
83        .new_with_children(
84            taffy::style::Style {
85                display: taffy::style::Display::Grid,
86                size: taffy::geometry::Size {
87                    width: taffy::style::Dimension::Length(200f32),
88                    height: taffy::style::Dimension::Length(200f32),
89                },
90                padding: taffy::geometry::Rect {
91                    left: taffy::style::LengthPercentage::Length(15f32),
92                    right: taffy::style::LengthPercentage::Length(15f32),
93                    top: taffy::style::LengthPercentage::Length(15f32),
94                    bottom: taffy::style::LengthPercentage::Length(15f32),
95                },
96                border: taffy::geometry::Rect {
97                    left: taffy::style::LengthPercentage::Length(20f32),
98                    right: taffy::style::LengthPercentage::Length(20f32),
99                    top: taffy::style::LengthPercentage::Length(20f32),
100                    bottom: taffy::style::LengthPercentage::Length(20f32),
101                },
102                ..Default::default()
103            },
104            &[node00, node01, node02, node03, node04, node05],
105        )
106        .unwrap();
107    let node10 = taffy
108        .new_leaf(taffy::style::Style {
109            position: taffy::style::Position::Absolute,
110            inset: taffy::geometry::Rect {
111                left: taffy::style::LengthPercentageAuto::Auto,
112                right: auto(),
113                top: taffy::style::LengthPercentageAuto::Auto,
114                bottom: auto(),
115            },
116            ..Default::default()
117        })
118        .unwrap();
119    let node11 = taffy
120        .new_leaf(taffy::style::Style {
121            position: taffy::style::Position::Absolute,
122            inset: taffy::geometry::Rect {
123                left: taffy::style::LengthPercentageAuto::Length(0f32),
124                right: auto(),
125                top: taffy::style::LengthPercentageAuto::Length(0f32),
126                bottom: auto(),
127            },
128            ..Default::default()
129        })
130        .unwrap();
131    let node12 = taffy
132        .new_leaf(taffy::style::Style {
133            position: taffy::style::Position::Absolute,
134            inset: taffy::geometry::Rect {
135                left: taffy::style::LengthPercentageAuto::Percent(1f32),
136                right: auto(),
137                top: taffy::style::LengthPercentageAuto::Percent(1f32),
138                bottom: auto(),
139            },
140            ..Default::default()
141        })
142        .unwrap();
143    let node13 = taffy
144        .new_leaf(taffy::style::Style {
145            position: taffy::style::Position::Absolute,
146            inset: taffy::geometry::Rect {
147                left: auto(),
148                right: taffy::style::LengthPercentageAuto::Percent(1f32),
149                top: auto(),
150                bottom: taffy::style::LengthPercentageAuto::Percent(1f32),
151            },
152            ..Default::default()
153        })
154        .unwrap();
155    let node14 = taffy
156        .new_leaf(taffy::style::Style {
157            position: taffy::style::Position::Absolute,
158            inset: taffy::geometry::Rect {
159                left: taffy::style::LengthPercentageAuto::Length(30f32),
160                right: auto(),
161                top: taffy::style::LengthPercentageAuto::Length(30f32),
162                bottom: auto(),
163            },
164            ..Default::default()
165        })
166        .unwrap();
167    let node15 = taffy
168        .new_leaf(taffy::style::Style {
169            position: taffy::style::Position::Absolute,
170            size: taffy::geometry::Size {
171                width: taffy::style::Dimension::Percent(1f32),
172                height: taffy::style::Dimension::Percent(1f32),
173            },
174            inset: taffy::geometry::Rect {
175                left: taffy::style::LengthPercentageAuto::Length(0f32),
176                right: auto(),
177                top: taffy::style::LengthPercentageAuto::Length(0f32),
178                bottom: auto(),
179            },
180            ..Default::default()
181        })
182        .unwrap();
183    let node1 = taffy
184        .new_with_children(
185            taffy::style::Style {
186                display: taffy::style::Display::Grid,
187                overflow: taffy::geometry::Point {
188                    x: taffy::style::Overflow::Scroll,
189                    y: taffy::style::Overflow::Scroll,
190                },
191                scrollbar_width: 15f32,
192                size: taffy::geometry::Size {
193                    width: taffy::style::Dimension::Length(200f32),
194                    height: taffy::style::Dimension::Length(200f32),
195                },
196                padding: taffy::geometry::Rect {
197                    left: taffy::style::LengthPercentage::Length(15f32),
198                    right: taffy::style::LengthPercentage::Length(15f32),
199                    top: taffy::style::LengthPercentage::Length(15f32),
200                    bottom: taffy::style::LengthPercentage::Length(15f32),
201                },
202                border: taffy::geometry::Rect {
203                    left: taffy::style::LengthPercentage::Length(20f32),
204                    right: taffy::style::LengthPercentage::Length(20f32),
205                    top: taffy::style::LengthPercentage::Length(20f32),
206                    bottom: taffy::style::LengthPercentage::Length(20f32),
207                },
208                ..Default::default()
209            },
210            &[node10, node11, node12, node13, node14, node15],
211        )
212        .unwrap();
213    let node = taffy.new_with_children(taffy::style::Style { ..Default::default() }, &[node0, node1]).unwrap();
214    taffy.compute_layout_with_measure(node, taffy::geometry::Size::MAX_CONTENT, crate::test_measure_function).unwrap();
215    println!("\nComputed tree:");
216    taffy.print_tree(node);
217    println!();
218    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
219    let layout @ Layout { size, location, .. } = taffy.layout(node).unwrap();
220    assert_eq!(size.width, 400f32, "width of node {:?}. Expected {}. Actual {}", node, 400f32, size.width);
221    assert_eq!(size.height, 200f32, "height of node {:?}. Expected {}. Actual {}", node, 200f32, size.height);
222    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node, 0f32, location.x);
223    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node, 0f32, location.y);
224    #[cfg(feature = "content_size")]
225    assert_eq!(
226        layout.scroll_width(),
227        0f32,
228        "scroll_width of node {:?}. Expected {}. Actual {}",
229        node,
230        0f32,
231        layout.scroll_width()
232    );
233    #[cfg(feature = "content_size")]
234    assert_eq!(
235        layout.scroll_height(),
236        0f32,
237        "scroll_height of node {:?}. Expected {}. Actual {}",
238        node,
239        0f32,
240        layout.scroll_height()
241    );
242    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
243    let layout @ Layout { size, location, .. } = taffy.layout(node0).unwrap();
244    assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node0, 200f32, size.width);
245    assert_eq!(size.height, 200f32, "height of node {:?}. Expected {}. Actual {}", node0, 200f32, size.height);
246    assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0, 0f32, location.x);
247    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0, 0f32, location.y);
248    #[cfg(feature = "content_size")]
249    assert_eq!(
250        layout.scroll_width(),
251        0f32,
252        "scroll_width of node {:?}. Expected {}. Actual {}",
253        node0,
254        0f32,
255        layout.scroll_width()
256    );
257    #[cfg(feature = "content_size")]
258    assert_eq!(
259        layout.scroll_height(),
260        0f32,
261        "scroll_height of node {:?}. Expected {}. Actual {}",
262        node0,
263        0f32,
264        layout.scroll_height()
265    );
266    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
267    let layout @ Layout { size, location, .. } = taffy.layout(node00).unwrap();
268    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node00, 0f32, size.width);
269    assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node00, 0f32, size.height);
270    assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node00, 20f32, location.x);
271    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node00, 20f32, location.y);
272    #[cfg(feature = "content_size")]
273    assert_eq!(
274        layout.scroll_width(),
275        0f32,
276        "scroll_width of node {:?}. Expected {}. Actual {}",
277        node00,
278        0f32,
279        layout.scroll_width()
280    );
281    #[cfg(feature = "content_size")]
282    assert_eq!(
283        layout.scroll_height(),
284        0f32,
285        "scroll_height of node {:?}. Expected {}. Actual {}",
286        node00,
287        0f32,
288        layout.scroll_height()
289    );
290    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
291    let layout @ Layout { size, location, .. } = taffy.layout(node01).unwrap();
292    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node01, 0f32, size.width);
293    assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node01, 0f32, size.height);
294    assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node01, 20f32, location.x);
295    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node01, 20f32, location.y);
296    #[cfg(feature = "content_size")]
297    assert_eq!(
298        layout.scroll_width(),
299        0f32,
300        "scroll_width of node {:?}. Expected {}. Actual {}",
301        node01,
302        0f32,
303        layout.scroll_width()
304    );
305    #[cfg(feature = "content_size")]
306    assert_eq!(
307        layout.scroll_height(),
308        0f32,
309        "scroll_height of node {:?}. Expected {}. Actual {}",
310        node01,
311        0f32,
312        layout.scroll_height()
313    );
314    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
315    let layout @ Layout { size, location, .. } = taffy.layout(node02).unwrap();
316    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node02, 0f32, size.width);
317    assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node02, 0f32, size.height);
318    assert_eq!(location.x, 180f32, "x of node {:?}. Expected {}. Actual {}", node02, 180f32, location.x);
319    assert_eq!(location.y, 180f32, "y of node {:?}. Expected {}. Actual {}", node02, 180f32, location.y);
320    #[cfg(feature = "content_size")]
321    assert_eq!(
322        layout.scroll_width(),
323        0f32,
324        "scroll_width of node {:?}. Expected {}. Actual {}",
325        node02,
326        0f32,
327        layout.scroll_width()
328    );
329    #[cfg(feature = "content_size")]
330    assert_eq!(
331        layout.scroll_height(),
332        0f32,
333        "scroll_height of node {:?}. Expected {}. Actual {}",
334        node02,
335        0f32,
336        layout.scroll_height()
337    );
338    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
339    let layout @ Layout { size, location, .. } = taffy.layout(node03).unwrap();
340    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node03, 0f32, size.width);
341    assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node03, 0f32, size.height);
342    assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node03, 20f32, location.x);
343    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node03, 20f32, location.y);
344    #[cfg(feature = "content_size")]
345    assert_eq!(
346        layout.scroll_width(),
347        0f32,
348        "scroll_width of node {:?}. Expected {}. Actual {}",
349        node03,
350        0f32,
351        layout.scroll_width()
352    );
353    #[cfg(feature = "content_size")]
354    assert_eq!(
355        layout.scroll_height(),
356        0f32,
357        "scroll_height of node {:?}. Expected {}. Actual {}",
358        node03,
359        0f32,
360        layout.scroll_height()
361    );
362    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
363    let layout @ Layout { size, location, .. } = taffy.layout(node04).unwrap();
364    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node04, 0f32, size.width);
365    assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node04, 0f32, size.height);
366    assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node04, 50f32, location.x);
367    assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node04, 50f32, location.y);
368    #[cfg(feature = "content_size")]
369    assert_eq!(
370        layout.scroll_width(),
371        0f32,
372        "scroll_width of node {:?}. Expected {}. Actual {}",
373        node04,
374        0f32,
375        layout.scroll_width()
376    );
377    #[cfg(feature = "content_size")]
378    assert_eq!(
379        layout.scroll_height(),
380        0f32,
381        "scroll_height of node {:?}. Expected {}. Actual {}",
382        node04,
383        0f32,
384        layout.scroll_height()
385    );
386    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
387    let layout @ Layout { size, location, .. } = taffy.layout(node05).unwrap();
388    assert_eq!(size.width, 160f32, "width of node {:?}. Expected {}. Actual {}", node05, 160f32, size.width);
389    assert_eq!(size.height, 160f32, "height of node {:?}. Expected {}. Actual {}", node05, 160f32, size.height);
390    assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node05, 20f32, location.x);
391    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node05, 20f32, location.y);
392    #[cfg(feature = "content_size")]
393    assert_eq!(
394        layout.scroll_width(),
395        0f32,
396        "scroll_width of node {:?}. Expected {}. Actual {}",
397        node05,
398        0f32,
399        layout.scroll_width()
400    );
401    #[cfg(feature = "content_size")]
402    assert_eq!(
403        layout.scroll_height(),
404        0f32,
405        "scroll_height of node {:?}. Expected {}. Actual {}",
406        node05,
407        0f32,
408        layout.scroll_height()
409    );
410    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
411    let layout @ Layout { size, location, .. } = taffy.layout(node1).unwrap();
412    assert_eq!(size.width, 200f32, "width of node {:?}. Expected {}. Actual {}", node1, 200f32, size.width);
413    assert_eq!(size.height, 200f32, "height of node {:?}. Expected {}. Actual {}", node1, 200f32, size.height);
414    assert_eq!(location.x, 200f32, "x of node {:?}. Expected {}. Actual {}", node1, 200f32, location.x);
415    assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node1, 0f32, location.y);
416    #[cfg(feature = "content_size")]
417    assert_eq!(
418        layout.scroll_width(),
419        0f32,
420        "scroll_width of node {:?}. Expected {}. Actual {}",
421        node1,
422        0f32,
423        layout.scroll_width()
424    );
425    #[cfg(feature = "content_size")]
426    assert_eq!(
427        layout.scroll_height(),
428        0f32,
429        "scroll_height of node {:?}. Expected {}. Actual {}",
430        node1,
431        0f32,
432        layout.scroll_height()
433    );
434    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
435    let layout @ Layout { size, location, .. } = taffy.layout(node10).unwrap();
436    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node10, 0f32, size.width);
437    assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node10, 0f32, size.height);
438    assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node10, 20f32, location.x);
439    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node10, 20f32, location.y);
440    #[cfg(feature = "content_size")]
441    assert_eq!(
442        layout.scroll_width(),
443        0f32,
444        "scroll_width of node {:?}. Expected {}. Actual {}",
445        node10,
446        0f32,
447        layout.scroll_width()
448    );
449    #[cfg(feature = "content_size")]
450    assert_eq!(
451        layout.scroll_height(),
452        0f32,
453        "scroll_height of node {:?}. Expected {}. Actual {}",
454        node10,
455        0f32,
456        layout.scroll_height()
457    );
458    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
459    let layout @ Layout { size, location, .. } = taffy.layout(node11).unwrap();
460    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node11, 0f32, size.width);
461    assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node11, 0f32, size.height);
462    assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node11, 20f32, location.x);
463    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node11, 20f32, location.y);
464    #[cfg(feature = "content_size")]
465    assert_eq!(
466        layout.scroll_width(),
467        0f32,
468        "scroll_width of node {:?}. Expected {}. Actual {}",
469        node11,
470        0f32,
471        layout.scroll_width()
472    );
473    #[cfg(feature = "content_size")]
474    assert_eq!(
475        layout.scroll_height(),
476        0f32,
477        "scroll_height of node {:?}. Expected {}. Actual {}",
478        node11,
479        0f32,
480        layout.scroll_height()
481    );
482    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
483    let layout @ Layout { size, location, .. } = taffy.layout(node12).unwrap();
484    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node12, 0f32, size.width);
485    assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node12, 0f32, size.height);
486    assert_eq!(location.x, 165f32, "x of node {:?}. Expected {}. Actual {}", node12, 165f32, location.x);
487    assert_eq!(location.y, 165f32, "y of node {:?}. Expected {}. Actual {}", node12, 165f32, location.y);
488    #[cfg(feature = "content_size")]
489    assert_eq!(
490        layout.scroll_width(),
491        0f32,
492        "scroll_width of node {:?}. Expected {}. Actual {}",
493        node12,
494        0f32,
495        layout.scroll_width()
496    );
497    #[cfg(feature = "content_size")]
498    assert_eq!(
499        layout.scroll_height(),
500        0f32,
501        "scroll_height of node {:?}. Expected {}. Actual {}",
502        node12,
503        0f32,
504        layout.scroll_height()
505    );
506    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
507    let layout @ Layout { size, location, .. } = taffy.layout(node13).unwrap();
508    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node13, 0f32, size.width);
509    assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node13, 0f32, size.height);
510    assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node13, 20f32, location.x);
511    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node13, 20f32, location.y);
512    #[cfg(feature = "content_size")]
513    assert_eq!(
514        layout.scroll_width(),
515        0f32,
516        "scroll_width of node {:?}. Expected {}. Actual {}",
517        node13,
518        0f32,
519        layout.scroll_width()
520    );
521    #[cfg(feature = "content_size")]
522    assert_eq!(
523        layout.scroll_height(),
524        0f32,
525        "scroll_height of node {:?}. Expected {}. Actual {}",
526        node13,
527        0f32,
528        layout.scroll_height()
529    );
530    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
531    let layout @ Layout { size, location, .. } = taffy.layout(node14).unwrap();
532    assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node14, 0f32, size.width);
533    assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node14, 0f32, size.height);
534    assert_eq!(location.x, 50f32, "x of node {:?}. Expected {}. Actual {}", node14, 50f32, location.x);
535    assert_eq!(location.y, 50f32, "y of node {:?}. Expected {}. Actual {}", node14, 50f32, location.y);
536    #[cfg(feature = "content_size")]
537    assert_eq!(
538        layout.scroll_width(),
539        0f32,
540        "scroll_width of node {:?}. Expected {}. Actual {}",
541        node14,
542        0f32,
543        layout.scroll_width()
544    );
545    #[cfg(feature = "content_size")]
546    assert_eq!(
547        layout.scroll_height(),
548        0f32,
549        "scroll_height of node {:?}. Expected {}. Actual {}",
550        node14,
551        0f32,
552        layout.scroll_height()
553    );
554    #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
555    let layout @ Layout { size, location, .. } = taffy.layout(node15).unwrap();
556    assert_eq!(size.width, 145f32, "width of node {:?}. Expected {}. Actual {}", node15, 145f32, size.width);
557    assert_eq!(size.height, 145f32, "height of node {:?}. Expected {}. Actual {}", node15, 145f32, size.height);
558    assert_eq!(location.x, 20f32, "x of node {:?}. Expected {}. Actual {}", node15, 20f32, location.x);
559    assert_eq!(location.y, 20f32, "y of node {:?}. Expected {}. Actual {}", node15, 20f32, location.y);
560    #[cfg(feature = "content_size")]
561    assert_eq!(
562        layout.scroll_width(),
563        0f32,
564        "scroll_width of node {:?}. Expected {}. Actual {}",
565        node15,
566        0f32,
567        layout.scroll_width()
568    );
569    #[cfg(feature = "content_size")]
570    assert_eq!(
571        layout.scroll_height(),
572        0f32,
573        "scroll_height of node {:?}. Expected {}. Actual {}",
574        node15,
575        0f32,
576        layout.scroll_height()
577    );
578}