-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
backface-visibility: hidden with transform-style: preserve-3d fails the "is.visible" test #5682
backface-visibility: hidden with transform-style: preserve-3d fails the "is.visible" test #5682
Comments
Hey guys, any update on this? would it be possible for you guys to confirm that this is an issue ? |
Hey @loekup, yes this indeed is not being calculated correctly in Cypress 3.7.0.
<!DOCTYPE html>
<html>
<body>
<style type="text/css">
.container {
position: relative;
transform-style: preserve-3d; /* This breaks visible check */
width: 200px;
height: 300px;
}
.flipped {
transform: rotateY(180deg);
}
.face {
backface-visibility: hidden;
position: absolute;
width: 100%;
height: 100%;
}
.front {
background: blue;
}
.back {
transform: rotateY(180deg);
background: red;
}
</style>
<div class="container">
<div class="face front">
Front
</div>
<div class="face back">
Back
</div>
</div>
<script>
const container = document.querySelector('.container');
container.addEventListener('click', () => {
container.classList.toggle('flipped');
})
</script>
</body>
</html> Failing it('should flip and validate the visibility of the card faces', () => {
cy.visit('index.html')
cy.get('.front').should('be.visible')
cy.get('.back').should('not.be.visible')
cy.get('.container').click()
cy.get('.front').should('not.be.visible')
cy.get('.back').should('be.visible')
}) The fix would require some similar logic as was written in https://github.com/cypress-io/cypress/pull/5591/files including tests. cc @sainthkh |
This requires a little more complicated matrix calculation. I'm thinking about the edge cases and solution. |
The code for this is done in cypress-io/cypress#5916, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
Currently an element with
backface-visibility: hidden; transform: rotateY(180deg);
that is inside a parent withtransform-style: preserve-3d; transform: rotateY(180deg)
will fail theis.visible
assertionThe same problem mentioned in #2985 was marked as fixed by #5591 i only think the case where the parent has the css property
transform-style: preserve-3d;
was forgottenDesired behavior:
it should not fail the
is.visible
assertionSteps to reproduce: (app code and test code)
app code
https://codepen.io/loekup/pen/rNNZqZW
test code
Versions
3.6.1.
The text was updated successfully, but these errors were encountered: