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

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

Issue 602783002: Devtools: make DOM traversal utilities climb shadow tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 var element = /** {!Element} */ (node); 178 var element = /** {!Element} */ (node);
179 if (element.classList.contains("text-prompt") || element.nodeName === "INPUT " || element.nodeName === "TEXTAREA") 179 if (element.classList.contains("text-prompt") || element.nodeName === "INPUT " || element.nodeName === "TEXTAREA")
180 return true; 180 return true;
181 181
182 if (!WebInspector.__editingCount) 182 if (!WebInspector.__editingCount)
183 return false; 183 return false;
184 184
185 while (element) { 185 while (element) {
186 if (element.__editing) 186 if (element.__editing)
187 return true; 187 return true;
188 element = element.parentElement; 188 element = element.parentElementOrShadowHost();
189 } 189 }
190 return false; 190 return false;
191 } 191 }
192 192
193 /** 193 /**
194 * @param {!Element} element 194 * @param {!Element} element
195 * @param {boolean} value 195 * @param {boolean} value
196 * @return {boolean} 196 * @return {boolean}
197 */ 197 */
198 WebInspector.markBeingEdited = function(element, value) 198 WebInspector.markBeingEdited = function(element, value)
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 window.addEventListener("focus", WebInspector._windowFocused, false); 1078 window.addEventListener("focus", WebInspector._windowFocused, false);
1079 window.addEventListener("blur", WebInspector._windowBlurred, false); 1079 window.addEventListener("blur", WebInspector._windowBlurred, false);
1080 document.addEventListener("focus", WebInspector._focusChanged, true); 1080 document.addEventListener("focus", WebInspector._focusChanged, true);
1081 document.addEventListener("blur", WebInspector._documentBlurred, true); 1081 document.addEventListener("blur", WebInspector._documentBlurred, true);
1082 window.removeEventListener("DOMContentLoaded", windowLoaded, false); 1082 window.removeEventListener("DOMContentLoaded", windowLoaded, false);
1083 } 1083 }
1084 1084
1085 window.addEventListener("DOMContentLoaded", windowLoaded, false); 1085 window.addEventListener("DOMContentLoaded", windowLoaded, false);
1086 1086
1087 })(); 1087 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698