Skip to content

Commit

Permalink
Revert "Fixing isShown: zero-size element should be invisible if it c…
Browse files Browse the repository at this point in the history
…ontains a"

This reverts commit f61d05c.
  • Loading branch information
barancev committed Feb 25, 2013
1 parent f61d05c commit 0d43cd8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion javascript/atoms/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,6 @@ bot.dom.isShown = function(elem, opt_ignoreOpacity) {
// if they have a child element or text node with positive size.
return goog.array.some(e.childNodes, function(n) {
return (n.nodeType == goog.dom.NodeType.TEXT &&
bot.dom.trimExcludingNonBreakingSpaceCharacters_(n.nodeValue) != '' &&
bot.dom.getEffectiveStyle(e, 'overflow') != 'hidden') ||
(bot.dom.isElement(n) && positiveSize(n));
});
Expand Down
12 changes: 1 addition & 11 deletions javascript/atoms/test/shown_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
}

function testZeroSizedDivIsShownIfDescendantHasSize() {
if (goog.userAgent.IE && !bot.userAgent.isProductVersion(7)) {
if (goog.userAgent.IE && !bot.userAgent.isProductVersion(7)) {
return;
}
var element = goog.dom.createDom('div', {id:"ZeroSizedDiv", style: 'width:0;height:0'},
Expand Down Expand Up @@ -415,14 +415,6 @@
var child = findElement({id: "bug5140-3-child"});
assertTrue(isShown(child));
}

function testZeroSizedDivIsNotShownIfDescendantHasEmptyText() {
if (goog.userAgent.IE && !bot.userAgent.isProductVersion(7)) {
return;
}
var element = findElement({id: 'bug5220-invisible'});
assertFalse(isShown(element));
}
</script>

<style type="text/css">
Expand Down Expand Up @@ -615,7 +607,5 @@
<div id='bug5140-1' style="overflow:hidden; height:0; width:0;"><div id='bug5140-1-child' style="height:25px; width:25px;">.</div></div>
<div id='bug5140-2' style="overflow:hidden; height:50px; width:50px;"><div id='bug5140-2-child' style="height:25px; width:25px; margin:50px; background-color:red;">.</div></div>
<div id='bug5140-3' style="overflow:hidden; height:50px; width:50px;"><div id='bug5140-3-child' style="height:25px; width:25px; margin:49px; background-color:red;">.</div></div>
<div id='bug5220-invisible' style="height:0; width:0;"><a href="#">
</a></div>
</body>
</html>

0 comments on commit 0d43cd8

Please sign in to comment.