summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/layers/opacity-change-stacking-context.html
blob: 375f3e7cb6ca23570c7586046ceb4ba19f3e8e95 (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>

<script src="../../resources/js-test.js"></script>

<style>
#target {
  top: 40px;
  width: 150px;
  height: 75px;
  background-color: yellow;
  transform: translateZ(0);
  opacity: 0;
}
</style>

<div id="target"></div>

<script>
description("Test that opacity changes from less than 1 to 1 don't cause layout if the layer remains a stacking context");
var div = document.getElementById('target');
div.offsetTop;
div.style.opacity = 1;
shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
shouldBe("internals.needsLayoutCount()", "0");
</script>