Changeset 251958 in webkit
- Timestamp:
- Nov 1, 2019 5:19:13 PM (4 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r251933 r251958 1 2019-11-01 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: default to focusing the console prompt if no other content is focused after opening Web Inspector 4 https://bugs.webkit.org/show_bug.cgi?id=203743 5 6 Reviewed by Eric Carlson and Brian Burg. 7 8 * UserInterface/Base/Main.js: 9 (WI.isContentAreaFocused): Added. 10 (WI.isConsoleFocused): 11 (WI._focusChanged): 12 (WI._restoreCookieForOpenTabs): 13 1 14 2019-11-01 Nikita Vasilyev <nvasilyev@apple.com> 2 15 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r251922 r251958 934 934 }; 935 935 936 WI.isContentAreaFocused = function() 937 { 938 return WI._contentElement.contains(document.activeElement); 939 } 940 936 941 WI.isConsoleFocused = function() 937 942 { 938 return WI.quickConsole.prompt.focused;943 return !WI._didAutofocusConsolePrompt && WI.quickConsole.prompt.focused; 939 944 }; 940 945 … … 1375 1380 WI._focusChanged = function(event) 1376 1381 { 1382 WI._didAutofocusConsolePrompt = false; 1383 1377 1384 // Make a caret selection inside the focused element if there isn't a range selection and there isn't already 1378 1385 // a caret selection inside. This is needed (at least) to remove caret from console when focus is moved. … … 1549 1556 tabContentView.restoreStateFromCookie(restorationType); 1550 1557 } 1558 1559 window.requestAnimationFrame(() => { 1560 if (WI.isContentAreaFocused()) 1561 return; 1562 1563 WI.quickConsole.prompt.focus(); 1564 WI._didAutofocusConsolePrompt = true; 1565 }); 1551 1566 }; 1552 1567
Note: See TracChangeset
for help on using the changeset viewer.