Closed jmcgavin closed 1 year ago
@aomarks, @bicknellr, this is a pretty significant bug because it prevents us from using the native feature set of toggleAttribute
. Let me know how I can help expedite this merge request
Hey @aomarks and @bicknellr 👋
Could you please review? Thanks!!
Hi, thanks for sending this! Could you add a test or two? It doesn't seem like we have any for the attribute functions on Element
yet, but Element.test.html.js
seems like it would be the right place to put it.
@jmcgavin any chance you could incorporate the review comments? Do you mind if somebody takes over?
@jpzwarte Apologies for the delay! I've addressed the comments that were left
@bicknellr Thank you for the review and my apologies for the tardiness of my response. I've addressed your comments. Let me know if it requires additional changes or tests
Thanks for the updates!
I looked into the failing test and it's seems like an unrelated bug that was exposed by a new getHTML
call. This line is unconditionally calling attributeChangedCallback
even though it might be undefined
:
The whole outer iteration over observedAttributes
could be nested in an if (definition.attributeChangedCallback) { ... }
to work around this:
Also, could you add a change log entry? (example here)
Addresses an issue where
toggleAttribute
would not retainforce
, the second positional argument passed to it.Fixes https://github.com/webcomponents/polyfills/issues/533