Closed Bug 427245 Opened 17 years ago Closed 17 years ago

IME is enabled on non text editable input element

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: inputmethod, intl, regression)

Attachments

(2 files, 2 obsolete files)

Attached patch Patch v1.0 (obsolete) (deleted) — Splinter Review
IME is enabled on non text editable input element (i.e., non <input type="text"> and <input type="password">).

nsIContent::GetDesiredIMEState() is checking IsEditableInternal(), however, such elements returns TRUE for the element. The input element's editable state is wrong.
Flags: blocking1.9?
Attachment #313817 - Flags: superreview?(roc)
Attachment #313817 - Flags: review?(peterv)
Severity: major → normal
Chris, didn't we reject a patch like this just recently?
Yes, bug 421827, its patch looks roughly equivalent to this one. Bug 421827 is wanted-1.9. Masayuki, do you know of anything critical that requires this change?
The IME state controling is one of the marketing points of Mozilla Japan. So, I want to fix this before Fx3. And by this bug, when the non editable input elements has focus and IME is opened, any shortcut keys and accesskeys are not used. And I think that the patch is not resky. So, we should/can fix this in Fx3.
While it may not be risky, I don't think this is something we'd hold the release for.  Masayuki, we could probably take the patch if it has a test as well (and it passes a review (I'll leave that judgment to chris and roc due to something like this was rejected in bug 421827).

wanted1.9.0.x+ 
Flags: wanted1.9.0.x+
Flags: blocking1.9?
Flags: blocking1.9-
roc and peter:

Please hurry up to review this. I want to land before 1.9.0.

The changing of content/html/content/src/nsGenericHTMLElement.cpp is same as the patch of bug 421827.

And also the patch has content/html/content/src/nsHTMLInputElement.cpp part. If the type attr is changed, we need to update the editable flag, but the patch of bug 421827 didn't so.
Attachment #313817 - Flags: superreview?(roc) → superreview+
Comment on attachment 313817 [details] [diff] [review]
Patch v1.0

>Index: content/html/content/src/nsHTMLInputElement.cpp
>===================================================================

>     if (aName == nsGkAtoms::type) {
>+      UpdateEditableState();

You need to add NS_EVENT_STATE_MOZ_READONLY and NS_EVENT_STATE_MOZ_READWRITE to the ContentStatesChanged call below and some tests.
Attachment #313817 - Flags: review?(peterv) → review+
Attached patch Patch v1.1 (obsolete) (deleted) — Splinter Review
Thank you, roc and Peter.
Attachment #313817 - Attachment is obsolete: true
Attachment #314920 - Flags: superreview+
Attachment #314920 - Flags: review+
Attachment #314920 - Flags: approval1.9?
Attached file testcase (deleted) —
Comment on attachment 314920 [details] [diff] [review]
Patch v1.1

a1.9=beltzner
Attachment #314920 - Flags: approval1.9? → approval1.9+
can we get that testcase in litmus?
Flags: in-litmus?
landed, and the tests are passed on Mac.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
the same test (test_bug415498.xul) cannot be passed on qm-centos5-01. backed-out.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 314920 [details] [diff] [review]
Patch v1.1

>Index: content/html/content/src/nsHTMLInputElement.cpp
>===================================================================

>     if (aName == nsGkAtoms::type) {
>       // Changing type means notifying on state changes.  Just start a batch
>       // now.
>       nsIDocument* document = GetCurrentDoc();
>       MOZ_AUTO_DOC_UPDATE(document, UPDATE_CONTENT_STATE, aNotify);
>-      
>+
>+      UpdateEditableState();
>+      if (document) {
>+        MOZ_AUTO_DOC_UPDATE(document, UPDATE_CONTENT_STATE, PR_TRUE);
>+        document->ContentStatesChanged(this, nsnull,
>+                                       NS_EVENT_STATE_MOZ_READONLY |
>+                                       NS_EVENT_STATE_MOZ_READWRITE);
>+      }

This is not what I asked and it's wrong. You need to add NS_EVENT_STATE_MOZ_READONLY and NS_EVENT_STATE_MOZ_READWRITE to the ContentStatesChanged call below (see http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/content/html/content/src/nsHTMLInputElement.cpp&rev=1.477&mark=602-617#600).
Attachment #314920 - Flags: review+ → review-
(In reply to comment #12)
> the same test (test_bug415498.xul) cannot be passed on qm-centos5-01.
> backed-out.

mmm, the test is passed before my backed-out... it's not my fault.

(In reply to comment #13)
> This is not what I asked and it's wrong. You need to add
> NS_EVENT_STATE_MOZ_READONLY and NS_EVENT_STATE_MOZ_READWRITE to the
> ContentStatesChanged call below (see
> http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/content/html/content/src/nsHTMLInputElement.cpp&rev=1.477&mark=602-617#600).

Oh, thanks. I'll post the new patch.
Attached patch Patch v1.2 (deleted) — Splinter Review
please re-review this.
Attachment #314920 - Attachment is obsolete: true
Attachment #315077 - Flags: review?(peterv)
Attachment #315077 - Flags: review?(peterv) → review+
Thank you, Peter.

re-landed it. (the actual logic doesn't change, a1.9 is carried over.)
Status: REOPENED → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
Flags: wanted1.9.0.x+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: