Bug 222816 - Improve blending of Length and other Length-related types
Summary: Improve blending of Length and other Length-related types
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
: 222514 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-03-05 12:25 PST by Antoine Quint
Modified: 2021-08-05 09:20 PDT (History)
4 users (show)

See Also:


Attachments
Patch for EWS (222.49 KB, patch)
2021-03-05 12:25 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch for EWS (228.83 KB, patch)
2021-03-06 03:30 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (240.98 KB, patch)
2021-03-06 06:32 PST, Antoine Quint
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2021-03-05 12:25:32 PST
Improve blending of Length and other Length-related types
Comment 1 Antoine Quint 2021-03-05 12:25:58 PST
Created attachment 422394 [details]
Patch for EWS
Comment 2 Antoine Quint 2021-03-06 03:30:53 PST
Created attachment 422482 [details]
Patch for EWS
Comment 3 Antoine Quint 2021-03-06 06:32:14 PST
Created attachment 422490 [details]
Patch
Comment 4 Antoine Quint 2021-03-06 06:33:15 PST
*** Bug 222514 has been marked as a duplicate of this bug. ***
Comment 5 Antti Koivisto 2021-03-06 07:05:46 PST
Comment on attachment 422490 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=422490&action=review

> Source/WebCore/animation/CSSPropertyAnimation.cpp:703
>  class LengthPropertyWrapper : public PropertyWrapperGetter<const Length&> {
>      WTF_MAKE_FAST_ALLOCATED;
>  public:
> -    LengthPropertyWrapper(CSSPropertyID prop, const Length& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(Length&&))
> +    enum class Flags {
> +        IsLengthPercentage          = 1 << 0,
> +        NegativeLengthsAreInvalid   = 1 << 1,
> +    };
> +    LengthPropertyWrapper(CSSPropertyID prop, const Length& (RenderStyle::*getter)() const, void (RenderStyle::*setter)(Length&&), OptionSet<Flags> flags = { })

I think you could make the flags a template argument instead as they are fixed for a given property type.

Not sure if this has much practical significance though and could be done separately.

> Source/WebCore/animation/CSSPropertyAnimation.cpp:712
> -        return !this->value(a).isAuto() && !this->value(b).isAuto();
> +        return canInterpolateLengths(this->value(a), this->value(b), m_flags.contains(Flags::IsLengthPercentage));

Then canInterpolateLengths would also take IsLengthPercentage as template argument.
Comment 6 EWS 2021-03-06 08:28:32 PST
Committed r274038: <https://commits.webkit.org/r274038>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 422490 [details].
Comment 7 Radar WebKit Bug Importer 2021-03-06 08:29:17 PST
<rdar://problem/75133641>