Bug Tracker

Changeset 72

Show
Ignore:
Timestamp:
06/16/06 00:09:51 (3 years ago)
Author:
john
Message:

$.css() now accounts for borders in addition to padding when calculating the height/width of an element.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • jquery/jquery/jquery.js

    r71 r72  
    354354    // Adapted from Prototype 1.4.0 
    355355    if ( p == 'height' || p == 'width' ) { 
    356         var ph = $.browser == "msie" ? 0 :  
    357             parseInt($.css(e,"paddingTop")) + parseInt($.css(e,"paddingBottom")); 
    358         var pw = $.browser == "msie" ? 0 :  
    359             parseInt($.css(e,"paddingLeft")) + parseInt($.css(e,"paddingRight")); 
     356 
     357        // Handle extra width/height provided by the W3C box model 
     358        var ph = !$.boxModel ? 0 :  
     359            parseInt($.css(e,"paddingTop")) + parseInt($.css(e,"paddingBottom")) + 
     360            parseInt($.css(e,"borderTop")) + parseInt($.css(e,"borderBottom")); 
     361 
     362        var pw = !$.boxModel ? 0 :  
     363            parseInt($.css(e,"paddingLeft")) + parseInt($.css(e,"paddingRight")) + 
     364            parseInt($.css(e,"borderLeft")) + parseInt($.css(e,"borderRight")); 
    360365 
    361366        var oHeight, oWidth;