Check backface visibility when the parents of the target element has css style transform-style: preserve-3d.#5916
Merged
jennifer-shehane merged 11 commits intocypress-io:developfrom Jan 7, 2020
Conversation
Contributor
|
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.
This was referenced Dec 27, 2019
Member
jennifer-shehane
left a comment
There was a problem hiding this comment.
I verified this fixes the original failing test.
chrisbreiding
requested changes
Jan 2, 2020
Member
|
@sainthkh A bit of conflict since I merged in your other PR |
Contributor
Author
|
Fixed conflicts and refactored. |
chrisbreiding
previously approved these changes
Jan 3, 2020
3 tasks
chrisbreiding
approved these changes
Jan 6, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User facing changelog
transform-style: preserve-3d.transformis 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.transformandoverfloware together.What is affected by this change?
N/A
Any implementation details to explain?
elIsHiddenByTransformandelIsBackfacetogether.elHasNoEffectiveWidthOrHeightHow 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-3ddescendants with flat element like below:Chrome:

Firefox:

And there are
flat elements betweenpreserve-3dandhidden` elements like below:Chrome:

Firefox:

So, this PR focuses only on 2 things:
, then it only checks thosepreserve-3d` ancestors and ignore others.flat. It goes up and checks and ignorespreserve-3delements.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?