Skip to main content

Bug Tracker

Side navigation

#8564 closed bug (invalid)

Opened March 18, 2011 04:19PM UTC

Closed March 20, 2011 10:07PM UTC

Visible/hidden selectors fail for inline elements that contain a block element

Reported by: Owned by:
Priority: undecided Milestone:
Component: unfiled Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:

Test case:

Happens in:

  • jQuery 1.4.4, jQuery 1.5.1, jQuery latest/git
  • Webkit (Chrome stable, Safari stable)


Visible/hidden selectors fail in Webkit for inline elements that contain a block element. It reports the inline element having 0,0 offsetDimensions, which jQuery uses to detect visibility.


The "visible" utility in jquery UI core and all dependencies of it (f.ex. :focused, :tabbable) are affected. Since it walks up the whole tree and checks each element if its visible, a whole branch can stop working if one element is inline containing a block.


I know it may not be recommended practice to have block elements inside inline elements, but sometimes it is necessary.

Attachments (0)
Change History (1)

Changed March 20, 2011 10:07PM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

Inline elements CANNOT contain block elements, so the document is invalid and the browser behavior for that case isn't defined by standard.