Fix #113 - Add support for CSSStyleDeclaration property get, set, and remove#114
Conversation
…get, set, and remove - CSSStyleDeclaration.getPropertyValue() - CSSStyleDeclaration.setProperty() - CSSStyleDeclaration.removeProperty()
| } | ||
|
|
||
| getPropertyValue(name) { | ||
| const self = this[PRIVATE]; |
There was a problem hiding this comment.
For my own understanding/curiosity, what is the difference between this and this[PRIVATE] (which is a getter that returns this)?
It seems like the cssText getters and setters are the only ones that use this directly.
There was a problem hiding this comment.
this points at the proxy, not at the original Map reference ... the constructor returns a Proxy ;-)
There was a problem hiding this comment.
Ahhh, the proxy passes the this[PRIVATE] getter back to the original object and accesses that this. Thanks for the explanation 🙂
|
|
||
| getPropertyValue(name) { | ||
| const self = this[PRIVATE]; | ||
| return handler.get(self, name); |
There was a problem hiding this comment.
The handler is for proxy thing ... once you have the original Map that is holding all values, you gotta do like:
return self.get(uhyphen(name));got it?
There was a problem hiding this comment.
Actually, never mind ... updateKeys needs to happen, so this was unnecessary optimization. All good!
|
Thanks for the review, merge, and release @WebReflection 🎉 |
See #653 (comment) We can allow this to run now since I added support for `setProperty` in `linkedom` ⏩ WebReflection/linkedom#114
Add support for
CSSStyleDeclarationproperty get, set, and remove:CSSStyleDeclaration.getPropertyValue()CSSStyleDeclaration.setProperty()CSSStyleDeclaration.removeProperty()Fix #113