| <!doctype html> |
| <html> |
| <head> |
| <script src="../js/resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <script> |
| description("Test offsetParent for elements inside a named flow.") |
| |
| var article = document.createElement("div"); |
| document.body.appendChild(article); |
| article.style.webkitFlowInto = "flow"; |
| shouldBe("article.offsetParent", "document.body"); |
| |
| var chapter = document.createElement("div"); |
| article.appendChild(chapter); |
| shouldBe("chapter.offsetParent", "document.body"); |
| |
| article.style.position = "relative"; |
| shouldBe("chapter.offsetParent", "article"); |
| |
| var table = document.createElement("table"); |
| document.body.appendChild(table); |
| |
| var td = document.createElement("td"); |
| table.appendChild(td); |
| |
| var tdChild = document.createElement("div"); |
| td.appendChild(tdChild); |
| shouldBe("tdChild.offsetParent", "td"); |
| |
| tdChild.style.webkitFlowInto = "flow"; |
| shouldBe("tdChild.offsetParent", "document.body"); |
| |
| shouldBeNull("document.body.offsetParent"); |
| </script> |
| <script src="../js/resources/js-test-post.js"></script> |
| </body> |
| </html> |
| |