Async Dart CSS handling - feature request #8689
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-obsolete
Closed as the reported issue is no longer relevant
library-html
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by fra...@igindo.com
--FEATURE REQUEST--
Currently, CSS style changes are processed immediately after you set a style property on an Element.
This causes a browser reflow event, depending on how the browser vendor deals with it behind the scenes.
Chrome for example will bundle individual style changes in the background to minimize reflow, other vendors however have less optimized reflow handlers, causing multiple async style changes in our code to trigger unnecessary reflows.
What steps will reproduce the problem?
n/a, CssStyleDeclaration behaviour in general
What is the expected output? What do you see instead?
It would be nice to have if Dart would bundle CSS style changes in the background as well, similar to Chrome's batch handling of style changes and reflow triggers.
Perhaps you could enhance the API?
// M3's style interaction
element.style.foo = 'bar';
// suggestion, existing next to the above syntax
// the > operand would indicate that you want to include this css change with the next update batch
element.style.foo > 'bar';
// Having a Future in return which indicates when your batch, with the css change, has been processed, would be great as well
=> Future futureCssUpdate = element.setStyleAsync('foo', 'bar');
Eventually, one would be able to trigger n-amount of style changes :
element.setStyleAsync('foo', 'bar');
element.setStyleAsync('another foo', 'another bar');
element.setStyleAsync('more foo', 'more bar');
... etc ...
all async, applied to one batch, and trigger a minimal reflow on the next batch iteration.
What version of the product are you using? On what operating system?
M3, win7
Please provide any additional information below.
The text was updated successfully, but these errors were encountered: