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

Unified Diff: third_party/WebKit/LayoutTests/imported/csswg-test/css-display-3/support/util.js

Issue 2588093003: Import display: contents tests from csswg-test. (Closed)
Patch Set: Rebased Created 4 years 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 | « third_party/WebKit/LayoutTests/imported/csswg-test/css-display-3/support/acid.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/csswg-test/css-display-3/support/acid.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698