Open Bug 2003858 Opened 21 hours ago Updated 5 hours ago

Setting HTMLInputElement.value on input events behaves differently from Chrome with Swiftkey keyboard

Categories

(Core :: DOM: Editor, defect)

Unspecified
Android
defect

Tracking

()

People

(Reporter: saschanaz, Assigned: m_kato)

References

(Blocks 1 open bug)

Details

(Keywords: parity-chrome, webcompat:platform-bug)

User Story

user-impact-score:360

Attachments

(1 file)

Attached file input.value example

On the attached file, focus on the input and tap 1 repeatedly on your on-screen keyboard.

On Chrome: The content is kept as 1 and no composition happens.
On Firefox: The content grows as the composition happens.

OS: Unspecified → Android

InputEvent.data is the same as the composing string which may be different from HTMLInputElement.value. Then, how we can retarget the replacing range of the composition string? That's the main issue of this kind of handling.

On the other hand, in your STR, I guess the values are the same. If so, I think we don't track the replacing range since we use nsRange for each composition string clause and it's shrunken when all data of the Text is modified. Perhaps, EditorBase::ReplaceSelectionAsSubAction() should stop modifying the Text when the new value is same during composition.

Component: DOM: UI Events & Focus Handling → DOM: Editor
Severity: -- → S3

Odd, it's not reproducible with synthesized compositions. I guess IME commits composition with a text change notification or something.

When HTMLInputElement.value is set, we notify TextControlState::SetValue() of the old value.
https://searchfox.org/firefox-main/rev/5a5b3741981250310f4327537f18879559779f9c/dom/html/HTMLInputElement.cpp#1752,1763-1766

Then, TextControlState::SetValue() does nothing if the old value is the same value as the new value.
https://searchfox.org/firefox-main/rev/5a5b3741981250310f4327537f18879559779f9c/dom/html/TextControlState.cpp#2574-2577,2591-2592,2594-2599

So, the testcase should work... Any ideas?

Flags: needinfo?(krosylight)

Err, I misunderstood the report. So, the <input>.value should have only the latest composition value and it should be committed. Hmm, the expected behavior conflicts with the expectation of bug 1240336. So, I don't understand Chrome works as so now.

Odd, this testcase works fine on desktop, but on Fenix, indeed, the composition string is not overwritten by the setting value.

I think the last input value which is dispatched after compositionend whose inputType is "insertCompositionText" and data is the latest composition string should overwrite the <input>.value after committing the composition. However, the composition is not committed by the setting value.

Makoto-san, could you take a look?

Flags: needinfo?(krosylight) → needinfo?(m_kato)

yep

Assignee: nobody → m_kato
Flags: needinfo?(m_kato)
User Story: (updated)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: