Re: [w3c/webcomponents] [idea] Make use of `observedAttributes` optional (#565)

> Basically, anytime an attribute is added, we have to evaluate the regular expression

Only the first time. Meta-speaking

```
if (!_whiteList.contains(newAttribute)) {
  if (!_blackList.contains(newAttribute)) {
    if (observedAttributes.test(newAttribute)) {
      _whiteList.push(newAttribute);
    } else {
      _blackList.push(newAttribute);
    }
  }
}
```

After the first time, you'll do that also only if the name is unknown/different which is usually not common.

Of course performance would be penalised compared to just first check but like I've said, we could keep the current `Array` when performance are a concern.

Mine was just an idea, it's surely more work for vendors and specs author, but it'd probably make developers happy giving them the ability to intercept whatever they want if/when they want.

I personally wouldn't mind keeping as it is, but I understand other developers needs.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/565#issuecomment-248278565

Received on Tuesday, 20 September 2016 11:48:11 UTC