Closed
Bug 952724
Opened 11 years ago
Closed 11 years ago
[InputMethid API] InputContext#replaceSurroundingText doesn't match spec
Categories
(Core :: DOM: Device Interfaces, defect)
Core
DOM: Device Interfaces
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: xyuan, Assigned: xyuan)
References
()
Details
Attachments
(2 files, 3 obsolete files)
The spec:
Promise<void> replaceSurroundingText(DOMString text, optional long offset, optional long length);
The webidl is the same with the spec:
http://mxr.mozilla.org/mozilla-central/source/dom/webidl/InputMethod.webidl#124
Promise replaceSurroundingText(DOMString text, optional long offset, optional long length);
The last two parameters give the offset from the cursor position where replacing starts and the length of text to replace.
But we made a mistake with the implementation:
Promise<void> replaceSurroundingText(DOMString text, optional long beforeLength, optional long afterLength);
The last two parameters give the text lengths before and after the cursor to replace.
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #8350871 -
Flags: review?(janjongboom)
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8350871 -
Attachment is obsolete: true
Attachment #8350871 -
Flags: review?(janjongboom)
Attachment #8350873 -
Flags: review?(janjongboom)
Assignee | ||
Comment 3•11 years ago
|
||
Sorry, I uploaded the wrong patch. This is the right one ;-)
Attachment #8350873 -
Attachment is obsolete: true
Attachment #8350873 -
Flags: review?(janjongboom)
Attachment #8350874 -
Flags: review?(janjongboom)
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #8350879 -
Flags: review?(dflanagan)
Comment 5•11 years ago
|
||
So what I don't like here is that we're making a breaking change in the API as of v1.4 with this patch. Is there any way we can deprecate the old call and make a new function that behaves correct (via an overload or something). I guess there will be people writing keyboards for 1.2 and up and there is no way to know which version of replaceSurroundingText they'll be dealing with...
Flags: needinfo?(xyuan)
Assignee | ||
Comment 6•11 years ago
|
||
The fix should be uplifted to v1.2 as well. We'll use the same API for v1.2 and above. Our implementation doesn't follow all our public wiki, webidl and documents. It'll make keyboard developer confusing.
Since v1.2 hasn't support 3rd party keyboard yet, and we mainly use the keyboard API for the built-in keyboard, I think we don't need to be compatible with the old call ;-)
Flags: needinfo?(xyuan)
Comment 7•11 years ago
|
||
Since when was 3rd party keyboard scrapped from 1.2? If this will be the only version people will ever see I'm fine with it :p
Flags: needinfo?(xyuan)
Comment 8•11 years ago
|
||
Comment on attachment 8350874 [details] [diff] [review]
gecko part v2
r=janjongboom.
Unrelated; why is INFO TEST-KNOWN-FAIL | /tests/dom/inputmethod/mochitest/test_basic.html | The input context type should match. - got text, expected input failing?
Attachment #8350874 -
Flags: review?(janjongboom) → review+
Comment 9•11 years ago
|
||
Comment on attachment 8350879 [details] [review]
gaia part
Looks good to me. Note, though, that I have not compiled the gecko patch and tested myself.
Thanks for patching the test_apps/demo-keyboard too!
Attachment #8350879 -
Flags: review?(dflanagan) → review+
Comment 10•11 years ago
|
||
(In reply to Jan Jongboom [:janjongboom] from comment #7)
> Since when was 3rd party keyboard scrapped from 1.2? If this will be the
> only version people will ever see I'm fine with it :p
3rd party keyboards didn't make 1.3 either, they'll start in 1.4. No need to backport anywhere please.
Assignee | ||
Updated•11 years ago
|
Flags: needinfo?(xyuan)
Keywords: checkin-needed
Assignee | ||
Comment 11•11 years ago
|
||
(In reply to Jan Jongboom [:janjongboom] from comment #8)
> Comment on attachment 8350874 [details] [diff] [review]
> gecko part v2
>
> r=janjongboom.
>
> Unrelated; why is INFO TEST-KNOWN-FAIL |
> /tests/dom/inputmethod/mochitest/test_basic.html | The input context type
> should match. - got text, expected input failing?
From the webild, InputContext#type should be "input", "textarea", or "contenteditable", but we get "text".
Comment 12•11 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/eccb5de0533a
The Gaia PR needs updating before it can be merged.
Flags: in-testsuite+
Keywords: checkin-needed
Comment 13•11 years ago
|
||
Attachment #8350879 -
Attachment is obsolete: true
Attachment #8355564 -
Flags: review+
Comment 14•11 years ago
|
||
Comment 15•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Assignee | ||
Comment 16•11 years ago
|
||
Jan & Ryan, thanks for the help :)
You need to log in
before you can comment on or make changes to this bug.
Description
•