Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add emulation for inverted-colors to web inspector #16014

Closed
wants to merge 1 commit into from

Conversation

lukewarlow
Copy link
Member

@lukewarlow lukewarlow commented Jul 22, 2023

08cc52f

Add emulation for inverted-colors to web inspector
https://bugs.webkit.org/show_bug.cgi?id=259418

Reviewed by NOBODY (OOPS!).

Web inspector now allows overriding the inverted-colors media query.

* LayoutTests/inspector/page/overrideUserPreference-expected.txt:
* LayoutTests/inspector/page/overrideUserPreference.html:
* Source/JavaScriptCore/inspector/protocol/Page.json:
* Source/WebCore/inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::overrideUserPreference):
(WebCore::InspectorPageAgent::overrideInvertedColors):
(WebCore::InspectorPageAgent::defaultUserPreferencesDidChange):
* Source/WebCore/inspector/agents/InspectorPageAgent.h:
* Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:
* Source/WebInspectorUI/UserInterface/Views/OverrideUserPreferencesPopover.js:
(WI.OverrideUserPreferencesPopover.prototype.createContentElement):
(WI.OverrideUserPreferencesPopover.prototype._userPreferenceValueLabel):

08cc52f

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt ❌ πŸ§ͺ mac-wk1 ❌ πŸ§ͺ gtk-wk2
βœ… πŸ›  πŸ§ͺ jsc βœ… πŸ§ͺ api-ios ❌ πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  πŸ§ͺ jsc-arm64 βœ… πŸ›  tv ❌ πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ›  jsc-armv7
βœ… πŸ›  tv-sim ❌ πŸ§ͺ mac-wk2-stress βœ… πŸ§ͺ jsc-armv7-tests
βœ… πŸ›  watch βœ… πŸ›  jsc-mips
βœ… πŸ›  watch-sim βœ… πŸ§ͺ jsc-mips-tests

https://bugs.webkit.org/show_bug.cgi?id=259418

Reviewed by NOBODY (OOPS!).

Web inspector now allows overriding the inverted-colors media query.

* LayoutTests/inspector/page/overrideUserPreference-expected.txt:
* LayoutTests/inspector/page/overrideUserPreference.html:
* Source/JavaScriptCore/inspector/protocol/Page.json:
* Source/WebCore/inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::overrideUserPreference):
(WebCore::InspectorPageAgent::overrideInvertedColors):
(WebCore::InspectorPageAgent::defaultUserPreferencesDidChange):
* Source/WebCore/inspector/agents/InspectorPageAgent.h:
* Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:
* Source/WebInspectorUI/UserInterface/Views/OverrideUserPreferencesPopover.js:
(WI.OverrideUserPreferencesPopover.prototype.createContentElement):
(WI.OverrideUserPreferencesPopover.prototype._userPreferenceValueLabel):
@lukewarlow lukewarlow self-assigned this Jul 22, 2023
@lukewarlow lukewarlow added the Web Inspector Bugs related to the WebKit Web Inspector. label Jul 22, 2023
@@ -86,7 +86,7 @@ WI.OverrideUserPreferencesPopover = class OverrideUserPreferencesPopover extends
});
}

if (InspectorBackend.Enum.Page?.UserPreferenceName?.PrefersReducedMotion || InspectorBackend.Enum.Page?.UserPreferenceName?.PrefersContrast) {
if (InspectorBackend.Enum.Page?.UserPreferenceName?.PrefersReducedMotion || InspectorBackend.Enum.Page?.UserPreferenceName?.PrefersContrast || InspectorBackend.Enum.Page?.UserPreference?.Inverted) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be || InspectorBackend.Enum.Page?.UserPreferenceName?.InvertedColors

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jul 22, 2023
@lukewarlow
Copy link
Member Author

Closing as I realised without actually inverting the page content this is far less useful than I imagined.

@lukewarlow lukewarlow closed this Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merging-blocked Applied to prevent a change from being merged Web Inspector Bugs related to the WebKit Web Inspector.
Projects
None yet
3 participants