Bug 186306 - Rename color-filter to -apple-color-filter and do not expose it to Web content
Summary: Rename color-filter to -apple-color-filter and do not expose it to Web content
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-06-05 06:06 PDT by Antoine Quint
Modified: 2018-06-06 15:27 PDT (History)
2 users (show)

See Also:


Attachments
Patch (107.13 KB, patch)
2018-06-05 08:21 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (111.09 KB, patch)
2018-06-05 08:40 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (106.70 KB, patch)
2018-06-06 01:27 PDT, Antoine Quint
simon.fraser: review+
simon.fraser: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2018-06-05 06:06:27 PDT
The CSS color-filter property was created to support some macOS Mojave-specific features and should not be exposed to the Web.
Comment 1 Antoine Quint 2018-06-05 06:06:42 PDT
<rdar://problem/39874167>
Comment 2 Antoine Quint 2018-06-05 08:21:26 PDT
Created attachment 341967 [details]
Patch
Comment 3 Antoine Quint 2018-06-05 08:23:32 PDT
For the reviewer: somehow the JS accessors and setters on CSSStyleDeclaration don't seem to work for .appleColorFilter and some tests fail. What am I missing to ensure that these work? Or is that not a big deal?
Comment 4 Antoine Quint 2018-06-05 08:26:43 PDT
Using setProperty("-apple-color-filter", …) and getPropertyValue("-apple-color-filter") instead of the appleColorFilter accessor and setter works as expected.
Comment 5 Antoine Quint 2018-06-05 08:40:24 PDT
Created attachment 341968 [details]
Patch
Comment 6 Antoine Quint 2018-06-05 08:40:56 PDT
I update the couple of problematic tests and the css3/color-filters subdirectory should now pass just fine.
Comment 7 Antoine Quint 2018-06-06 01:27:30 PDT
Created attachment 342039 [details]
Patch
Comment 8 Simon Fraser (smfr) 2018-06-06 12:02:54 PDT
Comment on attachment 342039 [details]
Patch

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

> Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h:570
> +WK_EXPORT void WKPreferencesSetColorFilterEnabled(WKPreferencesRef preferencesRef, bool flag);
> +WK_EXPORT bool WKPreferencesGetColorFilterEnabled(WKPreferencesRef preferencesRef);

No need to have the preferencesRef name here.

> Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:73
> +@property (nonatomic, setter=_setColorFilterEnabled:) BOOL _colorFilterEnabled WK_API_AVAILABLE(macosx(10.14));

This should be a TBA version, and also available in iOS TBA.
Comment 9 Antoine Quint 2018-06-06 15:27:28 PDT
Committed r232559: <https://trac.webkit.org/changeset/232559>