Eliminate a request for layout every time an item is added to the stage of the graphi...
[WebKit-https.git] / PerformanceTests / Animometer / resources / extensions.js
index 35673bf..a090eca 100644 (file)
@@ -68,6 +68,16 @@ function Insets(top, right, bottom, left)
     this.left = left;
 }
 
+Insets.elementPadding = function(element)
+{
+    var styles = window.getComputedStyle(element);
+    return new Insets(
+        parseFloat(styles.paddingTop),
+        parseFloat(styles.paddingRight),
+        parseFloat(styles.paddingBottom),
+        parseFloat(styles.paddingTop));
+}
+
 Insets.prototype =
 {
     get width()