[@container] idlharness test for @container rule
Bug: 1217931
Change-Id: I1dd035505f8302c17ed43902b63f0196f4ddd61d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3545349
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984329}
diff --git a/css/css-contain/container-queries/idlharness.html b/css/css-contain/container-queries/idlharness.html
new file mode 100644
index 0000000..4e32964
--- /dev/null
+++ b/css/css-contain/container-queries/idlharness.html
@@ -0,0 +1,29 @@
+<!doctype html>
+<title>CSS Container Queries: CSSContainer Rule IDL tests</title>
+<link rel="help" href="https://drafts.csswg.org/css-contain-3/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/WebIDLParser.js"></script>
+<script src="/resources/idlharness.js"></script>
+<!-- used to provide objects -->
+<style>
+ @container size(width=100px) {
+ @container size( inline-size >200% ) {
+ #id { color: lime }
+ }
+ #id { color: green }
+ }
+</style>
+<script>
+ idl_test(
+ ['css-contain-3'],
+ ['css-conditional', 'cssom', 'dom'],
+ idl_array => {
+ idl_array.add_objects({
+ CSSContainerRule: ['sheet.cssRules[0]',
+ 'sheet.cssRules[0].cssRules[0]'],
+ });
+ self.sheet = document.styleSheets[0];
+ }
+ );
+</script>