Closed Bug 988870 Opened 11 years ago Closed 11 years ago

"readonly" attribute doesn't disable spinner for <input type="number">

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 982189

People

(Reporter: wendelin.thomas, Unassigned)

References

()

Details

(Keywords: testcase)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:29.0) Gecko/20100101 Firefox/29.0 (Beta/Release) Build ID: 20140324101726 Steps to reproduce: Use following HTML5: <input type="number" readonly/> Actual results: Value can be modified by the user via spinner. * (Keyboard & paste is correctly ignored) Expected results: User should not be able to modify the value.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
OS: Mac OS X → All
Product: Firefox → Core
Hardware: x86 → All
Summary: Spinner accessible for <input type="number" readonly/> → "readonly" attribute doesn't disable Spinner for <input type="number">
Version: 29 Branch → Trunk
Summary: "readonly" attribute doesn't disable Spinner for <input type="number"> → "readonly" attribute doesn't disable spinner for <input type="number">
At first I thought that nsNumberControlFrame.cpp needed to be told to disable its buttons when the readonly attribute is set. It already handles this attribute by propagating it into its anon text child, it just doesn't update the spinner buttons appropriately, AFAICT. Except that those spinners seem to just be divs (?!), and not in and of themselves focusable/clickable, and so adding a disabled attribute won't do anything, I think. So I guess instead it's the click code here: http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/HTMLInputElement.cpp?force=1#4135 and the keyup/keydown handling here: http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/HTMLInputElement.cpp?force=1#3900 that need updating. (Note that while comment #0 correctly notes that e.g. typing/pasting is disabled, the up/down arrow keys still spin the number as if the input wasn't readonly.)
Component: DOM: Core & HTML → Layout: Form Controls
Egh, didn't mean to move this in the end.
Component: Layout: Form Controls → DOM: Core & HTML
I think this is a duplicate of Bug 982189
(In reply to Giovanni Sferro [:agi90] from comment #3) > I think this is a duplicate of Bug 982189 Yes! However, note that your patch seems to only address the arrow key case, and not the clicking of the spinner buttons. :-)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.