Bug Tracker

Modify

Ticket #7397 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

Regression: fadeIn no longer works correctly for inline elements

Reported by: dmuir Owned by: rwaldron
Priority: low Milestone: 1.5
Component: effects Version: 1.4.3
Keywords: Cc: john
Blocking: Blocked by:

Description

I just upgraded from 1.4.2 to 1.4.3, and it looks like a bug similar to #4173 is back.

Example:  http://jsfiddle.net/Gad7W/22/

When the span is absolutely positioned, the first time you click, it works correctly, but the second time you click, the span has display: block; If you have FireQuery installed in Firefox, you can see the olddisplay value swap from inline to block when the animation completes.

Change History

comment:1 Changed 3 years ago by snover

  • Status changed from new to assigned
  • Component changed from unfiled to effects
  • Priority changed from undecided to blocker
  • Version changed from 1.4.3 to 1.4.4rc
  • Milestone changed from 1.5 to 1.4.4
  • Owner set to snover

comment:2 Changed 3 years ago by snover

  • Owner snover deleted
  • Status changed from assigned to open

I’m punting on this one.

jQuery.css retrieves the computed style of any given element. In this case the computed style is block as per  CSS 2.1 §9.7. Unfortunately it seems using this as the display value changes the way in which the element ends up rendering itself, even though the computed value is the same no matter whether it is specified to be inline or block. Needs more spec research.

comment:3 Changed 3 years ago by dmuir

If I'm reading the spec right, it seems that jquery is doing the right thing and that:

element {position: absolute;}

should be interpreted as:

element {display: block; position: absolute;}

I guess the problem stems from browsers not following the spec correctly?

Last edited 3 years ago by dmuir (previous) (diff)

comment:4 Changed 3 years ago by jitter

I suspect this may have something to do with this commit  #5646a4.

Probably the value of olddisplay, if already set, shouldn't be always ignored as oldisplay does hold inline but gets overwritten with jQuery.css( this[i], "display" ) which is block at that moment.

comment:5 Changed 3 years ago by john

  • Owner set to john
  • Status changed from open to assigned

comment:7 Changed 3 years ago by rwldrn

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

Fixes #7397; Adds 4 supporting unit tests.

Changeset: 795e880bba1f7f949df58748f7fd92e50296a8f4

comment:8 Changed 3 years ago by rwaldron

  • Cc john added

Updated Unit tests (with original patch)

 https://github.com/jquery/jquery/pull/94

( Unit tests are passing in IE 6,7,8 )

comment:9 Changed 3 years ago by john

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:10 Changed 3 years ago by john

  • Priority changed from blocker to low
  • Status changed from reopened to closed
  • Resolution set to wontfix

This commit was backed out last night, here:  http://bit.ly/cJZckd It's not working correctly across all platforms.

In thinking about this more - this is really something that we're unlikely to fix. If you have an element that is being absolutely positioned it must be display: block (according to the CSS specification). Attempting to make it 'inline'. The fact that you're setting 'inline' (and use to get that value back) was purely incidental (and likely a bug on our end). The change in your code is as simple as making sure that your absolutely positioned elements have a display of 'block' set to them, consistently (this will help your display across browsers, as well).

comment:11 Changed 3 years ago by john

  • Status changed from closed to reopened
  • Version changed from 1.4.4rc to 1.4.3
  • Resolution wontfix deleted
  • Milestone changed from 1.4.4 to 1.4.5

Rick got his patch working - we're going to try this for 1.4.5. Considering that this is handling a weird spec edge case I wouldn't consider this to be a blocker for 1.4.4.

comment:12 Changed 3 years ago by john

  • Status changed from reopened to assigned

comment:13 Changed 3 years ago by snover

#7563 is a duplicate of this ticket.

comment:14 Changed 3 years ago by snover

  • Owner changed from john to rwaldron

comment:16 Changed 3 years ago by Colin Snover

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

comment:17 Changed 3 years ago by rwaldron

#7886 is a duplicate of this ticket.

comment:18 Changed 3 years ago by jitter

  • Milestone changed from 1.4.5 to 1.5

Move fixed tickets to appropriate milestone

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

View

Add a comment

Modify Ticket

Action
as closed
Author


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

 
Note: See TracTickets for help on using tickets.