Index: third_party/WebKit/LayoutTests/imported/csswg-test/css-display-3/support/util.js |
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-display-3/support/util.js b/third_party/WebKit/LayoutTests/imported/csswg-test/css-display-3/support/util.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..08024b52d5fd82e18fc482888164cbe127239329 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-display-3/support/util.js |
@@ -0,0 +1,23 @@ |
+function eachDisplayContentsElementIn(document, window, callbackDo, callbackUndo) { |
+ var elements = []; |
+ |
+ document.body.offsetHeight; |
+ |
+ // NOTE: Doing qsa('*') and getComputedStyle is just for the |
+ // test's sake, since it's easier to mess it up when |
+ // getComputedStyle is involved. |
+ var all = document.querySelectorAll('*'); |
+ for (var i = 0; i < all.length; ++i) { |
+ if (window.getComputedStyle(all[i]).display === "contents") { |
+ callbackDo(all[i]); |
+ elements.push(all[i]); |
+ } |
+ } |
+ |
+ document.body.offsetHeight; |
+ |
+ for (var i = 0; i < elements.length; ++i) |
+ callbackUndo(elements[i]); |
+ |
+ document.body.offsetHeight; |
+} |