User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Steps to reproduce:
Set maxlength on an input that is hidden with display: none
Actual results:
The maxlength did not change.
Expected results:
The maxlength should change to the specified value.

(In reply to Ehsan Akhgari [:ehsan] from comment #2)
> Yeah, unfortunately the maxlength enforcement is handled by the editor,
> which will not be around when the element doesn't have a frame attached to
> it...
Ehsan, shouldn't nsTextEditorState.cpp take care of that? I would think that nsTextEditorState::PrepareEditor should set the maxlength on the editor.

This looks like a bad reduction. Using elem.maxLength (capitalization) or elem.setAttribute( "maxlength", ... ) is working. I'll continue reducing the problem from the original jQuery UI report and figure out the actual case where this is failing.

I've updated the linked test case. In order for the bug to occur the original maxlength and style must be set via JavaScript. The original test case set them directly in the markup, and the bug did not occur, it just appeared broken because of the incorrect casing on the property name.

(In reply to Mounir Lamouri (:mounir) from comment #3)
> (In reply to Ehsan Akhgari [:ehsan] from comment #2)
> > Yeah, unfortunately the maxlength enforcement is handled by the editor,
> > which will not be around when the element doesn't have a frame attached to
> > it...
>
> Ehsan, shouldn't nsTextEditorState.cpp take care of that? I would think that
> nsTextEditorState::PrepareEditor should set the maxlength on the editor.
Yes, I think that would be the right fix.

Hi,
In my experiments, first time (if no maxlength is assigned), it works correctly.
If you try to update it (with display: none) it didn't work.
Fails using .maxLength but Using setAttribute works correctly.

(In reply to Fernando R. Sela [:frsela] from comment #7)
> Hi,
>
> In my experiments, first time (if no maxlength is assigned), it works
> correctly.
>
> If you try to update it (with display: none) it didn't work.
>
> Fails using .maxLength but Using setAttribute works correctly.
Finally worked in my box but not on B2G18 :(

(In reply to Fernando R. Sela (no CC, needinfo please) [:frsela] from comment #7)
> Hi,
>
> In my experiments, first time (if no maxlength is assigned), it works
> correctly.
>
> If you try to update it (with display: none) it didn't work.
>
> Fails using .maxLength but Using setAttribute works correctly.
Dear frsela:
Does setAttribute will work correctly??

(In reply to buri.blff from comment #11)
> (In reply to Fernando R. Sela (no CC, needinfo please) [:frsela] from
> comment #7)
> > Hi,
> >
> > In my experiments, first time (if no maxlength is assigned), it works
> > correctly.
> >
> > If you try to update it (with display: none) it didn't work.
> >
> > Fails using .maxLength but Using setAttribute works correctly.
>
> Dear frsela:
> Does setAttribute will work correctly??
As I told in comment #8, it worked in my box with firefox nightly >22 but not in B2G18 build so finally I added a Timeout in order to change it after the box is displayed.

(In reply to Jason Smith [:jsmith] from comment #14)
> Not blocking - we've shipped multiple platforms with this bug already and
> the blocking bug had a workaround implemented to get around this issue.
Jason Smith:
can you tell me how to workaround this pr?

(In reply to Jason Smith [:jsmith] from comment #14)
> Not blocking - we've shipped multiple platforms with this bug already and
> the blocking bug had a workaround implemented to get around this issue.
we don't find this pr in v1.0.1

It appears this issue was first reported years ago here:
https://bugzilla.mozilla.org/show_bug.cgi?id=350786
I'm still experiencing this issue in Firefox 26.0
Forgive my ignorance as this is the first issue I've been involved with with Firefox - I see that is bug is set to NEW however there has been talk of a proposed workaround.
What is the state of this issue - is there a solution that has not yet been released or is there no known solution?

> If i try to set a value for maxlenght when display is "none", maxlenght
> doesn't change and I can't set the same value.
When the textbox is get back visible, i can't set the same value i tried to set when display was none (test a).