[w3c/webcomponents] el.attributeStyleMap.set('display', 'block') does not trigger attributeChangedCallback although style attribute changed. (#890)

If I have a custom element like

```js
class MyEl extends HTMLElement {
  static observedAttributes = ['style']
  attributeChangedCallback(attr, oldVal, newVal) { console.log(attr, oldVal, newVal) }
}
customElements.define('my-el', MyEl)
```

I noticed that, in Chrome for example, if I run 

```js
el.setAttribute('style', 'block')
```

`attributeChangedCallback` is called and I see console output.

However if I run

```js
el.attributeStyleMap.set('display', new CSSKeywordValue('block'))
```

then `attributeChangedCallback` is not fired and I see no output. However, I can see the attribute is updated in the element inspector and I can call `el.getAttribute('style')` and see the new value.

Is this expected?

-- 
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/890

Received on Friday, 24 July 2020 23:35:54 UTC