v21’s avatarv21’s Twitter Archive—№ 72,989

  1. frontend experts, a question for you. I'm using Puppeteer to puppet a headless Chromium to render SVGs. tried triggering the capture after the load event, but images within the SVGs hadn't rendered. is there a better event to listen for? or do I just bodge a few seconds delay in?
    1. …in reply to @v21
      after a bit of digging into it, it seems like the answer is to wait for two requestAnimationFrames to pass. seems like there should be a simpler way! stackoverflow.com/questions/14578356/how-to-detect-when-an-image-has-finished-rendering-in-the-browser-i-e-painted
      1. …in reply to @v21
        ('load' is fired after the browser knows what to paint. but it just does the actual painting on it's own time, some time after that)
        1. …in reply to @v21
          after actually trying that... nope. time to just crank the delay up!