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

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

Issue 2626143004: DevTools: move from Common module - Geometry and CSSShadowModel (Closed)
Patch Set: minimize test diff Created 3 years, 11 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
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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 case 'changed': 983 case 'changed':
984 entry.node.textContent = entry.oldText; 984 entry.node.textContent = entry.oldText;
985 break; 985 break;
986 } 986 }
987 } 987 }
988 }; 988 };
989 989
990 /** 990 /**
991 * @param {!Element} element 991 * @param {!Element} element
992 * @param {?Element=} containerElement 992 * @param {?Element=} containerElement
993 * @return {!Size} 993 * @return {!UI.Size}
994 */ 994 */
995 UI.measurePreferredSize = function(element, containerElement) { 995 UI.measurePreferredSize = function(element, containerElement) {
996 var oldParent = element.parentElement; 996 var oldParent = element.parentElement;
997 var oldNextSibling = element.nextSibling; 997 var oldNextSibling = element.nextSibling;
998 containerElement = containerElement || element.ownerDocument.body; 998 containerElement = containerElement || element.ownerDocument.body;
999 containerElement.appendChild(element); 999 containerElement.appendChild(element);
1000 element.positionAt(0, 0); 1000 element.positionAt(0, 0);
1001 var result = element.getBoundingClientRect(); 1001 var result = element.getBoundingClientRect();
1002 1002
1003 element.positionAt(undefined, undefined); 1003 element.positionAt(undefined, undefined);
1004 if (oldParent) 1004 if (oldParent)
1005 oldParent.insertBefore(element, oldNextSibling); 1005 oldParent.insertBefore(element, oldNextSibling);
1006 else 1006 else
1007 element.remove(); 1007 element.remove();
1008 return new Size(result.width, result.height); 1008 return new UI.Size(result.width, result.height);
1009 }; 1009 };
1010 1010
1011 /** 1011 /**
1012 * @unrestricted 1012 * @unrestricted
1013 */ 1013 */
1014 UI.InvokeOnceHandlers = class { 1014 UI.InvokeOnceHandlers = class {
1015 /** 1015 /**
1016 * @param {boolean} autoInvoke 1016 * @param {boolean} autoInvoke
1017 */ 1017 */
1018 constructor(autoInvoke) { 1018 constructor(autoInvoke) {
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 var fileSelectorElement = createElement('input'); 2025 var fileSelectorElement = createElement('input');
2026 fileSelectorElement.type = 'file'; 2026 fileSelectorElement.type = 'file';
2027 fileSelectorElement.style.display = 'none'; 2027 fileSelectorElement.style.display = 'none';
2028 fileSelectorElement.setAttribute('tabindex', -1); 2028 fileSelectorElement.setAttribute('tabindex', -1);
2029 fileSelectorElement.onchange = onChange; 2029 fileSelectorElement.onchange = onChange;
2030 function onChange(event) { 2030 function onChange(event) {
2031 callback(fileSelectorElement.files[0]); 2031 callback(fileSelectorElement.files[0]);
2032 } 2032 }
2033 return fileSelectorElement; 2033 return fileSelectorElement;
2034 }; 2034 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698