MutationObserver.observe
check for options
argument is too strict
#1223
Labels
bug
Something isn't working
Describe the bug
MutationObserver.observe
check foroptions
argument is too strict and throwsDOMException
for the cases when it's valid according to the DOM Standard.It should also throw
TypeError
and notDOMException
in case whenoptions
object is invalid.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should not throw
DOMException
orTypeError
.Device:
13.1.4
Additional context
According to the DOM Standard the following steps should be performed first before checking
options
.options["attributeOldValue"]
oroptions["attributeFilter"]
exists, andoptions["attributes"]
does not exist, then setoptions["attributes"]
totrue
.options["characterDataOldValue"]
exists andoptions["characterData"]
does not exist, then setoptions["characterData"]
totrue
.Discovered while running tests against codebase with
VueUse
usage. HereMutationObserver
is used with justattributeFilter
: https://github.com/vueuse/vueuse/blob/84965f53edc73b221804de91e565ffdf71d1e28d/packages/core/useElementBounding/index.ts#L96-L98The text was updated successfully, but these errors were encountered: