| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <!-- | 2 <!-- |
| 3 @license | 3 @license |
| 4 Copyright (c) 2016 The Polymer Project Authors. All rights reserved. | 4 Copyright (c) 2016 The Polymer Project Authors. All rights reserved. |
| 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 8 Code distributed by Google as part of the polymer project is also | 8 Code distributed by Google as part of the polymer project is also |
| 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 10 --> | 10 --> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 width: 100%; | 31 width: 100%; |
| 32 height: 100%; | 32 height: 100%; |
| 33 min-width: 0; | 33 min-width: 0; |
| 34 } | 34 } |
| 35 .sizer { | 35 .sizer { |
| 36 width: 4000px; | 36 width: 4000px; |
| 37 height: 5000px; | 37 height: 5000px; |
| 38 } | 38 } |
| 39 </style> | 39 </style> |
| 40 | 40 |
| 41 <style is="custom-style"> | |
| 42 iron-overlay-backdrop { | |
| 43 /* For quicker tests */ | |
| 44 --iron-overlay-backdrop: { | |
| 45 transition: none; | |
| 46 } | |
| 47 } | |
| 48 </style> | |
| 49 | |
| 50 </head> | 41 </head> |
| 51 | 42 |
| 52 <body> | 43 <body> |
| 53 | 44 |
| 54 <div class="sizer"></div> | 45 <div class="sizer"></div> |
| 55 | 46 |
| 56 <test-fixture id="backdrop"> | 47 <test-fixture id="backdrop"> |
| 57 <template> | 48 <template> |
| 58 <test-overlay with-backdrop> | 49 <test-overlay with-backdrop> |
| 59 Overlay with backdrop | 50 Overlay with backdrop |
| 60 </test-overlay> | 51 </test-overlay> |
| 61 </template> | 52 </template> |
| 62 </test-fixture> | 53 </test-fixture> |
| 63 | 54 |
| 64 <script> | 55 <script> |
| 65 function runAfterOpen(overlay, callback) { | 56 function runAfterOpen(overlay, callback) { |
| 66 overlay.addEventListener('iron-overlay-opened', callback); | 57 overlay.addEventListener('iron-overlay-opened', callback); |
| 67 overlay.open(); | 58 overlay.open(); |
| 68 } | 59 } |
| 69 | 60 |
| 70 suite('overlay with backdrop', function() { | 61 suite('overlay with backdrop', function() { |
| 71 var overlay; | 62 var overlay; |
| 72 | 63 |
| 73 setup(function() { | 64 setup(function() { |
| 74 overlay = fixture('backdrop'); | 65 overlay = fixture('backdrop'); |
| 75 }); | 66 }); |
| 76 | 67 |
| 77 test('backdrop size matches parent size', function(done) { | 68 test('backdrop size matches parent size', function(done) { |
| 78 runAfterOpen(overlay, function() { | 69 runAfterOpen(overlay, function() { |
| 79 Polymer.Base.async(function() { | 70 // Flush so we are sure backdrop is added in the DOM. |
| 80 var backdrop = overlay.backdropElement; | 71 Polymer.dom.flush(); |
| 81 var parent = backdrop.parentElement; | 72 var backdrop = overlay.backdropElement; |
| 82 assert.strictEqual(backdrop.offsetWidth, parent.clientWidth,
'backdrop width matches parent width'); | 73 var parent = backdrop.parentElement; |
| 83 assert.strictEqual(backdrop.offsetHeight, parent.clientHeigh
t, 'backdrop height matches parent height'); | 74 assert.strictEqual(backdrop.offsetWidth, parent.clientWidth, 'ba
ckdrop width matches parent width'); |
| 84 done(); | 75 assert.strictEqual(backdrop.offsetHeight, parent.clientHeight, '
backdrop height matches parent height'); |
| 85 }, 1); | 76 done(); |
| 86 }); | 77 }); |
| 87 }); | 78 }); |
| 88 | 79 |
| 89 }); | 80 }); |
| 90 </script> | 81 </script> |
| 91 | 82 |
| 92 </body> | 83 </body> |
| 93 | 84 |
| 94 </html> | 85 </html> |
| OLD | NEW |