• Joel Martin's avatar
    canvas.js: workaround WebKit bug, issue #28. · cdb55d26
    Joel Martin authored
    This is WebKit bug https://bugs.webkit.org/show_bug.cgi?id=46319
    
    The workaround is to wrap Canvas render functions with a function that
    sets a flush timer. The flush function sets the right margin and then
    1ms later sets it back. This triggers the canvas to redraw with the
    correct contents.
    
    Two downsides:
    - rendering is slower, but only on the busted versions of webkit.
      Correct and useful is better than fast and useless.
    - There is a barely perceptible jitter of the control buttons because
      the canvas size is changing by one pixel.
    
    To support this functionality, we also have to read out the exact
    webkit version from the user agent in the render engine detection code
    in include/util.js.
    cdb55d26
util.js 6.99 KB