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: eirikur@nilsson.is Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:
Description

Test case:

http://jsbin.com/axeyi5/5/edit

Happens in:

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

Abstract:

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.

Affects:

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.

Disclosure:

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.

http://www.w3.org/TR/html401/struct/global.html#h-7.5.3