homepage Welcome to WebmasterWorld Guest from 54.197.211.197
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Browsers / Firefox Browser Usage and Support
Forum Library, Charter, Moderators: incrediBILL

Firefox Browser Usage and Support Forum

    
Stop Firefox from tabbing focus to body element?
Firefox keeps giving the body element focus during tabindex.
JAB Creations

WebmasterWorld Senior Member jab_creations us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3358802 posted 7:19 am on Jun 5, 2007 (gmt 0)

My site's layout uses an iframe like div and therefor the body element does not scroll, show scrollbars, or have any content on it in essence. However Firefox keeps insisting that the body element should be given focus every tabindex cycle. Not official lingo though I am using the word cycle for when the user cycles past all the focusable elements and returns to the browser GUI, which they will eventually tab back to the rendering area with the site/page. With my layout (and no I'm not changing my layout) Firefox creates a bug where only the body is given focus regardless of the fact that all three anchors in the following test case have tabindex attributes (and of course the body does not) on the second cycle.

The only way to negate an element from the tabindex according to the W3C is to disable it. I wanted to add the disable attribute dynamically with JavaScript (and not have to do so at the server because of validation issues). Correct - this is not valid code however it's also not valid behavior. I was not able to find the specific XHTML article though most HTML 4 is the same (with some deprecations to the contrast) as XHTML...
[w3.org...]

I have even manually attempted to add the disabled attribute to the body directly and Firefox still tabs to it! Suggestions?

- John

*Edit* Ops, helps to post the code! ;)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Tabindex Test</title>
<style type="text/css">

body:disabled {}
</style>
<script type="text/javascript">
document.getElementsByTagName("body").setAttribute("disabled", disabled);
</script>
</head>

<body disabled="disabled">

<div>
<a href="#" tabindex="1">anchor 1</a>
<a href="#" tabindex="2">anchor 2</a>
<a href="#" tabindex="3">anchor 3</a>

</div>

</body>
</html>

[edited by: JAB_Creations at 7:20 am (utc) on June 5, 2007]

 

JAB Creations

WebmasterWorld Senior Member jab_creations us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3358802 posted 8:03 pm on Jun 5, 2007 (gmt 0)

I have narrowed down the issue to

bug 383349 [bugzilla.mozilla.org].

- John

[edited by: jatar_k at 9:54 pm (utc) on June 5, 2007]
[edit reason] fixed link [/edit]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Browsers / Firefox Browser Usage and Support
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved