Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Allow users of Taffy to bring their own style representation(s).
Context
While we have support for custom node tree representations, we currently enforce usage of a concrete style representation. Additionally, that style representation is shared across all algorithms and thus must include the styles for Flexbox, CSS Grid and Block layout, making it quite large. A problem which will only get worse if non-css algorithms are supported in future.
Feedback wanted
Todo
Display
style. Algorithms typically only need to know whether theDisplay
isNone
or not. I am considering creating a new enum with justNone
andNormal
(name tbd) variants for this purpose. This would need to be extended withContents
if we implement that, but would never need to know about individual algorithms. See also:style::Display
is not according to specifications #115Remove theTurns out this is still required for root layoutget_style
method from the basePartialLayoutTree
trait