WebKit Bugzilla
Attachment 360082 Details for
Bug 193814
: Web Inspector: `WI.Setting.migrateValue` doesn't take into account the key prefix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193814-20190124222621.patch (text/plain), 2.59 KB, created by
Devin Rousso
on 2019-01-24 22:26:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-01-24 22:26:22 PST
Size:
2.59 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 44053a80022a1daf4c0f3351611e0f8fd99394b8..f8023c2b9d51ce81b9c09961718f5827c6f1c380 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-24 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: `WI.Setting.migrateValue` doesn't take into account the key prefix >+ https://bugs.webkit.org/show_bug.cgi?id=193814 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Base/Setting.js: >+ (WI.Setting): >+ (WI.Setting.migrateValue): >+ (WI.Setting._localStorageKey): Added. >+ > 2019-01-23 Nikita Vasilyev <nvasilyev@apple.com> > > Web Inspector: Refactor WI.CSSStyleDeclaration.prototype.update >diff --git a/Source/WebInspectorUI/UserInterface/Base/Setting.js b/Source/WebInspectorUI/UserInterface/Base/Setting.js >index c9d5140f19148e1320abb07cdbf107d92cf68499..0a8415aae2b262385f8ae9d0e9ad82974f39ceb4 100644 >--- a/Source/WebInspectorUI/UserInterface/Base/Setting.js >+++ b/Source/WebInspectorUI/UserInterface/Base/Setting.js >@@ -37,9 +37,7 @@ WI.Setting = class Setting extends WI.Object > > this._name = name; > >- let inspectionLevel = InspectorFrontendHost ? InspectorFrontendHost.inspectionLevel() : 1; >- let levelString = inspectionLevel > 1 ? "-" + inspectionLevel : ""; >- this._localStorageKey = `com.apple.WebInspector${levelString}.${name}`; >+ this._localStorageKey = WI.Setting._localStorageKey(this._name); > this._defaultValue = defaultValue; > } > >@@ -47,17 +45,26 @@ WI.Setting = class Setting extends WI.Object > > static migrateValue(key) > { >+ let localStorageKey = WI.Setting._localStorageKey(key); >+ > let value = undefined; >- if (!window.InspectorTest && window.localStorage && key in window.localStorage) { >+ if (!window.InspectorTest && window.localStorage && localStorageKey in window.localStorage) { > try { >- value = JSON.parse(window.localStorage[key]); >+ value = JSON.parse(window.localStorage[localStorageKey]); > } catch { } > >- window.localStorage.removeItem(key); >+ window.localStorage.removeItem(localStorageKey); > } > return value; > } > >+ static _localStorageKey(name) >+ { >+ let inspectionLevel = InspectorFrontendHost ? InspectorFrontendHost.inspectionLevel() : 1; >+ let levelString = inspectionLevel > 1 ? "-" + inspectionLevel : ""; >+ return `com.apple.WebInspector${levelString}.${name}`; >+ } >+ > // Public > > get name()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193814
: 360082