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

Unified Diff: Source/devtools/front_end/ui/UIUtils.js

Issue 675753002: [DevTools] Drop "ui" module from toolbox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/ui/RootView.js ('k') | Source/devtools/front_end/ui/module.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/UIUtils.js
diff --git a/Source/devtools/front_end/ui/UIUtils.js b/Source/devtools/front_end/ui/UIUtils.js
index 0730e8cc62146c6ea5a42cba7e7efe12aa53bb5f..e2c33c5fd0b1bc8a8227e7329637db3bf5b6b638 100644
--- a/Source/devtools/front_end/ui/UIUtils.js
+++ b/Source/devtools/front_end/ui/UIUtils.js
@@ -928,6 +928,25 @@ WebInspector.revertDomChanges = function(domChanges)
}
/**
+ * @param {!Element} element
+ * @param {?Element=} containerElement
+ * @return {!Size}
+ */
+WebInspector.measurePreferredSize = function(element, containerElement)
+{
+ containerElement = containerElement || element.ownerDocument.body;
+ containerElement.appendChild(element);
+ var fakingComponentRoot = WebInspector.installComponentRootStyles(element);
+ element.positionAt(0, 0);
+ var result = new Size(element.offsetWidth, element.offsetHeight);
+ element.positionAt(undefined, undefined);
+ element.remove();
+ if (fakingComponentRoot)
+ WebInspector.uninstallComponentRootStyles(element);
+ return result;
+}
+
+/**
* @constructor
* @param {boolean} autoInvoke
*/
« no previous file with comments | « Source/devtools/front_end/ui/RootView.js ('k') | Source/devtools/front_end/ui/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698