summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-grid/parsing/grid-template-node-not-connected.html
blob: 89bee03a11bcae62448a088889398ba32e6f25bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html>
<head>
<link rel="help" href="https://bugs.webkit.org/show_bug.cgi?id=261421">
<link rel="author" title="Sammy Gill" href="mailto:sammy.gill@apple.com">
<meta name="assert" content="test should not crash and grid-template for child should be the empty string after disconnecting the element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<style>
#child {
  grid-template: 10px / 10px;
}
</style>
<div>
  <div id="child"></div>
</div>
<script>
test(() => {
  let styleDeclaration = window.getComputedStyle(document.getElementById("child"));
  document.querySelector("body > div:nth-child(1)").textContent = "";
  assert_equals(styleDeclaration.gridTemplate, "");
});
</script>
</html>