### Eclipse Workspace Patch 1.0 #P drupal-head Index: misc/displace.js =================================================================== RCS file: /cvs/drupal/drupal/misc/displace.js,v retrieving revision 1.1 diff -u -r1.1 displace.js --- misc/displace.js 14 May 2010 07:45:53 -0000 1.1 +++ misc/displace.js 14 May 2010 11:39:31 -0000 @@ -4,7 +4,7 @@ /** * Provides a generic method to position elements fixed to the viewport. * - * Fixed positioning (CSS declaration position:fixed) is done relatively to the + * Fixed positioning (CSS declaration position:fixed) is done relative to the * viewport. This makes it hard to position multiple fixed positioned element * relative to each other (e.g. multiple toolbars should come after each other, * not on top of each other). @@ -14,7 +14,7 @@ * port add the class "displace-bottom". * * When a browser doesn't support position:fixed (like IE6) the element gets - * positioned absolutely by default, but this can be overriden by using the + * positioned absolutely by default, but this can be overridden by using the * "displace-unsupported" class. */ @@ -23,16 +23,9 @@ */ Drupal.behaviors.displace = { attach: function (context, settings) { - // Test for position:fixed support as IE6 does not. - // http://yura.thinkweb2.com/cft/#IS_POSITION_FIXED_SUPPORTED - if (this.supported === undefined) { - var el = $('
').appendTo(document.body); - this.supported = el[0].offsetTop === 10; - el.remove(); - - if (!this.supported) { - $(document.documentElement).addClass('displace-unsupported'); - } + // Test for position:fixed support. + if (!Drupal.positionFixedSupported()) { + $(document.documentElement).addClass('displace-unsupported'); } $(document.body).once('displace', function () { Index: misc/drupal.js =================================================================== RCS file: /cvs/drupal/drupal/misc/drupal.js,v retrieving revision 1.65 diff -u -r1.65 drupal.js --- misc/drupal.js 10 Mar 2010 15:14:38 -0000 1.65 +++ misc/drupal.js 14 May 2010 11:39:31 -0000 @@ -300,6 +300,24 @@ }; /** + * Checks if position:fixed is supported. + * + * @see http://yura.thinkweb2.com/cft/#IS_POSITION_FIXED_SUPPORTED + * + * @return + * Boolean indicating whether or not position:fixed is supported. + */ +Drupal.positionFixedSupported = function () { + if (this._positionFixedSupported === undefined) { + var el = $('').appendTo(document.body); + this._positionFixedSupported = el[0].offsetTop === 10; + el.remove(); + } + + return this._positionFixedSupported; +}; + +/** * Build an error message from an AJAX response. */ Drupal.ajaxError = function (xmlhttp, uri) {