Side navigation
#14250 closed bug (fixed)
Opened August 12, 2013 03:09AM UTC
Closed August 19, 2013 04:21PM UTC
Last modified January 24, 2014 05:27PM UTC
addClass and removeClass needlessly assign to className.
Reported by: | jdunck | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.11/2.1 |
Component: | attributes | Version: | 2.0.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Assigning to className, even with the same value, triggers a re-render in some browsers. This can cause a noticeable render delay on mobile. On causes.com with a $(body).addClass applying an existing class, it took 200ms to render.
I'm not sure how to show this in jsfiddle.
Attachments (0)
Change History (6)
Changed August 12, 2013 03:15AM UTC by comment:1
Changed August 13, 2013 02:01PM UTC by comment:2
component: | unfiled → attributes |
---|---|
milestone: | None → 1.10.3/2.0.4 |
priority: | undecided → low |
status: | new → open |
Seems like a good idea.
Changed August 19, 2013 04:21PM UTC by comment:3
resolution: | → fixed |
---|---|
status: | open → closed |
Fix #14164: assign className in addClass/removeClass only if changed. Close gh-1331.
Changeset: c418b94eb48188cd9329519ae5e030a52dd81cc9
Changed September 16, 2013 01:21AM UTC by comment:4
milestone: | 1.10.3/2.0.4 → 1.11/2.1 |
---|
Bulk update for new milestone
Changed December 28, 2013 08:43PM UTC by comment:5
Changed January 24, 2014 05:27PM UTC by comment:6
Ref https://code.google.com/p/chromium/issues/detail?id=278045 which has supposedly been fixed.
Per https://github.com/jquery/jquery/pull/1331#issuecomment-22469431 , this fits under the layout reflows umbrella: http://bugs.jquery.com/ticket/14164