Changeset 238882 in webkit
- Timestamp:
- Dec 4, 2018 5:37:03 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r238871 r238882 1 2018-12-04 Nikita Vasilyev <nvasilyev@apple.com> 2 3 Web Inspector: Add style editing debug mode 4 https://bugs.webkit.org/show_bug.cgi?id=192282 5 <rdar://problem/46399176> 6 7 Reviewed by Matt Baker. 8 9 Introduce a style editing debug mode to help to troubleshoot complex bugs in the style editor. 10 11 - Log CSS changes; 12 - Display red border for locked style declarations. 13 14 * UserInterface/Base/Setting.js: 15 * UserInterface/Models/CSSProperty.js: 16 (WI.CSSProperty.prototype._updateOwnerStyleText): 17 * UserInterface/Views/SettingsTabContentView.js: 18 (WI.SettingsTabContentView.prototype._createDebugSettingsView): 19 * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css: 20 (.spreadsheet-style-declaration-editor.debug-style-locked::after): 21 * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js: 22 (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout): 23 (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._updateStyleLock): 24 (WI.SpreadsheetCSSStyleDeclarationEditor.prototype._updateDebugLockStatus): 25 1 26 2018-12-04 Matt Baker <mattbaker@apple.com> 2 27 -
trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js
r238649 r238882 139 139 autoLogTimeStats: new WI.Setting("auto-collect-time-stats", false), 140 140 enableLayoutFlashing: new WI.Setting("enable-layout-flashing", false), 141 enableStyleEditingDebugMode: new WI.Setting("enable-style-editing-debug-mode", false), 141 142 enableUncaughtExceptionReporter: new WI.Setting("enable-uncaught-exception-reporter", true), 142 143 filterMultiplexingBackendInspectorProtocolMessages: new WI.Setting("filter-multiplexing-backend-inspector-protocol-messages", true), -
trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js
r237659 r238882 370 370 console.assert(oldText === styleText.slice(range.startOffset, range.endOffset), "_styleSheetTextRange data is invalid."); 371 371 372 if (WI.settings.enableStyleEditingDebugMode.value) { 373 let prefix = styleText.slice(0, range.startOffset); 374 let postfix = styleText.slice(range.endOffset); 375 console.info(`${prefix}%c${oldText}%c${newText}%c${postfix}`, `background: hsl(356, 100%, 90%); color: black`, `background: hsl(100, 100%, 91%); color: black`, `background: transparent`); 376 } 377 372 378 let newStyleText = this._appendSemicolonIfNeeded(styleText.slice(0, range.startOffset)) + newText + styleText.slice(range.endOffset); 373 379 -
trunk/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
r238649 r238882 318 318 this._debugSettingsView.addSeparator(); 319 319 320 this._debugSettingsView.addSetting(WI.unlocalizedString("Styles:"), WI.settings.enableStyleEditingDebugMode, WI.unlocalizedString("Enable style editing debug mode")); 321 322 this._debugSettingsView.addSeparator(); 323 320 324 this._debugSettingsView.addSetting(WI.unlocalizedString("Debugging:"), WI.settings.pauseForInternalScripts, WI.unlocalizedString("Pause in WebKit-internal scripts")); 321 325 -
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css
r238762 r238882 165 165 } 166 166 167 .spreadsheet-style-declaration-editor.debug-style-locked::after { 168 content: ""; 169 position: absolute; 170 top: 0; 171 bottom: 0; 172 right: 0; 173 width: 2px; 174 background-color: red; 175 pointer-events: none; 176 } 177 167 178 @media (prefers-dark-interface) { 168 179 .spreadsheet-style-declaration-editor { -
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js
r238813 r238882 113 113 else if (this.hasSelectedProperties()) 114 114 this.selectProperties(this._anchorIndex, this._focusIndex); 115 116 this._updateDebugLockStatus(); 115 117 } 116 118 … … 611 613 612 614 this._style.locked = this._focused || this._inlineSwatchActive; 615 this._updateDebugLockStatus(); 616 } 617 618 _updateDebugLockStatus() 619 { 620 if (!this._style || !WI.settings.enableStyleEditingDebugMode.value) 621 return; 622 623 this.element.classList.toggle("debug-style-locked", this._style.locked); 613 624 } 614 625 };
Note: See TracChangeset
for help on using the changeset viewer.