Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outerHeight(true) does not handle negative margins properly (starting with 3.3.x release) #3982

Closed
bmurmistro opened this issue Feb 19, 2018 · 2 comments · Fixed by #5234
Closed
Assignees
Milestone

Comments

@bmurmistro
Copy link

Hello,

outerHeight(true) does not handle negative margins properly (starting with 3.3.x release). This was working fine in 3.2.x.

3.2.1: https://jsfiddle.net/b1mtv4ts/12/
3.3.1: https://jsfiddle.net/b1mtv4ts/13/

@timmywil timmywil added this to the 3.4.0 milestone Feb 19, 2018
@mgol mgol added Bug and removed Bug labels Feb 19, 2018
@timmywil timmywil self-assigned this Feb 19, 2018
@gibson042 gibson042 assigned gibson042 and unassigned timmywil Feb 19, 2018
@gibson042
Copy link
Member

The problem seems to be that offsetHeight and offsetWidth aren't affected by negative margins. We should be able to account for that in boxModelAdjustment.

@timmywil timmywil modified the milestones: 3.4.0, 4.0.0 Apr 2, 2019
@timmywil timmywil modified the milestones: 4.0.0, 3.7.0 Aug 26, 2022
mgol added a commit to mgol/jquery that referenced this issue Mar 30, 2023
This regressed in jquerygh-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 jquerygh-3982
Ref jquerygh-3656
@mgol
Copy link
Member

mgol commented Mar 30, 2023

PR: #5234

@mgol mgol assigned mgol and unassigned gibson042 Apr 4, 2023
@mgol mgol closed this as completed in #5234 Apr 4, 2023
mgol added a commit that referenced this issue Apr 4, 2023
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
mgol added a commit that referenced this issue Apr 4, 2023
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 bce13b7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants