@@ -122,14 +122,6 @@ const UIStrings = {
122122 *@description Rendering emulation option for toggling the automatic dark mode
123123 */
124124 automaticDarkMode : 'Automatic dark mode' ,
125- /**
126- *@description Tooltip text that appears when hovering over the css changes button in the Styles Sidebar Pane of the Elements panel
127- */
128- copyAllCSSChanges : 'Copy CSS changes' ,
129- /**
130- *@description Tooltip text that appears after clicking on the copy CSS changes button
131- */
132- copiedToClipboard : 'Copied to clipboard' ,
133125 /**
134126 *@description Text displayed on layer separators in the styles sidebar pane.
135127 */
@@ -211,7 +203,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
211203
212204 activeCSSAngle : InlineEditor . CSSAngle . CSSAngle | null = null ;
213205 #urlToChangeTracker = new Map < Platform . DevToolsPath . UrlString , ChangeTracker > ( ) ;
214- #copyChangesButton?: UI . Toolbar . ToolbarButton ;
215206 #updateAbortController?: AbortController ;
216207 #updateComputedStylesAbortController?: AbortController ;
217208
@@ -586,11 +577,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
586577 if ( ! this . initialUpdateCompleted ) {
587578 this . initialUpdateCompleted = true ;
588579 this . appendToolbarItem ( this . createRenderingShortcuts ( ) ) ;
589- if ( Root . Runtime . experiments . isEnabled ( Root . Runtime . ExperimentName . STYLES_PANE_CSS_CHANGES ) ) {
590- this . #copyChangesButton = this . createCopyAllChangesButton ( ) ;
591- this . appendToolbarItem ( this . #copyChangesButton) ;
592- this . #copyChangesButton. element . classList . add ( 'hidden' ) ;
593- }
594580 this . dispatchEventToListeners ( Events . INITIAL_UPDATE_COMPLETED ) ;
595581 }
596582
@@ -1057,16 +1043,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
10571043 // the matched styles we reenable the button.
10581044 LayersWidget . ButtonProvider . instance ( ) . item ( ) . setVisible ( false ) ;
10591045
1060- const refreshedURLs = new Set < string > ( ) ;
10611046 for ( const style of matchedStyles . nodeStyles ( ) ) {
1062- if ( Root . Runtime . experiments . isEnabled ( Root . Runtime . ExperimentName . STYLES_PANE_CSS_CHANGES ) && style . parentRule ) {
1063- const url = style . parentRule . resourceURL ( ) ;
1064- if ( url && ! refreshedURLs . has ( url ) ) {
1065- await this . trackURLForChanges ( url ) ;
1066- refreshedURLs . add ( url ) ;
1067- }
1068- }
1069-
10701047 const parentNode = matchedStyles . isInherited ( style ) ? matchedStyles . nodeForStyle ( style ) : null ;
10711048 if ( parentNode && parentNode !== lastParentNode ) {
10721049 lastParentNode = parentNode ;
@@ -1394,22 +1371,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
13941371 return changedLines . has ( formattedLineNumber + 1 ) ;
13951372 }
13961373
1397- updateChangeStatus ( ) : void {
1398- if ( ! this . #copyChangesButton) {
1399- return ;
1400- }
1401-
1402- let hasChangedStyles = false ;
1403- for ( const changeTracker of this . #urlToChangeTracker. values ( ) ) {
1404- if ( changeTracker . changedLines . size > 0 ) {
1405- hasChangedStyles = true ;
1406- break ;
1407- }
1408- }
1409-
1410- this . #copyChangesButton. element . classList . toggle ( 'hidden' , ! hasChangedStyles ) ;
1411- }
1412-
14131374 private async refreshChangedLines ( uiSourceCode : Workspace . UISourceCode . UISourceCode ) : Promise < void > {
14141375 const changeTracker = this . #urlToChangeTracker. get ( uiSourceCode . url ( ) ) ;
14151376 if ( ! changeTracker ) {
@@ -1586,27 +1547,6 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
15861547
15871548 return button ;
15881549 }
1589-
1590- private createCopyAllChangesButton ( ) : UI . Toolbar . ToolbarButton {
1591- const copyAllChangesButton = new UI . Toolbar . ToolbarButton ( i18nString ( UIStrings . copyAllCSSChanges ) , 'copy' ) ;
1592- // TODO(1296947): implement a dedicated component to share between all copy buttons
1593- copyAllChangesButton . element . setAttribute ( 'data-content' , i18nString ( UIStrings . copiedToClipboard ) ) ;
1594- let timeout : number | undefined ;
1595- copyAllChangesButton . addEventListener ( UI . Toolbar . ToolbarButton . Events . CLICK , async ( ) => {
1596- const allChanges = await this . getFormattedChanges ( ) ;
1597- Host . InspectorFrontendHost . InspectorFrontendHostInstance . copyText ( allChanges ) ;
1598- if ( timeout ) {
1599- clearTimeout ( timeout ) ;
1600- timeout = undefined ;
1601- }
1602- copyAllChangesButton . element . classList . add ( 'copied-to-clipboard' ) ;
1603- timeout = window . setTimeout ( ( ) => {
1604- copyAllChangesButton . element . classList . remove ( 'copied-to-clipboard' ) ;
1605- timeout = undefined ;
1606- } , 2000 ) ;
1607- } ) ;
1608- return copyAllChangesButton ;
1609- }
16101550}
16111551
16121552export const enum Events {
0 commit comments