Closed
Bug 927319
Opened 11 years ago
Closed 11 years ago
Toggling the highlighted class of a keyboard key create reflow
Categories
(Firefox OS Graveyard :: Gaia::Keyboard, defect)
Firefox OS Graveyard
Gaia::Keyboard
Tracking
(blocking-b2g:1.3T+, b2g-v1.3T fixed, b2g-v1.4 fixed)
RESOLVED
FIXED
blocking-b2g | 1.3T+ |
People
(Reporter: vingtetun, Assigned: drs)
References
Details
(Keywords: perf)
Attachments
(4 files, 1 obsolete file)
Everytime the user hit a key the highlighted class is added to the key. This class triggers a lot of positionning changes that are creating a reflow. When this class is remove a new reflow is created.
So there is a basically 2 reflows per key touch. This hurts keyboard responsiveness. Could we come up with a solution for highlighting that does not trigger reflows, for example by having a set of highlighting elements (likely 2) that are positioned with a transform when the user hit the key, or by having those elements pre-build into the dom and hitting a key will just change their visibility and maybe a pointer-events rule?
Tim do you have some resources to work on that? Attached is the script I'm using to see keyboard reflows. You will notice that there is a lot of reflows happening as well when there is a suggestion but I will open a separate bug for that. So when debugging this one I suggest that text suggestions is disabled.
Flags: needinfo?(timdream)
Reporter | ||
Comment 1•11 years ago
|
||
For what it worth the code to see reflows will move into a devtool to make it easier to use (see bug 926371)
Keywords: perf
Comment 2•11 years ago
|
||
I would redirect ni? to djf as he intend to take over keyboard UI from v1.3.
Flags: needinfo?(timdream) → needinfo?(dflanagan)
Comment 3•11 years ago
|
||
At the moment we do all this positioning in keyboard.css for .keyboard-key.highlighted. If we can get rid of that we don't trigger reflows anymore.
Comment 4•11 years ago
|
||
There is visual design work happening in 1.3 to simplify the appearance of the keyboard.
And we may end up rewriting a bunch of stuff for dynamic hit targets anyway.
Thanks, Vivien!
Assignee | ||
Comment 5•11 years ago
|
||
Assignee: nobody → bugzilla
Attachment #8360149 -
Flags: review?(dflanagan)
Assignee | ||
Comment 6•11 years ago
|
||
This is a temporary fix. If the keyboard is rewritten I'm sure this will no longer be an issue.
Comment 7•11 years ago
|
||
Comment on attachment 8360149 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/15336
Stealing review.
Even in the new keyboard we might make the same mistakes.
Attachment #8360149 -
Flags: review?(dflanagan) → review?(janjongboom)
Comment 8•11 years ago
|
||
Comment on attachment 8360149 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/15336
Hi Douglas, With this patch enabled the key disappears when pressing it, the bubble isn't shown and it's not possible to type variants anymore (by holding key); so I guess something went wrong.
The UI tests cover most of this, you can run the tests through:
$ make && gaiatest --binary=/Applications/B2G.app/Contents/MacOS/b2g-bin --profile=$HOME/repos/gaia/profile/ --testvars=testvars.json --restart ./tests/python/gaia-ui-tests/gaiatest/tests/functional/keyboard/* --app-arg=-jsconsole
That way you don't have to go through Travis all the time.
Attachment #8360149 -
Flags: review?(janjongboom) → review-
Assignee | ||
Comment 9•11 years ago
|
||
Strange, it worked for me. I'll look more into it, thanks!
Comment 10•11 years ago
|
||
Yeah, let me know. i'd really like this patch.
Assignee | ||
Comment 11•11 years ago
|
||
Hey Jan, I tried reproing the issues that you described and I wasn't able to on B2G desktop or on a Hamachi device. I also ran the keyboard test suite and it didn't pick up any errors.
Would you please describe more about your setup to me?
Comment 12•11 years ago
|
||
I'm on this commit:
commit b57e4b8b5c7baebb165db1f94bf6ba2e970c6bda
Author: DouglasSherk <github@sherk.me>
Date: Tue Jan 14 17:43:04 2014 -0800
Bug 927323 - Fix key presses causing reflows of the entire keyboard.
Run via: make && /Applications/B2G.app/Contents/MacOS/b2g-bin -profile $PWD/profile
Comment 13•11 years ago
|
||
As you can see the key disappears when clicking on it...
Flags: needinfo?(bugzilla)
Assignee | ||
Comment 14•11 years ago
|
||
I still can't repro this, and I did exactly what you did. I've attached a video of myself using it with the exact same setup. As you can see from the paint flashing, it's definitely not reflowing the entire keyboard anymore. I've also re-tested it on my Hamachi and I get the exact same functionality. I'll see if I can get someone else to test it.
Flags: needinfo?(bugzilla)
Comment 15•11 years ago
|
||
Maybe a stupid question but are you sure we're on the same commit?
Flags: needinfo?(bugzilla)
Assignee | ||
Comment 16•11 years ago
|
||
Attachment #8360149 -
Attachment is obsolete: true
Flags: needinfo?(bugzilla)
Assignee | ||
Comment 17•11 years ago
|
||
(In reply to Jan Jongboom [:janjongboom] from comment #15)
> Maybe a stupid question but are you sure we're on the same commit?
I redid the pull request because I botched a rebase of the old one. I last tested it with my commit rebased on top of ff30172a, which was dated Jan 7 but was merged in about half an hour ago.
Assignee | ||
Updated•11 years ago
|
Attachment #8361242 -
Flags: review?(janjongboom)
Comment 18•11 years ago
|
||
Comment on attachment 8361242 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/15424
r=me. Works great now, tested in B2G desktop and on device. Now only repaints the parts of the screen that are affected.
Attachment #8361242 -
Flags: review?(janjongboom) → review+
Comment 19•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Flags: needinfo?(dflanagan)
Comment 22•11 years ago
|
||
Ask for approval from who?
Flags: needinfo?(janjongboom) → needinfo?(praghunath)
Assignee | ||
Comment 23•11 years ago
|
||
This is a fairly low-risk fix. Sanity checks on the keyboard would reveal any serious problems with it.
Comment 24•11 years ago
|
||
blocking- - this isn't a perf regression. We should consider this for approval.
blocking-b2g: 1.3? → -
Assignee | ||
Comment 25•11 years ago
|
||
(In reply to Jason Smith [:jsmith] from comment #24)
> blocking- - this isn't a perf regression. We should consider this for
> approval.
It is a perf regression. I don't know when from, but the keyboard didn't always reflow on every tap.
Comment 26•11 years ago
|
||
I'm pretty sure it does on 1.1
Updated•11 years ago
|
blocking-b2g: - → 1.3T+
Comment 27•11 years ago
|
||
We save ~5% CPU usage on a tarako w/ this patch on v1.3t.
Comment 28•11 years ago
|
||
Landed in v1.3t - 920e16f7b0b9d6c5474c35d689be5a73c5216213
Updated•11 years ago
|
status-b2g-v1.3T:
--- → fixed
Comment 29•11 years ago
|
||
I cannot see whole keyboard repanit even without this patch, and after this patch, we could still see 2 reflows for each keystroke, which I guess is still tracked by bug 969544.
Hi Doug,
Thanks for doing this patch, can I confirm with you the above is the same as what you see when testing this patch?
Thanks.
Flags: needinfo?(drs+bugzilla)
Assignee | ||
Comment 30•11 years ago
|
||
(In reply to Rudy Lu [:rudyl] from comment #29)
> I cannot see whole keyboard repanit even without this patch, and after this
> patch, we could still see 2 reflows for each keystroke, which I guess is
> still tracked by bug 969544.
The whole keyboard used to repaint on every key press. This patch took it to the latter state where, when pressed, there is a reflow of the key itself and the bubble above it. bug 969544 gets us down to no reflows on key press.
Flags: needinfo?(drs+bugzilla)
Updated•11 years ago
|
status-b2g-v1.4:
--- → fixed
Updated•11 years ago
|
Flags: needinfo?(praghunath)
You need to log in
before you can comment on or make changes to this bug.
Description
•