[Webkit-unassigned] [Bug 226174] [css-grid] Add discrete animation support for grid-template-columns|rows
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu May 27 03:23:17 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=226174
--- Comment #11 from zsun at igalia.com ---
(In reply to Oriol Brufau from comment #9)
> (In reply to zsun from comment #8)
> > Thanks for the comments! Oriol and I had a private discussion on this. If we
> > unify them into a single class, We will have to pass a lot arguments over to
> > the the unified class, for the moment, around 13. We thought maybe just
> > leave them separated?
>
> Thinking more about this, rather than passing all the functions as arguments
> to the constructor, I guess you could define a template class, and then
> specialize with different constructors. Something like
>
> template <GridTrackSizingDirection>
> class GridTemplateTracksWrapper : public AnimationPropertyWrapperBase {
> WTF_MAKE_FAST_ALLOCATED;
> public:
> GridTemplateTracksWrapper();
>
> private:
> // ... common logic
> };
>
> template <>
> GridTemplateTracksWrapper<ForColumns>::GridTemplateTracksWrapper()
> : AnimationPropertyWrapperBase(CSSPropertyGridTemplateColumns)
> , m_gridTracksWrapper(DiscretePropertyWrapper<const
> Vector<GridTrackSize>&>(CSSPropertyGridTemplateColumns,
> &RenderStyle::gridColumns, &RenderStyle::setGridColumns))
> , m_autoRepeatTracksWrapper(DiscretePropertyWrapper<const
> Vector<GridTrackSize>&>(CSSPropertyGridTemplateColumns,
> &RenderStyle::gridAutoRepeatColumns, &RenderStyle::setGridAutoRepeatColumns))
> // ...
> {
> }
>
> template <>
> GridTemplateTracksWrapper<ForRows>::GridTemplateTracksWrapper()
> : AnimationPropertyWrapperBase(CSSPropertyGridTemplateRows)
> , m_gridTracksWrapper(DiscretePropertyWrapper<const
> Vector<GridTrackSize>&>(CSSPropertyGridTemplateRows, &RenderStyle::gridRows,
> &RenderStyle::setGridRows))
> , m_autoRepeatTracksWrapper(DiscretePropertyWrapper<const
> Vector<GridTrackSize>&>(CSSPropertyGridTemplateRows,
> &RenderStyle::gridAutoRepeatRows, &RenderStyle::setGridAutoRepeatRows))
> // ...
> {
> }
>
> GridTrackSizingDirection is defined in GridPositionsResolver.h, you could
> also create another enum here I guess.
Thanks very much for the suggestions! Code has been updated.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210527/9081853f/attachment-0001.htm>
More information about the webkit-unassigned
mailing list