-
Notifications
You must be signed in to change notification settings - Fork 20.6k
Fix .offset() and .position() bugs #3487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@gibson042, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jbedard, @markelog and @dgalvez to be potential reviewers. |
// TODO Verify .offset(...) | ||
// assert.deepEqual( $el.offset( offset ).offset(), offset ) | ||
// assert.deepEqual( $el.offset( adjustedOffset ).offset(), adjustedOffset ) | ||
// assert.deepEqual( $new.offset( offset ).offset(), offset ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Omitted for scope creep. See gh-3488.
Resolved: There's no need to handle extreme situations in the broken environments. |
I think we need perf test for it |
A perf test for what? I'm not aware of any alternatives here. |
7ff4e83
to
a48fed8
Compare
@jquery/core This one is finally ready to land. I opened jquery/api.jquery.com#1027 to clarify some details that came to light over the course of working on it. |
Summary
Makes
.offset()
always relative to the document and.position()
always relative to the closest containing block offsetParent (if any).Some new tests fail on IE<11 (where
document.documentElement.getBoundingClientRect()
erroneously includes margins and disregards viewport scrolling), and have been manually disabled/patched up.Fixes gh-3080
Fixes gh-3107
Closes gh-3096
Ref gh-3479
Checklist