summaryrefslogtreecommitdiffstats
path: root/WebContent/statictestfiles/browserfeatures/WebkitPositionAbsoluteScrollbars.html
blob: 75478160065f2183bc420d6dd6fd61f2a991948b (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!doctype>
<html><head>
  <style>
  #spacer {
  	width: 100px;
  	height: 100px;
  	background: blue;
  }
  #scrollable {
  	background: white;
	border: 1px solid black;
  	overflow: auto;
  	position: relative;
  	width: 250px;
  }
  #container {
	position:relative;
	display:inline-block;
	width:100%;
	height:130px;
  }
  #margin {
	position: absolute;
    width: 200px; 
    top: 12px; 
    margin-right: 12px; 
    left: 12px; 
    height: 110px;
  }
  </style>
  </head>
 <body>
 <div>
 Starting point: No horizontal scrollbar<br/>
 Expected: Get back to starting point after clicking through steps (do 1, do  2, cancel 1, cancel 2)<br/>
 Actual: Scrollbars after doing the steps<br/><br/>
 </div>
<button id="step1" onclick="step1();">Step 1 - Enlarge container</button> 
<button id="step2" onclick="step2();">Step 2 - Move child</button> 
<button id="step3" onclick="step3();">Step 3 - Reduce container</button>
<button id="step4" onclick="step4();">Step 4 - Return child</button>
<div id="scrollable">
<div id="container">
<div id="margin" style="">
<div id="spacer" style="height: 100px; width: 100%;">
</div>
</div>
</div>
</div>
  
<script>
function step1() {
	document.getElementById("container").style.width="110%";
}
function step2() {
	document.getElementById("margin").style.left="200px";
}
function step3() {
	document.getElementById("container").style.width="100%";
}
function step4() {
	document.getElementById("margin").style.left="12px";      
}

</script>


</body>
</html>