chrome-devtools-frontend 1.0.1730971 → 1.0.1732418
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/Tests.js +20 -0
- package/front_end/core/host/AidaClient.ts +47 -3
- package/front_end/core/host/AidaClientTypes.ts +8 -1
- package/front_end/core/host/AidaGcaTranslation.ts +1 -1
- package/front_end/core/sdk/NetworkManager.ts +2 -1
- package/front_end/generated/Deprecation.ts +0 -8
- package/front_end/generated/InspectorBackendCommands.ts +2 -1
- package/front_end/generated/protocol.ts +9 -0
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/contexts/LighthouseContext.snapshot.txt +6 -1
- package/front_end/models/ai_assistance/contexts/LighthouseContext.ts +4 -3
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +91 -11
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +90 -43
- package/front_end/models/ai_assistance/skills/styling.md +4 -2
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +31 -36
- package/front_end/models/bindings/CompilerScriptMapping.ts +0 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +0 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -1
- package/front_end/models/har/HARFormat.ts +1 -0
- package/front_end/models/har/Importer.ts +7 -1
- package/front_end/models/har/Log.snapshot.txt +2 -0
- package/front_end/models/har/Log.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.ts +0 -4
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -0
- package/front_end/panels/ai_assistance/components/chatInput.css +1 -1
- package/front_end/panels/ai_assistance/components/exploreWidget.css +1 -1
- package/front_end/panels/animation/animationTimeline.css +11 -9
- package/front_end/panels/application/IndexedDBViews.ts +2 -2
- package/front_end/panels/application/PrivateVerificationTokensView.ts +217 -9
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/application/ServiceWorkersView.ts +1 -1
- package/front_end/panels/application/StorageView.ts +1 -1
- package/front_end/panels/application/appManifestView.css +0 -6
- package/front_end/panels/application/backgroundServiceView.css +0 -21
- package/front_end/panels/application/components/backForwardCacheView.css +1 -9
- package/front_end/panels/application/components/endpointsGrid.css +1 -1
- package/front_end/panels/application/components/permissionsPolicySection.css +1 -1
- package/front_end/panels/application/cookieItemsView.css +0 -1
- package/front_end/panels/application/frameDetailsReportView.css +0 -10
- package/front_end/panels/application/indexedDBViews.css +0 -6
- package/front_end/panels/application/privateVerificationTokensView.css +12 -0
- package/front_end/panels/application/resourcesPanel.css +0 -14
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +4 -4
- package/front_end/panels/application/serviceWorkersView.css +1 -1
- package/front_end/panels/changes/CombinedDiffView.ts +1 -1
- package/front_end/panels/comments/CommentsPane.ts +5 -0
- package/front_end/panels/common/CommentsOverlayWidget.ts +337 -117
- package/front_end/panels/console/consoleView.css +5 -3
- package/front_end/panels/coverage/CoverageView.ts +0 -1
- package/front_end/panels/coverage/coverageView.css +4 -3
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +0 -1
- package/front_end/panels/elements/AccessibilityTreeView.ts +1 -1
- package/front_end/panels/elements/CSSValueTraceView.ts +2 -4
- package/front_end/panels/elements/DOMTreeContextMenu.ts +1 -1
- package/front_end/panels/elements/DOMTreeWidget.ts +14 -0
- package/front_end/panels/elements/MetricsSidebarPane.ts +1 -1
- package/front_end/panels/elements/PlatformFontsWidget.ts +0 -1
- package/front_end/panels/elements/PropertiesWidget.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +2 -0
- package/front_end/panels/elements/WebCustomData.ts +1 -1
- package/front_end/panels/elements/components/cssHintDetailsView.css +1 -1
- package/front_end/panels/elements/components/cssVariableValueView.css +3 -1
- package/front_end/panels/elements/components/elementsTreeExpandButton.css +3 -2
- package/front_end/panels/elements/components/stylePropertyEditor.css +2 -2
- package/front_end/panels/elements/layoutPane.css +1 -1
- package/front_end/panels/elements/metricsSidebarPane.css +4 -4
- package/front_end/panels/elements/platformFontsWidget.css +1 -1
- package/front_end/panels/elements/stylesSidebarPane.css +1 -1
- package/front_end/panels/emulation/DeviceModeView.ts +4 -3
- package/front_end/panels/emulation/deviceModeView.css +6 -7
- package/front_end/panels/event_listeners/eventListenersView.css +4 -4
- package/front_end/panels/explain/components/consoleInsight.css +3 -18
- package/front_end/panels/issues/issuesTree.css +5 -6
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +4 -2
- package/front_end/panels/layer_viewer/TransformController.ts +106 -54
- package/front_end/panels/lighthouse/lighthousePanel.css +4 -7
- package/front_end/panels/lighthouse/lighthouseStartView.css +1 -2
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +4 -4
- package/front_end/panels/media/EventTimelineView.ts +1 -4
- package/front_end/panels/media/TickingFlameChart.ts +3 -2
- package/front_end/panels/media/playerListView.css +6 -3
- package/front_end/panels/media/playerMessagesView.css +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -7
- package/front_end/panels/network/NetworkConfigView.ts +1 -1
- package/front_end/panels/network/binaryResourceView.css +0 -7
- package/front_end/panels/network/networkLogView.css +0 -7
- package/front_end/panels/network/networkTimingTable.css +2 -2
- package/front_end/panels/network/requestConditionsDrawer.css +1 -24
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
- package/front_end/panels/performance_monitor/performanceMonitor.css +1 -1
- package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
- package/front_end/panels/protocol_monitor/protocolMonitor.css +1 -1
- package/front_end/panels/recorder/extensionView.css +1 -1
- package/front_end/panels/recorder/recorderPanel.css +3 -3
- package/front_end/panels/recorder/recordingListView.css +1 -1
- package/front_end/panels/recorder/stepEditor.css +2 -2
- package/front_end/panels/recorder/stepView.css +0 -24
- package/front_end/panels/screencast/screencastView.css +2 -1
- package/front_end/panels/search/searchView.css +4 -3
- package/front_end/panels/security/SecurityPanelSidebar.ts +0 -1
- package/front_end/panels/security/mainView.css +1 -1
- package/front_end/panels/security/originView.css +0 -4
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +2 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +1 -2
- package/front_end/panels/sources/breakpointsView.css +0 -1
- package/front_end/panels/sources/tabbedEditorContainer.css +1 -1
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +2 -2
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +1 -1
- package/front_end/panels/timeline/components/OriginMap.ts +1 -1
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +1 -1
- package/front_end/panels/timeline/components/metricCard.css +1 -1
- package/front_end/panels/timeline/components/networkRequestDetails.css +0 -1
- package/front_end/panels/timeline/components/networkRequestTooltip.css +2 -2
- package/front_end/panels/timeline/timelineFlamechartPopover.css +1 -1
- package/front_end/panels/timeline/timelineHistoryManager.css +1 -1
- package/front_end/panels/timeline/timelineMiniMap.css +1 -1
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
- package/front_end/panels/web_audio/webAudio.css +0 -20
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +166 -8
- package/front_end/ui/comments/CommentOverlayManager.ts +17 -2
- package/front_end/ui/components/diff_view/diffView.css +1 -1
- package/front_end/ui/components/markdown_view/markdownView.css +1 -1
- package/front_end/ui/components/menus/Menu.ts +1 -1
- package/front_end/ui/components/menus/menuItem.css +1 -1
- package/front_end/ui/components/panel_feedback/panelFeedback.css +2 -2
- package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +1 -1
- package/front_end/ui/components/report_view/reportValue.css +5 -2
- package/front_end/ui/components/suggestion_input/suggestionInput.css +4 -4
- package/front_end/ui/legacy/ContextMenu.ts +3 -0
- package/front_end/ui/legacy/GlassPane.ts +3 -3
- package/front_end/ui/legacy/SoftContextMenu.ts +7 -1
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +2 -0
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +7 -6
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -3
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +7 -6
- package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +4 -3
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +3 -3
- package/front_end/ui/legacy/components/source_frame/imageView.css +4 -4
- package/front_end/ui/legacy/components/utils/jsUtils.css +2 -1
- package/front_end/ui/legacy/dropTarget.css +1 -1
- package/front_end/ui/legacy/filter.css +4 -3
- package/front_end/ui/legacy/inspectorCommon.css +8 -23
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
- package/front_end/ui/legacy/suggestBox.css +2 -1
- package/front_end/ui/legacy/toolbar.css +2 -1
- package/front_end/ui/legacy/treeoutline.css +5 -4
- package/front_end/ui/legacy/viewContainers.css +2 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/inspector_overlay/highlight_anchor.ts +8 -11
- package/package.json +1 -1
|
@@ -157,10 +157,6 @@
|
|
|
157
157
|
transform: rotate(0deg);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
.is-start-of-group .chevron {
|
|
161
|
-
top: 34px;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
160
|
.details {
|
|
165
161
|
display: none;
|
|
166
162
|
margin-top: var(--sys-size-5);
|
|
@@ -175,26 +171,6 @@
|
|
|
175
171
|
overflow: auto;
|
|
176
172
|
}
|
|
177
173
|
|
|
178
|
-
devtools-recorder-step-editor {
|
|
179
|
-
border: var(--sys-size-1) solid var(--sys-color-neutral-outline);
|
|
180
|
-
padding: 3px 6px 6px;
|
|
181
|
-
margin-left: calc(-1 * var(--sys-size-4));
|
|
182
|
-
border-radius: 3px;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
devtools-recorder-step-editor:hover {
|
|
186
|
-
border: var(--sys-size-1) solid var(--sys-color-neutral-outline);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
devtools-recorder-step-editor.is-selected {
|
|
190
|
-
background-color: color-mix(
|
|
191
|
-
in srgb,
|
|
192
|
-
var(--sys-color-tonal-container),
|
|
193
|
-
var(--sys-color-cdt-base-container) 50%
|
|
194
|
-
);
|
|
195
|
-
border: var(--sys-size-1) solid var(--sys-color-tonal-outline);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
174
|
.summary {
|
|
199
175
|
display: flex;
|
|
200
176
|
flex-flow: row nowrap;
|
|
@@ -83,7 +83,8 @@
|
|
|
83
83
|
position: absolute;
|
|
84
84
|
bottom: 100%;
|
|
85
85
|
left: var(--sys-size-7);
|
|
86
|
-
border
|
|
86
|
+
/* 6px protruding arrow (--sys-size-4) plus 1px top border overlap (--sys-size-1) = 7px. */
|
|
87
|
+
border: calc(var(--sys-size-4) + var(--sys-size-1)) solid transparent;
|
|
87
88
|
border-bottom-color: var(--sys-color-yellow-container);
|
|
88
89
|
}
|
|
89
90
|
|
|
@@ -87,10 +87,11 @@
|
|
|
87
87
|
.search-toolbar-summary {
|
|
88
88
|
background-color: var(--sys-color-cdt-base-container);
|
|
89
89
|
border-top: var(--sys-size-1) solid var(--sys-color-divider);
|
|
90
|
-
padding-left:
|
|
91
|
-
|
|
90
|
+
padding-left: var(--sys-size-3);
|
|
91
|
+
/* 20px footer bar (--sys-size-9) minus 1px top divider border (--sys-size-1). */
|
|
92
|
+
flex: 0 0 calc(var(--sys-size-9) - var(--sys-size-1));
|
|
92
93
|
display: flex;
|
|
93
|
-
padding-right:
|
|
94
|
+
padding-right: var(--sys-size-3);
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
.search-results:has(.empty-widget-container) + .search-toolbar-summary {
|
|
@@ -219,7 +219,6 @@ export class SecurityPanelSidebar extends UI.Widget.VBox {
|
|
|
219
219
|
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
220
220
|
super(element);
|
|
221
221
|
this.#view = view;
|
|
222
|
-
this.registerRequiredCSS(lockIconStyles, sidebarStyles);
|
|
223
222
|
}
|
|
224
223
|
|
|
225
224
|
set onShowOrigin(callback: (origin: Platform.DevToolsPath.UrlString|null) => void) {
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
padding: var(--sys-size-8) var(--sys-size-11);
|
|
105
105
|
border-style: solid;
|
|
106
106
|
border-width: var(--sys-size-1) 0;
|
|
107
|
-
font-size:
|
|
107
|
+
font-size: var(--sys-typescale-body2-size);
|
|
108
108
|
background: var(--sys-color-cdt-base-container);
|
|
109
109
|
border-color: var(--sys-color-neutral-outline);
|
|
110
110
|
user-select: text;
|
|
@@ -226,6 +226,8 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
226
226
|
|
|
227
227
|
// clang-format off
|
|
228
228
|
render(html`
|
|
229
|
+
<style>${frameworkIgnoreListSettingsTabStyles}</style>
|
|
230
|
+
<style>${settingsScreenStyles}</style>
|
|
229
231
|
<div class="settings-card-container-wrapper">
|
|
230
232
|
<div class="settings-card-container ignore-list-settings">
|
|
231
233
|
<devtools-card .heading=${i18nString(UIStrings.frameworkIgnoreList)}>
|
|
@@ -341,7 +343,6 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox {
|
|
|
341
343
|
useShadowDom: true,
|
|
342
344
|
});
|
|
343
345
|
this.#view = view;
|
|
344
|
-
this.registerRequiredCSS(frameworkIgnoreListSettingsTabStyles, settingsScreenStyles);
|
|
345
346
|
|
|
346
347
|
const settings = Common.Settings.Settings.instance();
|
|
347
348
|
this.enabledSetting = settings.resolve(Workspace.IgnoreListManager.enableIgnoreListingSettingDescriptor);
|
|
@@ -45,7 +45,6 @@ import * as StackTrace from '../../models/stack_trace/stack_trace.js';
|
|
|
45
45
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
46
46
|
import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
47
47
|
import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
|
48
|
-
import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
|
|
49
48
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
50
49
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
51
50
|
import {Directives, html, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
|
|
@@ -374,6 +373,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
374
373
|
render(
|
|
375
374
|
// clang-format off
|
|
376
375
|
html`
|
|
376
|
+
<style>${watchExpressionsSidebarPaneStyles}</style>
|
|
377
377
|
${input.watchExpressions.length === 0
|
|
378
378
|
? html`<div class=gray-info-message tabindex=-1 >
|
|
379
379
|
${i18nString(UIStrings.noWatchExpressions)}
|
|
@@ -409,7 +409,6 @@ export class WatchExpressionsSidebarPane extends UI.Widget.VBox implements UI.Ac
|
|
|
409
409
|
#expansionTrackers = new Map<string, ObjectUI.ObjectPropertiesSection.ObjectTreeExpansionTracker>();
|
|
410
410
|
constructor() {
|
|
411
411
|
super({useShadowDom: true});
|
|
412
|
-
this.registerRequiredCSS(watchExpressionsSidebarPaneStyles, objectValueStyles);
|
|
413
412
|
|
|
414
413
|
this.#watchExpressions = [];
|
|
415
414
|
this.#watchExpressionsSetting =
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.watch-expressions {
|
|
36
|
-
min-height:
|
|
36
|
+
min-height: var(--sys-size-11);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.watch-expression-title {
|
|
@@ -49,7 +49,7 @@ li.watch-expression-tree-item > span.tree-element-title {
|
|
|
49
49
|
|
|
50
50
|
.watch-expression-title:hover,
|
|
51
51
|
.watch-expression-title:focus-within {
|
|
52
|
-
padding-right:
|
|
52
|
+
padding-right: var(--sys-size-11);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.watch-expression-object-header .watch-expression-title {
|
|
@@ -126,6 +126,7 @@ type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
|
126
126
|
const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
127
127
|
render(
|
|
128
128
|
html`
|
|
129
|
+
<style>${timelineSelectorStatsViewStyles}</style>
|
|
129
130
|
<devtools-data-grid striped name=${i18nString(UIStrings.selectorStats)}
|
|
130
131
|
@contextmenu=${input.onContextMenu.bind(input)}>
|
|
131
132
|
<table>
|
|
@@ -213,7 +214,6 @@ export class TimelineSelectorStatsView extends UI.Widget.VBox {
|
|
|
213
214
|
|
|
214
215
|
constructor(parsedTrace: Trace.TraceModel.ParsedTrace|null, view: View = DEFAULT_VIEW) {
|
|
215
216
|
super();
|
|
216
|
-
this.registerRequiredCSS(timelineSelectorStatsViewStyles);
|
|
217
217
|
|
|
218
218
|
this.#view = view;
|
|
219
219
|
this.#selectorLocations = new Map<string, Protocol.CSS.SourceRange[]>();
|
|
@@ -115,6 +115,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
115
115
|
}
|
|
116
116
|
// clang-format off
|
|
117
117
|
Lit.render(html`
|
|
118
|
+
<style>${originMapStyles}</style>
|
|
118
119
|
<devtools-data-grid striped inline deletable
|
|
119
120
|
@click=${(e: Event) => { e.stopPropagation(); }}
|
|
120
121
|
@create=${input.onCreate}>
|
|
@@ -144,7 +145,6 @@ export class OriginMap extends UI.Widget.VBox {
|
|
|
144
145
|
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
145
146
|
super(element, {useShadowDom: true});
|
|
146
147
|
this.#view = view;
|
|
147
|
-
this.registerRequiredCSS(originMapStyles);
|
|
148
148
|
CrUXManager.CrUXManager.instance().getConfigSetting().addChangeListener(this.requestUpdate, this);
|
|
149
149
|
this.requestUpdate();
|
|
150
150
|
}
|
|
@@ -14,26 +14,6 @@
|
|
|
14
14
|
min-height: fit-content;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.web-audio-landing-page {
|
|
18
|
-
position: absolute;
|
|
19
|
-
background-color: var(--sys-color-cdt-base-container);
|
|
20
|
-
justify-content: center;
|
|
21
|
-
align-items: center;
|
|
22
|
-
overflow: auto;
|
|
23
|
-
font-size: var(--sys-typescale-body3-size);
|
|
24
|
-
color: var(--sys-color-on-surface);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.web-audio-landing-page > div {
|
|
28
|
-
max-width: 500px;
|
|
29
|
-
margin: 10px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.web-audio-landing-page > div > p {
|
|
33
|
-
flex: none;
|
|
34
|
-
white-space: pre-line;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
17
|
.web-audio-content-container {
|
|
38
18
|
overflow-y: auto;
|
|
39
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: Dependencies sourced from the upstream `chromium` repository
|
|
2
2
|
URL: Internal
|
|
3
3
|
Version: N/A
|
|
4
|
-
Revision:
|
|
4
|
+
Revision: 8f43954c16bf4cc3c66cabb5750424d56e5f8ffd
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|
|
@@ -752,41 +752,196 @@ function isClippingOverflow(overflow: string): boolean {
|
|
|
752
752
|
|
|
753
753
|
interface ClippingAncestor {
|
|
754
754
|
element: Element;
|
|
755
|
+
occluders: Element[];
|
|
755
756
|
clipsX: boolean;
|
|
756
757
|
clipsY: boolean;
|
|
757
758
|
}
|
|
758
759
|
|
|
760
|
+
/**
|
|
761
|
+
* Attribute that marks an element as a sticky occluder: an element that sticks
|
|
762
|
+
* to its scroll container (e.g. a `position: sticky` table header or toolbar)
|
|
763
|
+
* and paints over scrolled content. Comment overlays are clipped against it.
|
|
764
|
+
* Components set it directly so they don't need to depend on this module.
|
|
765
|
+
*/
|
|
766
|
+
export const STICKY_OCCLUDER_ATTRIBUTE = 'data-sticky-occluder';
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* Sticky occluders collected by the caller's DOM scan (see `setStickyOccluders()`),
|
|
770
|
+
* or null to let the resolver scan the document itself.
|
|
771
|
+
*/
|
|
772
|
+
let stickyOccluders: Element[]|null = null;
|
|
773
|
+
let occludersByScrollerCache: Map<Element, Element[]>|null = null;
|
|
759
774
|
let clippingAncestorsCache = new WeakMap<Element, ClippingAncestor[]>();
|
|
760
775
|
|
|
776
|
+
/**
|
|
777
|
+
* Provides the sticky occluders found by a DOM scan the caller already runs, so
|
|
778
|
+
* the resolver does not walk the whole DOM again. CommentOverlayManager collects
|
|
779
|
+
* them in the same pass as `[jslog]` elements during rematching.
|
|
780
|
+
*
|
|
781
|
+
* @param elements Elements with the sticky occluder attribute, or null to make
|
|
782
|
+
* the resolver scan the document itself.
|
|
783
|
+
*/
|
|
784
|
+
export function setStickyOccluders(elements: Element[]|null): void {
|
|
785
|
+
stickyOccluders = elements;
|
|
786
|
+
clearClippingAncestorsCache();
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
function isScrollingOverflow(overflow: string): boolean {
|
|
790
|
+
return overflow === 'hidden' || overflow === 'auto' || overflow === 'scroll';
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
function getStickyScroller(occluder: Element, doc: Document, win: Window): Element|null {
|
|
794
|
+
let current = occluder.parentElementOrShadowHost();
|
|
795
|
+
while (current && current !== doc.documentElement && current !== doc.body) {
|
|
796
|
+
const currentStyle = win.getComputedStyle(current);
|
|
797
|
+
|
|
798
|
+
if (isScrollingOverflow(currentStyle.overflowX) || isScrollingOverflow(currentStyle.overflowY)) {
|
|
799
|
+
return current;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
current = current.parentElementOrShadowHost();
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
return null;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
function buildOccludersByScrollerMap(doc: Document, win: Window): Map<Element, Element[]> {
|
|
809
|
+
if (occludersByScrollerCache) {
|
|
810
|
+
return occludersByScrollerCache;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
const result = new Map<Element, Element[]>();
|
|
814
|
+
const occluders = stickyOccluders ?? deepQuerySelectorAll(doc, `[${STICKY_OCCLUDER_ATTRIBUTE}]`);
|
|
815
|
+
for (const occ of occluders) {
|
|
816
|
+
// The provided list can be up to one rematch behind the DOM.
|
|
817
|
+
if (!occ.isConnected) {
|
|
818
|
+
continue;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
const scroller = getStickyScroller(occ, doc, win);
|
|
822
|
+
if (!scroller) {
|
|
823
|
+
continue;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
const existingOccluders = result.get(scroller);
|
|
827
|
+
if (existingOccluders) {
|
|
828
|
+
existingOccluders.push(occ);
|
|
829
|
+
} else {
|
|
830
|
+
result.set(scroller, [occ]);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
occludersByScrollerCache = result;
|
|
835
|
+
return result;
|
|
836
|
+
}
|
|
837
|
+
|
|
761
838
|
/**
|
|
762
839
|
* Clears the cached clipping ancestor chains for elements.
|
|
763
840
|
* Called when DOM mutations or comment rematches occur.
|
|
764
841
|
*/
|
|
765
842
|
export function clearClippingAncestorsCache(): void {
|
|
766
843
|
clippingAncestorsCache = new WeakMap<Element, ClippingAncestor[]>();
|
|
844
|
+
occludersByScrollerCache = null;
|
|
767
845
|
}
|
|
768
846
|
|
|
769
847
|
function getClippingAncestors(element: Element, doc: Document, win: Window): ClippingAncestor[] {
|
|
770
848
|
const cached = clippingAncestorsCache.get(element);
|
|
771
|
-
if (cached && cached.every(item => item.element.isConnected)) {
|
|
849
|
+
if (cached && cached.every(item => item.element.isConnected && item.occluders.every(occ => occ.isConnected))) {
|
|
772
850
|
return cached;
|
|
773
851
|
}
|
|
774
852
|
|
|
775
853
|
const ancestors: ClippingAncestor[] = [];
|
|
854
|
+
const allAncestors = new Set<Element>();
|
|
855
|
+
|
|
776
856
|
let current = element.parentElementOrShadowHost();
|
|
777
857
|
while (current && current !== doc.documentElement && current !== doc.body) {
|
|
858
|
+
allAncestors.add(current);
|
|
778
859
|
const style = win.getComputedStyle(current);
|
|
779
860
|
const clipsX = isClippingOverflow(style.overflowX);
|
|
780
861
|
const clipsY = isClippingOverflow(style.overflowY);
|
|
781
862
|
if (clipsX || clipsY) {
|
|
782
|
-
ancestors.push({element: current, clipsX, clipsY});
|
|
863
|
+
ancestors.push({element: current, clipsX, clipsY, occluders: []});
|
|
783
864
|
}
|
|
784
865
|
current = current.parentElementOrShadowHost();
|
|
785
866
|
}
|
|
867
|
+
|
|
868
|
+
const occludersByScroller = buildOccludersByScrollerMap(doc, win);
|
|
869
|
+
for (const ancestor of ancestors) {
|
|
870
|
+
const occluders = occludersByScroller.get(ancestor.element);
|
|
871
|
+
if (!occluders) {
|
|
872
|
+
continue;
|
|
873
|
+
}
|
|
874
|
+
// An anchor that is the occluder or sits inside it (e.g. a header cell) is painted by it, not covered.
|
|
875
|
+
ancestor.occluders = occluders.filter(occ => occ !== element && !allAncestors.has(occ));
|
|
876
|
+
}
|
|
877
|
+
|
|
786
878
|
clippingAncestorsCache.set(element, ancestors);
|
|
787
879
|
return ancestors;
|
|
788
880
|
}
|
|
789
881
|
|
|
882
|
+
interface Bounds {
|
|
883
|
+
left: number;
|
|
884
|
+
right: number;
|
|
885
|
+
top: number;
|
|
886
|
+
bottom: number;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
function getCachedRect(element: Element, rectCache?: Map<Element, DOMRect>): DOMRect {
|
|
890
|
+
let rect = rectCache?.get(element);
|
|
891
|
+
if (!rect) {
|
|
892
|
+
rect = element.getBoundingClientRect();
|
|
893
|
+
rectCache?.set(element, rect);
|
|
894
|
+
}
|
|
895
|
+
return rect;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* Trims visible bounds by the sticky occluders of one scroll container.
|
|
900
|
+
*
|
|
901
|
+
* A sticky occluder is an element marked with STICKY_OCCLUDER_ATTRIBUTE that sticks
|
|
902
|
+
* to the edge of its scroll container (e.g. a table header or toolbar) and paints
|
|
903
|
+
* over content scrolled underneath it. That content is not visible, even though it
|
|
904
|
+
* is still inside the scroll container's bounds.
|
|
905
|
+
*
|
|
906
|
+
* - Covers the top edge: the bounds start at the occluder's bottom.
|
|
907
|
+
* - Covers the bottom edge: the bounds end at the occluder's top.
|
|
908
|
+
* - Covers the whole height: returns null.
|
|
909
|
+
* - Sits strictly inside the bounds: ignored, since a rect cannot have a hole.
|
|
910
|
+
*
|
|
911
|
+
* Occluders with no size or no horizontal overlap with the bounds are skipped.
|
|
912
|
+
*
|
|
913
|
+
* @param bounds The visible bounds after clipping against the scroll container.
|
|
914
|
+
* @param occluders The sticky occluders of that scroll container.
|
|
915
|
+
* @param rectCache Optional per-frame cache of element bounding client rects.
|
|
916
|
+
* @returns The trimmed bounds, or null if the occluders cover them completely.
|
|
917
|
+
*/
|
|
918
|
+
function trimByStickyOccluders(bounds: Bounds, occluders: Element[], rectCache?: Map<Element, DOMRect>): Bounds|null {
|
|
919
|
+
let {top, bottom} = bounds;
|
|
920
|
+
for (const occ of occluders) {
|
|
921
|
+
const occRect = getCachedRect(occ, rectCache);
|
|
922
|
+
if (occRect.width <= 0 || occRect.height <= 0) {
|
|
923
|
+
continue;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
if (occRect.right <= bounds.left || occRect.left >= bounds.right) {
|
|
927
|
+
continue;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
const coversTop = occRect.top <= top && occRect.bottom > top;
|
|
931
|
+
const coversBottom = occRect.top < bottom && occRect.bottom >= bottom;
|
|
932
|
+
if (coversTop && coversBottom) {
|
|
933
|
+
return null;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
if (coversTop) {
|
|
937
|
+
top = occRect.bottom;
|
|
938
|
+
} else if (coversBottom) {
|
|
939
|
+
bottom = occRect.top;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
return {left: bounds.left, right: bounds.right, top, bottom};
|
|
943
|
+
}
|
|
944
|
+
|
|
790
945
|
/**
|
|
791
946
|
* Computes the visible viewport-relative bounding box of an element after clipping against
|
|
792
947
|
* all ancestor scroll/overflow containers and viewport boundaries across shadow DOM roots.
|
|
@@ -833,12 +988,8 @@ export function computeVisibleRect(
|
|
|
833
988
|
}
|
|
834
989
|
|
|
835
990
|
const clippingAncestors = getClippingAncestors(element, doc, win);
|
|
836
|
-
for (const {element: ancestor, clipsX, clipsY} of clippingAncestors) {
|
|
837
|
-
|
|
838
|
-
if (!parentRect) {
|
|
839
|
-
parentRect = ancestor.getBoundingClientRect();
|
|
840
|
-
rectCache?.set(ancestor, parentRect);
|
|
841
|
-
}
|
|
991
|
+
for (const {element: ancestor, clipsX, clipsY, occluders} of clippingAncestors) {
|
|
992
|
+
const parentRect = getCachedRect(ancestor, rectCache);
|
|
842
993
|
if (clipsX) {
|
|
843
994
|
visibleLeft = Math.max(visibleLeft, parentRect.left);
|
|
844
995
|
visibleRight = Math.min(visibleRight, parentRect.right);
|
|
@@ -851,6 +1002,13 @@ export function computeVisibleRect(
|
|
|
851
1002
|
if (visibleLeft >= visibleRight || visibleTop >= visibleBottom) {
|
|
852
1003
|
return null;
|
|
853
1004
|
}
|
|
1005
|
+
|
|
1006
|
+
const trimmed = trimByStickyOccluders(
|
|
1007
|
+
{left: visibleLeft, right: visibleRight, top: visibleTop, bottom: visibleBottom}, occluders, rectCache);
|
|
1008
|
+
if (!trimmed) {
|
|
1009
|
+
return null;
|
|
1010
|
+
}
|
|
1011
|
+
({top: visibleTop, bottom: visibleBottom} = trimmed);
|
|
854
1012
|
}
|
|
855
1013
|
|
|
856
1014
|
const width = visibleRight - visibleLeft;
|
|
@@ -22,6 +22,8 @@ import {
|
|
|
22
22
|
removeCustomAnchorsMovedListener,
|
|
23
23
|
resolveCommentAnchor,
|
|
24
24
|
resolveCommentAnchorElement,
|
|
25
|
+
setStickyOccluders,
|
|
26
|
+
STICKY_OCCLUDER_ATTRIBUTE,
|
|
25
27
|
} from './CommentAnchorResolver.js';
|
|
26
28
|
|
|
27
29
|
export const COMMENT_MODE_CURSOR = 'var(--comment-cursor)';
|
|
@@ -394,7 +396,19 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
394
396
|
*/
|
|
395
397
|
#rematchAllComments(root: Document|Element = document): void {
|
|
396
398
|
clearClippingAncestorsCache();
|
|
397
|
-
|
|
399
|
+
// Single deep traversal shared by anchor rematching and sticky occluder clipping.
|
|
400
|
+
const scannedElements = deepQuerySelectorAll(root, `[jslog], [${STICKY_OCCLUDER_ATTRIBUTE}]`);
|
|
401
|
+
const jslogElements: Element[] = [];
|
|
402
|
+
const stickyOccluders: Element[] = [];
|
|
403
|
+
for (const el of scannedElements) {
|
|
404
|
+
if (el.hasAttribute('jslog')) {
|
|
405
|
+
jslogElements.push(el);
|
|
406
|
+
}
|
|
407
|
+
if (el.hasAttribute(STICKY_OCCLUDER_ATTRIBUTE)) {
|
|
408
|
+
stickyOccluders.push(el);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
setStickyOccluders(stickyOccluders);
|
|
398
412
|
const oldElements = new Set<Element>();
|
|
399
413
|
const newElements = new Set<Element>();
|
|
400
414
|
|
|
@@ -559,7 +573,7 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
559
573
|
*/
|
|
560
574
|
stop(): void {
|
|
561
575
|
document.body.style.cursor = '';
|
|
562
|
-
|
|
576
|
+
setStickyOccluders(null);
|
|
563
577
|
this.clearDraftThreads();
|
|
564
578
|
this.#removeClickListener();
|
|
565
579
|
this.#removeScrollListener();
|
|
@@ -870,6 +884,7 @@ export class CommentOverlayManager extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
870
884
|
'data-target-id',
|
|
871
885
|
'aria-expanded',
|
|
872
886
|
'data-file-path',
|
|
887
|
+
STICKY_OCCLUDER_ATTRIBUTE,
|
|
873
888
|
],
|
|
874
889
|
});
|
|
875
890
|
}
|
|
@@ -121,7 +121,7 @@ devtools-code-block {
|
|
|
121
121
|
|
|
122
122
|
h1.insight, h2.insight, h3.insight, h4.insight, h5.insight, h6.insight {
|
|
123
123
|
font: var(--sys-typescale-body4-bold);
|
|
124
|
-
margin: var(--sys-size-1) 0
|
|
124
|
+
margin: var(--sys-size-1) 0 var(--sys-size-5);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
.message table {
|
|
@@ -143,7 +143,7 @@ export class Menu extends HTMLElement {
|
|
|
143
143
|
connectedCallback(): void {
|
|
144
144
|
void RenderCoordinator.write(() => {
|
|
145
145
|
this.style.setProperty('--selected-item-check', `url(${selectedItemCheckmark})`);
|
|
146
|
-
this.style.setProperty('--menu-checkmark-width', this.#props.showSelectedItem ? '
|
|
146
|
+
this.style.setProperty('--menu-checkmark-width', this.#props.showSelectedItem ? 'var(--sys-size-8)' : '0px');
|
|
147
147
|
this.style.setProperty('--menu-checkmark-height', this.#props.showSelectedItem ? '12px' : '0px');
|
|
148
148
|
const dividerLine = this.showDivider ? '1px var(--divider-line) solid' : 'none';
|
|
149
149
|
this.style.setProperty('--override-divider-line', dividerLine);
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
display: inline-block;
|
|
43
43
|
mask-repeat: no-repeat;
|
|
44
44
|
mask-position: center;
|
|
45
|
-
width:
|
|
45
|
+
width: var(--menu-checkmark-width);
|
|
46
46
|
height: var(--menu-checkmark-height);
|
|
47
47
|
mask-image: var(--selected-item-check);
|
|
48
48
|
background: var(--sys-color-token-subtle);
|
|
@@ -24,10 +24,10 @@ h2 {
|
|
|
24
24
|
font-size: var(--sys-typescale-body3-size);
|
|
25
25
|
line-height: var(--sys-typescale-body3-line-height);
|
|
26
26
|
letter-spacing: 0.01em;
|
|
27
|
-
margin:
|
|
27
|
+
margin: var(--sys-size-5) 0 var(--sys-size-7);
|
|
28
28
|
display: flex;
|
|
29
29
|
align-items: center;
|
|
30
|
-
gap:
|
|
30
|
+
gap: var(--sys-size-3);
|
|
31
31
|
font-weight: normal;
|
|
32
32
|
}
|
|
33
33
|
|