| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>It tests that fixed (auto)positioned element is placed properly when the parent element is sticky positioned.</title> |
| <script> |
| if (window.testRunner) |
| testRunner.waitUntilDone(); |
| </script> |
| </head> |
| <body> |
| <div style="position: sticky; left: 50px; width: 20px; height: 20px; border: 1px solid green;"> |
| <div class=fixed style="width: 20px; height: 20px; background-color: green;"></div> |
| </div> |
| <div style="position: sticky; left: 50px; width: 20px; height: 20px; margin: 5px; border: 1px solid green;"> |
| <div class=fixed style="width: 20px; height: 20px; background-color: green;"></div> |
| </div> |
| |
| <script> |
| setTimeout(function() { |
| var elements = document.getElementsByClassName("fixed"); |
| for (var i = 0; i < elements.length; ++i) |
| elements[i].style.position = "fixed"; |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| }, 0); |
| </script> |
| </body> |
| </html> |