-
Notifications
You must be signed in to change notification settings - Fork 43
Feature/fix pseudo elements #642
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
Conversation
I tried to update the tests locally, but due to different OS (linux vs windows), the tests are not passing locally. I think that we have to upload the reports to GitHub Actions, like @oezelenes looked into some time ago. Furthermore, there is still this trouble within recheck(.cli) when applying inserted-deleted elements, which seem to not to remove the element properly and thus causes duplication with |
c61dd13
to
675764b
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: diba1013.
|
675764b
to
69d9e02
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: diba1013.
|
69d9e02
to
0a4486c
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: diba1013.
|
0a4486c
to
a2390cc
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: diba1013.
|
a2390cc
to
d3eb089
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: diba1013.
|
d3eb089
to
ab65538
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: diba1013.
|
as the w3c specifies that these pseudo elements should only be added, if `content != "none"`
since those do not have a hard criteria but instead only a subset of possible css attributes they accept. However, since we currently extract all css attributes, there are those that do not apply (e.g outline). Furthermore, css states (e.g. :pressed) is not propagated downwards, so the outline of the pseudo element cannot change and therefore will always be different to the parent.
ab65538
to
4328720
Compare
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: diba1013.
|
Before submission, please check that ...
you updated the changelog.(This is not released yet, so not necessary)you updated necessary documentation within retest/docs.(see above)Description
As already described by #625, ghost pseudo elements cause the alignment algorithm to get confused, which produces
"a" has been inserted
and"a" has been deleted
difference. This PR should address the most pressing problems and catch the currently known cases (mostly as a workaround).Bug
I have added a test which shows only one occurrence of the bug. It appears consistently, if a button (or link) is pressed and a check is generated at this exact moment or a few moments later—I have yet to figure out, when Selenium "completes" a click. Because buttons make use of a pseudo class (
:pressed
), it will change some properties of the button (e.g.outline
) to show the button has been pressed.This has the current algorithm detect changes in the parents' and the pseudo elements' style and generate a pseudo element which then confuses the alignment algorithm.
Problem
Inherited attributes
In general, attributes of a parent is inherited by the child element. Since pseudo elements (especially
::before
and::after
) are considered direct children of the parent attributes.Strangely enough, pseudo class changes are not propagated to the
getComputedStyle(parent, "$pseudo")
which returns the old CSS attributes (i.e. not pressed). I have tried to add the parents' states to the query, but the browser refuses to give the current state. I can only assume that this is by design, that pseudo classes (e.g.:hover
) are not passed down to the child to allow them to respond independently to them.Rendering of pseudo elements
While most pseudo elements are always present (although rarely used), the
::before
and::after
pseudo elements are not always added to the render tree. That is because the specification describes they should only be added if their content attribute is not"none"
. This is currently ignored by the implementation, which only looks at the inherited attributes.CSS Attributes
According to the specification, not all attributes are allowed on pseudo elements. However, we query attributes on the pseudo elements that will never affect the element (e.g. outline) and thus return a false value.
Implementation
::before
,::after
) are easy to exclude, following the specification.State of this PR
PseudoElementIT
?Additional Context