⎇ 3bc35ec3b541eea8ea62344722f155ce9b22e227
tests/generated/flex/android_news_feed.rs
Historia
Quién tocó qué
crudo
Implement `box-sizing: content-box` (#675)
1#[test]
2#[allow(non_snake_case)]
3fn android_news_feed__border_box() {
4 #[allow(unused_imports)]
5 use taffy::{prelude::*, tree::Layout, TaffyTree};
6 let mut taffy: TaffyTree<crate::TextMeasure> = TaffyTree::new();
7 let node000000 = taffy
8 .new_leaf(taffy::style::Style {
9 align_content: Some(taffy::style::AlignContent::Stretch),
10 flex_shrink: 0f32,
11 size: taffy::geometry::Size {
12 width: taffy::style::Dimension::Length(120f32),
13 height: taffy::style::Dimension::Length(120f32),
14 },
15 ..Default::default()
16 })
17 .unwrap();
18 let node00000 = taffy
19 .new_with_children(
20 taffy::style::Style {
21 align_content: Some(taffy::style::AlignContent::Stretch),
22 flex_shrink: 0f32,
23 ..Default::default()
24 },
25 &[node000000],
26 )
27 .unwrap();
28 let node000010 = taffy
29 .new_leaf(taffy::style::Style {
30 align_content: Some(taffy::style::AlignContent::Stretch),
31 flex_shrink: 1f32,
32 ..Default::default()
33 })
34 .unwrap();
35 let node000011 = taffy
36 .new_leaf(taffy::style::Style {
37 align_content: Some(taffy::style::AlignContent::Stretch),
38 flex_shrink: 1f32,
39 ..Default::default()
40 })
41 .unwrap();
42 let node00001 = taffy
43 .new_with_children(
44 taffy::style::Style {
45 flex_direction: taffy::style::FlexDirection::Column,
46 align_content: Some(taffy::style::AlignContent::Stretch),
47 flex_shrink: 1f32,
48 margin: taffy::geometry::Rect {
49 left: zero(),
50 right: taffy::style::LengthPercentageAuto::Length(36f32),
51 top: zero(),
52 bottom: zero(),
53 },
54 padding: taffy::geometry::Rect {
55 left: taffy::style::LengthPercentage::Length(36f32),
56 right: taffy::style::LengthPercentage::Length(36f32),
57 top: taffy::style::LengthPercentage::Length(21f32),
58 bottom: taffy::style::LengthPercentage::Length(18f32),
59 },
60 ..Default::default()
61 },
62 &[node000010, node000011],
63 )
64 .unwrap();
65 let node0000 = taffy
66 .new_with_children(
67 taffy::style::Style {
68 align_items: Some(taffy::style::AlignItems::FlexStart),
69 align_content: Some(taffy::style::AlignContent::Stretch),
70 margin: taffy::geometry::Rect {
71 left: taffy::style::LengthPercentageAuto::Length(36f32),
72 right: zero(),
73 top: taffy::style::LengthPercentageAuto::Length(24f32),
74 bottom: zero(),
75 },
76 ..Default::default()
77 },
78 &[node00000, node00001],
79 )
80 .unwrap();
81 let node000 = taffy
82 .new_with_children(
83 taffy::style::Style {
84 flex_direction: taffy::style::FlexDirection::Column,
85 align_content: Some(taffy::style::AlignContent::Stretch),
86 ..Default::default()
87 },
88 &[node0000],
89 )
90 .unwrap();
91 let node001000 = taffy
92 .new_leaf(taffy::style::Style {
93 align_content: Some(taffy::style::AlignContent::Stretch),
94 flex_shrink: 0f32,
95 size: taffy::geometry::Size {
96 width: taffy::style::Dimension::Length(72f32),
97 height: taffy::style::Dimension::Length(72f32),
98 },
99 ..Default::default()
100 })
101 .unwrap();
102 let node00100 = taffy
103 .new_with_children(
104 taffy::style::Style {
105 align_content: Some(taffy::style::AlignContent::Stretch),
106 flex_shrink: 0f32,
107 ..Default::default()
108 },
109 &[node001000],
110 )
111 .unwrap();
112 let node001010 = taffy
113 .new_leaf(taffy::style::Style {
114 align_content: Some(taffy::style::AlignContent::Stretch),
115 flex_shrink: 1f32,
116 ..Default::default()
117 })
118 .unwrap();
119 let node001011 = taffy
120 .new_leaf(taffy::style::Style {
121 align_content: Some(taffy::style::AlignContent::Stretch),
122 flex_shrink: 1f32,
123 ..Default::default()
124 })
125 .unwrap();
126 let node00101 = taffy
127 .new_with_children(
128 taffy::style::Style {
129 flex_direction: taffy::style::FlexDirection::Column,
130 align_content: Some(taffy::style::AlignContent::Stretch),
131 flex_shrink: 1f32,
132 margin: taffy::geometry::Rect {
133 left: zero(),
134 right: taffy::style::LengthPercentageAuto::Length(36f32),
135 top: zero(),
136 bottom: zero(),
137 },
138 padding: taffy::geometry::Rect {
139 left: taffy::style::LengthPercentage::Length(36f32),
140 right: taffy::style::LengthPercentage::Length(36f32),
141 top: taffy::style::LengthPercentage::Length(21f32),
142 bottom: taffy::style::LengthPercentage::Length(18f32),
143 },
144 ..Default::default()
145 },
146 &[node001010, node001011],
147 )
148 .unwrap();
149 let node0010 = taffy
150 .new_with_children(
151 taffy::style::Style {
152 align_items: Some(taffy::style::AlignItems::FlexStart),
153 align_content: Some(taffy::style::AlignContent::Stretch),
154 margin: taffy::geometry::Rect {
155 left: taffy::style::LengthPercentageAuto::Length(174f32),
156 right: zero(),
157 top: taffy::style::LengthPercentageAuto::Length(24f32),
158 bottom: zero(),
159 },
160 ..Default::default()
161 },
162 &[node00100, node00101],
163 )
164 .unwrap();
165 let node001 = taffy
166 .new_with_children(
167 taffy::style::Style {
168 flex_direction: taffy::style::FlexDirection::Column,
169 align_content: Some(taffy::style::AlignContent::Stretch),
170 ..Default::default()
171 },
172 &[node0010],
173 )
174 .unwrap();
175 let node00 = taffy
176 .new_with_children(
177 taffy::style::Style {
178 flex_direction: taffy::style::FlexDirection::Column,
179 align_content: Some(taffy::style::AlignContent::Stretch),
180 ..Default::default()
181 },
182 &[node000, node001],
183 )
184 .unwrap();
185 let node0 = taffy
186 .new_with_children(
187 taffy::style::Style {
188 flex_direction: taffy::style::FlexDirection::Column,
189 flex_shrink: 0f32,
190 ..Default::default()
191 },
192 &[node00],
193 )
194 .unwrap();
195 let node = taffy
196 .new_with_children(
197 taffy::style::Style {
198 flex_direction: taffy::style::FlexDirection::Column,
199 align_content: Some(taffy::style::AlignContent::Stretch),
200 flex_shrink: 0f32,
201 size: taffy::geometry::Size { width: taffy::style::Dimension::Length(1080f32), height: auto() },
202 ..Default::default()
203 },
204 &[node0],
205 )
206 .unwrap();
207 taffy.compute_layout_with_measure(node, taffy::geometry::Size::MAX_CONTENT, crate::test_measure_function).unwrap();
208 println!("\nComputed tree:");
209 taffy.print_tree(node);
210 println!();
211 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
212 let layout @ Layout { size, location, .. } = taffy.layout(node).unwrap();
213 assert_eq!(size.width, 1080f32, "width of node {:?}. Expected {}. Actual {}", node, 1080f32, size.width);
214 assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node, 240f32, size.height);
215 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node, 0f32, location.x);
216 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node, 0f32, location.y);
217 #[cfg(feature = "content_size")]
218 assert_eq!(
219 layout.scroll_width(),
220 0f32,
221 "scroll_width of node {:?}. Expected {}. Actual {}",
222 node,
223 0f32,
224 layout.scroll_width()
225 );
226 #[cfg(feature = "content_size")]
227 assert_eq!(
228 layout.scroll_height(),
229 0f32,
230 "scroll_height of node {:?}. Expected {}. Actual {}",
231 node,
232 0f32,
233 layout.scroll_height()
234 );
235 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
236 let layout @ Layout { size, location, .. } = taffy.layout(node0).unwrap();
237 assert_eq!(size.width, 1080f32, "width of node {:?}. Expected {}. Actual {}", node0, 1080f32, size.width);
238 assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node0, 240f32, size.height);
239 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0, 0f32, location.x);
240 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0, 0f32, location.y);
241 #[cfg(feature = "content_size")]
242 assert_eq!(
243 layout.scroll_width(),
244 0f32,
245 "scroll_width of node {:?}. Expected {}. Actual {}",
246 node0,
247 0f32,
248 layout.scroll_width()
249 );
250 #[cfg(feature = "content_size")]
251 assert_eq!(
252 layout.scroll_height(),
253 0f32,
254 "scroll_height of node {:?}. Expected {}. Actual {}",
255 node0,
256 0f32,
257 layout.scroll_height()
258 );
259 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
260 let layout @ Layout { size, location, .. } = taffy.layout(node00).unwrap();
261 assert_eq!(size.width, 1080f32, "width of node {:?}. Expected {}. Actual {}", node00, 1080f32, size.width);
262 assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node00, 240f32, size.height);
263 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node00, 0f32, location.x);
264 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
265 #[cfg(feature = "content_size")]
266 assert_eq!(
267 layout.scroll_width(),
268 0f32,
269 "scroll_width of node {:?}. Expected {}. Actual {}",
270 node00,
271 0f32,
272 layout.scroll_width()
273 );
274 #[cfg(feature = "content_size")]
275 assert_eq!(
276 layout.scroll_height(),
277 0f32,
278 "scroll_height of node {:?}. Expected {}. Actual {}",
279 node00,
280 0f32,
281 layout.scroll_height()
282 );
283 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
284 let layout @ Layout { size, location, .. } = taffy.layout(node000).unwrap();
285 assert_eq!(size.width, 1080f32, "width of node {:?}. Expected {}. Actual {}", node000, 1080f32, size.width);
286 assert_eq!(size.height, 144f32, "height of node {:?}. Expected {}. Actual {}", node000, 144f32, size.height);
287 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node000, 0f32, location.x);
288 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node000, 0f32, location.y);
289 #[cfg(feature = "content_size")]
290 assert_eq!(
291 layout.scroll_width(),
292 0f32,
293 "scroll_width of node {:?}. Expected {}. Actual {}",
294 node000,
295 0f32,
296 layout.scroll_width()
297 );
298 #[cfg(feature = "content_size")]
299 assert_eq!(
300 layout.scroll_height(),
301 0f32,
302 "scroll_height of node {:?}. Expected {}. Actual {}",
303 node000,
304 0f32,
305 layout.scroll_height()
306 );
307 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
308 let layout @ Layout { size, location, .. } = taffy.layout(node0000).unwrap();
309 assert_eq!(size.width, 1044f32, "width of node {:?}. Expected {}. Actual {}", node0000, 1044f32, size.width);
310 assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0000, 120f32, size.height);
311 assert_eq!(location.x, 36f32, "x of node {:?}. Expected {}. Actual {}", node0000, 36f32, location.x);
312 assert_eq!(location.y, 24f32, "y of node {:?}. Expected {}. Actual {}", node0000, 24f32, location.y);
313 #[cfg(feature = "content_size")]
314 assert_eq!(
315 layout.scroll_width(),
316 0f32,
317 "scroll_width of node {:?}. Expected {}. Actual {}",
318 node0000,
319 0f32,
320 layout.scroll_width()
321 );
322 #[cfg(feature = "content_size")]
323 assert_eq!(
324 layout.scroll_height(),
325 0f32,
326 "scroll_height of node {:?}. Expected {}. Actual {}",
327 node0000,
328 0f32,
329 layout.scroll_height()
330 );
331 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
332 let layout @ Layout { size, location, .. } = taffy.layout(node00000).unwrap();
333 assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node00000, 120f32, size.width);
334 assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node00000, 120f32, size.height);
335 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node00000, 0f32, location.x);
336 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00000, 0f32, location.y);
337 #[cfg(feature = "content_size")]
338 assert_eq!(
339 layout.scroll_width(),
340 0f32,
341 "scroll_width of node {:?}. Expected {}. Actual {}",
342 node00000,
343 0f32,
344 layout.scroll_width()
345 );
346 #[cfg(feature = "content_size")]
347 assert_eq!(
348 layout.scroll_height(),
349 0f32,
350 "scroll_height of node {:?}. Expected {}. Actual {}",
351 node00000,
352 0f32,
353 layout.scroll_height()
354 );
355 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
356 let layout @ Layout { size, location, .. } = taffy.layout(node000000).unwrap();
357 assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node000000, 120f32, size.width);
358 assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node000000, 120f32, size.height);
359 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node000000, 0f32, location.x);
360 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node000000, 0f32, location.y);
361 #[cfg(feature = "content_size")]
362 assert_eq!(
363 layout.scroll_width(),
364 0f32,
365 "scroll_width of node {:?}. Expected {}. Actual {}",
366 node000000,
367 0f32,
368 layout.scroll_width()
369 );
370 #[cfg(feature = "content_size")]
371 assert_eq!(
372 layout.scroll_height(),
373 0f32,
374 "scroll_height of node {:?}. Expected {}. Actual {}",
375 node000000,
376 0f32,
377 layout.scroll_height()
378 );
379 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
380 let layout @ Layout { size, location, .. } = taffy.layout(node00001).unwrap();
381 assert_eq!(size.width, 72f32, "width of node {:?}. Expected {}. Actual {}", node00001, 72f32, size.width);
382 assert_eq!(size.height, 39f32, "height of node {:?}. Expected {}. Actual {}", node00001, 39f32, size.height);
383 assert_eq!(location.x, 120f32, "x of node {:?}. Expected {}. Actual {}", node00001, 120f32, location.x);
384 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00001, 0f32, location.y);
385 #[cfg(feature = "content_size")]
386 assert_eq!(
387 layout.scroll_width(),
388 0f32,
389 "scroll_width of node {:?}. Expected {}. Actual {}",
390 node00001,
391 0f32,
392 layout.scroll_width()
393 );
394 #[cfg(feature = "content_size")]
395 assert_eq!(
396 layout.scroll_height(),
397 0f32,
398 "scroll_height of node {:?}. Expected {}. Actual {}",
399 node00001,
400 0f32,
401 layout.scroll_height()
402 );
403 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
404 let layout @ Layout { size, location, .. } = taffy.layout(node000010).unwrap();
405 assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node000010, 0f32, size.width);
406 assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node000010, 0f32, size.height);
407 assert_eq!(location.x, 36f32, "x of node {:?}. Expected {}. Actual {}", node000010, 36f32, location.x);
408 assert_eq!(location.y, 21f32, "y of node {:?}. Expected {}. Actual {}", node000010, 21f32, location.y);
409 #[cfg(feature = "content_size")]
410 assert_eq!(
411 layout.scroll_width(),
412 0f32,
413 "scroll_width of node {:?}. Expected {}. Actual {}",
414 node000010,
415 0f32,
416 layout.scroll_width()
417 );
418 #[cfg(feature = "content_size")]
419 assert_eq!(
420 layout.scroll_height(),
421 0f32,
422 "scroll_height of node {:?}. Expected {}. Actual {}",
423 node000010,
424 0f32,
425 layout.scroll_height()
426 );
427 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
428 let layout @ Layout { size, location, .. } = taffy.layout(node000011).unwrap();
429 assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node000011, 0f32, size.width);
430 assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node000011, 0f32, size.height);
431 assert_eq!(location.x, 36f32, "x of node {:?}. Expected {}. Actual {}", node000011, 36f32, location.x);
432 assert_eq!(location.y, 21f32, "y of node {:?}. Expected {}. Actual {}", node000011, 21f32, location.y);
433 #[cfg(feature = "content_size")]
434 assert_eq!(
435 layout.scroll_width(),
436 0f32,
437 "scroll_width of node {:?}. Expected {}. Actual {}",
438 node000011,
439 0f32,
440 layout.scroll_width()
441 );
442 #[cfg(feature = "content_size")]
443 assert_eq!(
444 layout.scroll_height(),
445 0f32,
446 "scroll_height of node {:?}. Expected {}. Actual {}",
447 node000011,
448 0f32,
449 layout.scroll_height()
450 );
451 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
452 let layout @ Layout { size, location, .. } = taffy.layout(node001).unwrap();
453 assert_eq!(size.width, 1080f32, "width of node {:?}. Expected {}. Actual {}", node001, 1080f32, size.width);
454 assert_eq!(size.height, 96f32, "height of node {:?}. Expected {}. Actual {}", node001, 96f32, size.height);
455 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node001, 0f32, location.x);
456 assert_eq!(location.y, 144f32, "y of node {:?}. Expected {}. Actual {}", node001, 144f32, location.y);
457 #[cfg(feature = "content_size")]
458 assert_eq!(
459 layout.scroll_width(),
460 0f32,
461 "scroll_width of node {:?}. Expected {}. Actual {}",
462 node001,
463 0f32,
464 layout.scroll_width()
465 );
466 #[cfg(feature = "content_size")]
467 assert_eq!(
468 layout.scroll_height(),
469 0f32,
470 "scroll_height of node {:?}. Expected {}. Actual {}",
471 node001,
472 0f32,
473 layout.scroll_height()
474 );
475 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
476 let layout @ Layout { size, location, .. } = taffy.layout(node0010).unwrap();
477 assert_eq!(size.width, 906f32, "width of node {:?}. Expected {}. Actual {}", node0010, 906f32, size.width);
478 assert_eq!(size.height, 72f32, "height of node {:?}. Expected {}. Actual {}", node0010, 72f32, size.height);
479 assert_eq!(location.x, 174f32, "x of node {:?}. Expected {}. Actual {}", node0010, 174f32, location.x);
480 assert_eq!(location.y, 24f32, "y of node {:?}. Expected {}. Actual {}", node0010, 24f32, location.y);
481 #[cfg(feature = "content_size")]
482 assert_eq!(
483 layout.scroll_width(),
484 0f32,
485 "scroll_width of node {:?}. Expected {}. Actual {}",
486 node0010,
487 0f32,
488 layout.scroll_width()
489 );
490 #[cfg(feature = "content_size")]
491 assert_eq!(
492 layout.scroll_height(),
493 0f32,
494 "scroll_height of node {:?}. Expected {}. Actual {}",
495 node0010,
496 0f32,
497 layout.scroll_height()
498 );
499 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
500 let layout @ Layout { size, location, .. } = taffy.layout(node00100).unwrap();
501 assert_eq!(size.width, 72f32, "width of node {:?}. Expected {}. Actual {}", node00100, 72f32, size.width);
502 assert_eq!(size.height, 72f32, "height of node {:?}. Expected {}. Actual {}", node00100, 72f32, size.height);
503 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node00100, 0f32, location.x);
504 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00100, 0f32, location.y);
505 #[cfg(feature = "content_size")]
506 assert_eq!(
507 layout.scroll_width(),
508 0f32,
509 "scroll_width of node {:?}. Expected {}. Actual {}",
510 node00100,
511 0f32,
512 layout.scroll_width()
513 );
514 #[cfg(feature = "content_size")]
515 assert_eq!(
516 layout.scroll_height(),
517 0f32,
518 "scroll_height of node {:?}. Expected {}. Actual {}",
519 node00100,
520 0f32,
521 layout.scroll_height()
522 );
523 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
524 let layout @ Layout { size, location, .. } = taffy.layout(node001000).unwrap();
525 assert_eq!(size.width, 72f32, "width of node {:?}. Expected {}. Actual {}", node001000, 72f32, size.width);
526 assert_eq!(size.height, 72f32, "height of node {:?}. Expected {}. Actual {}", node001000, 72f32, size.height);
527 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node001000, 0f32, location.x);
528 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node001000, 0f32, location.y);
529 #[cfg(feature = "content_size")]
530 assert_eq!(
531 layout.scroll_width(),
532 0f32,
533 "scroll_width of node {:?}. Expected {}. Actual {}",
534 node001000,
535 0f32,
536 layout.scroll_width()
537 );
538 #[cfg(feature = "content_size")]
539 assert_eq!(
540 layout.scroll_height(),
541 0f32,
542 "scroll_height of node {:?}. Expected {}. Actual {}",
543 node001000,
544 0f32,
545 layout.scroll_height()
546 );
547 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
548 let layout @ Layout { size, location, .. } = taffy.layout(node00101).unwrap();
549 assert_eq!(size.width, 72f32, "width of node {:?}. Expected {}. Actual {}", node00101, 72f32, size.width);
550 assert_eq!(size.height, 39f32, "height of node {:?}. Expected {}. Actual {}", node00101, 39f32, size.height);
551 assert_eq!(location.x, 72f32, "x of node {:?}. Expected {}. Actual {}", node00101, 72f32, location.x);
552 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00101, 0f32, location.y);
553 #[cfg(feature = "content_size")]
554 assert_eq!(
555 layout.scroll_width(),
556 0f32,
557 "scroll_width of node {:?}. Expected {}. Actual {}",
558 node00101,
559 0f32,
560 layout.scroll_width()
561 );
562 #[cfg(feature = "content_size")]
563 assert_eq!(
564 layout.scroll_height(),
565 0f32,
566 "scroll_height of node {:?}. Expected {}. Actual {}",
567 node00101,
568 0f32,
569 layout.scroll_height()
570 );
571 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
572 let layout @ Layout { size, location, .. } = taffy.layout(node001010).unwrap();
573 assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node001010, 0f32, size.width);
574 assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node001010, 0f32, size.height);
575 assert_eq!(location.x, 36f32, "x of node {:?}. Expected {}. Actual {}", node001010, 36f32, location.x);
576 assert_eq!(location.y, 21f32, "y of node {:?}. Expected {}. Actual {}", node001010, 21f32, location.y);
577 #[cfg(feature = "content_size")]
578 assert_eq!(
579 layout.scroll_width(),
580 0f32,
581 "scroll_width of node {:?}. Expected {}. Actual {}",
582 node001010,
583 0f32,
584 layout.scroll_width()
585 );
586 #[cfg(feature = "content_size")]
587 assert_eq!(
588 layout.scroll_height(),
589 0f32,
590 "scroll_height of node {:?}. Expected {}. Actual {}",
591 node001010,
592 0f32,
593 layout.scroll_height()
594 );
595 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
596 let layout @ Layout { size, location, .. } = taffy.layout(node001011).unwrap();
597 assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node001011, 0f32, size.width);
598 assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node001011, 0f32, size.height);
599 assert_eq!(location.x, 36f32, "x of node {:?}. Expected {}. Actual {}", node001011, 36f32, location.x);
600 assert_eq!(location.y, 21f32, "y of node {:?}. Expected {}. Actual {}", node001011, 21f32, location.y);
601 #[cfg(feature = "content_size")]
602 assert_eq!(
603 layout.scroll_width(),
604 0f32,
605 "scroll_width of node {:?}. Expected {}. Actual {}",
606 node001011,
607 0f32,
608 layout.scroll_width()
609 );
610 #[cfg(feature = "content_size")]
611 assert_eq!(
612 layout.scroll_height(),
613 0f32,
614 "scroll_height of node {:?}. Expected {}. Actual {}",
615 node001011,
616 0f32,
617 layout.scroll_height()
618 );
619}
620
621#[test]
622#[allow(non_snake_case)]
623fn android_news_feed__content_box() {
624 #[allow(unused_imports)]
625 use taffy::{prelude::*, tree::Layout, TaffyTree};
626 let mut taffy: TaffyTree<crate::TextMeasure> = TaffyTree::new();
627 let node000000 = taffy
628 .new_leaf(taffy::style::Style {
629 box_sizing: taffy::style::BoxSizing::ContentBox,
630 align_content: Some(taffy::style::AlignContent::Stretch),
631 flex_shrink: 0f32,
632 size: taffy::geometry::Size {
633 width: taffy::style::Dimension::Length(120f32),
634 height: taffy::style::Dimension::Length(120f32),
635 },
636 ..Default::default()
637 })
638 .unwrap();
639 let node00000 = taffy
640 .new_with_children(
641 taffy::style::Style {
642 box_sizing: taffy::style::BoxSizing::ContentBox,
643 align_content: Some(taffy::style::AlignContent::Stretch),
644 flex_shrink: 0f32,
645 ..Default::default()
646 },
647 &[node000000],
648 )
649 .unwrap();
650 let node000010 = taffy
651 .new_leaf(taffy::style::Style {
652 box_sizing: taffy::style::BoxSizing::ContentBox,
653 align_content: Some(taffy::style::AlignContent::Stretch),
654 flex_shrink: 1f32,
655 ..Default::default()
656 })
657 .unwrap();
658 let node000011 = taffy
659 .new_leaf(taffy::style::Style {
660 box_sizing: taffy::style::BoxSizing::ContentBox,
661 align_content: Some(taffy::style::AlignContent::Stretch),
662 flex_shrink: 1f32,
663 ..Default::default()
664 })
665 .unwrap();
666 let node00001 = taffy
667 .new_with_children(
668 taffy::style::Style {
669 box_sizing: taffy::style::BoxSizing::ContentBox,
670 flex_direction: taffy::style::FlexDirection::Column,
671 align_content: Some(taffy::style::AlignContent::Stretch),
672 flex_shrink: 1f32,
673 margin: taffy::geometry::Rect {
674 left: zero(),
675 right: taffy::style::LengthPercentageAuto::Length(36f32),
676 top: zero(),
677 bottom: zero(),
678 },
679 padding: taffy::geometry::Rect {
680 left: taffy::style::LengthPercentage::Length(36f32),
681 right: taffy::style::LengthPercentage::Length(36f32),
682 top: taffy::style::LengthPercentage::Length(21f32),
683 bottom: taffy::style::LengthPercentage::Length(18f32),
684 },
685 ..Default::default()
686 },
687 &[node000010, node000011],
688 )
689 .unwrap();
690 let node0000 = taffy
691 .new_with_children(
692 taffy::style::Style {
693 box_sizing: taffy::style::BoxSizing::ContentBox,
694 align_items: Some(taffy::style::AlignItems::FlexStart),
695 align_content: Some(taffy::style::AlignContent::Stretch),
696 margin: taffy::geometry::Rect {
697 left: taffy::style::LengthPercentageAuto::Length(36f32),
698 right: zero(),
699 top: taffy::style::LengthPercentageAuto::Length(24f32),
700 bottom: zero(),
701 },
702 ..Default::default()
703 },
704 &[node00000, node00001],
705 )
706 .unwrap();
707 let node000 = taffy
708 .new_with_children(
709 taffy::style::Style {
710 box_sizing: taffy::style::BoxSizing::ContentBox,
711 flex_direction: taffy::style::FlexDirection::Column,
712 align_content: Some(taffy::style::AlignContent::Stretch),
713 ..Default::default()
714 },
715 &[node0000],
716 )
717 .unwrap();
718 let node001000 = taffy
719 .new_leaf(taffy::style::Style {
720 box_sizing: taffy::style::BoxSizing::ContentBox,
721 align_content: Some(taffy::style::AlignContent::Stretch),
722 flex_shrink: 0f32,
723 size: taffy::geometry::Size {
724 width: taffy::style::Dimension::Length(72f32),
725 height: taffy::style::Dimension::Length(72f32),
726 },
727 ..Default::default()
728 })
729 .unwrap();
730 let node00100 = taffy
731 .new_with_children(
732 taffy::style::Style {
733 box_sizing: taffy::style::BoxSizing::ContentBox,
734 align_content: Some(taffy::style::AlignContent::Stretch),
735 flex_shrink: 0f32,
736 ..Default::default()
737 },
738 &[node001000],
739 )
740 .unwrap();
741 let node001010 = taffy
742 .new_leaf(taffy::style::Style {
743 box_sizing: taffy::style::BoxSizing::ContentBox,
744 align_content: Some(taffy::style::AlignContent::Stretch),
745 flex_shrink: 1f32,
746 ..Default::default()
747 })
748 .unwrap();
749 let node001011 = taffy
750 .new_leaf(taffy::style::Style {
751 box_sizing: taffy::style::BoxSizing::ContentBox,
752 align_content: Some(taffy::style::AlignContent::Stretch),
753 flex_shrink: 1f32,
754 ..Default::default()
755 })
756 .unwrap();
757 let node00101 = taffy
758 .new_with_children(
759 taffy::style::Style {
760 box_sizing: taffy::style::BoxSizing::ContentBox,
761 flex_direction: taffy::style::FlexDirection::Column,
762 align_content: Some(taffy::style::AlignContent::Stretch),
763 flex_shrink: 1f32,
764 margin: taffy::geometry::Rect {
765 left: zero(),
766 right: taffy::style::LengthPercentageAuto::Length(36f32),
767 top: zero(),
768 bottom: zero(),
769 },
770 padding: taffy::geometry::Rect {
771 left: taffy::style::LengthPercentage::Length(36f32),
772 right: taffy::style::LengthPercentage::Length(36f32),
773 top: taffy::style::LengthPercentage::Length(21f32),
774 bottom: taffy::style::LengthPercentage::Length(18f32),
775 },
776 ..Default::default()
777 },
778 &[node001010, node001011],
779 )
780 .unwrap();
781 let node0010 = taffy
782 .new_with_children(
783 taffy::style::Style {
784 box_sizing: taffy::style::BoxSizing::ContentBox,
785 align_items: Some(taffy::style::AlignItems::FlexStart),
786 align_content: Some(taffy::style::AlignContent::Stretch),
787 margin: taffy::geometry::Rect {
788 left: taffy::style::LengthPercentageAuto::Length(174f32),
789 right: zero(),
790 top: taffy::style::LengthPercentageAuto::Length(24f32),
791 bottom: zero(),
792 },
793 ..Default::default()
794 },
795 &[node00100, node00101],
796 )
797 .unwrap();
798 let node001 = taffy
799 .new_with_children(
800 taffy::style::Style {
801 box_sizing: taffy::style::BoxSizing::ContentBox,
802 flex_direction: taffy::style::FlexDirection::Column,
803 align_content: Some(taffy::style::AlignContent::Stretch),
804 ..Default::default()
805 },
806 &[node0010],
807 )
808 .unwrap();
809 let node00 = taffy
810 .new_with_children(
811 taffy::style::Style {
812 box_sizing: taffy::style::BoxSizing::ContentBox,
813 flex_direction: taffy::style::FlexDirection::Column,
814 align_content: Some(taffy::style::AlignContent::Stretch),
815 ..Default::default()
816 },
817 &[node000, node001],
818 )
819 .unwrap();
820 let node0 = taffy
821 .new_with_children(
822 taffy::style::Style {
823 box_sizing: taffy::style::BoxSizing::ContentBox,
824 flex_direction: taffy::style::FlexDirection::Column,
825 flex_shrink: 0f32,
826 ..Default::default()
827 },
828 &[node00],
829 )
830 .unwrap();
831 let node = taffy
832 .new_with_children(
833 taffy::style::Style {
834 box_sizing: taffy::style::BoxSizing::ContentBox,
835 flex_direction: taffy::style::FlexDirection::Column,
836 align_content: Some(taffy::style::AlignContent::Stretch),
837 flex_shrink: 0f32,
838 size: taffy::geometry::Size { width: taffy::style::Dimension::Length(1080f32), height: auto() },
839 ..Default::default()
840 },
841 &[node0],
842 )
843 .unwrap();
844 taffy.compute_layout_with_measure(node, taffy::geometry::Size::MAX_CONTENT, crate::test_measure_function).unwrap();
845 println!("\nComputed tree:");
846 taffy.print_tree(node);
847 println!();
848 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
849 let layout @ Layout { size, location, .. } = taffy.layout(node).unwrap();
850 assert_eq!(size.width, 1080f32, "width of node {:?}. Expected {}. Actual {}", node, 1080f32, size.width);
851 assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node, 240f32, size.height);
852 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node, 0f32, location.x);
853 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node, 0f32, location.y);
854 #[cfg(feature = "content_size")]
855 assert_eq!(
856 layout.scroll_width(),
857 0f32,
858 "scroll_width of node {:?}. Expected {}. Actual {}",
859 node,
860 0f32,
861 layout.scroll_width()
862 );
863 #[cfg(feature = "content_size")]
864 assert_eq!(
865 layout.scroll_height(),
866 0f32,
867 "scroll_height of node {:?}. Expected {}. Actual {}",
868 node,
869 0f32,
870 layout.scroll_height()
871 );
872 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
873 let layout @ Layout { size, location, .. } = taffy.layout(node0).unwrap();
874 assert_eq!(size.width, 1080f32, "width of node {:?}. Expected {}. Actual {}", node0, 1080f32, size.width);
875 assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node0, 240f32, size.height);
876 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node0, 0f32, location.x);
877 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node0, 0f32, location.y);
878 #[cfg(feature = "content_size")]
879 assert_eq!(
880 layout.scroll_width(),
881 0f32,
882 "scroll_width of node {:?}. Expected {}. Actual {}",
883 node0,
884 0f32,
885 layout.scroll_width()
886 );
887 #[cfg(feature = "content_size")]
888 assert_eq!(
889 layout.scroll_height(),
890 0f32,
891 "scroll_height of node {:?}. Expected {}. Actual {}",
892 node0,
893 0f32,
894 layout.scroll_height()
895 );
896 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
897 let layout @ Layout { size, location, .. } = taffy.layout(node00).unwrap();
898 assert_eq!(size.width, 1080f32, "width of node {:?}. Expected {}. Actual {}", node00, 1080f32, size.width);
899 assert_eq!(size.height, 240f32, "height of node {:?}. Expected {}. Actual {}", node00, 240f32, size.height);
900 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node00, 0f32, location.x);
901 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00, 0f32, location.y);
902 #[cfg(feature = "content_size")]
903 assert_eq!(
904 layout.scroll_width(),
905 0f32,
906 "scroll_width of node {:?}. Expected {}. Actual {}",
907 node00,
908 0f32,
909 layout.scroll_width()
910 );
911 #[cfg(feature = "content_size")]
912 assert_eq!(
913 layout.scroll_height(),
914 0f32,
915 "scroll_height of node {:?}. Expected {}. Actual {}",
916 node00,
917 0f32,
918 layout.scroll_height()
919 );
920 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
921 let layout @ Layout { size, location, .. } = taffy.layout(node000).unwrap();
922 assert_eq!(size.width, 1080f32, "width of node {:?}. Expected {}. Actual {}", node000, 1080f32, size.width);
923 assert_eq!(size.height, 144f32, "height of node {:?}. Expected {}. Actual {}", node000, 144f32, size.height);
924 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node000, 0f32, location.x);
925 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node000, 0f32, location.y);
926 #[cfg(feature = "content_size")]
927 assert_eq!(
928 layout.scroll_width(),
929 0f32,
930 "scroll_width of node {:?}. Expected {}. Actual {}",
931 node000,
932 0f32,
933 layout.scroll_width()
934 );
935 #[cfg(feature = "content_size")]
936 assert_eq!(
937 layout.scroll_height(),
938 0f32,
939 "scroll_height of node {:?}. Expected {}. Actual {}",
940 node000,
941 0f32,
942 layout.scroll_height()
943 );
944 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
945 let layout @ Layout { size, location, .. } = taffy.layout(node0000).unwrap();
946 assert_eq!(size.width, 1044f32, "width of node {:?}. Expected {}. Actual {}", node0000, 1044f32, size.width);
947 assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node0000, 120f32, size.height);
948 assert_eq!(location.x, 36f32, "x of node {:?}. Expected {}. Actual {}", node0000, 36f32, location.x);
949 assert_eq!(location.y, 24f32, "y of node {:?}. Expected {}. Actual {}", node0000, 24f32, location.y);
950 #[cfg(feature = "content_size")]
951 assert_eq!(
952 layout.scroll_width(),
953 0f32,
954 "scroll_width of node {:?}. Expected {}. Actual {}",
955 node0000,
956 0f32,
957 layout.scroll_width()
958 );
959 #[cfg(feature = "content_size")]
960 assert_eq!(
961 layout.scroll_height(),
962 0f32,
963 "scroll_height of node {:?}. Expected {}. Actual {}",
964 node0000,
965 0f32,
966 layout.scroll_height()
967 );
968 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
969 let layout @ Layout { size, location, .. } = taffy.layout(node00000).unwrap();
970 assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node00000, 120f32, size.width);
971 assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node00000, 120f32, size.height);
972 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node00000, 0f32, location.x);
973 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00000, 0f32, location.y);
974 #[cfg(feature = "content_size")]
975 assert_eq!(
976 layout.scroll_width(),
977 0f32,
978 "scroll_width of node {:?}. Expected {}. Actual {}",
979 node00000,
980 0f32,
981 layout.scroll_width()
982 );
983 #[cfg(feature = "content_size")]
984 assert_eq!(
985 layout.scroll_height(),
986 0f32,
987 "scroll_height of node {:?}. Expected {}. Actual {}",
988 node00000,
989 0f32,
990 layout.scroll_height()
991 );
992 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
993 let layout @ Layout { size, location, .. } = taffy.layout(node000000).unwrap();
994 assert_eq!(size.width, 120f32, "width of node {:?}. Expected {}. Actual {}", node000000, 120f32, size.width);
995 assert_eq!(size.height, 120f32, "height of node {:?}. Expected {}. Actual {}", node000000, 120f32, size.height);
996 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node000000, 0f32, location.x);
997 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node000000, 0f32, location.y);
998 #[cfg(feature = "content_size")]
999 assert_eq!(
1000 layout.scroll_width(),
1001 0f32,
1002 "scroll_width of node {:?}. Expected {}. Actual {}",
1003 node000000,
1004 0f32,
1005 layout.scroll_width()
1006 );
1007 #[cfg(feature = "content_size")]
1008 assert_eq!(
1009 layout.scroll_height(),
1010 0f32,
1011 "scroll_height of node {:?}. Expected {}. Actual {}",
1012 node000000,
1013 0f32,
1014 layout.scroll_height()
1015 );
1016 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
1017 let layout @ Layout { size, location, .. } = taffy.layout(node00001).unwrap();
1018 assert_eq!(size.width, 72f32, "width of node {:?}. Expected {}. Actual {}", node00001, 72f32, size.width);
1019 assert_eq!(size.height, 39f32, "height of node {:?}. Expected {}. Actual {}", node00001, 39f32, size.height);
1020 assert_eq!(location.x, 120f32, "x of node {:?}. Expected {}. Actual {}", node00001, 120f32, location.x);
1021 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00001, 0f32, location.y);
1022 #[cfg(feature = "content_size")]
1023 assert_eq!(
1024 layout.scroll_width(),
1025 0f32,
1026 "scroll_width of node {:?}. Expected {}. Actual {}",
1027 node00001,
1028 0f32,
1029 layout.scroll_width()
1030 );
1031 #[cfg(feature = "content_size")]
1032 assert_eq!(
1033 layout.scroll_height(),
1034 0f32,
1035 "scroll_height of node {:?}. Expected {}. Actual {}",
1036 node00001,
1037 0f32,
1038 layout.scroll_height()
1039 );
1040 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
1041 let layout @ Layout { size, location, .. } = taffy.layout(node000010).unwrap();
1042 assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node000010, 0f32, size.width);
1043 assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node000010, 0f32, size.height);
1044 assert_eq!(location.x, 36f32, "x of node {:?}. Expected {}. Actual {}", node000010, 36f32, location.x);
1045 assert_eq!(location.y, 21f32, "y of node {:?}. Expected {}. Actual {}", node000010, 21f32, location.y);
1046 #[cfg(feature = "content_size")]
1047 assert_eq!(
1048 layout.scroll_width(),
1049 0f32,
1050 "scroll_width of node {:?}. Expected {}. Actual {}",
1051 node000010,
1052 0f32,
1053 layout.scroll_width()
1054 );
1055 #[cfg(feature = "content_size")]
1056 assert_eq!(
1057 layout.scroll_height(),
1058 0f32,
1059 "scroll_height of node {:?}. Expected {}. Actual {}",
1060 node000010,
1061 0f32,
1062 layout.scroll_height()
1063 );
1064 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
1065 let layout @ Layout { size, location, .. } = taffy.layout(node000011).unwrap();
1066 assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node000011, 0f32, size.width);
1067 assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node000011, 0f32, size.height);
1068 assert_eq!(location.x, 36f32, "x of node {:?}. Expected {}. Actual {}", node000011, 36f32, location.x);
1069 assert_eq!(location.y, 21f32, "y of node {:?}. Expected {}. Actual {}", node000011, 21f32, location.y);
1070 #[cfg(feature = "content_size")]
1071 assert_eq!(
1072 layout.scroll_width(),
1073 0f32,
1074 "scroll_width of node {:?}. Expected {}. Actual {}",
1075 node000011,
1076 0f32,
1077 layout.scroll_width()
1078 );
1079 #[cfg(feature = "content_size")]
1080 assert_eq!(
1081 layout.scroll_height(),
1082 0f32,
1083 "scroll_height of node {:?}. Expected {}. Actual {}",
1084 node000011,
1085 0f32,
1086 layout.scroll_height()
1087 );
1088 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
1089 let layout @ Layout { size, location, .. } = taffy.layout(node001).unwrap();
1090 assert_eq!(size.width, 1080f32, "width of node {:?}. Expected {}. Actual {}", node001, 1080f32, size.width);
1091 assert_eq!(size.height, 96f32, "height of node {:?}. Expected {}. Actual {}", node001, 96f32, size.height);
1092 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node001, 0f32, location.x);
1093 assert_eq!(location.y, 144f32, "y of node {:?}. Expected {}. Actual {}", node001, 144f32, location.y);
1094 #[cfg(feature = "content_size")]
1095 assert_eq!(
1096 layout.scroll_width(),
1097 0f32,
1098 "scroll_width of node {:?}. Expected {}. Actual {}",
1099 node001,
1100 0f32,
1101 layout.scroll_width()
1102 );
1103 #[cfg(feature = "content_size")]
1104 assert_eq!(
1105 layout.scroll_height(),
1106 0f32,
1107 "scroll_height of node {:?}. Expected {}. Actual {}",
1108 node001,
1109 0f32,
1110 layout.scroll_height()
1111 );
1112 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
1113 let layout @ Layout { size, location, .. } = taffy.layout(node0010).unwrap();
1114 assert_eq!(size.width, 906f32, "width of node {:?}. Expected {}. Actual {}", node0010, 906f32, size.width);
1115 assert_eq!(size.height, 72f32, "height of node {:?}. Expected {}. Actual {}", node0010, 72f32, size.height);
1116 assert_eq!(location.x, 174f32, "x of node {:?}. Expected {}. Actual {}", node0010, 174f32, location.x);
1117 assert_eq!(location.y, 24f32, "y of node {:?}. Expected {}. Actual {}", node0010, 24f32, location.y);
1118 #[cfg(feature = "content_size")]
1119 assert_eq!(
1120 layout.scroll_width(),
1121 0f32,
1122 "scroll_width of node {:?}. Expected {}. Actual {}",
1123 node0010,
1124 0f32,
1125 layout.scroll_width()
1126 );
1127 #[cfg(feature = "content_size")]
1128 assert_eq!(
1129 layout.scroll_height(),
1130 0f32,
1131 "scroll_height of node {:?}. Expected {}. Actual {}",
1132 node0010,
1133 0f32,
1134 layout.scroll_height()
1135 );
1136 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
1137 let layout @ Layout { size, location, .. } = taffy.layout(node00100).unwrap();
1138 assert_eq!(size.width, 72f32, "width of node {:?}. Expected {}. Actual {}", node00100, 72f32, size.width);
1139 assert_eq!(size.height, 72f32, "height of node {:?}. Expected {}. Actual {}", node00100, 72f32, size.height);
1140 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node00100, 0f32, location.x);
1141 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00100, 0f32, location.y);
1142 #[cfg(feature = "content_size")]
1143 assert_eq!(
1144 layout.scroll_width(),
1145 0f32,
1146 "scroll_width of node {:?}. Expected {}. Actual {}",
1147 node00100,
1148 0f32,
1149 layout.scroll_width()
1150 );
1151 #[cfg(feature = "content_size")]
1152 assert_eq!(
1153 layout.scroll_height(),
1154 0f32,
1155 "scroll_height of node {:?}. Expected {}. Actual {}",
1156 node00100,
1157 0f32,
1158 layout.scroll_height()
1159 );
1160 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
1161 let layout @ Layout { size, location, .. } = taffy.layout(node001000).unwrap();
1162 assert_eq!(size.width, 72f32, "width of node {:?}. Expected {}. Actual {}", node001000, 72f32, size.width);
1163 assert_eq!(size.height, 72f32, "height of node {:?}. Expected {}. Actual {}", node001000, 72f32, size.height);
1164 assert_eq!(location.x, 0f32, "x of node {:?}. Expected {}. Actual {}", node001000, 0f32, location.x);
1165 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node001000, 0f32, location.y);
1166 #[cfg(feature = "content_size")]
1167 assert_eq!(
1168 layout.scroll_width(),
1169 0f32,
1170 "scroll_width of node {:?}. Expected {}. Actual {}",
1171 node001000,
1172 0f32,
1173 layout.scroll_width()
1174 );
1175 #[cfg(feature = "content_size")]
1176 assert_eq!(
1177 layout.scroll_height(),
1178 0f32,
1179 "scroll_height of node {:?}. Expected {}. Actual {}",
1180 node001000,
1181 0f32,
1182 layout.scroll_height()
1183 );
1184 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
1185 let layout @ Layout { size, location, .. } = taffy.layout(node00101).unwrap();
1186 assert_eq!(size.width, 72f32, "width of node {:?}. Expected {}. Actual {}", node00101, 72f32, size.width);
1187 assert_eq!(size.height, 39f32, "height of node {:?}. Expected {}. Actual {}", node00101, 39f32, size.height);
1188 assert_eq!(location.x, 72f32, "x of node {:?}. Expected {}. Actual {}", node00101, 72f32, location.x);
1189 assert_eq!(location.y, 0f32, "y of node {:?}. Expected {}. Actual {}", node00101, 0f32, location.y);
1190 #[cfg(feature = "content_size")]
1191 assert_eq!(
1192 layout.scroll_width(),
1193 0f32,
1194 "scroll_width of node {:?}. Expected {}. Actual {}",
1195 node00101,
1196 0f32,
1197 layout.scroll_width()
1198 );
1199 #[cfg(feature = "content_size")]
1200 assert_eq!(
1201 layout.scroll_height(),
1202 0f32,
1203 "scroll_height of node {:?}. Expected {}. Actual {}",
1204 node00101,
1205 0f32,
1206 layout.scroll_height()
1207 );
1208 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
1209 let layout @ Layout { size, location, .. } = taffy.layout(node001010).unwrap();
1210 assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node001010, 0f32, size.width);
1211 assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node001010, 0f32, size.height);
1212 assert_eq!(location.x, 36f32, "x of node {:?}. Expected {}. Actual {}", node001010, 36f32, location.x);
1213 assert_eq!(location.y, 21f32, "y of node {:?}. Expected {}. Actual {}", node001010, 21f32, location.y);
1214 #[cfg(feature = "content_size")]
1215 assert_eq!(
1216 layout.scroll_width(),
1217 0f32,
1218 "scroll_width of node {:?}. Expected {}. Actual {}",
1219 node001010,
1220 0f32,
1221 layout.scroll_width()
1222 );
1223 #[cfg(feature = "content_size")]
1224 assert_eq!(
1225 layout.scroll_height(),
1226 0f32,
1227 "scroll_height of node {:?}. Expected {}. Actual {}",
1228 node001010,
1229 0f32,
1230 layout.scroll_height()
1231 );
1232 #[cfg_attr(not(feature = "content_size"), allow(unused_variables))]
1233 let layout @ Layout { size, location, .. } = taffy.layout(node001011).unwrap();
1234 assert_eq!(size.width, 0f32, "width of node {:?}. Expected {}. Actual {}", node001011, 0f32, size.width);
1235 assert_eq!(size.height, 0f32, "height of node {:?}. Expected {}. Actual {}", node001011, 0f32, size.height);
1236 assert_eq!(location.x, 36f32, "x of node {:?}. Expected {}. Actual {}", node001011, 36f32, location.x);
1237 assert_eq!(location.y, 21f32, "y of node {:?}. Expected {}. Actual {}", node001011, 21f32, location.y);
1238 #[cfg(feature = "content_size")]
1239 assert_eq!(
1240 layout.scroll_width(),
1241 0f32,
1242 "scroll_width of node {:?}. Expected {}. Actual {}",
1243 node001011,
1244 0f32,
1245 layout.scroll_width()
1246 );
1247 #[cfg(feature = "content_size")]
1248 assert_eq!(
1249 layout.scroll_height(),
1250 0f32,
1251 "scroll_height of node {:?}. Expected {}. Actual {}",
1252 node001011,
1253 0f32,
1254 layout.scroll_height()
1255 );
1256}