WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
137535
[Mac] Support "inverted-colors" and "monochrome" media feature.
https://bugs.webkit.org/show_bug.cgi?id=137535
Summary
[Mac] Support "inverted-colors" and "monochrome" media feature.
James Craig
Reported
2014-10-08 13:08:36 PDT
CSS4: Support "inverted" media feature.
http://dev.w3.org/csswg/mediaqueries-4/#inverted
Based on IndieUI, which uses old name "colors-inverted":
http://www.w3.org/TR/indie-ui-context/#media-feature-colors-inverted
Attachments
Patch
(8.62 KB, patch)
2014-10-19 08:19 PDT
,
Dean Jackson
no flags
Details
Formatted Diff
Diff
Patch
(16.07 KB, patch)
2014-10-20 12:18 PDT
,
Dean Jackson
bfulgham
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2014-10-08 13:08:46 PDT
<
rdar://problem/18586398
>
James Craig
Comment 2
2014-10-08 13:09:53 PDT
Apple UIKit API for detecting color inversion on iOS // From <UIKit/UIAccessibility.h> // Returns whether the system preference for invert colors is enabled. UIKIT_EXTERN BOOL UIAccessibilityIsInvertColorsEnabled() NS_AVAILABLE_IOS(6_0); UIKIT_EXTERN NSString *const UIAccessibilityInvertColorsStatusDidChangeNotification NS_AVAILABLE_IOS(6_0);
Dean Jackson
Comment 3
2014-10-19 08:19:30 PDT
Created
attachment 240086
[details]
Patch
Dean Jackson
Comment 4
2014-10-19 08:22:43 PDT
Not for review yet, but it works fine. I need to write the ChangeLog and make sure it compiles on other platforms. Oh, I did the monochrome media query as well, although I need to read the spec to make sure we do the right thing if the rule asks for particular bit depths. I'm not sure we can test this. We'd have to expose an internals API to invert the screen. Is this a completely safe thing to do? Also, the media query does not re-evaluate as the screen swaps. The page needs to be reloaded. We can detect the change on iOS, but I have not found any notification for OS X.
WebKit Commit Bot
Comment 5
2014-10-19 08:24:45 PDT
Attachment 240086
[details]
did not pass style-queue: ERROR: Source/WebCore/css/MediaQueryEvaluator.cpp:240: inverted_colorsMediaFeatureEval is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WebCore/ChangeLog:8: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5] Total errors found: 2 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dean Jackson
Comment 6
2014-10-20 12:18:49 PDT
Created
attachment 240137
[details]
Patch
WebKit Commit Bot
Comment 7
2014-10-20 12:21:38 PDT
Attachment 240137
[details]
did not pass style-queue: ERROR: Source/WebCore/css/MediaQueryEvaluator.cpp:240: inverted_colorsMediaFeatureEval is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 1 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Brent Fulgham
Comment 8
2014-10-20 12:28:34 PDT
Comment on
attachment 240137
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=240137&action=review
r=me. I think you could support Windows here with the change I suggested below.
> Source/WebCore/platform/win/PlatformScreenWin.cpp:89 > + return false;
I think this could be #if USE(CG) return CGDisplayUsesInvertedPolarity(); #else return false; #endif
Dean Jackson
Comment 9
2014-10-20 12:38:39 PDT
Committed
r174901
: <
http://trac.webkit.org/changeset/174901
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug