Closed Bug 878843 Opened 11 years ago Closed 10 years ago

Use mozKeyboard.replaceSurroundingText in autocorrect

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: janjongboom, Unassigned)

References

Details

Attachments

(1 file, 2 obsolete files)

Follow up of bug 878387. Use mozKeyboard.replaceSurroundingText instead of sending BACKSPACE and keycode events.
Attached patch Patch (obsolete) — Splinter Review
Attachment #757442 - Flags: review?(dflanagan)
Comment on attachment 757442 [details] [diff] [review]
Patch

I don't understand what the tools/extensions/  stuff is. It looks like a copy of the gecko patch, but in gaia. I didn't know we could do this. And I don't know what the rules are for landing stuff there.  Is this how we're doing uplifts into b2g18?  I suspect that I can't just r+ and land this. Some kind of approval is probably required.  Or is it just there for testing until the gecko patch is uplifted to the b2g18 tree?

Does adding extensions like this just work without compilation?  That is *so* much easier than rebuilding gecko.

If your intent is to permanently put this code in tools/extensions/ then Fabrice is probably a better reviewer. I'm switching this to him.

Andreas raised a concern in bug 861515 about the events that get sent when words are replaced this way. I don't think the concern was ever addressed in that bug, so I think we should address it here before landing this: what kind of events are generated when an auto-correction is done this way. We need to be sure that web content has some way to monitor changes to their text fields.  Is there a textinput event or something that is fired?

I'm happy with the gaia keyboard code. If some kind of event is triggered, and if Fabrice is okay with the tools/extensions/ stuff, then this looks good to me.
Attachment #757442 - Flags: review?(dflanagan) → review?(fabrice)
The tools/extensions/ stuff is a copy from Gecko, and it's being used to run the keyboard code in desktop Firefox Nightly. vingtetun introduced this in gaia codebase. Updated it so the keyboard doesn't break in desktop. The code already landed in mozilla-central, so that's why I copied this to gaia.

The only changes that need to be reviewed are in apps/keyboard.
Comment on attachment 757442 [details] [diff] [review]
Patch

David, the extensions here are for the desktop helper, not something we ship on device.
Attachment #757442 - Flags: review?(fabrice) → review+
Landed in https://github.com/mozilla-b2g/gaia/commit/181f88ac62bf16499653b4d1124b87adc9c85ca6
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Reverted: https://github.com/mozilla-b2g/gaia/commit/34ba4788729e110bcaa689e7e02b3553c1dc40fd

Landing this patch now breaks autocorrect for all nightly builds. Only people who build their own versions of gecko will be able to use it.

We need to wait to land the patch or rewrite the patch to only use replaceSurroundingText when it is available.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I patched the code to fallback to sending backspaces if replaceSurroundingText is not supported: https://github.com/mozilla-b2g/gaia/pull/10174.
Attachment #757736 - Flags: review?(dflanagan)
Comment on attachment 757736 [details]
patch with fallback for older builds of gecko

r+ technically, but there is lint in the patch.

Since Evan is not around, and this needs to land tonight, I'll fix the lint and land it.
Attachment #757736 - Flags: review?(dflanagan) → review+
This patch has a complicated history: Jan created it originally. Then I backed it out and Evan fixed it to work with versions of gecko both with and without replaceSurroundingText. Then I fixed the lint in Evan's patch. Fabrice reviewed Jan's original patch. I reviewed Evan's patch, and the lint fixes are unreviewed.
Attachment #757442 - Attachment is obsolete: true
Attachment #757736 - Attachment is obsolete: true
Attachment #757775 - Flags: review+
Landed on master: https://github.com/mozilla-b2g/gaia/commit/bc48562d5ede4d0c96f10557d64ccf9a5204253c
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Blocks: 883129
This causes a regression with MMS, see bug 883129.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Closing since the bug was never backed out.
Status: REOPENED → RESOLVED
Closed: 11 years ago10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: