Changeset 241980 in webkit
- Timestamp:
- Feb 22, 2019 8:07:58 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r241975 r241980 1 2019-02-22 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Styles Redesign: clicking CSS property or selector should always select its text 4 https://bugs.webkit.org/show_bug.cgi?id=180791 5 <rdar://problem/36038366> 6 7 Reviewed by Brian Burg. 8 9 * UserInterface/Views/SpreadsheetSelectorField.js: 10 (WI.SpreadsheetSelectorField): 11 (WI.SpreadsheetSelectorField.prototype.startEditing): 12 (WI.SpreadsheetSelectorField.prototype.stopEditing): 13 (WI.SpreadsheetSelectorField.prototype._handleMouseDown): Added. 14 (WI.SpreadsheetSelectorField.prototype._handleMouseUp): Added. 15 (WI.SpreadsheetSelectorField.prototype._handleFocus): Deleted. 16 17 * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: 18 (WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout): 19 * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css: 20 (.spreadsheet-css-declaration .selector.editing:focus, .spreadsheet-css-declaration .selector > .matched): Added. 21 (.spreadsheet-css-declaration .selector.spreadsheet-selector-field): 22 (.spreadsheet-css-declaration .selector:focus, .spreadsheet-css-declaration .selector > .matched): Deleted. 23 1 24 2019-02-22 Nikita Vasilyev <nvasilyev@apple.com> 2 25 -
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css
r241638 r241980 104 104 } 105 105 106 .spreadsheet-css-declaration .selector :focus,106 .spreadsheet-css-declaration .selector.editing:focus, 107 107 .spreadsheet-css-declaration .selector > .matched { 108 108 color: var(--text-color); … … 120 120 121 121 .spreadsheet-css-declaration .selector.spreadsheet-selector-field { 122 outline -offset: -3px;122 outline: none; 123 123 } 124 124 -
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js
r241226 r241980 82 82 if (this._style.selectorEditable) { 83 83 this._selectorTextField = new WI.SpreadsheetSelectorField(this, this._selectorElement); 84 this._selectorTextField.addEventListener(WI.SpreadsheetSelectorField.Event.StartedEditing, (event) => { 85 this._headerElement.classList.add("editing-selector"); 86 }); 87 this._selectorTextField.addEventListener(WI.SpreadsheetSelectorField.Event.StoppedEditing, (event) => { 88 this._headerElement.classList.remove("editing-selector"); 89 }); 90 84 91 this._selectorElement.tabIndex = 0; 85 this._selectorElement.addEventListener("focus", () => this._headerElement.classList.add("editing-selector"));86 this._selectorElement.addEventListener("blur", () => this._headerElement.classList.remove("editing-selector"));87 92 } 88 93 -
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetSelectorField.js
r239527 r241980 24 24 */ 25 25 26 WI.SpreadsheetSelectorField = class SpreadsheetSelectorField 26 WI.SpreadsheetSelectorField = class SpreadsheetSelectorField extends WI.Object 27 27 { 28 28 constructor(delegate, element) 29 29 { 30 super(); 31 30 32 this._delegate = delegate; 31 33 this._element = element; 32 34 this._element.classList.add("spreadsheet-selector-field"); 33 35 34 this._element.addEventListener("focus", this._handleFocus.bind(this)); 36 this._element.addEventListener("mousedown", this._handleMouseDown.bind(this)); 37 this._element.addEventListener("mouseup", this._handleMouseUp.bind(this)); 35 38 this._element.addEventListener("blur", this._handleBlur.bind(this)); 36 39 this._element.addEventListener("keydown", this._handleKeyDown.bind(this)); 37 40 38 41 this._editing = false; 42 this._handledMouseDown = false; 39 43 } 40 44 … … 60 64 61 65 this._selectText(); 66 67 this.dispatchEventToListeners(WI.SpreadsheetSelectorField.Event.StartedEditing); 62 68 } 63 69 … … 70 76 this._element.classList.remove("editing"); 71 77 this._element.contentEditable = false; 78 79 this.dispatchEventToListeners(WI.SpreadsheetSelectorField.Event.StoppedEditing); 72 80 } 73 81 … … 79 87 } 80 88 81 _handle Focus(event)89 _handleMouseDown(event) 82 90 { 91 this._handledMouseDown = true; 92 } 93 94 _handleMouseUp(event) 95 { 96 if (!this._handledMouseDown) 97 return; 98 99 this._handledMouseDown = false; 100 83 101 this.startEditing(); 84 102 } … … 131 149 } 132 150 }; 151 152 WI.SpreadsheetSelectorField.Event = { 153 StartedEditing: "spreadsheet-selector-field-started-editing", 154 StoppedEditing: "spreadsheet-selector-field-stopped-editing", 155 };
Note: See TracChangeset
for help on using the changeset viewer.