# Changelog ## 0.12.2 ### Fixed - Block: return margin-collapsing outputs from vertical axis ComputeSize calls (#976) ## 0.12.1 This release container a couple of critical fixes for layout/caching bugs in the 0.12.0 release. ### Fixed - Block: don't commit deferred in-flow layouts to the tree when only computing size (#971) - Block: pass through the requested `run_mode` when performing final layout on in-flow children, instead of always using `MeasureSize` (#972) ## 0.12.0 The MSRV for this release is 1.71. ### Block: support for `align-content` (#959) Block containers now implement `align_content` along the block axis for their in-flow children. ### More correct caching logic - The cache key now includes the axis, parent size, and available space, and ignores available space in an axis when a known dimension is set there. This is a performance hit (~10% in common cases, ~60% in pathalogically ones) but is necessary for correctness. It does also enable early-return optimizations (in cases where only the horizontal size is needed, which can allow that performance to be recouped in some cases (#911) ### Fixed - Flexbox: fall back to safe `align-self` of `start` on absolute-position overflow (#958) - Block: derive definite height from `aspect-ratio` at final layout. A block container with `aspect-ratio` and an automatic height now becomes definite when its width is filled/stretched, so children's percentage heights resolve correctly and the ratio is preserved (#965) ## 0.11.0 The MSRV for this release is 1.71. ### Implemented safe alignment keywords (#952) Taffy now implements [safe alignment](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/align-items#safe) (in addition to unsafe alignment). The alignment style types are now structs consisting of an `AlignmentKeyword` and an `AlignmentSafety` modifier. For most users this will mean changing from using enum variants like `AlignContent::Start` to associated constants like `AlignContent::START`. This change applies to the `AlignContent`, `JustifyContent`, `AlignItems`, `JustifyItems`, `AlignSelf`, and `JustifySelf` types. ### Fixed - Grid: resolve item percentages against grid area rather than grid container (#960) ## 0.10.1 ### Fixed - CSS Grid auto-repeat and minimum-size handling (#946) ## 0.10.0 The MSRV for this release is 1.71. ### Support for `direction` The `direction` property is now supported, allowing for RTL layout of boxes in Block, Flexbox, and CSS Grid layout modes. ### Support for floats The `float` and `clear` properties are now supported. Support consists of a general-purpose `FloatContext` in the `compute` module, and integration of float layout into Block layout. Block layout now also has a `BlockContext` that allows a `FloatContext` to be shared across an entire Block formatting context. Float support is feature flagged by the `float_layout` feature. ### Support for parsing styles from CSS string (#929) All of Taffy's style types (except the top-level `Style` struct) now have `FromStr` implementations that parses the type from the CSS representation of that value (e.g. `30px` or `50%` for `LengthPercentage`. A future version of Taffy will likely add support for parsing `Style` from `;`-seperated CSS. CSS parsing is feature flagged by the `parse` feature. Additionally the `parse_faster` feature enables optimizations for faster parsing at the cost of pulling in proc-macro dependencies such as `syn`. ### Changed - Make DetailedGridTracksInfo accessible from a public module (#899) - Add `TaffyTree::write_tree` method to debug print the tree into an arbitrary writer (#925) - The cache `set` and `set` APIs now take `&LayoutInput` rather than individual values (#933) ### Fixed - Flexbox: apply gap even when there are auto margins (#938) ## 0.9.3 ### Added - Added write_tree method to utils. ## 0.9.2 ### Fixed - Fix wrong size propogation for absolute elements (#878) - Fix bounds check in CellOccupancyMatrix::last_of_type (#890) - Use doc_cfg instead of doc_auto_cfg (#868) ### Changed - Upgraded grid dependency from 0.18 to 1.0 (#864) ## 0.9.1 ### Fixed - Flexbox: don't apply cross-axis stretch alignment to children with auto margins (#861) ## 0.9.0 The MSRV for this release is 1.65. ### Support for named grid lines and grid areas Taffy now supports named grid lines and areas. As these rely on arbitrary user-provided strings, Taffy's `Style` struct is now generic over a string-like type (via the `CheapCloneStr` trait). Additionally as the `grid` feature is optional, it has a `PhantomData` field of that type to make type inference work. ### Changed - `PrintTree` and `RoundTree`: use `Layout` instead of `&Layout` (#849). - Renamed `TrackSizingFunction` to `GridTemplateComponent` - Renamed `NonRepeatedTrackSizingFunction` to `TrackSizingFunction` - The `Repeat` variant of `GridTemplateComponent` now contains a new `GridTemplateRepetition` struct, which allows line names to be specifed in addition to tracks. - The way that grid styles are exposed in the low-level API is now a lot more generic with many associated types. ### Added - `GridTemplateArea` struct and `Style::grid_template_areas` field - `Style::grid_template_column_names` and `Style::grid_template_row_names` fields. If non-empty, these should have length of exactly one greater than the corresponding `grid_template_column`/`grid_template_rows` style. ## 0.8.3 ### Fixed - Fix `serde` feature on 32bit targets (#845) ## 0.8.2 ### Fixed - Fix: Calculate correct new grid size when expanding cell_occupancy_matrix in the negative direction (#843) ## 0.8.1 ### Added - Impl `GridItemStyle` and `BlockContainerStyle` for `Style` (#832). ## 0.8.0 ### Highlights **The big feature in this release is support for `calc()` values in the low-level API.** To use this API: - Implement the `resolve_calc_value` method when implementing the `LayoutPartialTree` trait. - Pass a type-erased pointer (`*const ()`) to constructors like `LengthPercentage::calc(...)` Taffy treats the pointer as an opaque value (excepting that it uses the low 3 bits as a tag) which it will pass to `LayoutPartialTree::resolve_calc_value` along with a percentage resolution basis when it needs to resolve the value. ### Changed - The representation of many "size" types is now a tagged pointer than an enum. This is to enable `calc()`. The effected types are `LengthPercentage`, `LengthPercentageAuto`, `Dimension`, `MinTrackSizingFunction`, and `MaxTrackSizingFunction` types. ### Added - Special-case "compressible replaced elements" in grid sizing algorithm (#807) This allows for more correct sizing of "replaced" elements such as images that are children of flexbox or grid containers. ### Fixed - Grid: Fix infinite loop due to float precision in grid layout maximise tracks step (#792) - Grid: Fix removed wrong addition, causing items to be misplaced. (#817) - Grid: Fix grid placement for items with fixed primary axis (#818) - Leaf layout: don't set available space to max-size (#819) ## 0.7.7 ### Fixed - Add `#[inline]` annotation to some methods on `TaffyTree` (#802) - Add `TaffyTree::remove_children_range` method (#802) ## 0.7.6 ### Fixed - Fix infinite loop due to float precision in grid layout maximise tracks step (#792) ## 0.7.5 ### Fixed - Grid: only stretch auto tracks if content-alignment is stretch (#783) ## 0.7.4 ### Fixed - Fix detailed grid info for empty grid (#782) ## 0.7.3 ### Fixed - Make `TaffyTree::detailed_layout_info` take `&self` rather than `&mut self` (#779) ## 0.7.2 ### Added - The ability to access computed track sizes and item positions of a CSS Grid layout (#772). This information can be accessed using the `LayoutGridContainer::set_detailed_grid_info` method in the low-level API or the `TaffyTree::detailed_layout_info` method in the high-level API. ## 0.7.1 ### Fixed - Improve interaction of abspos children of block containers with margin collapsing (#760) ### Added - Add `TaffyTree::unrounded_layout` getter (#765) ### Removed - The `num-traits` dependency was removed (#761) (#762) ## 0.7.0 ### Changed - BREAKING: The `cache_mut` method on the `LayoutPartialTree` trait has been replaced with a separate `CacheTree` trait. This allows Taffy to be more easily used without caching or with a custom cache implementation. - BREAKING: the `TaffyTree::set_children` method now removes the children from their previous parent (if they have one). ### Added - Helper methods to retrieve content-box sizes were added to `Layout` ## 0.6.3 ### Fixes - Block: ignore margin collapsing when computing static position of abspos items (#747) ## 0.6.2 ### Fixes - Fix: clamp indefinite available space by min- and max- size as appropriate (#742) ## 0.6.1 ### Fixes - Fix calculation of `auto-fill`/`auto-fit` repetition count when container has a definite percentage size (#722) - Fix min-size style not affecting intrinsic sizes (#723) - Fix documentation of dirty and mark_dirty functions (#724) - Fix intrinsic size of scroll containers that have a small explicit flex-basis (#728) ## 0.6.0 ### Highlights - The `Style` struct has been "traitified". This supports Taffy's integration in Servo and generally makes Taffy more flexible. The `Style` struct still exists and implements the new traits so existing uses of Taffy will continue to work as before. - The `box-sizing` style is supported - Computed margins are output in `Layout` ### Fixes - Fix `print_tree()` when rounding is disabled (#680) - Absolute Insets should be resolved against the container size minus border (#666) - Fix flooring hypothetical_main_size by computed min size (#689) - Fix flex line cross-size determination (#690) - Fix panics in the grid algorithm (#691) - Fix resolving flexible lengths (WPT css/flexbox-multiline-min-max test) (#692) - Fix wrapping when a max main size style is present (#694) - Fix case where Taffy allowed margins to collapse through an element when it shouldn't have (#695) ### Added - Legacy text align (for laying out `