Skip to content
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

Fix incorrect image magnifier size bug in Safari #17426

Conversation

dannynimmo
Copy link
Contributor

Description

This pull request fixes a bug in the product gallery magnifier (zoom). In some cases (e.g. in the Safari browser), the image full size is calculated incorrectly, due to the image not being loaded before the dimensions are checked.

The fix makes use of the image element properties naturalWidth & naturalHeight which can check the full size of the image without needing to re-create it from the src. naturalWidth & naturalHeight are supported in IE9+, and all other browsers.

Fixed Issues (if relevant)

  1. Product image zoom (magnifier) is broken in Safari #17416: Product image zoom (magnifier) is broken in Safari

Manual testing preconditions

  1. Enable the magnifier in the Luma theme in etc/view.xml
  2. Safari browser (v11.1.2)
  3. Remote environment (issue does not exist on local environments due to the bug being a race condition from the image loading)

Manual testing scenarios

  1. Browse to product detail page with a large image
  2. Click the image to open the fullscreen gallery
  3. Click on the "zoom in" button

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Aug 7, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @dannynimmo. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team
Copy link
Contributor

Hi @VladimirZaets, thank you for the review.
ENGCOM-2698 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@dannynimmo thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@dannynimmo
Copy link
Contributor Author

Hi @magento-engcom-team, how can I get the Travis CI build to pass? The build failed on the below step:

The command if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi exited with 2.

I don't believe this is related to this pull request.

@magento-engcom-team
Copy link
Contributor

Hi @dannynimmo. Thank you for your contribution.
We will aim to release these changes as part of 2.3.0.
Please check the release notes for final confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants