Bug 164954 - Better testing for accessibility media queries
Summary: Better testing for accessibility media queries
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-11-18 14:05 PST by Dean Jackson
Modified: 2016-11-18 15:00 PST (History)
1 user (show)

See Also:


Attachments
Patch (20.90 KB, patch)
2016-11-18 14:12 PST, Dean Jackson
mmaxfield: review+
Details | Formatted Diff | Diff
Patch (22.16 KB, patch)
2016-11-18 14:29 PST, Dean Jackson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2016-11-18 14:05:53 PST
Add the "force" option for inverted-colors and monochrome.
Comment 1 Radar WebKit Bug Importer 2016-11-18 14:06:13 PST
<rdar://problem/29338292>
Comment 2 Dean Jackson 2016-11-18 14:12:44 PST
Created attachment 295188 [details]
Patch
Comment 3 Myles C. Maxfield 2016-11-18 14:16:56 PST
Comment on attachment 295188 [details]
Patch

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

> Source/WebCore/css/MediaQueryEvaluator.cpp:264
> +    bool isMonochrome = screenIsMonochrome(frame.mainFrame().view());

I suggest putting this inside a conditional below so it doesn't have to be called.

> Source/WebCore/css/MediaQueryEvaluator.cpp:280
> +    if (frame.settings().forcedColorsAreInvertedAccessibilityValue() == Settings::ForcedAccessibilityValue::On)

Ditto.

> Source/WebCore/css/MediaQueryEvaluator.cpp:675
>      bool userPrefersReducedMotion = platformTheme()->userPrefersReducedMotion();

Ditto.

> Source/WebCore/testing/InternalSettings.idl:97
> +    attribute ForcedAccessibilityValue forcedColorsAreInvertedAccessibilityValue;
> +    attribute ForcedAccessibilityValue forcedDisplayIsMonochromeAccessibilityValue;
> +    attribute ForcedAccessibilityValue forcedPrefersReducedMotionAccessibilityValue;

It's pretty awesome you don't need to make SPI for this. It keeps the patch much simpler than it would otherwise be.
Comment 4 Dean Jackson 2016-11-18 14:29:35 PST
Created attachment 295193 [details]
Patch
Comment 5 Dean Jackson 2016-11-18 15:00:17 PST
Committed r208899: <http://trac.webkit.org/changeset/208899>