Bug 993427 - Make getVisualData non-blocking

There are too many constant used here like magic number, about the UI dimension.
This make it harder for other devs to change the UI without looking into this part of code.
If this is the only way to get rid of sync reflow, I am fine with that, but please help extract these numbers out as constant, `defined as var CANDIDATE_PANEL_HEIGHT = 3;`, for example.
Would be better to add some comments around these const.