From adb57f335af4c1245db6245ab96e5ead4370df31 Mon Sep 17 00:00:00 2001 From: Robert Smith Date: Tue, 14 Jun 2011 14:08:10 -0500 Subject: Fix for issue #286 - GitHub logo doesn't get hinted --- linkHints.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'linkHints.js') diff --git a/linkHints.js b/linkHints.js index c8c743ea..9219fee6 100644 --- a/linkHints.js +++ b/linkHints.js @@ -128,7 +128,9 @@ var linkHints = { // but floated elements. Check for this. if (clientRect && (clientRect.width == 0 || clientRect.height == 0)) { for (var j = 0, childrenCount = element.children.length; j < childrenCount; j++) { - if (window.getComputedStyle(element.children[j], null).getPropertyValue('float') == 'none') + var computedStyle = window.getComputedStyle(element.children[j], null); + // Ignore child elements which are not floated and not absolutely positioned for parent elements with zero width/height + if (computedStyle.getPropertyValue('float') == 'none' && computedStyle.getPropertyValue('position') != 'absolute') continue; var childClientRect = element.children[j].getClientRects()[0]; if (!this.isVisible(element.children[j], childClientRect)) -- cgit v1.2.3