Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3 #20313

Merged
merged 1 commit into from Jul 21, 2016

Projects

None yet

4 participants

@cvrebert cvrebert added js v3 labels Jul 17, 2016
@cvrebert cvrebert added this to the v3.3.7 milestone Jul 17, 2016
@twbs-savage
Member

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 6b1e2bc
Build details: https://travis-ci.org/twbs-savage/bootstrap/builds/145303749
Docs preview: http://preview.twbsapps.com/c/${commitSha.sha}

(Please note that this is a fully automated comment.)

@cvrebert
Member

The Savage failure is Safari-specific, seemingly unrelated, and probably transient: https://saucelabs.com/jobs/c8bda0f8f4db468491e30a985319aabc
Will retry shortly.

@cvrebert cvrebert Avoid using $.offset() on SVGs since it gives incorrect results in jQ…
…uery 3; fixes #20280

Refs jquery/jquery#3137

[skip validator]
c4d1cdd
@twbs-savage
Member

Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: c4d1cdd
Build details: https://travis-ci.org/twbs-savage/bootstrap/builds/145305276
Docs preview: http://preview.twbsapps.com/c/${commitSha.sha}

(Please note that this is a fully automated comment.)

@hnrch02
Member
hnrch02 commented Jul 17, 2016

So for SVGs the position is now determined based on getBoundingClientRect alone, right? Does that mean tooltips are now be properly positioned when used in SVGs? I remember reading an issue about that problem some time ago.

@XhmikosR
Member

LGTM as far as I can tell.

@cvrebert
Member

So for SVGs the position is now determined based on getBoundingClientRect alone, right?

Correct.

Does that mean tooltips are now be properly positioned when used in SVGs?

That's already the case and should remain the case. We have a unit test specifically for SVG handling: https://github.com/twbs/bootstrap/blob/d3cbb8eac266ee21b0e653a49f71007e720ccdb2/js/tests/unit/tooltip.js#L1042

@cvrebert
Member

For extra assurance, I upgraded to jQuery 3 in an experimental commit (b9ac9e5) and the Sauce tests still passed on all browsers:
https://travis-ci.org/twbs/bootstrap/jobs/146142422

@hnrch02
Member
hnrch02 commented Jul 21, 2016

LGTM then.

@cvrebert cvrebert merged commit c2404d3 into master Jul 21, 2016

3 of 4 checks passed

hound Hound is busy reviewing changes...
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
savage CONFIRMED: Savage cross-browser JS tests passed
@cvrebert cvrebert deleted the jq3-svg-fail branch Jul 21, 2016
@krissihall krissihall pushed a commit to krissihall/bootstrap that referenced this pull request Sep 17, 2016
Hall, Kristina Merge tag 'v3.3.7' of https://github.com/twbs/bootstrap into smcrossover
* tag 'v3.3.7' of https://github.com/twbs/bootstrap: (195 commits)
  Regenerate Customizer JavaScript
  _config.yml: Update SRI hashes for v3.3.7
  grunt
  grunt dist
  Update remaining version numbers in source files
  Fix grunt/change-version.js to update NuGet-related files too
  Fix grunt/change-version.js to update .less files too
  NuGet: Adjust version range to allow jQuery 3
  Update NuGet version numbers is preparation for v3.3.7 release
  Update version numbers in preparation for v3.3.7 release (#20357)
  Discourage usage of <a>s for disabled pagination items
  Revert "Add pointer-events:none to disabled pager/pagination"
  Update iOS temporal input types support comment (#20343)
  iOS 9.3 is still affected by https://webkit.org/b/153856
  Docs: Update Safari versions affected by #9774
  Update jQuery version check and jQuery dependency version range (#20338)
  Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3; fixes #20280 (#20313)
  Port #20315 to v3
  Clarify valid values of Carousel's `pause` option
  Docs CSS: Removed border from GitHub buttons (#19606)
  ...
8b1cdf0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment