blob: e28828bab1fe74955d97a0601fa1d64b98822273 (
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<!DOCTYPE html>
<title>Chromium bug: getComputedStyle() crashes with subtree layout of out-of-flow node</title>
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1458561">
<style>
.container {
position: relative;
width: 100px;
height: 100px;
background: lime;
}
.oof {
position: absolute;
width: 30px;
height: 30px;
top: 0;
left: 0;
overflow: hidden;
background: hotpink;
}
</style>
<div class="container">
<div id="target1" class="oof">hi</div>
</div>
<script>
document.body.offsetTop;
target1.innerText = 'boom';
getComputedStyle(target1).top; // Shouldn't crash
</script>
<div class="container">
<div id="target2" class="oof"><div>hi</div></div>
</div>
<script>
document.body.offsetTop;
target2.firstChild.innerText = 'boom';
getComputedStyle(target2).top; // Shouldn't crash
</script>
|