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
Web Inspector: REGRESSION(257744@main): Dark Mode simulation isn't maintained on page change, but remains selected in the UI #13630
Conversation
EWS run on previous version of this PR (hash 3e5b25e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Thanks for fixing this. Looks good.
this._overriddenUserPreferences.delete(InspectorBackend.Enum.Page.UserPreferenceName.PrefersColorScheme); | ||
this.dispatchEventToListeners(WI.CSSManager.Event.OverriddenUserPreferencesDidChange); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it's trying to keep the UI sync with the cleared override for older backends that don't have this fix. As in: not fixing the bug, but having a truthful UI. Am I reading this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct! this will ensure that the prefers-color-scheme
override doesn't persist across toplevel navigations for older backends
@@ -709,6 +710,7 @@ WI.DOMTreeContentView = class DOMTreeContentView extends WI.ContentView | |||
|
|||
_defaultUserPreferencesDidChange() | |||
{ | |||
// COMPATIBILITY (macOS 13, iOS 16.0): `Page.setForcedAppearance()` was removed in favor of `Page.overrideUserPreference()` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: This compatibility message is already included in the getters WI.cssManager.supportsOverrideUserPreference
and WI.cssManager.supportsOverrideColorScheme
. Could be dropped here.
This looks good to me, but I'm not a reviewer yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I concur with Razvan, LGTM.
EWS run on current version of this PR (hash 10ab51b) |
β¦intained on page change, but remains selected in the UI https://bugs.webkit.org/show_bug.cgi?id=254457 <rdar://problem/107506257> Reviewed by Patrick Angle. Having to force dark (or light) mode with each refresh is pretty tedious, as it's probably pretty common that developers will refresh as they make changes to the backend source. * Source/WebCore/page/Page.cpp: (WebCore::Page::didCommitLoad): Don't clear the forced appearance override on main frame navigation. * Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js: (WI.DOMTreeContentView): (WI.DOMTreeContentView.prototype._defaultUserPreferencesDidChange): A new `WI.DOMTreeContentView` is created each time the main frame navigates, so make sure to initialize `activated` (and `enabled`) instead of waiting for `WI.CSSManager.Event.OverriddenUserPreferencesDidChange` (and `WI.CSSManager.Event.DefaultUserPreferencesDidChange`). * Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js: (WI.CSSManager.prototype._mainResourceDidChange): Add compatibility behavior for releases before this change. Canonical link: https://commits.webkit.org/264172@main
10ab51b
to
1fb980b
Compare
Committed 264172@main (1fb980b): https://commits.webkit.org/264172@main Reviewed commits have been landed. Closing PR #13630 and removing active labels. |
1fb980b
10ab51b
π§ͺ wpe-wk2π§ͺ ios-wk2-wptπ§ͺ api-iosπ§ͺ mac-wk2π§ͺ mac-AS-debug-wk2