w3c/css-houdini-drafts

[css-paint-api] Use of entries in the paint class instances map needs to check that they actually exist

Opened this issue · 0 comments

https://drafts.css-houdini.org/css-paint-api-1/#invoke-a-paint-callback step 5 does:

Let paintInstance be the result of get paintClassInstanceMap[|name]|. If paintInstance is null, run the following steps:

But I don't see how the "is null" thing can happen. Either the entry does not exist (which is different from null, note!) or it does exist and then it's never null.

This should probably check whether the entry exists, and if not create it and set paintInstance to the entry's new value. Otherwise, if the entry exists, set paintInstance to its value.