Bug Tracker


Ticket #9441 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

innerWidth, innerHeight, outerWidth, outerHeight are inaccurate for child of hidden parent

Reported by: mikesherov Owned by:
Priority: low Milestone: 1.next
Component: dimensions Version: 1.6.1
Keywords: Cc:
Blocking: Blocked by:


this was discovered while I was working on #9300. #9300 fixes the outerWidth(true) case, but the rest of the dimensions functions suffer in similar ways.

This is due to the fact that the width/height fallbacks are ignorant as to whether or not the padding and border (and margin in #9300) are applied.

I should have a patch for this tomorrow, but it's based off my fix for #9300:  https://github.com/jquery/jquery/pull/394 so I'll wait to see if that one is accepted before I continue.


Change History

comment:1 Changed 3 years ago by timmywil

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to dimensions

It is likely to make it after some more review. Thanks for your work!

comment:2 Changed 3 years ago by mikesherov

comment:3 Changed 3 years ago by Mike Sherov

  • Status changed from open to closed
  • Resolution set to fixed

Add margin after checking width. Add tests. Fixes #9441. Fixes #9300.

Changeset: 80ad14bd14467c547c2867f2677ca581aa29bf33

comment:4 Changed 3 years ago by rwaldron

@timmywil & @mikesherov I'm getting a lot of fails in the dimensions module, here:  http://gyazo.com/0b1958b17e40106f86ad6da54d7aa0d2

I don't remember seeing any fails at all when i reviewed mikesherov's patch,  https://github.com/jquery/jquery/commit/80ad14bd14467c547c2867f2677ca581aa29bf33

But I had never seen this one:


comment:5 Changed 3 years ago by timmywil

I'm showing full passes in all browsers.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.