From faf87d992455280182edef015c8733313744a739 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 20 Oct 2014 19:29:35 -0400 Subject: Core: Remove .zIndex() Fixes #9156 --- build/tasks/testswarm.js | 1 - tests/unit/all.html | 1 - tests/unit/core/core_deprecated.html | 132 ----------------------------------- tests/unit/core/core_deprecated.js | 24 ------- ui/core.js | 29 -------- 5 files changed, 187 deletions(-) delete mode 100644 tests/unit/core/core_deprecated.html delete mode 100644 tests/unit/core/core_deprecated.js diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index aa1c52abc..44cf2c5eb 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -15,7 +15,6 @@ var versions = { "Autocomplete": "autocomplete/autocomplete.html", "Button": "button/button.html", "Core": "core/core.html", - "Core_deprecated": "core/core_deprecated.html", "Datepicker": "datepicker/datepicker.html", "Dialog": "dialog/dialog.html", "Draggable": "draggable/draggable.html", diff --git a/tests/unit/all.html b/tests/unit/all.html index 77daff6d5..043304f76 100644 --- a/tests/unit/all.html +++ b/tests/unit/all.html @@ -20,7 +20,6 @@ "autocomplete/autocomplete.html", "button/button.html", "core/core.html", - "core/core_deprecated.html", "datepicker/datepicker.html", "dialog/dialog.html", "draggable/draggable.html", diff --git a/tests/unit/core/core_deprecated.html b/tests/unit/core/core_deprecated.html deleted file mode 100644 index be865f77e..000000000 --- a/tests/unit/core/core_deprecated.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - jQuery UI Core Test Suite - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - -
-
- -
- - - - - - - - - - xxx - anchor - anchor - x -
x
- x -
x
-
- -
- - - - - - - - - -
- -
- - - - - - - - - -
- -
- - - - - - . - . - . - . -
- -
- - -
- -
-
.
-
-
-
.
-
-
-
.
-
-
- -
- -
- - diff --git a/tests/unit/core/core_deprecated.js b/tests/unit/core/core_deprecated.js deleted file mode 100644 index bb06f77b2..000000000 --- a/tests/unit/core/core_deprecated.js +++ /dev/null @@ -1,24 +0,0 @@ -(function( $ ) { - -module( "core - deprecated" ); - -test( "zIndex", function() { - expect( 7 ); - var el = $( "#zIndexAutoWithParent" ), - parent = el.parent(); - equal( el.zIndex(), 100, "zIndex traverses up to find value" ); - equal( parent.zIndex(200 ), parent, "zIndex setter is chainable" ); - equal( el.zIndex(), 200, "zIndex setter changed zIndex" ); - - el = $( "#zIndexAutoWithParentViaCSS" ); - equal( el.zIndex(), 0, "zIndex traverses up to find CSS value, not found because not positioned" ); - - el = $( "#zIndexAutoWithParentViaCSSPositioned" ); - equal( el.zIndex(), 100, "zIndex traverses up to find CSS value" ); - el.parent().zIndex( 200 ); - equal( el.zIndex(), 200, "zIndex setter changed zIndex, overriding CSS" ); - - equal( $( "#zIndexAutoNoParent" ).zIndex(), 0, "zIndex never explicitly set in hierarchy" ); -}); - -})( jQuery ); diff --git a/ui/core.js b/ui/core.js index 652884e6b..5e5f6d574 100644 --- a/ui/core.js +++ b/ui/core.js @@ -223,35 +223,6 @@ $.fn.extend({ enableSelection: function() { return this.unbind( ".ui-disableSelection" ); - }, - - zIndex: function( zIndex ) { - if ( zIndex !== undefined ) { - return this.css( "zIndex", zIndex ); - } - - if ( this.length ) { - var elem = $( this[ 0 ] ), position, value; - while ( elem.length && elem[ 0 ] !== document ) { - // Ignore z-index if position is set to a value where z-index is ignored by the browser - // This makes behavior of this function consistent across browsers - // WebKit always returns auto if the element is positioned - position = elem.css( "position" ); - if ( position === "absolute" || position === "relative" || position === "fixed" ) { - // IE returns 0 when zIndex is not specified - // other browsers return a string - // we ignore the case of nested elements with an explicit value of 0 - //
- value = parseInt( elem.css( "zIndex" ), 10 ); - if ( !isNaN( value ) && value !== 0 ) { - return value; - } - } - elem = elem.parent(); - } - } - - return 0; } }); -- cgit v1.2.3