Ticket #6942 (closed enhancement: fixed)
JQuery.event.fix causes unnecessary reflows in IE when handling key events
|Reported by:||scott_h||Owned by:||dmethvin|
Description (last modified by dmethvin) (diff)
When normalising the event object, jQuery adds pageX/pageY properties in IE based on a combination of event.clientX/Y and document.body.scrollLeft/Top.
Accessing scrollLeft/Top on the body triggers a full-page reflow. On a large DOM, this makes jQuery's key* event handlers unnecessarily slow in IE7 and IE8, since pageX/Y are useless for key events (and so could be defined without triggering reflows).
Interestingly, I discovered that IE defines clientX/Y on key* events to be the current mouse position, whereas in Safari/Firefox they (along with pageX/Y) are both 0. This inconsistency makes me sure that no one uses jQuery's pageX/Y on key events.
- Priority set to low
- Status changed from new to open
- Type changed from bug to enhancement
- Milestone changed from 1.4.3 to 1.next
- Keywords performance,reflow,1.7-discuss added; performance reflow removed
comment:16 Changed 3 years ago by dmethvin
- Description modified (diff)
- Milestone changed from 1.next to 1.7
comment:18 Changed 3 years ago by dmethvin
- Owner set to dmethvin
- Status changed from open to assigned