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" ' +
<div id="notification">
<span>&nbsp;</span>
<span><span class="link" tabindex="0"></span></span>
<span><span class="link"></span></span>
</div>
<div id="most-visited">
......
......@@ -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() {
......
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