79390301

Date: 2025-01-27 09:52:50
Score: 0.5
Natty:
Report link

[UPDATE 2025]

Looking at MDN, there is no reference to any paint event existing on the window object and there is no reference to any window.onpaint method, even in the list of deprecated methods. After searching on the internet, there is no reference of such method, except the two Stacckoverflow questions (this one and the one mentioned in the question).

The 2024 EcmaScript standard (https://262.ecma-international.org/15.0/) does not mention such event or method.

Last but not least, window.onpaint is never called automatically by the browser. A simple test can be done:

    <script>
        window.onpaint = () => {
            console.log("hello stackoverflow from window.onpaint()")
        }
    </script>

The snippet above won't log anything into the console.

In other words, feel free to define window.onpaint but don't expect this function to be called when initializing the DOM.

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Sébastien M.