Commit 38d57cad authored by arv@google.com's avatar arv@google.com

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
parent 938d54ac
...@@ -84,7 +84,7 @@ document.write('<link id="themecss" rel="stylesheet" ' + ...@@ -84,7 +84,7 @@ document.write('<link id="themecss" rel="stylesheet" ' +
<div id="notification"> <div id="notification">
<span>&nbsp;</span> <span>&nbsp;</span>
<span><span class="link" tabindex="0"></span></span> <span><span class="link"></span></span>
</div> </div>
<div id="most-visited"> <div id="most-visited">
......
...@@ -188,7 +188,7 @@ function onShownSections(mask) { ...@@ -188,7 +188,7 @@ function onShownSections(mask) {
} }
mostVisited.updateDisplayMode(); mostVisited.updateDisplayMode();
layoutRecentlyClosed(); renderRecentlyClosed();
updateOptionMenu(); updateOptionMenu();
} }
...@@ -298,7 +298,7 @@ function handleWindowResize() { ...@@ -298,7 +298,7 @@ function handleWindowResize() {
if (layoutMode != oldLayoutMode){ if (layoutMode != oldLayoutMode){
mostVisited.invalidate(); mostVisited.invalidate();
mostVisited.layout(); mostVisited.layout();
layoutRecentlyClosed(); renderRecentlyClosed();
} }
} }
...@@ -329,7 +329,7 @@ function showSection(section) { ...@@ -329,7 +329,7 @@ function showSection(section) {
shownSections &= ~Section.THUMB; shownSections &= ~Section.THUMB;
mostVisited.invalidate(); mostVisited.invalidate();
} else { } else {
layoutRecentlyClosed(); renderRecentlyClosed();
} }
updateOptionMenu(); updateOptionMenu();
...@@ -347,7 +347,7 @@ function hideSection(section) { ...@@ -347,7 +347,7 @@ function hideSection(section) {
} }
if (section & Section.RECENT) { if (section & Section.RECENT) {
layoutRecentlyClosed(); renderRecentlyClosed();
} }
updateOptionMenu(); updateOptionMenu();
...@@ -677,11 +677,6 @@ function layoutRecentlyClosed() { ...@@ -677,11 +677,6 @@ function layoutRecentlyClosed() {
} else { } else {
style.opacity = style.height = ''; 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. // We cannot use clientWidth here since the width has a transition.
var spacing = 20; var spacing = 20;
var headerEl = recentElement.firstElementChild; var headerEl = recentElement.firstElementChild;
...@@ -700,7 +695,7 @@ function layoutRecentlyClosed() { ...@@ -700,7 +695,7 @@ function layoutRecentlyClosed() {
} }
elementsToHide.forEach(function(el) { elementsToHide.forEach(function(el) {
el.style.display = 'none'; el.parentNode.removeChild(el);
}); });
} }
} }
...@@ -919,6 +914,8 @@ function showNotification(text, actionText, opt_f, opt_delay) { ...@@ -919,6 +914,8 @@ function showNotification(text, actionText, opt_f, opt_delay) {
notificationElement.onmouseout = delayedHide; notificationElement.onmouseout = delayedHide;
actionLink.onfocus = show; actionLink.onfocus = show;
actionLink.onblur = delayedHide; actionLink.onblur = delayedHide;
// Enable tabbing to the link now that it is shown.
actionLink.tabIndex = 0;
show(); show();
delayedHide(); delayedHide();
...@@ -927,6 +924,9 @@ function showNotification(text, actionText, opt_f, opt_delay) { ...@@ -927,6 +924,9 @@ function showNotification(text, actionText, opt_f, opt_delay) {
function hideNotification() { function hideNotification() {
var notificationElement = $('notification'); var notificationElement = $('notification');
removeClass(notificationElement, 'show'); removeClass(notificationElement, 'show');
var actionLink = notificationElement.querySelector('.link');
// Prevent tabbing to the hidden link.
actionLink.tabIndex = -1;
} }
function showFirstRunNotification() { function showFirstRunNotification() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment