Closed
Bug 421827
Opened 16 years ago
Closed 16 years ago
Non editable <input> should not have an editable flag
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: cpearce, Assigned: masayuki)
References
Details
Attachments
(3 files, 2 obsolete files)
826 bytes,
text/html
|
Details | |
1.36 KB,
patch
|
peterv
:
review+
peterv
:
superreview+
|
Details | Diff | Splinter Review |
1.80 KB,
text/html
|
Details |
This was picked up in bug 421169. <input> elements have their editable flag set, even for non-editable types such as button, checkbox, file, hidden, image, radio, reset, submit. The attached testcase is taken from bug 421169, and lists all the <input> types, with a red box after them if they're editable (if they match a -moz-read-write selector).
Flags: blocking1.9?
Comment 1•16 years ago
|
||
I'd guess the issue is that nsGenericHTMLFormElement::UpdateEditableFormControlState sets any non-readonly form control as editable... That seems wrong: that attribute should only affect text and password inputs.
Reporter | ||
Comment 2•16 years ago
|
||
(In reply to comment #1) > I'd guess the issue is that > nsGenericHTMLFormElement::UpdateEditableFormControlState sets any non-readonly > form control as editable... That seems wrong: that attribute should only > affect text and password inputs. > The readonly attribute should only affect text and password inputs, but the others shouldn't be non-readonly anyway right? Where can we turn change the default for input to be non-readonly (except in the text & password case)?
Comment 3•16 years ago
|
||
I think we should just check the input type in the last if() condition in that function....
Why should text and password inputs have the editable flag? Their anonymous contents, sure, but the inputs themselves aren't really "editable".
Comment 5•16 years ago
|
||
> Why should text and password inputs have the editable flag?
That's what css3-ui seems to imply, basically.
Reporter | ||
Comment 6•16 years ago
|
||
Adds check to nsGenericHTMLFormElement::UpdateEditableFormControlState() so that we only enable editable flag for non-readonly password and text inputs.
Comment 7•16 years ago
|
||
Comment on attachment 308372 [details] [diff] [review] Patch v1 >Index: content/html/content/src/nsGenericHTMLElement.cpp >+ nsIFormControl *fctl = static_cast<nsIFormControl*>(this); >+ const PRInt32 type = fctl->GetType(); You can just call GetType() directly (as a member method of |this|) without the casting, no? The rest looks ok, but given that I suggested the change it would make more sense to have peterv review it..
Reporter | ||
Comment 8•16 years ago
|
||
V1 with BZ's suggested change.
Attachment #308372 -
Attachment is obsolete: true
Attachment #308472 -
Flags: review?(peterv)
Attachment #308372 -
Flags: review?(bzbarsky)
Reporter | ||
Comment 9•16 years ago
|
||
Comment on attachment 308472 [details] [diff] [review] Patch v2 This patch makes the caret not appear in <textarea>. :(
Attachment #308472 -
Attachment is obsolete: true
Attachment #308472 -
Flags: review?(peterv)
Comment 10•16 years ago
|
||
Oh. Well, textarea should also follow the readonly attribute...
Reporter | ||
Comment 11•16 years ago
|
||
As v2 with NS_FORM_TEXTAREA check.
Attachment #308551 -
Flags: review?(peterv)
Flags: wanted1.9+
Flags: blocking1.9?
Flags: blocking1.9-
Updated•16 years ago
|
Attachment #308551 -
Flags: superreview+
Attachment #308551 -
Flags: review?(peterv)
Attachment #308551 -
Flags: review+
Assignee | ||
Comment 12•16 years ago
|
||
Comment on attachment 308551 [details] [diff] [review] Patch v3 See bug 427245 comment 3. This patch is important for us. Please land this.
Attachment #308551 -
Flags: approval1.9?
Assignee | ||
Comment 13•16 years ago
|
||
Comment on attachment 308551 [details] [diff] [review] Patch v3 Oops, this patch doesn't change |nsHTMLInputElement::AfterSetAttr|. This patch is baggy.
Attachment #308551 -
Flags: approval1.9?
Assignee | ||
Comment 14•16 years ago
|
||
click the "Toggle the input type" button, the input elements will be type="text". But you cannot input any text to them.
Reporter | ||
Comment 15•16 years ago
|
||
Masayuki, could you please take this bug and finish it? You have a much better understanding of how this affects IME input, I don't even have IME or know how to use it!
Assignee | ||
Comment 16•16 years ago
|
||
(In reply to comment #15) > Masayuki, could you please take this bug and finish it? You have a much better > understanding of how this affects IME input, I don't even have IME or know how > to use it! O.K. I'll continue to work on bug 427245. That already has the patch.
Assignee: chris → masayuki
Status: ASSIGNED → NEW
Assignee | ||
Comment 17•16 years ago
|
||
landed, thanks!
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 19•16 years ago
|
||
re-landed.
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Flags: in-testsuite?
Comment 20•16 years ago
|
||
Please check in a test for this. It should be trivial to write a reftest, given the HTML already in the bug.
You need to log in
before you can comment on or make changes to this bug.
Description
•