Repository navigation
Implement prefers-reduced-transparency media feature - #11560
lukewarlow wants to merge 1 commit into
Conversation
|
EWS run on previous version of this PR (hash b537e90) Details |
|
Standards position issue: WebKit/standards-positions#145 |
b537e90 to
e8483c8
Compare
|
EWS run on previous version of this PR (hash e8483c8) Details |
e8483c8 to
609b31a
Compare
|
EWS run on previous version of this PR (hash 609b31a) Details |
|
macOS minibrowser WK-1 and WK-2 Works dynamically (no page reload) (including web inspector override) iOS Simulator minibrowser Works statically (requires app reload to update) Safari on iOS loads but doesn't seem to honour the media query (also fails test suite so not convinced its using the local build) Safari on macOS when launched through the command fails to load any pages for me so couldn't test |
|
Thanks for working on this! It would be nice to have a test that dynamically forces the value on and off, similar to https://github.com/WebKit/WebKit/blob/a8cb90d/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value.html. |
609b31a to
d347319
Compare
|
EWS run on previous version of this PR (hash d347319) Details |
|
Have mostly copied the code for I believe there's a Windows setting to reduce transparency so if this is wanted within the WinCairo build I believe it can be done. I couldn't see an obvious ThemeWindows file in the same way that there's a ThemeIOS and ThemeMac though. |
|
I'm assuming the build failures are because libAccessibility.tbd doesn't expose any reducedTransparency definitions. This seems to be part of the platform SDK itself so I'll try and remove the stuff that's referencing these properties. |
d347319 to
f86fabf
Compare
|
Putting some of the code in WebProcess and WebProcessPool inside of if PLATFORM(MAC) checks seems to have fixed the iOS build locally. |
|
EWS run on previous version of this PR (hash f86fabf) Details |
f86fabf to
4d0837f
Compare
|
EWS run on previous version of this PR (hash 4d0837f) Details |
|
See WebKit/standards-positions#145, which has the "Concerns" label. |
|
As for the privacy concerns I understand them but WebKit already exposes the other preference media queries so I personally don't see how this one would be different. But I understand that the team needs to go through the correct process. |
4d0837f to
c7d3f76
Compare
|
EWS run on previous version of this PR (hash c7d3f76) Details |
https://bugs.webkit.org/show_bug.cgi?id=175497 Reviewed by NOBODY (OOPS!). Implements the prefers-reduced-transparency media feature for iOS and macOS. This support is behind an off by default testable feature flag. Also adds support for overriding this value within Web Inspector. Spec: https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-transparency * LayoutTests/fast/media/mq-prefers-reduced-transparency-expected.html: Added. * LayoutTests/fast/media/mq-prefers-reduced-transparency-forced-value-expected.html: Added. * LayoutTests/fast/media/mq-prefers-reduced-transparency-forced-value.html: Added. * LayoutTests/fast/media/mq-prefers-reduced-transparency-live-update-expected.html: Added. * LayoutTests/fast/media/mq-prefers-reduced-transparency-live-update-for-listener-expected.txt: Added. * LayoutTests/fast/media/mq-prefers-reduced-transparency-live-update-for-listener.html: Added. * LayoutTests/fast/media/mq-prefers-reduced-transparency-live-update.html: Added. * LayoutTests/fast/media/mq-prefers-reduced-transparency-matchMedia-expected.txt: Added. * LayoutTests/fast/media/mq-prefers-reduced-transparency-matchMedia.html: Added. * LayoutTests/fast/media/mq-prefers-reduced-transparency.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/prefers-reduced-transparency-expected.txt: * Source/JavaScriptCore/inspector/protocol/Page.json: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/PAL/pal/ios/UIKitSoftLink.h: * Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm: * Source/WebCore/PAL/pal/spi/mac/HIServicesSPI.h: * Source/WebCore/css/CSSValueKeywords.in: * Source/WebCore/css/MediaQueryParserContext.cpp: (WebCore::MediaQueryParserContext::MediaQueryParserContext): * Source/WebCore/css/MediaQueryParserContext.h: * Source/WebCore/css/parser/CSSParserContext.cpp: (WebCore::operator==): (WebCore::add): * Source/WebCore/css/parser/CSSParserContext.h: * Source/WebCore/css/query/MediaQueryFeatures.cpp: (WebCore::MQ::Features::prefersReducedTransparency): (WebCore::MQ::Features::dynamicDependency): * Source/WebCore/css/query/MediaQueryFeatures.h: * Source/WebCore/css/query/MediaQueryParser.cpp: (WebCore::MQ::MediaQueryParser::schemaForFeatureName const): * Source/WebCore/inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::disable): (WebCore::InspectorPageAgent::overrideUserPreference): (WebCore::InspectorPageAgent::overridePrefersReducedTransparency): (WebCore::InspectorPageAgent::defaultUserPreferencesDidChange): * Source/WebCore/inspector/agents/InspectorPageAgent.h: * Source/WebCore/page/Settings.yaml: * Source/WebCore/platform/Theme.cpp: (WebCore::Theme::userPrefersReducedTransparency const): * Source/WebCore/platform/Theme.h: * Source/WebCore/platform/ios/ThemeIOS.h: * Source/WebCore/platform/ios/ThemeIOS.mm: (WebCore::ThemeIOS::userPrefersReducedTransparency const): * Source/WebCore/platform/mac/ThemeMac.h: * Source/WebCore/platform/mac/ThemeMac.mm: (WebCore::ThemeMac::userPrefersReducedTransparency const): * Source/WebCore/testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::forcedPrefersReducedTransparencyAccessibilityValue const): (WebCore::InternalSettings::setForcedPrefersReducedTransparencyAccessibilityValue): * Source/WebCore/testing/InternalSettings.h: * Source/WebCore/testing/InternalSettings.idl: * Source/WebCore/testing/Internals.cpp: (WebCore::Internals::userPrefersReducedTransparency const): * Source/WebCore/testing/Internals.h: * Source/WebCore/testing/Internals.idl: * Source/WebCore/testing/Internals.mm: (WebCore::Internals::userPrefersReducedTransparency const): * Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js: * Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js: * Source/WebInspectorUI/UserInterface/Views/OverrideUserPreferencesPopover.js: (WI.OverrideUserPreferencesPopover.prototype.createContentElement): * Source/WebKit/Platform/spi/Cocoa/AccessibilitySupportSPI.h: * Source/WebKit/Shared/AccessibilityPreferences.cpp: (IPC::ArgumentCoder<WebKit::AccessibilityPreferences>::encode): (IPC::ArgumentCoder<WebKit::AccessibilityPreferences>::decode): * Source/WebKit/Shared/AccessibilityPreferences.h: * Source/WebKit/Shared/Cocoa/AuxiliaryProcessCocoa.mm: (WebKit::handleAXPreferenceChange): * Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _registerForNotifications]): * Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::accessibilityPreferences): (WebKit::WebProcessPool::registerNotificationObservers): (WebKit::WebProcessPool::unregisterNotificationObservers): * Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::accessibilityPreferencesDidChange): (WebKit::WebProcess::handlePreferenceChange):
c7d3f76 to
4bf0c47
Compare
|
EWS run on current version of this PR (hash 4bf0c47) Details |
|
Gonna close this for now, if and when WebKit have a positive position on this feature I'll bring it back |
4bf0c47
4bf0c47