]> source.dussan.org Git - jquery.git/commit
CSS: Make `offsetHeight( true )`, etc. include negative margins
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Tue, 4 Apr 2023 14:00:55 +0000 (16:00 +0200)
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Tue, 4 Apr 2023 14:03:06 +0000 (16:03 +0200)
commit7bb48a0290a20594ea2a5a7b5772e0410a67164c
tree79e93f3278d876abce331db41cb9fce2cfe7611d
parent9ab26aa508c6cca6afa9c6247ee6d50eaed2da77
CSS: Make `offsetHeight( true )`, etc. include negative margins

This regressed in gh-3656 as the added logic to include scroll gutters
in `.innerWidth()` / `.innerHeight()` didn't take negative margins into
account. This broke handling of negative margins in
`.offsetHeight( true )` and `.offsetWidth( true )`. To fix it, calculate
margin delta separately and only add it after the scroll gutter
adjustment logic.

Fixes gh-3982
Closes gh-5234
Ref gh-3656

(cherry picked from commit bce13b72c1753e16cc0db53ebf0f0456bdcf6b48)
src/css.js
test/unit/dimensions.js