-
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
Check backface visibility when the parents of the target element has css style transform-style: preserve-3d. #5916
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
It's created for visual tests.
Committed for future reference.
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.
I verified this fixes the original failing test.
@sainthkh A bit of conflict since I merged in your other PR |
Fixed conflicts and refactored. |
User facing changelog
transform-style: preserve-3d
.transform
is notnone
. -> Transform visibility when height/width is set. #6000 couldn't detect this case and it is fixed.Additional details
Why was this change necessary?
transform-style: flat
. When there is an element withtransform-style: preserve-3d
. Backface visibility didn't work properly.transform
andoverflow
are together.What is affected by this change?
N/A
Any implementation details to explain?
elIsHiddenByTransform
andelIsBackface
together.elHasNoEffectiveWidthOrHeight
How has the user experience changed?
Backface Visibility Detection cannot be perfect when there is an element with
perserve-3d
.After some research, I realized that the behaviors of descendant elements are inconsistent from browser to browser.
And it's a bit unpredictable in the same browsers.
For example, when you hide
preserve-3d
descendants with flat element like below:Chrome:
Firefox:
And there are
flat elements between
preserve-3dand
hidden` elements like below:Chrome:
Firefox:
So, this PR focuses only on 2 things:
, then it only checks those
preserve-3d` ancestors and ignore others.flat
. It goes up and checks and ignorespreserve-3d
elements.When some element goes out of this scope, it returns that it's not a backface. And this decision can be false.
I guess this difference between browsers happened because the transform-related specs are now in draft stage.
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?