User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Ubuntu/10.04 Chromium/8.0.552.237 Chrome/8.0.552.237 Safari/534.10 Build Identifier: Mozilla XULRunner 188.8.131.52 - 20101206143738 The CSS property “-moz-user-focus” doesn't work in my text field. Reproducible: Always Steps to Reproduce: Run: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window width="400" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <textbox id="textBox1"/> <textbox id="textBox2" style="-moz-user-focus: none;"/> <textbox id="textBox3"/> </window> Actual Results: the textBox2 is focusable Expected Results: the textBox2 should not be focusable
As a workaround, provided by Neil: "The textbox itself never takes focus. Instead, XBL creates an anonymous XHTML input element inside the textbox, and this is what takes focus. You can stop the textbox taking keyboard focus by setting its tab index to -1, and mouse focus by preventing the default action of mousedown events. Another approach is to set the textbox to disabled or readonly, depending on why you don't want the textbox to be focused." Still, I think the -moz-focus should work as well, and should prevent both keyboard and mouse focus.
I believe you should be using `ignore` instead of `none`: https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-focus Still, it looks like it is broken for touch events.