diff options
author | arv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-09 21:20:24 +0000 |
---|---|---|
committer | arv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-09 21:20:24 +0000 |
commit | 38d57cada621c79e6a21f9f56c9c92305123850f (patch) | |
tree | 80ebd40904b6b8d41917e2086fb8fccb8806c6de /chrome | |
parent | 938d54ac33044905429ca7f0f55eb7fe2d459321 (diff) | |
download | chromium_src-38d57cada621c79e6a21f9f56c9c92305123850f.zip chromium_src-38d57cada621c79e6a21f9f56c9c92305123850f.tar.gz chromium_src-38d57cada621c79e6a21f9f56c9c92305123850f.tar.bz2 |
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
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/resources/new_new_tab.html | 2 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.js | 20 |
2 files changed, 11 insertions, 11 deletions
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('<link id="themecss" rel="stylesheet" ' + <div id="notification"> <span> </span> - <span><span class="link" tabindex="0"></span></span> + <span><span class="link"></span></span> </div> <div id="most-visited"> 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() { |