Index: LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-layout.html |
diff --git a/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-layout.html b/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-layout.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..50903ee2bfcc760a53ad7abdee92bd87d8a5c0ac |
--- /dev/null |
+++ b/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-layout.html |
@@ -0,0 +1,60 @@ |
+<!DOCTYPE html> |
+<html> |
esprehn
2014/06/20 01:32:37
ditto to all of these tests.
falken
2014/06/20 01:49:54
Done.
|
+<head> |
+<link href="resources/dialog-layout.css" rel="stylesheet"> |
+<script src="../../../resources/js-test.js"></script> |
+</head> |
+<body> |
+ <div id="absolute-div"> |
+ <div id="relative-div"> |
+ <dialog id="dialog">It is my dialog.</dialog> |
+ </div> |
+ </div> |
+</body> |
+<script> |
+description('Tests layout of non-modal dialogs.'); |
+ |
+dialog = document.querySelector('#dialog'); |
+div = document.querySelector('#div-dialog'); |
+relativeContainer = document.querySelector('#relative-div'); |
+offset = 50; |
+dialog.style.top = offset + 'px'; |
+dialog.style.left = offset + 'px'; |
+ |
+(function() { |
+ debug('<br>Test absolute position'); |
+ dialog.style.position = 'absolute'; |
+ dialog.show(); |
+ shouldBe('dialog.getBoundingClientRect().top', 'relativeContainer.getBoundingClientRect().top + offset'); |
+ shouldBe('dialog.getBoundingClientRect().left', 'relativeContainer.getBoundingClientRect().left + offset'); |
+}()); |
+ |
+(function() { |
+ debug('<br>Test static position'); |
+ dialog.style.position = 'static'; |
+ dialog.show(); |
+ shouldBe('dialog.getBoundingClientRect().top', 'relativeContainer.getBoundingClientRect().top'); |
+ shouldBe('dialog.getBoundingClientRect().left', 'relativeContainer.getBoundingClientRect().left'); |
+ dialog.close(); |
+}()); |
+ |
+(function() { |
+ debug('<br>Test relative position'); |
+ dialog.style.position = 'relative'; |
+ dialog.show(); |
+ shouldBe('dialog.getBoundingClientRect().top', 'relativeContainer.getBoundingClientRect().top + offset'); |
+ shouldBe('dialog.getBoundingClientRect().left', 'relativeContainer.getBoundingClientRect().left + offset'); |
+ dialog.close(); |
+}()); |
+ |
+(function() { |
+ debug('<br>Test fixed position'); |
+ dialog.style.position = 'fixed'; |
+ dialog.show(); |
+ shouldBe('dialog.getBoundingClientRect().top', 'offset'); |
+ shouldBe('dialog.getBoundingClientRect().left', 'offset'); |
+ dialog.close(); |
+}()); |
+</script> |
+</body> |
+</html> |