4 <link rel=
"stylesheet" type=
"text/css" href=
"resources/link-highlight-style.css">
5 <script src=
"resources/link-highlight-helper.js"></script>
7 <body onload=
"runTest();">
8 <div style=
"transform: translateZ(0); position: relative; left: 10px; top: 10px"></div>
9 <div id=
"targetDiv" style=
"position: relative; left: 10px; top: 40px; width: 200px; height: 100px; overflow-y: scroll; overflow-x: scroll;">
10 <div id=
"divToForceCompositedLayer">
11 <a href=
"">Link
1</a><br>
12 <a href=
"">Link
2</a><br>
13 <a href=
"">Link
3</a><br>
14 <a class=
"opaqueHighlight" href=
"" id=
"targetLink">Target Link.
</a><br>
15 <a href=
"">Link
4</a><br>
16 <a href=
"">Link
5</a><br>
18 <div style=
"position: relative; left: 10px; top: 80px">
19 This test is successful if
"Target Link" above is covered in a green rectangle with square corners.
21 <script src=
"../../resources/run-after-layout-and-paint.js"></script>
25 var targetDiv
= document
.getElementById('targetDiv');
26 var clientRect
= document
.getElementById('targetLink').getBoundingClientRect();
27 x
= (clientRect
.left
+ clientRect
.right
) / 2;
28 y
= (clientRect
.top
+ clientRect
.bottom
) / 2;
29 if (window
.testRunner
) {
30 testRunner
.dumpAsTextWithPixelResults();
31 testRunner
.waitUntilDone();
34 // This test highlights a link in a non-composited overflow-div, then forces that div to become composited,
35 // then scrolls that div, then exits. If everything is working correctly, the link highlight will still
36 // be displayed correctly after all these operations.
37 if (window
.eventSender
&& window
.testRunner
) {
38 eventSender
.gestureShowPress(x
, y
);
39 runAfterLayoutAndPaint(function() {
40 document
.getElementById('divToForceCompositedLayer').style
.webkitTransform
= 'translateZ(0)';
41 document
.body
.offsetTop
;
42 runAfterLayoutAndPaint(function() {
43 targetDiv
.scrollTop
+= 20;
44 testRunner
.notifyDone();
48 debug("This test requires DumpRenderTree.");