width/height css set hook causes forced reflows #3991
Closed
Comments
jbedard
added a commit
to jbedard/jquery
that referenced
this issue
Mar 14, 2018
- this avoids forcing a reflow in some cases Fixes jquery#3991
jbedard
added a commit
to jbedard/jquery
that referenced
this issue
Mar 18, 2018
- this avoids forcing a reflow in some cases Fixes jquery#3991
jbedard
added a commit
that referenced
this issue
Mar 25, 2018
- this avoids forcing a reflow in some cases Fixes #3991
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
3fcddd6#diff-414c8f59bff0d1b63680b64763d8c529R370 started invoking the
isBorderBoxtest 100% of the time instead of only when necessary. In my case this causes a series of.css({width})calls to cause a "forced reflow" (that's the chrome terminology in the performance tool).Updating the width/height
setto avoid computingisBorderBoxunless necessary fixes it for me locally, but makes the code a bit uglier:However so far I have been unable to reproduce this in jsbin, so there must be another condition that I'm not understanding such as a specific position type on the element or parent element?
Here's an example where a series of

ng-style="{width: X}"in AngularJS causes this (and jQuery 3.1 does not cause it):Link to test case
TODO
The text was updated successfully, but these errors were encountered: