| <!DOCTYPE html> |
| <html> |
| <head> |
| <style> |
| #region { -webkit-flow-from: flow; position: absolute; top: 100px; left: 100px; width: 100px; height: 100px; border: 5px solid black; } |
| #parent { -webkit-flow-into: flow; position: absolute; -webkit-transform: translateX(50px); } |
| #red { position: absolute; top: 105px; left: 155px; width: 50px; height: 50px; background-color: red; } |
| #fixed { position: fixed; width: 50px; height: 50px; background-color: green; } |
| </style> |
| </head> |
| <body> |
| <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=111176">[CSS Regions] position: fixed is computed relative to the first region, not the viewport</a>.</p> |
| <p>Test that a fixed positioned element with a transformed parent collected in a named flow is positioned relative to the transformed parent instead of the viewport.</p> |
| <p>On success you should see PASS below</p> |
| <p id="result">FAIL</p> |
| <div id="red"></div> |
| |
| <div id="parent"> |
| <div id="fixed"></div> |
| </div> |
| <div id="region"></div> |
| <script> |
| if (window.testRunner) |
| window.testRunner.dumpAsText(); |
| var boundingRect = document.getElementById("fixed").getBoundingClientRect(); |
| if (boundingRect.top == 105 && boundingRect.left == 155) |
| document.getElementById("result").innerText = "PASS"; |
| </script> |
| </body> |
| </html> |