Comment by cramforce

6 years ago

Counter anecdote: As a Google engineer it always seemed like Edge implemented the sparsest possible version of the web platform to make major Google products work–and literally nothing else. That works to launch the browser, but then basically any product change runs a chance to no longer fall into that sparse subset and break in a browser. If Edge had implemented a more robust set of features, it would have massively improved compatibility down the road.

Features like empty divs on top of video? Could be by accident ofc, but the entire story makes this unlikely.

  • > Features like empty divs on top of video? Could be by accident ofc, but the entire story makes this unlikely.

    I'd suggest inspecting a few sites you watch video on. An empty div is the least weird thing you'll find.

    • I highly suspect that the issue is that Windows video playback can only use scanout compositing if there is nothing on top of the video. Scanout compositing is significantly more energy-efficient than standard framebuffer compositing because it avoids a memory copy each frame.

      This ultimately comes down to hardware limitations. GPUs are limited as to what they can compose during scanout, because of memory bandwidth limits. Each plane that you can alpha-blend together at scanout time multiplies the amount of memory fetches per dot you have to do. On today's high-DPI displays, the bandwidth going out to the display is very high to begin with, so you can't afford to multiply that by much. That is why putting something on top of a video is tricky: you're adding another layer to be alpha-blended on top, increasing your memory bandwidth by 50% over the two layers you already have (RGB for the background plus YUV for the video). The user's GPU may or may not support that--as I recall, prior to Skylake, Intel GPUs only had two hardware planes, for instance.

      I'm not surprised that Microsoft just used "are there any DOM elements over the video?" as a quick heuristic to determine whether scanout compositing can be used. Remember that there is always a tradeoff between heuristics and performance. At the limit you could scan every pixel of each layer to see whether all of them are transparent and cull the layer if so, but that would be very expensive. You need heuristics of some kind to get good performance, and I can't blame Microsoft for using the DOM for that.

      6 replies →

    • On the other hand, pretty easy how such a div might trigger a less efficient path; if the video is top in the z-order then it can probably bypass being composited by the browser (and who knows, maybe even bypass being composited by the OS) and avoid a whole mess of rendering to a texture, texturing some triangles, and so on and so forth.

      6 replies →

  • I fail to understand how an empty DIV can break a state-of-the-art video acceleration. Why not add another check to remove such empty HTML tags before hand.

    Also, what can explain Edge failing to load Azure dashboard - was that a Google bug too? Ref: https://www.youtube.com/watch?v=5zMbfvEHlTU

    • > Why not add another check to remove such empty HTML tags before hand.

      Sure, and they did. And then next month it’ll be something else, and a new check. The next month it’ll be something else yet again, and yet another check. Pretty soon Microsoft’s codebase is littered with checks and guards against the random things Google does, and they’ll still always be a deploy behind. Google could keep this up for years.