Editor/IME/spellcheck use content states when they mean IsEditable()

RESOLVED FIXED in mozilla5

Status

()

Core
Editor
P1
normal
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

Trunk
mozilla5
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Patch coming up per discussion with Ehsan.
OS: Mac OS X → All
Hardware: x86 → All
In particular, checking for the MOZ_READONLY state is exactly equivalent to checking for |IsEditable() || (some sort of text input the user can type in)|.  It's not clear why we'd ever want to handle those two cases in the same way.
Created attachment 511105 [details] [diff] [review]
Check IsEditable(), not content states, if we care about editability.
Attachment #511105 - Flags: review?(masayuki)
Attachment #511105 - Flags: review?(ehsan)
Whiteboard: [need review]

Updated

7 years ago
Attachment #511105 - Flags: review?(ehsan) → review+
Attachment #511105 - Flags: review?(masayuki) → review+
Whiteboard: [need review] → [need gk2 ship]
Doesn't this disable spellchecking for xul:textbox and xul:textarea? Or for some XTF elements (nsXTFElementWrapper has a SetIntrinsicState)?
Tthe key part here for spellchecking is the test for _text_ nodes, not elements as far as I can tell.  And for text nodes IntrinsicState() looks like this:

773   return IsEditable() ? NS_EVENT_STATE_MOZ_READWRITE :
774                         NS_EVENT_STATE_MOZ_READONLY;

If you prefer we could back this out and replace with a patch that checks IsEditable() on text nodes and the state on elements; the key part for me is that state is not going to exist on text nodes...
Pushed http://hg.mozilla.org/mozilla-central/rev/cb3e118dda44
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [need gk2 ship]
Target Milestone: --- → mozilla2.2
You need to log in before you can comment on or make changes to this bug.