(bug 36310) jquery.byteLimit should skip < 0 due to Firefox bug.
* Firefox returns -1 if an element has no maxLength property set.
(instead of undefined). This is especially problematic because
roundtripping that value (e.g. setting elem.maxLength = -1;)
causes a DOMException to be thrown.
That exception is expected (and happens also in Chrome), but Chrome
and other standard browsers don't return -1 for the getter, so it
would never end up in the setter.
* Moved the check to before the property set/removal. Otherwise
the exception would still be thrown. This should've been before
anyway.
* This fixes:
- (bug 36310) Can't enter a log summary on Special:MovePage
in Firefox.
Even though we do set maxLength for that field from PHP. Recently
the input field was changed from <input> to <textarea>. And since
English Wikipedia has wgHtml5 disabled and maxLength on <textarea>
is new in HTML5, that property was stripped by the Html class, and
the javascript incorrectly assumed that the property would be there
and thus caused the DOMException in Firefox.
* Added unit test for this (which fails in Firefox without this fix).
Change-Id: I28490b61bd5a20dd1d84c4730615514d3822aa77