Changeset 243826 in webkit
- Timestamp:
- Apr 3, 2019, 2:03:58 PM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r243819 r243826 1 2019-04-03 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Single click on links in non-read-only TextEditors should not follow links 4 https://bugs.webkit.org/show_bug.cgi?id=123364 5 <rdar://problem/15323913> 6 7 Reviewed by Timothy Hatcher. 8 9 * UserInterface/Base/Main.js: 10 (WI._updateModifierKeys): 11 Add classes to the body whenever alt, shift, or ctrl are pressed. 12 13 * UserInterface/Views/CodeMirrorEditor.js: 14 (WI.CodeMirrorEditor.create): 15 Add a `read-only` class if the `CodeMirror` is readonly. 16 17 * UserInterface/Views/SyntaxHighlightingDefaultTheme.css: 18 (.cm-s-default .cm-link,): 19 (.read-only.cm-s-default .cm-link:hover,): 20 (.cm-s-default .cm-link:hover,): Deleted. 21 22 * UserInterface/Views/TextEditor.js: 23 (WI.TextEditor.prototype.set readOnly): 24 (WI.TextEditor.prototype._openClickedLinks): 25 1 26 2019-04-03 Myles C. Maxfield <mmaxfield@apple.com> 2 27 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r243355 r243826 1652 1652 WI._updateModifierKeys = function(event) 1653 1653 { 1654 let metaKeyDidChange = this.modifierKeys.metaKey !== event.metaKey; 1655 let didChange = this.modifierKeys.altKey !== event.altKey || metaKeyDidChange || this.modifierKeys.shiftKey !== event.shiftKey; 1656 1657 this.modifierKeys = {altKey: event.altKey, metaKey: event.metaKey, shiftKey: event.shiftKey}; 1658 1659 if (metaKeyDidChange) 1660 document.body.classList.toggle("meta-key-pressed", this.modifierKeys.metaKey); 1661 1662 if (didChange) 1654 let keys = { 1655 altKey: event.altKey, 1656 metaKey: event.metaKey, 1657 ctrlKey: event.ctrlKey, 1658 shiftKey: event.shiftKey, 1659 }; 1660 1661 let changed = !Object.shallowEqual(this.modifierKeys, keys); 1662 1663 this.modifierKeys = keys; 1664 1665 document.body.classList.toggle("alt-key-pressed", this.modifierKeys.altKey); 1666 document.body.classList.toggle("ctrl-key-pressed", this.modifierKeys.ctrlKey); 1667 document.body.classList.toggle("meta-key-pressed", this.modifierKeys.metaKey); 1668 document.body.classList.toggle("shift-key-pressed", this.modifierKeys.shiftKey); 1669 1670 if (changed) 1663 1671 this.notifications.dispatchEventToListeners(WI.Notification.GlobalModifierKeysDidChange, event); 1664 1672 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorEditor.js
r233920 r243826 32 32 // Clients can override this if custom layout for RTL is available. 33 33 element.setAttribute("dir", "ltr"); 34 element.classList.toggle("read-only", options.readOnly); 34 35 35 36 let codeMirror = new CodeMirror(element, options); -
trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css
r239760 r243826 83 83 .syntax-highlighted a { 84 84 text-decoration: none; 85 cursor: pointer;86 85 } 87 86 88 .cm-s-default .cm-link:hover, 87 .read-only.cm-s-default .cm-link:hover, 88 .mac-platform.meta-key-pressed :not(.read-only).cm-s-default .cm-link:hover, 89 :not(.mac-platform).control-key-pressed :not(.read-only).cm-s-default .cm-link:hover, 89 90 .syntax-highlighted a:hover { 90 91 text-decoration: underline; 92 cursor: pointer; 91 93 } 92 94 -
trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js
r242018 r243826 181 181 { 182 182 this._codeMirror.setOption("readOnly", readOnly); 183 this._codeMirror.getWrapperElement().classList.toggle("read-only", !!readOnly); 183 184 } 184 185 … … 1688 1689 _openClickedLinks(event) 1689 1690 { 1691 if (!this.readOnly && !event.commandOrControlKey) 1692 return; 1693 1690 1694 // Get the position in the text and the token at that position. 1691 1695 var position = this._codeMirror.coordsChar({left: event.pageX, top: event.pageY});
Note:
See TracChangeset
for help on using the changeset viewer.