Re: [csswg-drafts] [cssom] How safe is it really to shorthandify properties? (#8398)

I'm also concerned that the proposal might affect code doing something along these lines:

```js
for (let i = style.length - 1; i >= 0; i -= 1) {
  style.removeProperty(style[i]);
}
```

If removing longhands can remove a preceding shorthands, this will mess the indices, making `style[i]` go out-of-bounds, or if only some properties are removed, possibly revisit an already iterated one. The specific code above won't throw nor anything, but if the author is doing additional things with `style[i]`, it could be bad.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8398#issuecomment-2160183238 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 11 June 2024 09:04:05 UTC