Skip to content
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 @@ = (function() {
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 Aug 31, 2011


You could also drop the quotes around padding:0;border:0;display:none:

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

tds = div.getElementsByTagName( "td" );

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

3 comments on commit ddf925b


This comment has been minimized.

Copy link

@davidmurdoch 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.


This comment has been minimized.

Copy link

@mathiasbynens 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


This comment has been minimized.

Copy link
Member Author

@rwaldron rwaldron replied Aug 31, 2011

Nice catch - that's the right fix

Please sign in to comment.