Index: LayoutTests/fast/layout/nested-subtree-layout-preferred-widths.html |
diff --git a/LayoutTests/fast/layout/nested-subtree-layout-preferred-widths.html b/LayoutTests/fast/layout/nested-subtree-layout-preferred-widths.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5118abded823be1f3b947e45517f022c866199d2 |
--- /dev/null |
+++ b/LayoutTests/fast/layout/nested-subtree-layout-preferred-widths.html |
@@ -0,0 +1,40 @@ |
+<!DOCTYPE html> |
+<style> |
+div { |
+ overflow: hidden; |
+} |
+#root { |
+ width: 200px; |
+ height: 400px; |
+ background: red; |
+} |
+#content { |
+ background: green; |
+ width: 100%; |
+ height: 400px; |
+ display: block; |
+} |
+#container { |
+ width: 400px; |
+ height: 400px; |
+} |
+</style> |
+<script src="../../resources/check-layout.js"></script> |
+<div> |
+ crbug.com/497178: This test ensures we properly recompute preferred widths for |
+ nested subtree roots. If this test is ever flaky, it should be considered |
+ failing due the the non-deterministic way we iterate over subtree layout roots. |
+</div> |
+<div id="container"> |
+ <div id="root"> |
+ <div data-expected-width="400" id="content">OriginalText</div> |
+ </div> |
+</div> |
+<script> |
+document.body.offsetTop; |
+var rootElement = document.getElementById("root"); |
+var content = document.getElementById("content"); |
+content.innerText = ""; |
+rootElement.style.width = "400px"; |
+checkLayout("#content"); |
+</script> |