W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2019

Re: [csswg-drafts] [cssom] Proposal: CSS.assign (#4486)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Wed, 06 Nov 2019 15:04:03 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-550350301-1573052641-sysbot+gh@w3.org>
> It would be lovely to have the ability to define multiple CSS properties at once, without causing reflows or repaint during each property that might trigger those.

Doesn't this happen already? AFAIK, unless you force it, styles are not applied synchronously.

For example, if I go to https://drafts.csswg.org/cssom/ and run
```js
for (let i = 0; i < 100; ++i) {
  document.body.style.width = Math.random() * 1000 + "px";
  document.body.offsetLeft;
}
```
it takes like 8 seconds, because I'm forcing layout at each iteration. But if I remove the `offsetLeft` line, it's a single millisecond.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4486#issuecomment-550350301 using your GitHub account
Received on Wednesday, 6 November 2019 15:04:10 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:56 UTC