Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#9106 closed bug (wontfix)

$('html').show(); does not work in firefox 3.6

Reported by: kharlamov@… Owned by: Rick Waldron
Priority: low Milestone: 1.7
Component: effects Version: 1.6
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by cowboy)

With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag.

I have made a quick demo here:

demo: http://jsfiddle.net/UHEEm/

html:

<html>
    <body>
        test
    </body>
</html>

css:

html {
    display: none;
}

jquery:

$('html').show();

//$('html').css('display', 'block'); //this works though.



Change History (22)

comment:1 Changed 8 years ago by vyrak.bunleang@…

Seems like this is an issue if Firefox 4.0 as well

comment:2 Changed 8 years ago by anonymous

The body tag looks like the only other tag that is affected by this bug.

comment:3 Changed 8 years ago by Rick Waldron

Component: unfiledeffects
Priority: undecidedblocker
Status: newopen

IMHO, like #8099 and this ticket, modifying the display property directly instead of via a class is flat out wrong. I'm going to recommend, for simplicity sake, that we just pre-define html & body in the in the elementdisplay object, something like this:

https://github.com/rwldrn/jquery/commit/435536606f8f5f341f6d923ea8c5a2084fbc41c7

While I don't think this is right, nor do I really think we should be making iframes to account for what amounts to BAD markup and styles, I guess people are doing it, so we need to address the issue.

Nearly a duplicate of #8099

comment:4 Changed 8 years ago by Rick Waldron

Owner: set to Rick Waldron
Status: openassigned

comment:5 Changed 8 years ago by john

Keywords: 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:6 Changed 8 years ago by Rick Waldron

Description: modified (diff)

+0, Not fond of this issue, but it might be a bug

comment:7 Changed 8 years ago by jaubourg

+1, I'd say bug

comment:8 Changed 8 years ago by timmywil

+1,

comment:9 Changed 8 years ago by dmethvin

Description: modified (diff)

+1, rwaldron's solution is an enabler of lame code but his heart is in the right place! :-)

comment:10 Changed 8 years ago by timmywil

Milestone: 1.next1.6.2

comment:11 Changed 8 years ago by Rick Waldron

FYI Guys, this is in the same ballpark as the defaultDisplay bug #8099

We may need to draw the line somewhere

comment:12 Changed 8 years ago by john

Description: modified (diff)

+0, Ugh... why?

comment:13 in reply to:  12 Changed 8 years ago by anonymous

Replying to john:

+0, Ugh... why?

This is important for people who are using any type of notion of modules.

For example: those who use requirejs could need to wait until all of their required scripts are loaded. When all of those required scripts preform all their actions to alter the DOM on the page, then only do you want to show the entire page. Otherwise the page could look like a tetris while it loads.

This is common in many enterprise applications.

comment:14 Changed 8 years ago by Rick Waldron

Description: modified (diff)

@anonymous the problem with this is that when an end developer changes the _default_ display style property of an element, there is _NO_WAY_ to find out what it should really be without creating an iframe and appending a temporary test element to that iframe. We've been down this road and explored a breadth of potential solutions.

The fact is that changing the default display of an element as shown in the given example is a broken approach and in general a bad practice.

You could achieve exactly the same effect by using a class:

html:

<html class="toggler">
    <body>
        test
    </body>
</html>

css:

.toggler {
    display: none;
}

jquery:

$('html').show();

See: http://jsbin.com/udaso4

I move to close as invalid.

comment:15 Changed 8 years ago by addyosmani

Description: modified (diff)

+0

comment:16 Changed 8 years ago by rpflorence@…

+0

Use CSS to hide the content, add classes to the HTML or BODY elements to show them when you want to.

comment:17 Changed 8 years ago by ajpiano

Description: modified (diff)

-1, How deep does the rabbithole go?

comment:18 Changed 8 years ago by scottgonzalez

Description: modified (diff)

-1, seems extremely rare and unnecessary to support

comment:19 Changed 8 years ago by cowboy

Description: modified (diff)

MINUS ONE!!!

comment:20 Changed 8 years ago by Rick Waldron

Resolution: wontfix
Status: assignedclosed

comment:21 Changed 8 years ago by Rick Waldron

Keywords: 1.7-discuss removed
Milestone: 1.6.21.7
Priority: blockerlow

comment:22 Changed 7 years ago by mikesherov

#12179 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.