Bypass css text (#2811)

* [DOM mocks] enable setting element.style

* Use the style setter directly
This commit is contained in:
Pierre-Yves Gérardy 2023-01-17 15:04:19 +01:00 committed by GitHub
parent 645cf663b2
commit c1fc1de772
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 13 deletions

View file

@ -800,10 +800,10 @@ module.exports = function($window) {
// Styles are equivalent, do nothing.
} else if (style == null) {
// New style is missing, just clear it.
element.style.cssText = ""
element.style = ""
} else if (typeof style !== "object") {
// New style is a string, let engine deal with patching.
element.style.cssText = style
element.style = style
} else if (old == null || typeof old !== "object") {
// `old` is missing or a string, `style` is an object.
element.style.cssText = ""