diff options
author | Brant Burnett <btburnett3@gmail.com> | 2010-01-29 18:38:21 +0000 |
---|---|---|
committer | Brant Burnett <btburnett3@gmail.com> | 2010-01-29 18:38:21 +0000 |
commit | b91ecde0a7d60185d47493c455e9fec3666d483a (patch) | |
tree | a43f28e80e20a214b21ae62aa6af79fbb73cb07c /tests/unit/core | |
parent | f214b708894ef2a1607050977f9698cf0d916d43 (diff) | |
download | jquery-ui-b91ecde0a7d60185d47493c455e9fec3666d483a.tar.gz jquery-ui-b91ecde0a7d60185d47493c455e9fec3666d483a.zip |
'Changed
Diffstat (limited to 'tests/unit/core')
-rw-r--r-- | tests/unit/core/core.html | 13 | ||||
-rw-r--r-- | tests/unit/core/core.js | 13 |
2 files changed, 23 insertions, 3 deletions
diff --git a/tests/unit/core/core.html b/tests/unit/core/core.html index 0b2235a99..1e6f49d33 100644 --- a/tests/unit/core/core.html +++ b/tests/unit/core/core.html @@ -14,6 +14,11 @@ <script type="text/javascript" src="core.js"></script> <script type="text/javascript" src="selector.js"></script> + + <style type="text/css"> + .zindex {z-index: 100} + .absolute {position: absolute} + </style> </head> <body> @@ -95,9 +100,15 @@ <div id="aria"></div> - <div id="zIndex100" style="z-index: 100;"> + <div id="zIndex100" style="z-index: 100; position: absolute"> <div id="zIndexAutoWithParent"></div> </div> + <div id="zIndex100ViaCSS" class="zindex"> + <div id="zIndexAutoWithParentViaCSS"></div> + </div> + <div id="zIndex100ViaCSSPositioned" class="zindex absolute"> + <div id="zIndexAutoWithParentViaCSSPositioned"></div> + </div> <div id="zIndexAutoNoParent"></div> </div> diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js index 23292671a..c94241f19 100644 --- a/tests/unit/core/core.js +++ b/tests/unit/core/core.js @@ -49,11 +49,20 @@ test('focus', function() { }); test('zIndex', function() { - var el = $('#zIndexAutoWithParent'); + var el = $('#zIndexAutoWithParent'), + parent = el.parent(); equals(el.zIndex(), 100, 'zIndex traverses up to find value'); - equals(el.zIndex(200), el, 'zIndex setter is chainable'); + equals(parent.zIndex(200), parent, 'zIndex setter is chainable'); equals(el.zIndex(), 200, 'zIndex setter changed zIndex'); + el = $('#zIndexAutoWithParentViaCSS'); + equals(el.zIndex(), 0, 'zIndex traverses up to find CSS value, not found because not positioned'); + + el = $('#zIndexAutoWithParentViaCSSPositioned'); + equals(el.zIndex(), 100, 'zIndex traverses up to find CSS value'); + el.parent().zIndex(200); + equals(el.zIndex(), 200, 'zIndex setter changed zIndex, overriding CSS'); + equals($('#zIndexAutoNoParent').zIndex(), 0, 'zIndex never explicitly set in hierarchy'); }); |