mozilla/firefox-ios — pull request #55 by st3fan (2014-12-17 20:49:55+00:00)
Title: St3fan/bug1109656 location completion

This implemented a first iteration of location completion. It implements the following rules:

* If the user types `www.m` and we have a completion suggestion `http://www.mozilla.org`, the completion will be `www.mozilla.org`.
* If the user types `m` and we have a completion suggestion `http://www.mozilla.org`, the completion will be `mozilla.org`.
* If the user types `http://wwww.m` and we have a completion suggestion `http://www.mozilla.org`, the completion will be `http://www.mozilla.org`.

In all cases the completion suggestion will *also* include the actual source URL `http://www.mozilla.org` - so that we can make a difference between what is typed in the location field and what that actually resolves to.

Currently the patch includes a fixed list of mock suggestions. I will file a followup bug to hook this up to our real datasources.

The code currently does not deal with paths in URLs. This is intentional. If we require that, then I will add a followup bug to adjust the API accordingly.