From 38d57cada621c79e6a21f9f56c9c92305123850f Mon Sep 17 00:00:00 2001 From: "arv@google.com" Date: Wed, 9 Sep 2009 21:20:24 +0000 Subject: NNTP: Disable tabbing to hidden elements. This is a work around since the WebKit fix is not on the M3 branch. BUG=15711 TEST=Tab around. At all times something on the page should have focus (unless the address bar got the focus). Review URL: http://codereview.chromium.org/201068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25789 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/resources/new_new_tab.html | 2 +- chrome/browser/resources/new_new_tab.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index 5bac6f6..6f62878 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -84,7 +84,7 @@ document.write('   - +
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index 57fbf55..5866c6b 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -188,7 +188,7 @@ function onShownSections(mask) { } mostVisited.updateDisplayMode(); - layoutRecentlyClosed(); + renderRecentlyClosed(); updateOptionMenu(); } @@ -298,7 +298,7 @@ function handleWindowResize() { if (layoutMode != oldLayoutMode){ mostVisited.invalidate(); mostVisited.layout(); - layoutRecentlyClosed(); + renderRecentlyClosed(); } } @@ -329,7 +329,7 @@ function showSection(section) { shownSections &= ~Section.THUMB; mostVisited.invalidate(); } else { - layoutRecentlyClosed(); + renderRecentlyClosed(); } updateOptionMenu(); @@ -347,7 +347,7 @@ function hideSection(section) { } if (section & Section.RECENT) { - layoutRecentlyClosed(); + renderRecentlyClosed(); } updateOptionMenu(); @@ -677,11 +677,6 @@ function layoutRecentlyClosed() { } else { style.opacity = style.height = ''; - // Show all items. - for (var i = 0, child; child = recentElement.children[i]; i++) { - child.style.display = ''; - } - // We cannot use clientWidth here since the width has a transition. var spacing = 20; var headerEl = recentElement.firstElementChild; @@ -700,7 +695,7 @@ function layoutRecentlyClosed() { } elementsToHide.forEach(function(el) { - el.style.display = 'none'; + el.parentNode.removeChild(el); }); } } @@ -919,6 +914,8 @@ function showNotification(text, actionText, opt_f, opt_delay) { notificationElement.onmouseout = delayedHide; actionLink.onfocus = show; actionLink.onblur = delayedHide; + // Enable tabbing to the link now that it is shown. + actionLink.tabIndex = 0; show(); delayedHide(); @@ -927,6 +924,9 @@ function showNotification(text, actionText, opt_f, opt_delay) { function hideNotification() { var notificationElement = $('notification'); removeClass(notificationElement, 'show'); + var actionLink = notificationElement.querySelector('.link'); + // Prevent tabbing to the hidden link. + actionLink.tabIndex = -1; } function showFirstRunNotification() { -- cgit v1.1