Bug 222516 - Blending of border-image-width should be discrete between "auto" values and other types
Summary: Blending of border-image-width should be discrete between "auto" values and o...
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
Depends on:
Blocks:
 
Reported: 2021-02-27 10:44 PST by Antoine Quint
Modified: 2021-02-28 04:00 PST (History)
5 users (show)

See Also:


Attachments
Patch (12.64 KB, patch)
2021-02-27 10:47 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (14.85 KB, patch)
2021-02-27 11:01 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (14.73 KB, patch)
2021-02-28 00:29 PST, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (58.40 KB, patch)
2021-02-28 01:59 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-02-27 10:44:43 PST
Blending of border-image-width should be discrete between "auto" values and other types
Comment 1 Antoine Quint 2021-02-27 10:47:53 PST
Created attachment 421752 [details]
Patch
Comment 2 Antoine Quint 2021-02-27 11:01:57 PST
Created attachment 421753 [details]
Patch
Comment 3 Dean Jackson 2021-02-27 14:48:37 PST
Comment on attachment 421753 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        got tricked by an "auto" Length returning true for Length::isZero(). So we also check that 0 values aren't

Is this a bug? Seems like returning isZero for an auto length is wrong. Did you check why that is?

    if (isCalculated())
        return false;
    return m_isFloat ? !m_floatValue : !m_intValue;

Seems like auto should be similar to calculated. But I bet some code would break if we made a change here.
Comment 4 Simon Fraser (smfr) 2021-02-27 15:53:21 PST
Comment on attachment 421753 [details]
Patch

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

> Source/WebCore/animation/CSSPropertyAnimation.cpp:756
> +            if (a.type() == b.type() || (a.isZero() && !a.isAuto()) || (b.isZero() && !b.isAuto()))

Wouldn't it be better to add a function to Length that does what isZero() && !isAuto() does?
Comment 5 Antoine Quint 2021-02-28 00:26:00 PST
(In reply to Simon Fraser (smfr) from comment #4)
> Comment on attachment 421753 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=421753&action=review
> 
> > Source/WebCore/animation/CSSPropertyAnimation.cpp:756
> > +            if (a.type() == b.type() || (a.isZero() && !a.isAuto()) || (b.isZero() && !b.isAuto()))
> 
> Wouldn't it be better to add a function to Length that does what isZero() &&
> !isAuto() does?

Actually, I think isZero() should return false when isAuto() is true, as Dean suggested. I'll file a patch to see if EWS is happy with that.
Comment 6 Antoine Quint 2021-02-28 00:29:32 PST
Created attachment 421771 [details]
Patch
Comment 7 Antoine Quint 2021-02-28 01:42:52 PST
(In reply to Antoine Quint from comment #5)
> (In reply to Simon Fraser (smfr) from comment #4)
> > Comment on attachment 421753 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=421753&action=review
> > 
> > > Source/WebCore/animation/CSSPropertyAnimation.cpp:756
> > > +            if (a.type() == b.type() || (a.isZero() && !a.isAuto()) || (b.isZero() && !b.isAuto()))
> > 
> > Wouldn't it be better to add a function to Length that does what isZero() &&
> > !isAuto() does?
> 
> Actually, I think isZero() should return false when isAuto() is true, as
> Dean suggested. I'll file a patch to see if EWS is happy with that.

This looks like a winner, there are a bunch of new PASS results from css-grid tests as well!
Comment 8 Antoine Quint 2021-02-28 01:59:48 PST
Created attachment 421773 [details]
Patch
Comment 9 EWS 2021-02-28 03:59:57 PST
Committed r273635: <https://commits.webkit.org/r273635>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421773 [details].
Comment 10 Radar WebKit Bug Importer 2021-02-28 04:00:20 PST
<rdar://problem/74835871>