javascript - Safari 9.0.3 flickering issue on window.scrollTo() due to a early repaint on the way -
i'm experiencing odd behaviuor in safari.
on quite content-rich page, upon specific user action (that requires relayouts , substitutions of elements on page) rebuild entire document call window.scrollto()
move viewport calculated point.
isolating problem found before window.scrollto()
repaint occurrs (even if javascript still executing !) scroll performed causing flicker.
the document first displayed new layout, -a frame later- displayed (with new layout) on new position.
i explored variuos "safari flickers" questions (and answers) none of them covers issue i'm experiencing.
the behaviour described bug of safari repaint must not occurr until javascript execution has terminated.
the web page have solid color background. after experimenting found out using image background instead of solid color solves issue.
the main document-sized <div>
has background css property:
background: #eee;
replacing in-line png (a small square same color)
background: url("data:image/png;base64,ivborw0kggoaaaansuheugaaabaaaaaqcaiaaacqkwg2aaaagxrfwhrtb2z0d2fyzqbbzg9izsbjbwfnzvjlywr5ccllpaaaabljrefuenpifpfuhqmpghfuw6ig4asbimaaymassrrucysaaaaasuvork5cyii=") fixed repeat;
avoid spurious repaint , eliminates flicker.
Comments
Post a Comment