#8099 closed bug (fixed)
SPAN element becomes block level on show()
| Reported by: | Owned by: | Rick Waldron | |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.6 |
| Component: | effects | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
I created two demos:
Demo 1: http://jsfiddle.net/DqvTa/7/ Demo 2: http://jsfiddle.net/DqvTa/8/
The demos are almost identical. The only difference is that I set #span { display:none; } in demo 1 and span { display:none; } in demo 2.
Could someone explain why the SPAN element - in demo 2 - becomes a block-level element?
My assumption is that (during show()) jQuery internally creates a SPAN element to check whether it is naturally an inline or block-level element. But since I set all SPANs to display:none in demo 2, jQuery is unable to determine that.
Change History (16)
comment:1 Changed 6 years ago by
| Component: | unfiled → effects |
|---|---|
| Milestone: | 1.next → 1.5.1 |
| Priority: | undecided → blocker |
| Status: | new → open |
comment:2 Changed 6 years ago by
The exact function where the undesired behaviour happens seems to be defaultDisplay where it adds the element to the page and checks for its display property and if it is none or "" then it assumes block.
comment:3 Changed 6 years ago by
Apologies for my comment. It was relevant when I typed it but not by the time I submitted it. I would delete if I could but I don't seem to have the option. Please delete it (and this one with it).
comment:4 Changed 6 years ago by
| Owner: | set to Rick Waldron |
|---|---|
| Status: | open → assigned |
comment:7 Changed 6 years ago by
| Version: | 1.4.4 → 1.5 |
|---|
comment:9 Changed 6 years ago by
There you go. Proof of FOUC happens at least in Opera 10.63/11/11.01 on Windows XP. And a (maybe) subjective feeling that the first few effects test take way longer with the 8099 fix then without
comment:10 Changed 6 years ago by
| Milestone: | 1.5.1 → 1.6 |
|---|---|
| Resolution: | fixed |
| Status: | closed → reopened |
Reverted commit faa6fe32f72900d7b31000caead2794a8346f6d8
Caused FOUC in Opera verified by me, mike and dave.
comment:12 Changed 6 years ago by
| Status: | reopened → open |
|---|
comment:14 Changed 6 years ago by
| Status: | open → assigned |
|---|
Tested and passing in IE6, 7, 8; Chrome 9, 10, 12; Safari 3, 4, 5; Firefox 3.0.12, 3.6.16, 4: http://jsfiddle.net/rwaldron/6THBr/show/
Combined effort by louisremi (lrbabe) and myself. Patch & PR to follow
comment:15 Changed 6 years ago by
Here is my PR, for the record: https://github.com/jquery/jquery/pull/320
comment:16 Changed 6 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Merge branch '8099' of https://github.com/rwldrn/jquery. Fixes #8099.
Conflicts:
test/data/testsuite.css
Changeset: 1dda994c463f01977c7126407998d61efed218a5

Confirmed:
http://jsfiddle.net/rwaldron/DqvTa/13/
However, it appears that by setting the display to "none" for all span tags, you've short-circuited the internal defaultDisplay function:
http://jsfiddle.net/rwaldron/DqvTa/15/