chrome-devtools-frontend 1.0.1730971 → 1.0.1732697
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/docs/get_the_code.md +1 -73
- package/front_end/Tests.js +15 -0
- package/front_end/core/host/AidaClient.ts +47 -3
- package/front_end/core/host/AidaClientTypes.ts +27 -3
- package/front_end/core/host/AidaGcaTranslation.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +8 -3
- package/front_end/core/sdk/NetworkManager.ts +2 -1
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +2 -2
- package/front_end/generated/Deprecation.ts +0 -8
- package/front_end/generated/InspectorBackendCommands.ts +2 -1
- package/front_end/generated/SupportedCSSProperties.ts +2 -2
- package/front_end/generated/protocol.ts +9 -0
- package/front_end/models/ai-utils/debug.ts +127 -22
- package/front_end/models/ai_assistance/README.md +1 -1
- package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -5
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/contexts/DOMNodeContext.ts +4 -3
- package/front_end/models/ai_assistance/contexts/LighthouseContext.snapshot.txt +9 -2
- package/front_end/models/ai_assistance/contexts/LighthouseContext.ts +4 -3
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +97 -11
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +92 -43
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +26 -26
- 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/ai_code_completion/AiCodeCompletion.ts +2 -1
- package/front_end/models/ai_code_completion/ai_code_completion.ts +11 -2
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -1
- package/front_end/models/ai_code_generation/ai_code_generation.ts +11 -2
- 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/models/trace/LanternComputationData.ts +4 -0
- package/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +126 -1
- package/front_end/models/trace/lantern/types/Lantern.ts +3 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +33 -1
- package/front_end/panels/ai_assistance/ExternalHandler.ts +1 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -0
- package/front_end/panels/ai_assistance/components/PermissionPrompt.ts +4 -4
- package/front_end/panels/ai_assistance/components/chatInput.css +1 -1
- package/front_end/panels/ai_assistance/components/chatMessage.css +3 -4
- package/front_end/panels/ai_assistance/components/exploreWidget.css +3 -3
- 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/components/reportsGrid.css +1 -1
- package/front_end/panels/application/components/serviceWorkerRouterView.css +2 -2
- package/front_end/panels/application/components/trustTokensView.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 -10
- package/front_end/panels/application/privateVerificationTokensView.css +12 -0
- package/front_end/panels/application/resourcesPanel.css +0 -23
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +7 -7
- package/front_end/panels/application/serviceWorkersView.css +4 -3
- package/front_end/panels/changes/CombinedDiffView.ts +1 -1
- package/front_end/panels/comments/CommentsPane.ts +7 -11
- package/front_end/panels/common/CommentThreadWidget.ts +11 -3
- package/front_end/panels/common/CommentsOverlayWidget.ts +337 -117
- package/front_end/panels/console/consoleContextSelector.css +1 -1
- package/front_end/panels/console/consolePinPane.css +1 -1
- package/front_end/panels/console/consolePrompt.css +4 -2
- 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/ComputedStyleWidget.ts +8 -19
- 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/PropertyRenderer.ts +7 -27
- package/front_end/panels/elements/StylePropertyTreeElement.ts +61 -72
- 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/elementsBreadcrumbs.css +1 -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 +6 -6
- package/front_end/panels/elements/platformFontsWidget.css +1 -1
- package/front_end/panels/elements/propertiesWidget.css +0 -5
- 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 +9 -10
- package/front_end/panels/event_listeners/eventListenersView.css +5 -5
- package/front_end/panels/explain/components/consoleInsight.css +5 -20
- package/front_end/panels/issues/issuesTree.css +11 -10
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +4 -2
- package/front_end/panels/layer_viewer/TransformController.ts +106 -54
- package/front_end/panels/layer_viewer/layerTreeOutline.css +1 -1
- package/front_end/panels/lighthouse/lighthousePanel.css +5 -8
- 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/linear_memory_inspector/components/valueInterpreterDisplay.css +1 -1
- 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 +14 -7
- package/front_end/panels/media/playerMessagesView.css +11 -7
- 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/NetworkWaterfallColumn.ts +92 -55
- package/front_end/panels/network/binaryResourceView.css +0 -7
- package/front_end/panels/network/networkConfigView.css +3 -3
- package/front_end/panels/network/networkLogView.css +5 -11
- package/front_end/panels/network/networkManageCustomHeadersView.css +1 -1
- package/front_end/panels/network/networkTimingTable.css +6 -6
- package/front_end/panels/network/requestConditionsDrawer.css +1 -24
- package/front_end/panels/network/requestPayloadView.css +1 -1
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
- package/front_end/panels/performance_monitor/performanceMonitor.css +2 -2
- package/front_end/panels/profiler/ModuleUIStrings.ts +12 -0
- package/front_end/panels/protocol_monitor/JSONEditor.css +4 -3
- 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/createRecordingView.css +2 -2
- 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 -31
- package/front_end/panels/recorder/timelineSection.css +1 -1
- package/front_end/panels/screencast/screencastView.css +3 -2
- 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 +2 -2
- package/front_end/panels/security/originView.css +1 -5
- 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 +3 -4
- package/front_end/panels/sources/tabbedEditorContainer.css +1 -1
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +4 -3
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +30 -10
- 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 +4 -4
- package/front_end/panels/timeline/components/relatedInsightChips.css +1 -1
- package/front_end/panels/timeline/timelineFlameChartView.css +4 -4
- package/front_end/panels/timeline/timelineFlamechartPopover.css +3 -3
- package/front_end/panels/timeline/timelineHistoryManager.css +1 -1
- package/front_end/panels/timeline/timelineMiniMap.css +3 -2
- 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/buttons/button.css +0 -1
- package/front_end/ui/components/diff_view/diffView.css +2 -2
- package/front_end/ui/components/markdown_view/codeBlock.css +3 -3
- package/front_end/ui/components/markdown_view/markdownView.css +3 -3
- 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 +5 -4
- 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 +6 -6
- 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/colorSwatch.css +1 -2
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -3
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +1 -1
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +1 -1
- package/front_end/ui/legacy/components/perf_ui/flameChart.css +12 -9
- package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +11 -7
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +3 -4
- package/front_end/ui/legacy/components/source_frame/imageView.css +4 -4
- package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
- 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 +16 -48
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
- package/front_end/ui/legacy/progressIndicator.css +1 -2
- package/front_end/ui/legacy/reportView.css +4 -1
- package/front_end/ui/legacy/searchableView.css +1 -1
- package/front_end/ui/legacy/suggestBox.css +2 -1
- package/front_end/ui/legacy/tabbedPane.css +7 -4
- package/front_end/ui/legacy/toolbar.css +2 -1
- package/front_end/ui/legacy/treeoutline.css +6 -5
- package/front_end/ui/legacy/viewContainers.css +3 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +15 -0
- package/inspector_overlay/highlight_anchor.ts +8 -11
- package/package.json +1 -1
- package/front_end/models/ai_code_completion/debug.ts +0 -33
- package/front_end/models/ai_code_generation/debug.ts +0 -33
|
@@ -19,8 +19,14 @@ import {createIcon, Icon} from '../../ui/kit/kit.js';
|
|
|
19
19
|
import * as ColorPicker from '../../ui/legacy/components/color_picker/color_picker.js';
|
|
20
20
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
21
21
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
22
|
-
import
|
|
23
|
-
|
|
22
|
+
import {
|
|
23
|
+
Directives,
|
|
24
|
+
html,
|
|
25
|
+
type LitTemplate,
|
|
26
|
+
nothing,
|
|
27
|
+
render,
|
|
28
|
+
type TemplateResult,
|
|
29
|
+
} from '../../ui/lit/lit.js';
|
|
24
30
|
import * as SettingsUI from '../../ui/settings/settings.js';
|
|
25
31
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
26
32
|
|
|
@@ -211,7 +217,7 @@ export class EnvFunctionRenderer extends EnvFunctionRendererBase {
|
|
|
211
217
|
readonly computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null) {
|
|
212
218
|
super();
|
|
213
219
|
}
|
|
214
|
-
override render(match: SDK.CSSPropertyParserMatchers.EnvFunctionMatch, context: RenderingContext):
|
|
220
|
+
override render(match: SDK.CSSPropertyParserMatchers.EnvFunctionMatch, context: RenderingContext): LitTemplate {
|
|
215
221
|
const [, fallbackNodes] = ASTUtils.callArgs(match.node);
|
|
216
222
|
if (match.value) {
|
|
217
223
|
const substitution = context.tracing?.substitution();
|
|
@@ -252,8 +258,7 @@ export class FlexGridRenderer extends FlexGridRendererBase {
|
|
|
252
258
|
this.#stylesContainer = stylesContainer;
|
|
253
259
|
}
|
|
254
260
|
|
|
255
|
-
override render(match: SDK.CSSPropertyParserMatchers.FlexGridGridLanesMatch,
|
|
256
|
-
context: RenderingContext): Lit.LitTemplate {
|
|
261
|
+
override render(match: SDK.CSSPropertyParserMatchers.FlexGridGridLanesMatch, context: RenderingContext): LitTemplate {
|
|
257
262
|
const children = Renderer.render(ASTUtils.siblings(ASTUtils.declValue(match.node)), context).nodes;
|
|
258
263
|
if (!this.#treeElement?.editable()) {
|
|
259
264
|
return children;
|
|
@@ -317,8 +322,7 @@ export class CSSWideKeywordRenderer extends CSSWideKeywordRendererBase {
|
|
|
317
322
|
this.#stylesContainer = stylesContainer;
|
|
318
323
|
}
|
|
319
324
|
|
|
320
|
-
override render(match: SDK.CSSPropertyParserMatchers.CSSWideKeywordMatch,
|
|
321
|
-
context: RenderingContext): Lit.LitTemplate {
|
|
325
|
+
override render(match: SDK.CSSPropertyParserMatchers.CSSWideKeywordMatch, context: RenderingContext): LitTemplate {
|
|
322
326
|
const resolvedProperty = match.resolveProperty();
|
|
323
327
|
if (!resolvedProperty) {
|
|
324
328
|
return html`${match.text}`;
|
|
@@ -386,7 +390,7 @@ export class VariableRenderer extends VariableRendererBase {
|
|
|
386
390
|
this.#computedStyleExtraFields = computedStyleExtraFields;
|
|
387
391
|
}
|
|
388
392
|
|
|
389
|
-
override render(match: SDK.CSSPropertyParserMatchers.VariableMatch, context: RenderingContext):
|
|
393
|
+
override render(match: SDK.CSSPropertyParserMatchers.VariableMatch, context: RenderingContext): LitTemplate {
|
|
390
394
|
if (this.#treeElement?.property.ownerStyle.parentRule instanceof SDK.CSSRule.CSSFunctionRule) {
|
|
391
395
|
return Renderer.render(ASTUtils.children(match.node), context).nodes;
|
|
392
396
|
}
|
|
@@ -480,7 +484,7 @@ export class VariableNameRenderer extends VariableNameRendererBase {
|
|
|
480
484
|
this.#matchedStyles = matchedStyles;
|
|
481
485
|
}
|
|
482
486
|
|
|
483
|
-
override render(match: SDK.CSSPropertyParserMatchers.VariableNameMatch, _context: RenderingContext):
|
|
487
|
+
override render(match: SDK.CSSPropertyParserMatchers.VariableNameMatch, _context: RenderingContext): LitTemplate {
|
|
484
488
|
if (this.#treeElement?.property.ownerStyle.parentRule instanceof SDK.CSSRule.CSSFunctionRule) {
|
|
485
489
|
return html`${match.text}`;
|
|
486
490
|
}
|
|
@@ -532,7 +536,7 @@ export class AttributeRenderer extends AttributeRendererBase {
|
|
|
532
536
|
this.#computedStyleExtraFields = computedStyleExtraFields;
|
|
533
537
|
}
|
|
534
538
|
|
|
535
|
-
override render(match: SDK.CSSPropertyParserMatchers.AttributeMatch, context: RenderingContext):
|
|
539
|
+
override render(match: SDK.CSSPropertyParserMatchers.AttributeMatch, context: RenderingContext): LitTemplate {
|
|
536
540
|
if (this.#treeElement?.property.ownerStyle.parentRule instanceof SDK.CSSRule.CSSFunctionRule) {
|
|
537
541
|
return Renderer.render(ASTUtils.children(match.node), context).nodes;
|
|
538
542
|
}
|
|
@@ -635,8 +639,7 @@ const LinearGradientRendererBase: RendererBase<SDK.CSSPropertyParserMatchers.Lin
|
|
|
635
639
|
// clang-format off
|
|
636
640
|
export class LinearGradientRenderer extends LinearGradientRendererBase {
|
|
637
641
|
// clang-format on
|
|
638
|
-
override render(match: SDK.CSSPropertyParserMatchers.LinearGradientMatch,
|
|
639
|
-
context: RenderingContext): Lit.LitTemplate {
|
|
642
|
+
override render(match: SDK.CSSPropertyParserMatchers.LinearGradientMatch, context: RenderingContext): LitTemplate {
|
|
640
643
|
const children = ASTUtils.children(match.node);
|
|
641
644
|
const {nodes, cssControls} = Renderer.render(children, context);
|
|
642
645
|
const angles = cssControls.get('angle');
|
|
@@ -670,7 +673,7 @@ export class RelativeColorChannelRenderer extends RelativeColorChannelRendererBa
|
|
|
670
673
|
this.#treeElement = treeElement;
|
|
671
674
|
}
|
|
672
675
|
override render(match: SDK.CSSPropertyParserMatchers.RelativeColorChannelMatch,
|
|
673
|
-
context: RenderingContext):
|
|
676
|
+
context: RenderingContext): LitTemplate {
|
|
674
677
|
const color = context.findParent(match.node, SDK.CSSPropertyParserMatchers.ColorMatch);
|
|
675
678
|
if (!color?.relativeColor) {
|
|
676
679
|
return html`${match.text}`;
|
|
@@ -682,7 +685,7 @@ export class RelativeColorChannelRenderer extends RelativeColorChannelRendererBa
|
|
|
682
685
|
return html`${match.text}`;
|
|
683
686
|
}
|
|
684
687
|
|
|
685
|
-
const evaluation = context.tracing?.applyEvaluation([], () => ({
|
|
688
|
+
const evaluation = context.tracing?.applyEvaluation([], () => ({template: html`${value.toFixed(3)}`}));
|
|
686
689
|
if (evaluation) {
|
|
687
690
|
return evaluation;
|
|
688
691
|
}
|
|
@@ -712,7 +715,7 @@ export class ColorRenderer extends ColorRendererBase {
|
|
|
712
715
|
}
|
|
713
716
|
|
|
714
717
|
#getValueChild(match: SDK.CSSPropertyParserMatchers.ColorMatch, context: RenderingContext): {
|
|
715
|
-
valueChild:
|
|
718
|
+
valueChild: LitTemplate,
|
|
716
719
|
cssControls?: CSSControlMap,
|
|
717
720
|
childTracingContexts?: TracingContext[],
|
|
718
721
|
} {
|
|
@@ -735,7 +738,7 @@ export class ColorRenderer extends ColorRendererBase {
|
|
|
735
738
|
return {valueChild, cssControls, childTracingContexts};
|
|
736
739
|
}
|
|
737
740
|
|
|
738
|
-
override render(match: SDK.CSSPropertyParserMatchers.ColorMatch, context: RenderingContext):
|
|
741
|
+
override render(match: SDK.CSSPropertyParserMatchers.ColorMatch, context: RenderingContext): LitTemplate {
|
|
739
742
|
const {valueChild, cssControls, childTracingContexts} = this.#getValueChild(match, context);
|
|
740
743
|
let colorText = context.matchedResult.getComputedText(match.node);
|
|
741
744
|
|
|
@@ -758,20 +761,15 @@ export class ColorRenderer extends ColorRendererBase {
|
|
|
758
761
|
if (match.node.name === 'CallExpression' && childTracingContexts) {
|
|
759
762
|
const evaluation = context.tracing?.applyEvaluation(childTracingContexts, () => {
|
|
760
763
|
const displayColor = color.as(((color.alpha ?? 1) !== 1) ? Common.Color.Format.HEXA : Common.Color.Format.HEX);
|
|
761
|
-
const colorText = document.createElement('span');
|
|
762
|
-
colorText.textContent = displayColor.asString();
|
|
763
764
|
const swatch =
|
|
764
765
|
new ColorRenderer(this.#stylesContainer, null)
|
|
765
766
|
.renderColorSwatch(displayColor.isGamutClipped() ? color : (displayColor.nickname() ?? displayColor),
|
|
766
767
|
match, context);
|
|
767
|
-
swatch.addEventListener(InlineEditor.ColorSwatch.ColorChangedEvent.eventName, ev => {
|
|
768
|
-
colorText.textContent = ev.data.color.asString();
|
|
769
|
-
});
|
|
770
768
|
context.addControl('color', swatch);
|
|
771
|
-
return {
|
|
769
|
+
return {template: html`${swatch}<span>${displayColor.asString()}</span>`};
|
|
772
770
|
});
|
|
773
771
|
if (evaluation) {
|
|
774
|
-
return
|
|
772
|
+
return evaluation;
|
|
775
773
|
}
|
|
776
774
|
}
|
|
777
775
|
|
|
@@ -882,16 +880,15 @@ export class LightDarkColorRenderer extends LightDarkColorRendererBase {
|
|
|
882
880
|
this.#matchedStyles = matchedStyles;
|
|
883
881
|
}
|
|
884
882
|
|
|
885
|
-
#renderContent(match: SDK.CSSPropertyParserMatchers.LightDarkColorMatch, light:
|
|
886
|
-
|
|
883
|
+
#renderContent(match: SDK.CSSPropertyParserMatchers.LightDarkColorMatch, light: LitTemplate, dark: LitTemplate,
|
|
884
|
+
activeColor?: CodeMirror.SyntaxNode[]): LitTemplate {
|
|
887
885
|
const lightClasses = classMap({'inactive-value': activeColor === match.dark});
|
|
888
886
|
const darkClasses = classMap({'inactive-value': activeColor === match.light});
|
|
889
887
|
return html`<span>light-dark(<span class=${lightClasses}>${light}</span>, <span class=${darkClasses}>${
|
|
890
888
|
dark}</span>)</span>`;
|
|
891
889
|
}
|
|
892
890
|
|
|
893
|
-
override render(match: SDK.CSSPropertyParserMatchers.LightDarkColorMatch,
|
|
894
|
-
context: RenderingContext): Lit.LitTemplate {
|
|
891
|
+
override render(match: SDK.CSSPropertyParserMatchers.LightDarkColorMatch, context: RenderingContext): LitTemplate {
|
|
895
892
|
const {nodes: light, cssControls: lightControls} = Renderer.render(match.light, context);
|
|
896
893
|
const {nodes: dark, cssControls: darkControls} = Renderer.render(match.dark, context);
|
|
897
894
|
const content = this.#renderContent(match, light, dark);
|
|
@@ -920,9 +917,8 @@ export class LightDarkColorRenderer extends LightDarkColorRendererBase {
|
|
|
920
917
|
}
|
|
921
918
|
|
|
922
919
|
async applyColorScheme(match: SDK.CSSPropertyParserMatchers.LightDarkColorMatch, context: RenderingContext,
|
|
923
|
-
colorSwatch: InlineEditor.ColorSwatch.ColorSwatch, light:
|
|
924
|
-
|
|
925
|
-
darkControls: CSSControlMap): Promise<Lit.LitTemplate> {
|
|
920
|
+
colorSwatch: InlineEditor.ColorSwatch.ColorSwatch, light: LitTemplate, dark: LitTemplate,
|
|
921
|
+
lightControls: CSSControlMap, darkControls: CSSControlMap): Promise<LitTemplate> {
|
|
926
922
|
const activeColor = await this.#activeColor(match);
|
|
927
923
|
if (context.signal?.aborted || !activeColor) {
|
|
928
924
|
return this.#renderContent(match, light, dark);
|
|
@@ -997,7 +993,7 @@ export class ColorMixRenderer extends ColorMixRendererBase {
|
|
|
997
993
|
this.#treeElement = treeElement;
|
|
998
994
|
}
|
|
999
995
|
|
|
1000
|
-
override render(match: SDK.CSSPropertyParserMatchers.ColorMixMatch, context: RenderingContext):
|
|
996
|
+
override render(match: SDK.CSSPropertyParserMatchers.ColorMixMatch, context: RenderingContext): LitTemplate {
|
|
1001
997
|
const hookUpColorArg = (node: Node, onChange: (newColorText: string) => void): boolean => {
|
|
1002
998
|
if (node instanceof InlineEditor.ColorMixSwatch.ColorMixSwatch ||
|
|
1003
999
|
node instanceof InlineEditor.ColorSwatch.ColorSwatch) {
|
|
@@ -1050,28 +1046,25 @@ export class ColorMixRenderer extends ColorMixRendererBase {
|
|
|
1050
1046
|
if (nodeId !== undefined && childTracingContexts) {
|
|
1051
1047
|
const evaluation = context.tracing?.applyEvaluation(childTracingContexts, () => {
|
|
1052
1048
|
const initialColor = Common.Color.parse('#000') as Common.Color.Color;
|
|
1053
|
-
const {promise, resolve} = Promise.withResolvers<string>();
|
|
1054
1049
|
const swatch = new ColorRenderer(this.#stylesContainer, null).renderColorSwatch(initialColor, match, context);
|
|
1055
|
-
swatch.addEventListener(InlineEditor.ColorSwatch.ColorChangedEvent.eventName, ev => {
|
|
1056
|
-
resolve(ev.data.color.asString());
|
|
1057
|
-
});
|
|
1058
1050
|
context.addControl('color', swatch);
|
|
1059
|
-
const asyncEvalCallback = async(): Promise<
|
|
1051
|
+
const asyncEvalCallback = async(): Promise<LitTemplate|null> => {
|
|
1060
1052
|
const results = await this.#stylesContainer.cssModel()?.resolveValues(undefined, nodeId, colorMixText);
|
|
1061
1053
|
if (context.signal?.aborted) {
|
|
1062
|
-
return
|
|
1054
|
+
return null;
|
|
1063
1055
|
}
|
|
1064
1056
|
if (results) {
|
|
1065
1057
|
const color = Common.Color.parse(results[0]);
|
|
1066
1058
|
if (color) {
|
|
1067
|
-
|
|
1068
|
-
|
|
1059
|
+
const formattedColor = color.as(Common.Color.Format.HEXA);
|
|
1060
|
+
swatch.setColor(formattedColor);
|
|
1061
|
+
return html`${swatch}<span>${formattedColor.asString()}</span>`;
|
|
1069
1062
|
}
|
|
1070
1063
|
}
|
|
1071
|
-
return
|
|
1064
|
+
return null;
|
|
1072
1065
|
};
|
|
1073
1066
|
return {
|
|
1074
|
-
|
|
1067
|
+
template: html`${swatch}<span>${initialColor.asString()}</span>`,
|
|
1075
1068
|
asyncEvalCallback,
|
|
1076
1069
|
};
|
|
1077
1070
|
});
|
|
@@ -1107,7 +1100,7 @@ export class ColorMixRenderer extends ColorMixRendererBase {
|
|
|
1107
1100
|
>${ifExpanded(() => {
|
|
1108
1101
|
const color = swatch.mixedColor();
|
|
1109
1102
|
if (!color) {
|
|
1110
|
-
return
|
|
1103
|
+
return nothing;
|
|
1111
1104
|
}
|
|
1112
1105
|
const rgb = color.as(Common.Color.Format.HEX);
|
|
1113
1106
|
return html`${rgb.isGamutClipped() ? color.asString() : rgb.asString()}`;
|
|
@@ -1129,7 +1122,7 @@ export class ContrastColorRenderer extends ContrastColorRendererBase {
|
|
|
1129
1122
|
this.#stylesContainer = stylesContainer;
|
|
1130
1123
|
}
|
|
1131
1124
|
|
|
1132
|
-
override render(match: SDK.CSSPropertyParserMatchers.ContrastColorMatch, context: RenderingContext):
|
|
1125
|
+
override render(match: SDK.CSSPropertyParserMatchers.ContrastColorMatch, context: RenderingContext): LitTemplate {
|
|
1133
1126
|
const content = html`<span>contrast-color(${Renderer.render(match.color, context).nodes})</span>`;
|
|
1134
1127
|
|
|
1135
1128
|
if (context.matchedResult.hasUnresolvedSubstitutions(match.node)) {
|
|
@@ -1168,7 +1161,7 @@ export class AngleRenderer extends AngleRendererBase {
|
|
|
1168
1161
|
this.#treeElement = treeElement;
|
|
1169
1162
|
}
|
|
1170
1163
|
|
|
1171
|
-
override render(match: SDK.CSSPropertyParserMatchers.AngleMatch, context: RenderingContext):
|
|
1164
|
+
override render(match: SDK.CSSPropertyParserMatchers.AngleMatch, context: RenderingContext): LitTemplate {
|
|
1172
1165
|
const angleText = match.text;
|
|
1173
1166
|
if (!this.#treeElement?.editable()) {
|
|
1174
1167
|
return html`${angleText}`;
|
|
@@ -1272,7 +1265,7 @@ export class LinkableNameRenderer extends LinkableNameRendererBase {
|
|
|
1272
1265
|
}
|
|
1273
1266
|
}
|
|
1274
1267
|
|
|
1275
|
-
override render(match: SDK.CSSPropertyParserMatchers.LinkableNameMatch):
|
|
1268
|
+
override render(match: SDK.CSSPropertyParserMatchers.LinkableNameMatch): LitTemplate {
|
|
1276
1269
|
const {metric, jslogContext, ruleBlock, isDefined} = this.#getLinkData(match);
|
|
1277
1270
|
// clang-format off
|
|
1278
1271
|
const swatch = html`<devtools-link-swatch .data=${{
|
|
@@ -1309,8 +1302,8 @@ export class LinkableNameRenderer extends LinkableNameRendererBase {
|
|
|
1309
1302
|
@mouseup=${(ev: Event) => {
|
|
1310
1303
|
ev.consume(true);
|
|
1311
1304
|
void Common.Revealer.reveal(maybeAnimationGroup);
|
|
1312
|
-
}}></devtools-icon>` :
|
|
1313
|
-
|
|
1305
|
+
}}></devtools-icon>` : nothing)) :
|
|
1306
|
+
nothing;
|
|
1314
1307
|
return html`<span>${icon}${swatch}</span>`;
|
|
1315
1308
|
}
|
|
1316
1309
|
// clang-format on
|
|
@@ -1329,7 +1322,7 @@ export class BezierRenderer extends BezierRendererBase {
|
|
|
1329
1322
|
super();
|
|
1330
1323
|
this.#treeElement = treeElement;
|
|
1331
1324
|
}
|
|
1332
|
-
override render(match: SDK.CSSPropertyParserMatchers.BezierMatch, context: RenderingContext):
|
|
1325
|
+
override render(match: SDK.CSSPropertyParserMatchers.BezierMatch, context: RenderingContext): LitTemplate {
|
|
1333
1326
|
const nodes = match.node.name === 'CallExpression' ? Renderer.render(ASTUtils.children(match.node), context).nodes :
|
|
1334
1327
|
match.text;
|
|
1335
1328
|
if (!this.#treeElement?.editable() ||
|
|
@@ -1364,7 +1357,7 @@ export class AutoBaseRenderer extends AutoBaseRendererBase {
|
|
|
1364
1357
|
this.#computedStyleExtraFields = computedStyleExtraFields;
|
|
1365
1358
|
}
|
|
1366
1359
|
|
|
1367
|
-
override render(match: SDK.CSSPropertyParserMatchers.AutoBaseMatch, context: RenderingContext):
|
|
1360
|
+
override render(match: SDK.CSSPropertyParserMatchers.AutoBaseMatch, context: RenderingContext): LitTemplate {
|
|
1368
1361
|
const auto = Renderer.render(match.auto, context).nodes;
|
|
1369
1362
|
const base = Renderer.render(match.base, context).nodes;
|
|
1370
1363
|
|
|
@@ -1548,8 +1541,8 @@ export class ShadowModel implements InlineEditor.CSSShadowEditor.CSSShadowModel
|
|
|
1548
1541
|
return parts;
|
|
1549
1542
|
}
|
|
1550
1543
|
|
|
1551
|
-
renderContents():
|
|
1552
|
-
const parts: Array<string|
|
|
1544
|
+
renderContents(): LitTemplate {
|
|
1545
|
+
const parts: Array<string|LitTemplate> = [];
|
|
1553
1546
|
for (const part of this.#parts()) {
|
|
1554
1547
|
if (parts.length > 0) {
|
|
1555
1548
|
parts.push(' ');
|
|
@@ -1754,9 +1747,9 @@ export class ShadowRenderer extends ShadowRendererBase {
|
|
|
1754
1747
|
return new ShadowModel(shadowType, properties, context);
|
|
1755
1748
|
}
|
|
1756
1749
|
|
|
1757
|
-
override render(match: SDK.CSSPropertyParserMatchers.ShadowMatch, context: RenderingContext):
|
|
1750
|
+
override render(match: SDK.CSSPropertyParserMatchers.ShadowMatch, context: RenderingContext): LitTemplate {
|
|
1758
1751
|
const shadows = ASTUtils.split(ASTUtils.siblings(ASTUtils.declValue(match.node)));
|
|
1759
|
-
const result: Array<Node|
|
|
1752
|
+
const result: Array<Node|LitTemplate> = [];
|
|
1760
1753
|
// The text of the whole value is put together from the shadows below, so the changes that renderers make to their
|
|
1761
1754
|
// parts need to be recorded in a tracking of their own to not be hidden by it.
|
|
1762
1755
|
const nestedEdits = new ValueUpdateTracking(context.ast);
|
|
@@ -1801,7 +1794,7 @@ const GridTemplateRendererBase: RendererBase<SDK.CSSPropertyParserMatchers.GridT
|
|
|
1801
1794
|
// clang-format off
|
|
1802
1795
|
export class GridTemplateRenderer extends GridTemplateRendererBase {
|
|
1803
1796
|
// clang-format on
|
|
1804
|
-
override render(match: SDK.CSSPropertyParserMatchers.GridTemplateMatch, context: RenderingContext):
|
|
1797
|
+
override render(match: SDK.CSSPropertyParserMatchers.GridTemplateMatch, context: RenderingContext): LitTemplate {
|
|
1805
1798
|
if (match.lines.length <= 1) {
|
|
1806
1799
|
return Renderer.render(ASTUtils.siblings(ASTUtils.declValue(match.node)), context).nodes;
|
|
1807
1800
|
}
|
|
@@ -1865,7 +1858,7 @@ export class LengthRenderer extends LengthRendererBase {
|
|
|
1865
1858
|
this.#propertyName = propertyName;
|
|
1866
1859
|
}
|
|
1867
1860
|
|
|
1868
|
-
override render(match: SDK.CSSPropertyParserMatchers.LengthMatch, context: RenderingContext):
|
|
1861
|
+
override render(match: SDK.CSSPropertyParserMatchers.LengthMatch, context: RenderingContext): LitTemplate {
|
|
1869
1862
|
const template = html`${match.text}`;
|
|
1870
1863
|
const evaluation =
|
|
1871
1864
|
context.tracing?.applyEvaluation([], () => ({
|
|
@@ -1885,7 +1878,7 @@ export class LengthRenderer extends LengthRendererBase {
|
|
|
1885
1878
|
// clang-format on
|
|
1886
1879
|
}
|
|
1887
1880
|
|
|
1888
|
-
async getTooltipValue(match: SDK.CSSPropertyParser.Match, context: RenderingContext): Promise<
|
|
1881
|
+
async getTooltipValue(match: SDK.CSSPropertyParser.Match, context: RenderingContext): Promise<LitTemplate|null> {
|
|
1889
1882
|
const pixelValue =
|
|
1890
1883
|
(await resolveValues(this.#stylesContainer, this.#propertyName, match, context, match.text))?.[0];
|
|
1891
1884
|
if (context.signal?.aborted || !pixelValue || pixelValue === match.text) {
|
|
@@ -1919,7 +1912,7 @@ export class BaseFunctionRenderer extends BaseFunctionRendererBase {
|
|
|
1919
1912
|
this.#propertyName = propertyName;
|
|
1920
1913
|
}
|
|
1921
1914
|
|
|
1922
|
-
#renderArgs(renderedArgs:
|
|
1915
|
+
#renderArgs(renderedArgs: LitTemplate[], activeArgs?: boolean[]): TemplateResult {
|
|
1923
1916
|
return html`${renderedArgs.map((arg, idx) => {
|
|
1924
1917
|
const classes = classMap({'inactive-value': activeArgs?.[idx] === false});
|
|
1925
1918
|
return html`${idx === 0 ? nothing : ', '}<span class=${classes}>${arg}</span>`;
|
|
@@ -1927,7 +1920,7 @@ export class BaseFunctionRenderer extends BaseFunctionRendererBase {
|
|
|
1927
1920
|
}
|
|
1928
1921
|
|
|
1929
1922
|
override render(match: SDK.CSSPropertyParserMatchers.BaseFunctionMatch<string>,
|
|
1930
|
-
context: RenderingContext):
|
|
1923
|
+
context: RenderingContext): LitTemplate {
|
|
1931
1924
|
const childTracingContexts = context.tracing?.evaluation(match.args, {match, context});
|
|
1932
1925
|
const renderedArgs = match.args.map(
|
|
1933
1926
|
(arg, idx) =>
|
|
@@ -1953,7 +1946,7 @@ export class BaseFunctionRenderer extends BaseFunctionRendererBase {
|
|
|
1953
1946
|
}
|
|
1954
1947
|
|
|
1955
1948
|
async applyEvaluation(match: SDK.CSSPropertyParserMatchers.BaseFunctionMatch<string>,
|
|
1956
|
-
context: RenderingContext): Promise<
|
|
1949
|
+
context: RenderingContext): Promise<LitTemplate|null> {
|
|
1957
1950
|
const value = context.matchedResult.getComputedText(match.node, match => {
|
|
1958
1951
|
if (match instanceof SDK.CSSPropertyParserMatchers.RelativeColorChannelMatch) {
|
|
1959
1952
|
const relativeColor =
|
|
@@ -1969,9 +1962,8 @@ export class BaseFunctionRenderer extends BaseFunctionRendererBase {
|
|
|
1969
1962
|
return html`${evaled[0]}`;
|
|
1970
1963
|
}
|
|
1971
1964
|
|
|
1972
|
-
async applyMathFunction(renderedArgs:
|
|
1973
|
-
|
|
1974
|
-
context: RenderingContext): Promise<Lit.LitTemplate> {
|
|
1965
|
+
async applyMathFunction(renderedArgs: LitTemplate[], match: SDK.CSSPropertyParserMatchers.BaseFunctionMatch<string>,
|
|
1966
|
+
context: RenderingContext): Promise<LitTemplate> {
|
|
1975
1967
|
// To understand which argument was selected by the function, we evaluate the function as well as all the arguments
|
|
1976
1968
|
// and compare the function result to the values of all its arguments. Evaluating the arguments eliminates nested
|
|
1977
1969
|
// function calls and normalizes all units to px.
|
|
@@ -2158,8 +2150,7 @@ export class PositionAreaRenderer extends PositionAreaRendererBase {
|
|
|
2158
2150
|
(child): child is StylePropertyTreeElement =>
|
|
2159
2151
|
child instanceof StylePropertyTreeElement && child.property.name === propertyName);
|
|
2160
2152
|
}
|
|
2161
|
-
|
|
2162
|
-
override render(match: SDK.CSSPropertyParserMatchers.PositionAreaMatch, context: RenderingContext): Lit.LitTemplate {
|
|
2153
|
+
override render(match: SDK.CSSPropertyParserMatchers.PositionAreaMatch, context: RenderingContext): LitTemplate {
|
|
2163
2154
|
const children = Renderer.render(ASTUtils.siblings(ASTUtils.declValue(match.node)), context).nodes;
|
|
2164
2155
|
// The text of the match is the value as authored, which may contain comments or var()s that resolve to the area.
|
|
2165
2156
|
if (!this.#treeElement?.editable() ||
|
|
@@ -2207,7 +2198,6 @@ export class PositionAreaRenderer extends PositionAreaRendererBase {
|
|
|
2207
2198
|
});
|
|
2208
2199
|
}
|
|
2209
2200
|
}
|
|
2210
|
-
|
|
2211
2201
|
const updateProperty = (propertyName: string, computedStyle: Map<string, string>|null): void => {
|
|
2212
2202
|
const matchedStyles = active.treeElement.matchedStyles();
|
|
2213
2203
|
const resolved = matchedStyles.resolveProperty(propertyName, active.treeElement.property.ownerStyle);
|
|
@@ -2338,8 +2328,8 @@ export class PositionTryRenderer extends PositionTryRendererBase {
|
|
|
2338
2328
|
this.#treeElement = treeElement;
|
|
2339
2329
|
}
|
|
2340
2330
|
|
|
2341
|
-
override render(match: SDK.CSSPropertyParserMatchers.PositionTryMatch, context: RenderingContext):
|
|
2342
|
-
const content:
|
|
2331
|
+
override render(match: SDK.CSSPropertyParserMatchers.PositionTryMatch, context: RenderingContext): LitTemplate {
|
|
2332
|
+
const content: LitTemplate[] = [];
|
|
2343
2333
|
if (match.preamble.length > 0) {
|
|
2344
2334
|
const {nodes} = Renderer.render(match.preamble, context);
|
|
2345
2335
|
content.push(nodes);
|
|
@@ -2518,7 +2508,6 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2518
2508
|
carryOverCommittedProperty(previous: StylePropertyTreeElement): void {
|
|
2519
2509
|
this.#lastCommittedProperty = previous.#lastCommittedProperty;
|
|
2520
2510
|
}
|
|
2521
|
-
|
|
2522
2511
|
async gridNames(): Promise<Set<string>> {
|
|
2523
2512
|
if (!SDK.CSSMetadata.cssMetadata().isGridNameAwareProperty(this.name)) {
|
|
2524
2513
|
return new Set();
|
|
@@ -3135,10 +3124,10 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3135
3124
|
return swatch;
|
|
3136
3125
|
}
|
|
3137
3126
|
|
|
3138
|
-
getTracingTooltip(
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3127
|
+
getTracingTooltip(functionName: string, node: CodeMirror.SyntaxNode,
|
|
3128
|
+
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, computedStyles: Map<string, string>,
|
|
3129
|
+
computedStyleExtraFields: Protocol.CSS.ComputedStyleExtraFields|null,
|
|
3130
|
+
context: RenderingContext): TemplateResult {
|
|
3142
3131
|
if (context.tracing || !context.property) {
|
|
3143
3132
|
return html`${functionName}`;
|
|
3144
3133
|
}
|
|
@@ -1681,6 +1681,8 @@ export class StylesSidebarPane extends StylesSidebarPaneBase implements StylesCo
|
|
|
1681
1681
|
|
|
1682
1682
|
private createStylesSidebarToolbar(): HTMLElement {
|
|
1683
1683
|
const container = this.contentElement.createChild('div', 'styles-sidebar-pane-toolbar-container');
|
|
1684
|
+
// Sticky toolbar: comment overlays for rules scrolled under it are clipped (see CommentAnchorResolver).
|
|
1685
|
+
container.setAttribute('data-sticky-occluder', '');
|
|
1684
1686
|
container.role = 'toolbar';
|
|
1685
1687
|
const hbox = container.createChild('div', 'hbox styles-sidebar-pane-toolbar');
|
|
1686
1688
|
const toolbar = hbox.createChild('devtools-toolbar', 'styles-pane-toolbar');
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.divider {
|
|
21
|
-
|
|
21
|
+
/* Bleed across the 8px (--sys-size-5) inline padding
|
|
22
|
+
* of devtools-tooltip's .container. */
|
|
23
|
+
margin: var(--sys-size-5) calc(-1 * var(--sys-size-5));
|
|
22
24
|
border: var(--sys-size-1) solid var(--sys-color-divider);
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
align-items: center;
|
|
23
23
|
box-sizing: border-box;
|
|
24
24
|
width: var(--sys-size-7);
|
|
25
|
-
height
|
|
25
|
+
/* 8px (--sys-size-5) interior height + 2 * 1px (--sys-size-1) top/bottom borders. */
|
|
26
|
+
height: calc(var(--sys-size-5) + 2 * var(--sys-size-1));
|
|
26
27
|
margin: 0 var(--sys-size-2);
|
|
27
28
|
border: var(--sys-size-1) solid var(--override-adorner-border-color, var(--sys-color-tonal-outline));
|
|
28
|
-
border-radius:
|
|
29
|
+
border-radius: var(--sys-shape-corner-full);
|
|
29
30
|
background: var(--override-adorner-background-color, var(--sys-color-cdt-base-container));
|
|
30
31
|
padding: 0;
|
|
31
32
|
position: relative;
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.buttons > :first-child {
|
|
44
|
-
border-radius:
|
|
44
|
+
border-radius: var(--sys-shape-corner-extra-small) 0 0 var(--sys-shape-corner-extra-small);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.buttons > :last-child {
|
|
48
|
-
border-radius: 0
|
|
48
|
+
border-radius: 0 var(--sys-shape-corner-extra-small) var(--sys-shape-corner-extra-small) 0;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.button {
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
.metrics {
|
|
7
7
|
padding: var(--sys-size-5);
|
|
8
|
-
font-size:
|
|
8
|
+
font-size: var(--sys-typescale-body5-size);
|
|
9
|
+
line-height: var(--sys-size-6);
|
|
9
10
|
text-align: center;
|
|
10
11
|
white-space: nowrap;
|
|
11
12
|
height: var(--metrics-height);
|
|
@@ -41,7 +42,6 @@
|
|
|
41
42
|
|
|
42
43
|
.metrics .label {
|
|
43
44
|
position: absolute;
|
|
44
|
-
font-size: 10px;
|
|
45
45
|
left: var(--sys-size-3);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
display: inline-block;
|
|
76
76
|
text-align: center;
|
|
77
77
|
vertical-align: middle;
|
|
78
|
-
padding:
|
|
79
|
-
margin:
|
|
78
|
+
padding: var(--sys-size-2) var(--sys-size-4);
|
|
79
|
+
margin: var(--sys-size-2);
|
|
80
80
|
position: relative;
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
display: inline-block;
|
|
100
100
|
text-align: center;
|
|
101
101
|
vertical-align: middle;
|
|
102
|
-
padding:
|
|
103
|
-
margin:
|
|
102
|
+
padding: var(--sys-size-2);
|
|
103
|
+
margin: var(--sys-size-2);
|
|
104
104
|
min-width: var(--sys-size-19);
|
|
105
105
|
overflow: visible;
|
|
106
106
|
}
|
|
@@ -4,11 +4,6 @@
|
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
.properties-widget-section {
|
|
8
|
-
padding: var(--sys-size-2) 0 var(--sys-size-2) 5px;
|
|
9
|
-
flex: none;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
7
|
.properties-widget-toolbar {
|
|
13
8
|
border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
|
|
14
9
|
flex-shrink: 0;
|
|
@@ -147,7 +147,9 @@ export const DEFAULT_DEVICE_MODE_VIEW: DeviceModeViewView = (
|
|
|
147
147
|
'4K',
|
|
148
148
|
];
|
|
149
149
|
// clang-format off
|
|
150
|
-
render(
|
|
150
|
+
render(html`
|
|
151
|
+
<style>${deviceModeViewStyles}</style>
|
|
152
|
+
${input.showDeviceMode
|
|
151
153
|
? html`${UI.Widget.widget(DeviceModeToolbar, {model: input.model})}
|
|
152
154
|
<div class=${classMap({
|
|
153
155
|
'device-mode-content-clip': true,
|
|
@@ -246,7 +248,7 @@ export const DEFAULT_DEVICE_MODE_VIEW: DeviceModeViewView = (
|
|
|
246
248
|
</div>
|
|
247
249
|
</div>
|
|
248
250
|
`
|
|
249
|
-
: widget(() => InspectedPagePlaceholder.instance(), {minimumSize: new Geometry.Size(150, 150)})
|
|
251
|
+
: widget(() => InspectedPagePlaceholder.instance(), {minimumSize: new Geometry.Size(150, 150)})}`,
|
|
250
252
|
target, {
|
|
251
253
|
container: {
|
|
252
254
|
classes: ['device-mode-view'],
|
|
@@ -289,7 +291,6 @@ export class DeviceModeView extends UI.Widget.VBox {
|
|
|
289
291
|
this.#view = view;
|
|
290
292
|
|
|
291
293
|
this.setMinimumSize(150, 150);
|
|
292
|
-
this.registerRequiredCSS(deviceModeViewStyles);
|
|
293
294
|
|
|
294
295
|
this.model = EmulationModel.DeviceModeModel.DeviceModeModel.instance();
|
|
295
296
|
this.model.addEventListener(EmulationModel.DeviceModeModel.Events.UPDATED, this.updateUI, this);
|