mozilla

Revision 323781 of -moz-user-focus

  • Revision slug: CSS/-moz-user-focus
  • Revision title: -moz-user-focus
  • Revision id: 323781
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment -tag

Revision Content

Used to indicate whether the element can have the focus. By setting this to 'ignore', you can disable focusing the element, which means that the user will not be able to activate the element. The element will be skipped in the tab sequence. A similar property 'user-focus' was proposed in early drafts of a predecessor of css3-ui but was rejected by the working group.

ignore
The element does not accept the keyboard focus and will be skipped in the tab order.
normal
The element can accept the keyboard focus.
Note: This property doesn't work for XUL {{ XULElem("textbox") }} elements, because the textbox itself never takes focus. Instead, XBL creates an anonymous HTML {{ HTMLElement("input") }} element inside the textbox, and that element is what receives focus. You can stop the textbox from taking keyboard focus by setting its tab index to -1, and from taking mouse focus by preventing the default action of mousedown events.

Revision Source

<p>Used to indicate whether the element can have the focus. By setting this to 'ignore', you can disable focusing the element, which means that the user will not be able to activate the element. The element will be skipped in the tab sequence. A similar property 'user-focus' was proposed in <a class="external" href="http://www.w3.org/TR/2000/WD-css3-userint-20000216">early drafts of a predecessor of css3-ui</a> but was rejected by the working group.</p>
<dl>
  <dt>
    <code>ignore</code></dt>
  <dd>
    The element does not accept the keyboard focus and will be skipped in the tab order.</dd>
  <dt>
    <code>normal</code></dt>
  <dd>
    The element can accept the keyboard focus.</dd>
</dl>
<div class="note">
  <strong>Note:</strong> This property doesn't work for XUL&nbsp;{{ XULElem("textbox") }} elements, because the <code>textbox</code> itself never takes focus. Instead, XBL&nbsp;creates an anonymous HTML&nbsp;{{ HTMLElement("input") }}&nbsp;element inside the <code>textbox</code>, and that element is what receives focus. You can stop the <code>textbox</code> from taking keyboard focus by setting its tab index to -1, and from taking mouse focus by preventing the default action of <code>mousedown</code> events.</div>
Revert to this revision