Bug 236265 - Return 'none' as the computed style for mask when there are no images
Summary: Return 'none' as the computed style for mask when there are no images
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-07 15:16 PST by Matt Woodrow
Modified: 2022-02-08 10:43 PST (History)
9 users (show)

See Also:


Attachments
Patch (2.08 KB, patch)
2022-02-07 15:18 PST, Matt Woodrow
no flags Details | Formatted Diff | Diff
Patch (5.13 KB, patch)
2022-02-07 18:58 PST, Matt Woodrow
no flags Details | Formatted Diff | Diff
Patch (29.14 KB, patch)
2022-02-07 22:03 PST, Matt Woodrow
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Woodrow 2022-02-07 15:16:16 PST
rdar://88178304

We currently always return the full set of properties for the computed style of mask, even when there aren't any images (which matches what we do for background).

To match other engines, we should just return 'none' for the case where there are no images.
Comment 1 Matt Woodrow 2022-02-07 15:18:35 PST
Created attachment 451161 [details]
Patch
Comment 2 Matt Woodrow 2022-02-07 18:58:06 PST
Created attachment 451193 [details]
Patch
Comment 3 Matt Woodrow 2022-02-07 22:03:45 PST
Created attachment 451210 [details]
Patch
Comment 4 EWS 2022-02-08 08:24:30 PST
Committed r289377 (246965@main): <https://commits.webkit.org/246965@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 451210 [details].
Comment 5 Darin Adler 2022-02-08 08:56:03 PST
Comment on attachment 451210 [details]
Patch

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

> Source/WebCore/css/CSSComputedStyleDeclaration.h:99
> -    Ref<CSSValueList> getFillLayerPropertyShorthandValue(CSSPropertyID, const StylePropertyShorthand& propertiesBeforeSlashSeparator, const StylePropertyShorthand& propertiesAfterSlashSeparator, CSSPropertyID lastLayerProperty);
> -    Ref<CSSValueList> getBackgroundShorthandValue();
> -    Ref<CSSValueList> getMaskShorthandValue();
> +    RefPtr<CSSValue> getFillLayerPropertyShorthandValue(CSSPropertyID, const StylePropertyShorthand& propertiesBeforeSlashSeparator, const StylePropertyShorthand& propertiesAfterSlashSeparator, CSSPropertyID lastLayerProperty);
> +    RefPtr<CSSValue> getBackgroundShorthandValue();
> +    RefPtr<CSSValue> getMaskShorthandValue();

Why the change from Ref to RefPtr? These can’t return nullptr, can they?
Comment 6 Matt Woodrow 2022-02-08 10:43:05 PST
(In reply to Darin Adler from comment #5) 
> Why the change from Ref to RefPtr? These can’t return nullptr, can they?

Ah indeed, this is a remnant from an earlier revision of the patch, I could have left these as Ref.