Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2094873002: DevTools: fix deepActiveElement and focus on Dialog when document blurs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-added buttons as default elements and fix deepActiveElement and dialog focus Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/Dialog.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
5 * Copyright (C) 2009 Joseph Pecoraro 5 * Copyright (C) 2009 Joseph Pecoraro
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 if (!WebInspector._isTextEditingElement(x) && selection.isCollapsed && ! x.isInsertionCaretInside()) { 869 if (!WebInspector._isTextEditingElement(x) && selection.isCollapsed && ! x.isInsertionCaretInside()) {
870 var selectionRange = x.ownerDocument.createRange(); 870 var selectionRange = x.ownerDocument.createRange();
871 selectionRange.setStart(x, 0); 871 selectionRange.setStart(x, 0);
872 selectionRange.setEnd(x, 0); 872 selectionRange.setEnd(x, 0);
873 873
874 selection.removeAllRanges(); 874 selection.removeAllRanges();
875 selection.addRange(selectionRange); 875 selection.addRange(selectionRange);
876 } 876 }
877 } else if (WebInspector._previousFocusElement) 877 } else if (WebInspector._previousFocusElement)
878 WebInspector._previousFocusElement.blur(); 878 WebInspector._previousFocusElement.blur();
879
880 if (!x)
881 WebInspector.Dialog.focus();
dgozman 2016/06/29 22:19:15 I wonder how the dialog is different from document
luoe 2016/06/30 00:03:16 When the document is blurred (e.g. clicking on a n
879 } 882 }
880 883
881 WebInspector.restoreFocusFromElement = function(element) 884 WebInspector.restoreFocusFromElement = function(element)
882 { 885 {
883 if (element && element.isSelfOrAncestor(WebInspector.currentFocusElement())) 886 if (element && element.isSelfOrAncestor(WebInspector.currentFocusElement()))
884 WebInspector.setCurrentFocusElement(WebInspector.previousFocusElement()) ; 887 WebInspector.setCurrentFocusElement(WebInspector.previousFocusElement()) ;
885 } 888 }
886 889
887 /** 890 /**
888 * @param {!Element} element 891 * @param {!Element} element
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1978 * @param {string} title 1981 * @param {string} title
1979 * @return {!Element} 1982 * @return {!Element}
1980 */ 1983 */
1981 WebInspector.linkifyDocumentationURLAsNode = function(article, title) 1984 WebInspector.linkifyDocumentationURLAsNode = function(article, title)
1982 { 1985 {
1983 return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tool s/chrome-devtools/" + article, title, undefined, true); 1986 return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tool s/chrome-devtools/" + article, title, undefined, true);
1984 } 1987 }
1985 1988
1986 /** @type {!WebInspector.ThemeSupport} */ 1989 /** @type {!WebInspector.ThemeSupport} */
1987 WebInspector.themeSupport; 1990 WebInspector.themeSupport;
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/Dialog.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698