chrome-devtools-frontend 1.0.1039140 → 1.0.1040170
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/sdk/CSSMatchedStyles.ts +32 -36
- package/front_end/core/sdk/CSSProperty.ts +26 -2
- package/front_end/core/sdk/CSSStyleDeclaration.ts +3 -19
- package/front_end/panels/application/AppManifestView.ts +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +26 -2
- package/front_end/panels/application/IndexedDBModel.ts +68 -41
- package/front_end/panels/application/IndexedDBViews.ts +3 -1
- package/front_end/panels/elements/StylePropertiesSection.ts +1 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +6 -7
- package/front_end/panels/elements/StylesSidebarPane.ts +5 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -0
- package/front_end/panels/settings/keybindsSettingsTab.css +4 -0
- package/front_end/ui/legacy/ReportView.ts +7 -0
- package/package.json +1 -1
@@ -5,7 +5,7 @@
|
|
5
5
|
import * as Protocol from '../../generated/protocol.js';
|
6
6
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
7
7
|
|
8
|
-
import {cssMetadata,
|
8
|
+
import {cssMetadata, VariableRegex} from './CSSMetadata.js';
|
9
9
|
|
10
10
|
import {type CSSModel} from './CSSModel.js';
|
11
11
|
import {type CSSProperty} from './CSSProperty.js';
|
@@ -618,7 +618,8 @@ class NodeCascade {
|
|
618
618
|
this.propertiesState.clear();
|
619
619
|
this.activeProperties.clear();
|
620
620
|
|
621
|
-
for (
|
621
|
+
for (let i = this.styles.length - 1; i >= 0; i--) {
|
622
|
+
const style = this.styles[i];
|
622
623
|
const rule = style.parentRule;
|
623
624
|
// Compute cascade for CSSStyleRules only.
|
624
625
|
if (rule && !(rule instanceof CSSStyleRule)) {
|
@@ -637,44 +638,43 @@ class NodeCascade {
|
|
637
638
|
continue;
|
638
639
|
}
|
639
640
|
|
640
|
-
|
641
|
-
|
641
|
+
// When a property does not have a range in an otherwise ranged CSSStyleDeclaration,
|
642
|
+
// we consider it as a non-leading property (see computeLeadingProperties()), and most
|
643
|
+
// of them are computed longhands. We exclude these from activeProperties calculation,
|
644
|
+
// and use parsed longhands instead (see below).
|
645
|
+
if (style.range && !property.range) {
|
642
646
|
continue;
|
643
647
|
}
|
644
648
|
|
645
|
-
|
646
|
-
const isPropShorthand = Boolean(metadata.getLonghands(canonicalName));
|
647
|
-
|
648
|
-
if (isPropShorthand) {
|
649
|
-
const longhandsFromShort =
|
650
|
-
(property.value.match(CustomVariableRegex) || []).map(e => e.replace(CustomVariableRegex, '$2'));
|
651
|
-
longhandsFromShort.forEach(longhandProperty => {
|
652
|
-
if (metadata.isCSSPropertyName(longhandProperty)) {
|
653
|
-
const activeProperty = this.activeProperties.get(longhandProperty);
|
654
|
-
if (!activeProperty) {
|
655
|
-
this.activeProperties.set(longhandProperty, property);
|
656
|
-
} else {
|
657
|
-
this.propertiesState.set(activeProperty, PropertyState.Overloaded);
|
658
|
-
this.activeProperties.set(longhandProperty, property);
|
659
|
-
}
|
660
|
-
}
|
661
|
-
});
|
662
|
-
}
|
663
|
-
|
664
|
-
const activeProperty = this.activeProperties.get(canonicalName);
|
665
|
-
if (activeProperty && (activeProperty.important || !property.important)) {
|
649
|
+
if (!property.activeInStyle()) {
|
666
650
|
this.propertiesState.set(property, PropertyState.Overloaded);
|
667
651
|
continue;
|
668
652
|
}
|
669
653
|
|
670
|
-
|
671
|
-
|
654
|
+
const canonicalName = metadata.canonicalPropertyName(property.name);
|
655
|
+
this.updatePropertyState(property, canonicalName);
|
656
|
+
for (const longhand of property.getLonghandProperties()) {
|
657
|
+
if (metadata.isCSSPropertyName(longhand.name)) {
|
658
|
+
this.updatePropertyState(longhand, longhand.name);
|
659
|
+
}
|
672
660
|
}
|
673
|
-
this.propertiesState.set(property, PropertyState.Active);
|
674
|
-
this.activeProperties.set(canonicalName, property);
|
675
661
|
}
|
676
662
|
}
|
677
663
|
}
|
664
|
+
|
665
|
+
private updatePropertyState(propertyWithHigherSpecificity: CSSProperty, canonicalName: string): void {
|
666
|
+
const activeProperty = this.activeProperties.get(canonicalName);
|
667
|
+
if (activeProperty?.important && !propertyWithHigherSpecificity.important) {
|
668
|
+
this.propertiesState.set(propertyWithHigherSpecificity, PropertyState.Overloaded);
|
669
|
+
return;
|
670
|
+
}
|
671
|
+
|
672
|
+
if (activeProperty) {
|
673
|
+
this.propertiesState.set(activeProperty, PropertyState.Overloaded);
|
674
|
+
}
|
675
|
+
this.propertiesState.set(propertyWithHigherSpecificity, PropertyState.Active);
|
676
|
+
this.activeProperties.set(canonicalName, propertyWithHigherSpecificity);
|
677
|
+
}
|
678
678
|
}
|
679
679
|
|
680
680
|
class DOMInheritanceCascade {
|
@@ -841,9 +841,7 @@ class DOMInheritanceCascade {
|
|
841
841
|
const activeProperties = new Map<string, CSSProperty>();
|
842
842
|
for (const nodeCascade of this.#nodeCascades) {
|
843
843
|
nodeCascade.computeActiveProperties();
|
844
|
-
for (const
|
845
|
-
const property = (entry[0] as CSSProperty);
|
846
|
-
const state = (entry[1] as PropertyState);
|
844
|
+
for (const [property, state] of nodeCascade.propertiesState) {
|
847
845
|
if (state === PropertyState.Overloaded) {
|
848
846
|
this.#propertiesState.set(property, PropertyState.Overloaded);
|
849
847
|
continue;
|
@@ -858,11 +856,9 @@ class DOMInheritanceCascade {
|
|
858
856
|
}
|
859
857
|
}
|
860
858
|
// If every longhand of the shorthand is not active, then the shorthand is not active too.
|
861
|
-
for (const
|
862
|
-
const canonicalName = (entry[0] as string);
|
863
|
-
const shorthandProperty = (entry[1] as CSSProperty);
|
859
|
+
for (const [canonicalName, shorthandProperty] of activeProperties) {
|
864
860
|
const shorthandStyle = shorthandProperty.ownerStyle;
|
865
|
-
const longhands =
|
861
|
+
const longhands = shorthandProperty.getLonghandProperties();
|
866
862
|
if (!longhands.length) {
|
867
863
|
continue;
|
868
864
|
}
|
@@ -27,10 +27,12 @@ export class CSSProperty {
|
|
27
27
|
#nameRangeInternal: TextUtils.TextRange.TextRange|null;
|
28
28
|
#valueRangeInternal: TextUtils.TextRange.TextRange|null;
|
29
29
|
#invalidString?: Common.UIString.LocalizedString;
|
30
|
+
#longhandProperties: CSSProperty[] = [];
|
30
31
|
|
31
32
|
constructor(
|
32
33
|
ownerStyle: CSSStyleDeclaration, index: number, name: string, value: string, important: boolean,
|
33
|
-
disabled: boolean, parsedOk: boolean, implicit: boolean, text?: string|null, range?: Protocol.CSS.SourceRange
|
34
|
+
disabled: boolean, parsedOk: boolean, implicit: boolean, text?: string|null, range?: Protocol.CSS.SourceRange,
|
35
|
+
longhandProperties?: Protocol.CSS.CSSProperty[]) {
|
34
36
|
this.ownerStyle = ownerStyle;
|
35
37
|
this.index = index;
|
36
38
|
this.name = name;
|
@@ -44,6 +46,24 @@ export class CSSProperty {
|
|
44
46
|
this.#active = true;
|
45
47
|
this.#nameRangeInternal = null;
|
46
48
|
this.#valueRangeInternal = null;
|
49
|
+
|
50
|
+
if (longhandProperties && longhandProperties.length > 0) {
|
51
|
+
for (const property of longhandProperties) {
|
52
|
+
this.#longhandProperties.push(new CSSProperty(
|
53
|
+
ownerStyle, this.#longhandProperties.length, property.name, property.value, important, disabled, parsedOk,
|
54
|
+
true));
|
55
|
+
}
|
56
|
+
} else {
|
57
|
+
// Blink would not parse shorthands containing 'var()' functions:
|
58
|
+
// https://drafts.csswg.org/css-variables/#variables-in-shorthands).
|
59
|
+
// Therefore we manually check if the current property is a shorthand,
|
60
|
+
// and fills its longhand components with empty values.
|
61
|
+
const longhandNames = cssMetadata().getLonghands(name);
|
62
|
+
for (const longhandName of longhandNames || []) {
|
63
|
+
this.#longhandProperties.push(new CSSProperty(
|
64
|
+
ownerStyle, this.#longhandProperties.length, longhandName, '', important, disabled, parsedOk, true));
|
65
|
+
}
|
66
|
+
}
|
47
67
|
}
|
48
68
|
|
49
69
|
static parsePayload(ownerStyle: CSSStyleDeclaration, index: number, payload: Protocol.CSS.CSSProperty): CSSProperty {
|
@@ -55,7 +75,7 @@ export class CSSProperty {
|
|
55
75
|
const result = new CSSProperty(
|
56
76
|
ownerStyle, index, payload.name, payload.value, payload.important || false, payload.disabled || false,
|
57
77
|
('parsedOk' in payload) ? Boolean(payload.parsedOk) : true, Boolean(payload.implicit), payload.text,
|
58
|
-
payload.range);
|
78
|
+
payload.range, payload.longhandProperties);
|
59
79
|
return result;
|
60
80
|
}
|
61
81
|
|
@@ -302,4 +322,8 @@ export class CSSProperty {
|
|
302
322
|
getInvalidStringForInvalidProperty(): Common.UIString.LocalizedString|undefined {
|
303
323
|
return this.#invalidString;
|
304
324
|
}
|
325
|
+
|
326
|
+
getLonghandProperties(): CSSProperty[] {
|
327
|
+
return this.#longhandProperties;
|
328
|
+
}
|
305
329
|
}
|
@@ -62,19 +62,15 @@ export class CSSStyleDeclaration {
|
|
62
62
|
|
63
63
|
if (payload.cssText && this.range) {
|
64
64
|
const cssText = new TextUtils.Text.Text(payload.cssText);
|
65
|
-
let start:
|
66
|
-
line: number,
|
67
|
-
column: number,
|
68
|
-
}|{
|
69
|
-
line: number,
|
70
|
-
column: number,
|
71
|
-
} = {line: this.range.startLine, column: this.range.startColumn};
|
65
|
+
let start = {line: this.range.startLine, column: this.range.startColumn};
|
72
66
|
for (const cssProperty of payload.cssProperties) {
|
73
67
|
const range = cssProperty.range;
|
74
68
|
if (range) {
|
75
69
|
parseUnusedText.call(this, cssText, start.line, start.column, range.startLine, range.startColumn);
|
76
70
|
start = {line: range.endLine, column: range.endColumn};
|
77
71
|
}
|
72
|
+
// TODO(changhaohan): we should try not including longhand properties anymore, because
|
73
|
+
// they are already included in the longhandProperties field in a shorthand property.
|
78
74
|
this.#allPropertiesInternal.push(
|
79
75
|
CSSProperty.parsePayload(this, this.#allPropertiesInternal.length, cssProperty));
|
80
76
|
}
|
@@ -303,18 +299,6 @@ export class CSSStyleDeclaration {
|
|
303
299
|
return property ? property.implicit : false;
|
304
300
|
}
|
305
301
|
|
306
|
-
longhandProperties(name: string): CSSProperty[] {
|
307
|
-
const longhands = cssMetadata().getLonghands(name.toLowerCase());
|
308
|
-
const result = [];
|
309
|
-
for (let i = 0; longhands && i < longhands.length; ++i) {
|
310
|
-
const property = this.#activePropertyMap.get(longhands[i]);
|
311
|
-
if (property) {
|
312
|
-
result.push(property);
|
313
|
-
}
|
314
|
-
}
|
315
|
-
return result;
|
316
|
-
}
|
317
|
-
|
318
302
|
propertyAt(index: number): CSSProperty|null {
|
319
303
|
return (index < this.allProperties().length) ? this.allProperties()[index] : null;
|
320
304
|
}
|
@@ -458,7 +458,7 @@ export class AppManifestView extends UI.Widget.VBox implements SDK.TargetManager
|
|
458
458
|
this.presentationSection = this.reportView.appendSection(i18nString(UIStrings.presentation));
|
459
459
|
this.protocolHandlersSection = this.reportView.appendSection(i18nString(UIStrings.protocolHandlers));
|
460
460
|
this.protocolHandlersView = new ApplicationComponents.ProtocolHandlersView.ProtocolHandlersView();
|
461
|
-
this.protocolHandlersSection.
|
461
|
+
this.protocolHandlersSection.appendFieldWithCustomView(this.protocolHandlersView);
|
462
462
|
this.iconsSection = this.reportView.appendSection(i18nString(UIStrings.icons), 'report-section-icons');
|
463
463
|
this.shortcutSections = [];
|
464
464
|
this.screenshotsSections = [];
|
@@ -981,7 +981,8 @@ export class AppManifestTreeElement extends ApplicationPanelTreeElement {
|
|
981
981
|
for (const section of staticSections) {
|
982
982
|
const sectionElement = section.getTitleElement();
|
983
983
|
const childTitle = section.title();
|
984
|
-
const
|
984
|
+
const sectionFieldElement = section.getFieldElement();
|
985
|
+
const child = new ManifestChildTreeElement(this.resourcesPanel, sectionElement, childTitle, sectionFieldElement);
|
985
986
|
this.appendChild(child);
|
986
987
|
}
|
987
988
|
}
|
@@ -998,12 +999,15 @@ export class AppManifestTreeElement extends ApplicationPanelTreeElement {
|
|
998
999
|
|
999
1000
|
export class ManifestChildTreeElement extends ApplicationPanelTreeElement {
|
1000
1001
|
#sectionElement: Element;
|
1001
|
-
|
1002
|
+
#sectionFieldElement: HTMLElement;
|
1003
|
+
constructor(storagePanel: ResourcesPanel, element: Element, childTitle: string, fieldElement: HTMLElement) {
|
1002
1004
|
super(storagePanel, childTitle, false);
|
1003
1005
|
const icon = UI.Icon.Icon.create('mediumicon-manifest', 'resource-tree-item');
|
1004
1006
|
this.setLeadingIcons([icon]);
|
1005
1007
|
this.#sectionElement = element;
|
1008
|
+
this.#sectionFieldElement = fieldElement;
|
1006
1009
|
self.onInvokeElement(this.listItemElement, this.onInvoke.bind(this));
|
1010
|
+
this.listItemElement.addEventListener('keydown', this.onInvokeElementKeydown.bind(this));
|
1007
1011
|
UI.ARIAUtils.setAccessibleName(
|
1008
1012
|
this.listItemElement, i18nString(UIStrings.beforeInvokeAlert, {PH1: this.listItemElement.title}));
|
1009
1013
|
}
|
@@ -1018,6 +1022,26 @@ export class ManifestChildTreeElement extends ApplicationPanelTreeElement {
|
|
1018
1022
|
UI.ARIAUtils.alert(i18nString(UIStrings.onInvokeAlert, {PH1: this.listItemElement.title}));
|
1019
1023
|
Host.userMetrics.manifestSectionSelected(this.listItemElement.title);
|
1020
1024
|
}
|
1025
|
+
// direct focus to the corresponding element
|
1026
|
+
onInvokeElementKeydown(event: KeyboardEvent): void {
|
1027
|
+
if (event.key !== 'Tab' || event.shiftKey) {
|
1028
|
+
return;
|
1029
|
+
}
|
1030
|
+
const checkBoxElement = this.#sectionFieldElement.querySelector('.mask-checkbox');
|
1031
|
+
let focusableElement: HTMLElement|null = this.#sectionFieldElement.querySelector('[tabindex="0"]');
|
1032
|
+
if (checkBoxElement && checkBoxElement.shadowRoot) {
|
1033
|
+
focusableElement = checkBoxElement.shadowRoot.querySelector('input') || null;
|
1034
|
+
} else if (!focusableElement) {
|
1035
|
+
// special case for protocol handler section since it is a custom Element and has different structure than the others
|
1036
|
+
focusableElement = this.#sectionFieldElement.querySelector('devtools-protocol-handlers-view')
|
1037
|
+
?.shadowRoot?.querySelector('[tabindex="0"]') ||
|
1038
|
+
null;
|
1039
|
+
}
|
1040
|
+
if (focusableElement) {
|
1041
|
+
focusableElement?.focus();
|
1042
|
+
event.consume(true);
|
1043
|
+
}
|
1044
|
+
}
|
1021
1045
|
}
|
1022
1046
|
|
1023
1047
|
export class ClearStorageTreeElement extends ApplicationPanelTreeElement {
|
@@ -176,9 +176,11 @@ export class IndexedDBModel extends SDK.SDKModel.SDKModel<EventTypes> implements
|
|
176
176
|
if (!this.enabled) {
|
177
177
|
return;
|
178
178
|
}
|
179
|
-
|
180
|
-
|
181
|
-
|
179
|
+
if (databaseId.securityOrigin) {
|
180
|
+
await this.indexedDBAgent.invoke_deleteDatabase(
|
181
|
+
{securityOrigin: databaseId.securityOrigin, databaseName: databaseId.name});
|
182
|
+
void this.loadDatabaseNames(databaseId.securityOrigin);
|
183
|
+
}
|
182
184
|
}
|
183
185
|
|
184
186
|
async refreshDatabaseNames(): Promise<void> {
|
@@ -193,14 +195,18 @@ export class IndexedDBModel extends SDK.SDKModel.SDKModel<EventTypes> implements
|
|
193
195
|
}
|
194
196
|
|
195
197
|
async clearObjectStore(databaseId: DatabaseId, objectStoreName: string): Promise<void> {
|
196
|
-
|
197
|
-
|
198
|
+
if (databaseId.securityOrigin) {
|
199
|
+
await this.indexedDBAgent.invoke_clearObjectStore(
|
200
|
+
{securityOrigin: databaseId.securityOrigin, databaseName: databaseId.name, objectStoreName});
|
201
|
+
}
|
198
202
|
}
|
199
203
|
|
200
204
|
async deleteEntries(databaseId: DatabaseId, objectStoreName: string, idbKeyRange: IDBKeyRange): Promise<void> {
|
201
205
|
const keyRange = IndexedDBModel.keyRangeFromIDBKeyRange(idbKeyRange);
|
202
|
-
|
203
|
-
|
206
|
+
if (databaseId.securityOrigin) {
|
207
|
+
await this.indexedDBAgent.invoke_deleteObjectStoreEntries(
|
208
|
+
{securityOrigin: databaseId.securityOrigin, databaseName: databaseId.name, objectStoreName, keyRange});
|
209
|
+
}
|
204
210
|
}
|
205
211
|
|
206
212
|
private securityOriginAdded(event: Common.EventTarget.EventTargetEvent<string>): void {
|
@@ -259,19 +265,19 @@ export class IndexedDBModel extends SDK.SDKModel.SDKModel<EventTypes> implements
|
|
259
265
|
for (const securityOrigin in this.databaseNamesBySecurityOrigin) {
|
260
266
|
const databaseNames = this.databaseNamesBySecurityOrigin[securityOrigin];
|
261
267
|
for (let i = 0; i < databaseNames.length; ++i) {
|
262
|
-
result.push(new DatabaseId(securityOrigin, databaseNames[i]));
|
268
|
+
result.push(new DatabaseId(securityOrigin, undefined, databaseNames[i]));
|
263
269
|
}
|
264
270
|
}
|
265
271
|
return result;
|
266
272
|
}
|
267
273
|
|
268
274
|
private databaseAdded(securityOrigin: string, databaseName: string): void {
|
269
|
-
const databaseId = new DatabaseId(securityOrigin, databaseName);
|
275
|
+
const databaseId = new DatabaseId(securityOrigin, undefined, databaseName);
|
270
276
|
this.dispatchEventToListeners(Events.DatabaseAdded, {model: this, databaseId: databaseId});
|
271
277
|
}
|
272
278
|
|
273
279
|
private databaseRemoved(securityOrigin: string, databaseName: string): void {
|
274
|
-
const databaseId = new DatabaseId(securityOrigin, databaseName);
|
280
|
+
const databaseId = new DatabaseId(securityOrigin, undefined, databaseName);
|
275
281
|
this.dispatchEventToListeners(Events.DatabaseRemoved, {model: this, databaseId: databaseId});
|
276
282
|
}
|
277
283
|
|
@@ -288,15 +294,20 @@ export class IndexedDBModel extends SDK.SDKModel.SDKModel<EventTypes> implements
|
|
288
294
|
}
|
289
295
|
|
290
296
|
private async loadDatabase(databaseId: DatabaseId, entriesUpdated: boolean): Promise<void> {
|
291
|
-
|
292
|
-
|
297
|
+
let databaseWithObjectStores: Protocol.IndexedDB.DatabaseWithObjectStores|null = null;
|
298
|
+
if (databaseId.securityOrigin) {
|
299
|
+
databaseWithObjectStores = (await this.indexedDBAgent.invoke_requestDatabase({
|
300
|
+
securityOrigin: databaseId.securityOrigin,
|
301
|
+
databaseName: databaseId.name,
|
302
|
+
})).databaseWithObjectStores;
|
303
|
+
if (!this.databaseNamesBySecurityOrigin[databaseId.securityOrigin]) {
|
304
|
+
return;
|
305
|
+
}
|
306
|
+
}
|
293
307
|
|
294
308
|
if (!databaseWithObjectStores) {
|
295
309
|
return;
|
296
310
|
}
|
297
|
-
if (!this.databaseNamesBySecurityOrigin[databaseId.securityOrigin]) {
|
298
|
-
return;
|
299
|
-
}
|
300
311
|
|
301
312
|
const databaseModel = new Database(databaseId, databaseWithObjectStores.version);
|
302
313
|
this.databasesInternal.set(databaseId, databaseModel);
|
@@ -334,44 +345,58 @@ export class IndexedDBModel extends SDK.SDKModel.SDKModel<EventTypes> implements
|
|
334
345
|
idbKeyRange: IDBKeyRange|null, skipCount: number, pageSize: number,
|
335
346
|
callback: (arg0: Array<Entry>, arg1: boolean) => void): Promise<void> {
|
336
347
|
const keyRange = idbKeyRange ? IndexedDBModel.keyRangeFromIDBKeyRange(idbKeyRange) : undefined;
|
348
|
+
const runtimeModel = this.target().model(SDK.RuntimeModel.RuntimeModel);
|
349
|
+
let response: Protocol.IndexedDB.RequestDataResponse|null = null;
|
350
|
+
|
351
|
+
if (databaseId.securityOrigin) {
|
352
|
+
response = await this.indexedDBAgent.invoke_requestData({
|
353
|
+
securityOrigin: databaseId.securityOrigin,
|
354
|
+
databaseName,
|
355
|
+
objectStoreName,
|
356
|
+
indexName,
|
357
|
+
skipCount,
|
358
|
+
pageSize,
|
359
|
+
keyRange,
|
360
|
+
});
|
361
|
+
if (!runtimeModel || !this.databaseNamesBySecurityOrigin[databaseId.securityOrigin]) {
|
362
|
+
return;
|
363
|
+
}
|
364
|
+
}
|
337
365
|
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
objectStoreName,
|
342
|
-
indexName,
|
343
|
-
skipCount,
|
344
|
-
pageSize,
|
345
|
-
keyRange,
|
346
|
-
});
|
347
|
-
|
366
|
+
if (!response) {
|
367
|
+
return;
|
368
|
+
}
|
348
369
|
if (response.getError()) {
|
349
370
|
console.error('IndexedDBAgent error: ' + response.getError());
|
350
371
|
return;
|
351
372
|
}
|
352
373
|
|
353
|
-
const runtimeModel = this.target().model(SDK.RuntimeModel.RuntimeModel);
|
354
|
-
if (!runtimeModel || !this.databaseNamesBySecurityOrigin[databaseId.securityOrigin]) {
|
355
|
-
return;
|
356
|
-
}
|
357
374
|
const dataEntries = response.objectStoreDataEntries;
|
358
375
|
const entries = [];
|
359
376
|
for (const dataEntry of dataEntries) {
|
360
|
-
const key = runtimeModel
|
361
|
-
const primaryKey = runtimeModel
|
362
|
-
const value = runtimeModel
|
377
|
+
const key = runtimeModel?.createRemoteObject(dataEntry.key);
|
378
|
+
const primaryKey = runtimeModel?.createRemoteObject(dataEntry.primaryKey);
|
379
|
+
const value = runtimeModel?.createRemoteObject(dataEntry.value);
|
380
|
+
if (!key || !primaryKey || !value) {
|
381
|
+
return;
|
382
|
+
}
|
363
383
|
entries.push(new Entry(key, primaryKey, value));
|
364
384
|
}
|
365
385
|
callback(entries, response.hasMore);
|
366
386
|
}
|
367
387
|
|
368
388
|
async getMetadata(databaseId: DatabaseId, objectStore: ObjectStore): Promise<ObjectStoreMetadata|null> {
|
369
|
-
const databaseOrigin = databaseId.securityOrigin;
|
370
389
|
const databaseName = databaseId.name;
|
371
390
|
const objectStoreName = objectStore.name;
|
372
|
-
|
373
|
-
|
391
|
+
let response: Protocol.IndexedDB.GetMetadataResponse|null = null;
|
392
|
+
if (databaseId.securityOrigin) {
|
393
|
+
response = await this.indexedDBAgent.invoke_getMetadata(
|
394
|
+
{securityOrigin: databaseId.securityOrigin, databaseName, objectStoreName});
|
395
|
+
}
|
374
396
|
|
397
|
+
if (!response) {
|
398
|
+
return null;
|
399
|
+
}
|
375
400
|
if (response.getError()) {
|
376
401
|
console.error('IndexedDBAgent error: ' + response.getError());
|
377
402
|
return null;
|
@@ -382,7 +407,7 @@ export class IndexedDBModel extends SDK.SDKModel.SDKModel<EventTypes> implements
|
|
382
407
|
private async refreshDatabaseList(securityOrigin: string): Promise<void> {
|
383
408
|
const databaseNames = await this.loadDatabaseNames(securityOrigin);
|
384
409
|
for (const databaseName of databaseNames) {
|
385
|
-
void this.loadDatabase(new DatabaseId(securityOrigin, databaseName), false);
|
410
|
+
void this.loadDatabase(new DatabaseId(securityOrigin, undefined, databaseName), false);
|
386
411
|
}
|
387
412
|
}
|
388
413
|
|
@@ -400,7 +425,7 @@ export class IndexedDBModel extends SDK.SDKModel.SDKModel<EventTypes> implements
|
|
400
425
|
|
401
426
|
indexedDBContentUpdated({origin: securityOrigin, databaseName, objectStoreName}:
|
402
427
|
Protocol.Storage.IndexedDBContentUpdatedEvent): void {
|
403
|
-
const databaseId = new DatabaseId(securityOrigin, databaseName);
|
428
|
+
const databaseId = new DatabaseId(securityOrigin, undefined, databaseName);
|
404
429
|
this.dispatchEventToListeners(
|
405
430
|
Events.IndexedDBContentUpdated, {databaseId: databaseId, objectStoreName: objectStoreName, model: this});
|
406
431
|
}
|
@@ -450,15 +475,17 @@ export class Entry {
|
|
450
475
|
}
|
451
476
|
|
452
477
|
export class DatabaseId {
|
453
|
-
securityOrigin
|
478
|
+
readonly securityOrigin?: string;
|
479
|
+
readonly storageKey?: string;
|
454
480
|
name: string;
|
455
|
-
constructor(securityOrigin: string, name: string) {
|
456
|
-
this.securityOrigin = securityOrigin;
|
481
|
+
constructor(securityOrigin: string|undefined, storageKey: string|undefined, name: string) {
|
482
|
+
securityOrigin ? this.securityOrigin = securityOrigin : (storageKey ? this.storageKey = storageKey : undefined);
|
457
483
|
this.name = name;
|
458
484
|
}
|
459
485
|
|
460
486
|
equals(databaseId: DatabaseId): boolean {
|
461
|
-
return this.name === databaseId.name && this.securityOrigin === databaseId.securityOrigin
|
487
|
+
return this.name === databaseId.name && this.securityOrigin === databaseId.securityOrigin &&
|
488
|
+
this.storageKey === databaseId.storageKey;
|
462
489
|
}
|
463
490
|
}
|
464
491
|
|
@@ -198,7 +198,9 @@ export class IDBDatabaseView extends UI.Widget.VBox {
|
|
198
198
|
}
|
199
199
|
|
200
200
|
private refreshDatabase(): void {
|
201
|
-
|
201
|
+
if (this.database.databaseId.securityOrigin) {
|
202
|
+
this.securityOriginElement.textContent = this.database.databaseId.securityOrigin;
|
203
|
+
}
|
202
204
|
if (this.versionElement) {
|
203
205
|
this.versionElement.textContent = this.database.version.toString();
|
204
206
|
}
|
@@ -971,7 +971,7 @@ export class StylePropertiesSection {
|
|
971
971
|
break;
|
972
972
|
}
|
973
973
|
count++;
|
974
|
-
const isShorthand =
|
974
|
+
const isShorthand = property.getLonghandProperties().length > 0;
|
975
975
|
const inherited = this.isPropertyInherited(property.name);
|
976
976
|
const overloaded = this.isPropertyOverloaded(property);
|
977
977
|
if (style.parentRule && style.parentRule.isUserAgent() && inherited) {
|
@@ -558,19 +558,19 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
558
558
|
return;
|
559
559
|
}
|
560
560
|
|
561
|
-
const longhandProperties = this.
|
561
|
+
const longhandProperties = this.property.getLonghandProperties();
|
562
562
|
const leadingProperties = this.style.leadingProperties();
|
563
563
|
|
564
|
-
for (
|
565
|
-
const name =
|
564
|
+
for (const property of longhandProperties) {
|
565
|
+
const name = property.name;
|
566
566
|
let inherited = false;
|
567
567
|
let overloaded = false;
|
568
568
|
|
569
569
|
const section = this.section();
|
570
570
|
if (section) {
|
571
571
|
inherited = section.isPropertyInherited(name);
|
572
|
-
overloaded =
|
573
|
-
SDK.CSSMatchedStyles.PropertyState.Overloaded;
|
572
|
+
overloaded =
|
573
|
+
this.matchedStylesInternal.propertyState(property) === SDK.CSSMatchedStyles.PropertyState.Overloaded;
|
574
574
|
}
|
575
575
|
|
576
576
|
const leadingProperty = leadingProperties.find(property => property.name === name && property.activeInStyle());
|
@@ -579,8 +579,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
579
579
|
}
|
580
580
|
|
581
581
|
const item = new StylePropertyTreeElement(
|
582
|
-
this.parentPaneInternal, this.matchedStylesInternal,
|
583
|
-
false);
|
582
|
+
this.parentPaneInternal, this.matchedStylesInternal, property, false, inherited, overloaded, false);
|
584
583
|
item.setComputedStyles(this.computedStyles);
|
585
584
|
item.setParentsComputedStyles(this.parentsComputedStyles);
|
586
585
|
this.appendChild(item);
|
@@ -1396,7 +1396,11 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
1396
1396
|
button.setToggleWithDot(true);
|
1397
1397
|
|
1398
1398
|
button.element.addEventListener('click', event => {
|
1399
|
-
const
|
1399
|
+
const boundingRect = button.element.getBoundingClientRect();
|
1400
|
+
const menu = new UI.ContextMenu.ContextMenu(event, {
|
1401
|
+
x: boundingRect.left,
|
1402
|
+
y: boundingRect.bottom,
|
1403
|
+
});
|
1400
1404
|
const preferredColorScheme = prefersColorSchemeSetting.get();
|
1401
1405
|
const isLightColorScheme = preferredColorScheme === 'light';
|
1402
1406
|
const isDarkColorScheme = preferredColorScheme === 'dark';
|
@@ -461,6 +461,7 @@ export class ShortcutListItem {
|
|
461
461
|
private createIconButton(label: string, iconName: string, className: string, listener: () => void):
|
462
462
|
HTMLButtonElement {
|
463
463
|
const button = document.createElement('button') as HTMLButtonElement;
|
464
|
+
button.setAttribute('title', label);
|
464
465
|
button.appendChild(UI.Icon.Icon.create(iconName));
|
465
466
|
button.addEventListener('click', listener);
|
466
467
|
UI.ARIAUtils.setAccessibleName(button, label);
|
@@ -130,6 +130,13 @@ export class Section extends VBox {
|
|
130
130
|
return this.titleElement;
|
131
131
|
}
|
132
132
|
|
133
|
+
getFieldElement(): HTMLElement {
|
134
|
+
return this.fieldList;
|
135
|
+
}
|
136
|
+
appendFieldWithCustomView(customElement: HTMLElement): void {
|
137
|
+
this.fieldList.append(customElement);
|
138
|
+
}
|
139
|
+
|
133
140
|
setTitle(title: string, tooltip?: string): void {
|
134
141
|
if (this.titleElement.textContent !== title) {
|
135
142
|
this.titleElement.textContent = title;
|
package/package.json
CHANGED