User:Timdream/forms.js requirements: Difference between revisions

→‎Focus management: Note on blur-then-focus
(→‎Focus management: Note on blur-then-focus)
Line 23: Line 23:
# Send an async message when any of the text inputs (input/textarea/contenteditable) lost focus
# Send an async message when any of the text inputs (input/textarea/contenteditable) lost focus
# Send an async message when any of the select lost focus
# Send an async message when any of the select lost focus
# When the focus move from one input to another input in the same widget, don't send two blur/focus events but reduce to one focus event only.


Focus are currently detected by listen to DOM events [https://hg.mozilla.org/mozilla-central/file/7723b15ea695/dom/inputmethod/forms.js#l193 L193].
Focus are currently detected by listen to DOM events [https://hg.mozilla.org/mozilla-central/file/7723b15ea695/dom/inputmethod/forms.js#l193 L193].
Line 28: Line 29:


Blur can happen not only the real blur (detected by DOM event [https://hg.mozilla.org/mozilla-central/file/7723b15ea695/dom/inputmethod/forms.js#l194 L194]) but also removal from DOM tree (detected by mutation observer [https://hg.mozilla.org/mozilla-central/file/7723b15ea695/dom/inputmethod/forms.js#l298 L298].
Blur can happen not only the real blur (detected by DOM event [https://hg.mozilla.org/mozilla-central/file/7723b15ea695/dom/inputmethod/forms.js#l194 L194]) but also removal from DOM tree (detected by mutation observer [https://hg.mozilla.org/mozilla-central/file/7723b15ea695/dom/inputmethod/forms.js#l298 L298].
The way to reduce blur-then-focus events to one focus event is implemented by schedule the event sending function to the end of the event queue [https://hg.mozilla.org/mozilla-central/file/7723b15ea695/dom/inputmethod/forms.js#l685 L685] and [https://hg.mozilla.org/mozilla-central/file/7723b15ea695/dom/inputmethod/forms.js#l700 L700]. '''We should be able to safely remove this feature''' since System app and Keyboard app has the safeguard in place anyway, as we did not reduce two events when focus moved between processes.


=== Issues ===
=== Issues ===
Confirmed users
478

edits