Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-layout.html

Issue 342943002: Center fixpos <dialog> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rm non-anchored-dialog-positioning-expected.txt Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698