Closed
Bug 948549
Opened 11 years ago
Closed 11 years ago
Make <input type=number> behave honor the 'disabled' attribute, and correctly disable when inside a disabled fieldset
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
Attachments
(1 file)
|
10.33 KB,
patch
|
smaug
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
The HTML5 spec doesn't mention 'disabled' in the list given after the text "The following common input element content attributes, IDL attributes, and methods apply to the element" for <input type=number>, so I omitted to implement disabling:
http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#number-state-%28type=number%29
| Assignee | ||
Comment 1•11 years ago
|
||
This patch remedies things by doing for 'number' what bug 596088 did for 'file', plus a change to nsNativeTheme.cpp to make sure that the spin buttons get the disabled styling too.
Attachment #8345423 -
Flags: review?(bugs)
Comment 2•11 years ago
|
||
Comment on attachment 8345423 [details] [diff] [review]
patch
>+ NS_IMETHOD Run() MOZ_OVERRIDE {
{ goes to the next line
>@@ -80,16 +80,24 @@ nsNativeTheme::GetContentState(nsIFrame*
> // anonymous <input type=text> takes focus for it.
> if (aWidgetType == NS_THEME_NUMBER_INPUT &&
> frameContent->IsHTML(nsGkAtoms::input)) {
> nsNumberControlFrame *numberControlFrame = do_QueryFrame(aFrame);
> if (numberControlFrame && numberControlFrame->IsFocused()) {
> flags |= NS_EVENT_STATE_FOCUS;
> }
> }
>+
>+ nsNumberControlFrame* numberControlFrame =
>+ nsNumberControlFrame::GetNumberControlFrameForSpinButton(aFrame);
>+ if (numberControlFrame &&
>+ numberControlFrame->GetContent()->AsElement()->State().
>+ HasState(NS_EVENT_STATE_DISABLED)) {
>+ flags |= NS_EVENT_STATE_DISABLED;
>+ }
Would be nice to combine this somehow with the stuff above, but don't see now how.
Attachment #8345423 -
Flags: review?(bugs) → review+
Comment 3•11 years ago
|
||
Please file a spec bug!
Comment 4•11 years ago
|
||
I'll file spec bugs for this and select()
| Assignee | ||
Comment 5•11 years ago
|
||
Comment 6•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
| Assignee | ||
Comment 7•11 years ago
|
||
Comment on attachment 8345423 [details] [diff] [review]
patch
[Approval Request Comment]
Bug caused by (feature/regressing bug #): N/A
User impact if declined: disabled <input type=number> will not be disabled in v28
Testing completed (on m-c, etc.): landed m-i, merged to m-c
Risk to taking this patch (and alternatives if risky): low and early
String or IDL/UUID changes made by this patch: none
We're early in the cycle so hopefully this is fine to uplift. Probably needed to keep <input type=number> on in v28.
Attachment #8345423 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Comment 8•11 years ago
|
||
(In reply to Jonathan Watt [:jwatt] from comment #7)
> Bug caused by (feature/regressing bug #): N/A
Or bug 344616 and its dependencies if you need one to blame.
Updated•11 years ago
|
Attachment #8345423 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
| Assignee | ||
Comment 9•11 years ago
|
||
| Assignee | ||
Updated•11 years ago
|
status-firefox28:
--- → fixed
Target Milestone: mozilla29 → mozilla28
Comment 10•11 years ago
|
||
(TM tracks when it hit m-c, status flags track what branches it's been uplifted to)
status-firefox29:
--- → fixed
Target Milestone: mozilla28 → mozilla29
You need to log in
before you can comment on or make changes to this bug.
Description
•