| OLD | NEW |
| 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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 entry.node.remove(); | 921 entry.node.remove(); |
| 922 break; | 922 break; |
| 923 case "changed": | 923 case "changed": |
| 924 entry.node.textContent = entry.oldText; | 924 entry.node.textContent = entry.oldText; |
| 925 break; | 925 break; |
| 926 } | 926 } |
| 927 } | 927 } |
| 928 } | 928 } |
| 929 | 929 |
| 930 /** | 930 /** |
| 931 * @param {!Element} element |
| 932 * @param {?Element=} containerElement |
| 933 * @return {!Size} |
| 934 */ |
| 935 WebInspector.measurePreferredSize = function(element, containerElement) |
| 936 { |
| 937 containerElement = containerElement || element.ownerDocument.body; |
| 938 containerElement.appendChild(element); |
| 939 var fakingComponentRoot = WebInspector.installComponentRootStyles(element); |
| 940 element.positionAt(0, 0); |
| 941 var result = new Size(element.offsetWidth, element.offsetHeight); |
| 942 element.positionAt(undefined, undefined); |
| 943 element.remove(); |
| 944 if (fakingComponentRoot) |
| 945 WebInspector.uninstallComponentRootStyles(element); |
| 946 return result; |
| 947 } |
| 948 |
| 949 /** |
| 931 * @constructor | 950 * @constructor |
| 932 * @param {boolean} autoInvoke | 951 * @param {boolean} autoInvoke |
| 933 */ | 952 */ |
| 934 WebInspector.InvokeOnceHandlers = function(autoInvoke) | 953 WebInspector.InvokeOnceHandlers = function(autoInvoke) |
| 935 { | 954 { |
| 936 this._handlers = null; | 955 this._handlers = null; |
| 937 this._autoInvoke = autoInvoke; | 956 this._autoInvoke = autoInvoke; |
| 938 } | 957 } |
| 939 | 958 |
| 940 WebInspector.InvokeOnceHandlers.prototype = { | 959 WebInspector.InvokeOnceHandlers.prototype = { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 /** | 1164 /** |
| 1146 * @param {!Window} window | 1165 * @param {!Window} window |
| 1147 */ | 1166 */ |
| 1148 WebInspector.initializeUIUtils = function(window) | 1167 WebInspector.initializeUIUtils = function(window) |
| 1149 { | 1168 { |
| 1150 window.addEventListener("focus", WebInspector._windowFocused.bind(WebInspect
or, window.document), false); | 1169 window.addEventListener("focus", WebInspector._windowFocused.bind(WebInspect
or, window.document), false); |
| 1151 window.addEventListener("blur", WebInspector._windowBlurred.bind(WebInspecto
r, window.document), false); | 1170 window.addEventListener("blur", WebInspector._windowBlurred.bind(WebInspecto
r, window.document), false); |
| 1152 window.document.addEventListener("focus", WebInspector._focusChanged.bind(We
bInspector, window.document), true); | 1171 window.document.addEventListener("focus", WebInspector._focusChanged.bind(We
bInspector, window.document), true); |
| 1153 window.document.addEventListener("blur", WebInspector._documentBlurred.bind(
WebInspector, window.document), true); | 1172 window.document.addEventListener("blur", WebInspector._documentBlurred.bind(
WebInspector, window.document), true); |
| 1154 } | 1173 } |
| OLD | NEW |