Closed Bug 632904 Opened 9 years ago Closed 9 years ago

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

Categories

(Core :: DOM: Editor, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

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.
Whiteboard: [need review]
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
Closed: 9 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.