Skip to content
Permalink
Browse files

Non-breaking-space should achieve the same effect as a visible charac…

…ter. Fixes #9634
  • Loading branch information...
rwaldron committed Jul 25, 2011
1 parent 27291ff commit ddf925b77007bb6f219c7bc56166753177a86dec
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/support.js
@@ -184,7 +184,7 @@ jQuery.support = (function() {
support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
} }


div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>"; div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>&nbsp;</td></tr></table>";

This comment has been minimized.

Copy link
@mathiasbynens

mathiasbynens Aug 31, 2011

Contributor

You could also drop the quotes around padding:0;border:0;display:none: http://mothereffingunquotedattributes.com/#padding%3A0%3Bborder%3A0%3Bdisplay%3Anone

The end tags </td> and </tr> are not needed.

tds = div.getElementsByTagName( "td" ); tds = div.getElementsByTagName( "td" );


// Check if table cells still have offsetWidth/Height when they are set // Check if table cells still have offsetWidth/Height when they are set

3 comments on commit ddf925b

@davidmurdoch

This comment has been minimized.

Copy link
Contributor

davidmurdoch replied Aug 31, 2011

This shouldn't matter as the div should be ~1400px off screen. But as diego points out, the "top" and "left" values aren't being set on lines 154 and 155. They need to be string values including "px".

Also, I just want to point out that

div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
uses a <tag >tag[0]</tag> pattern. Reverting this commit back to <td>t</td> or updating line 27 to <a>&nbsp;</a> would make things more consistent.

@mathiasbynens

This comment has been minimized.

Copy link
Contributor

mathiasbynens replied Aug 31, 2011

Btw, that line 27 in support.js @davidmurdoch mentioned could be shortened/optimized without changing its meaning. I committed this change a while ago in my fork (for the lulz): mathiasbynens@489245e

@rwaldron

This comment has been minimized.

Copy link
Member Author

rwaldron replied Aug 31, 2011

Nice catch - that's the right fix

Please sign in to comment.
You can’t perform that action at this time.