-
Notifications
You must be signed in to change notification settings - Fork 791
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(link-in-text-block): take into account ancestor inline element styles #4135
Draft
straker
wants to merge
10
commits into
develop
Choose a base branch
from
link-in-text-style-ancestor
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bc4bf09
fix(link-in-text-block): take into account ancestor inline element st…
straker 47bf2b5
integration tests
straker 859ffcf
typo
straker c50700e
fix same color issue
straker 470b462
add u example
straker 2f100c1
figure out text-decoration
straker 014585f
fix tests
straker 5ebde67
Merge branch 'develop' into link-in-text-style-ancestor
straker 4d839b9
suggestions
straker 25b3001
fix test
straker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ <h1>Non-color change tests</h1> | |
<p style="color: black"> | ||
paragraph of text (pass: link is bolder than paragraph) | ||
<a | ||
style="text-decoration: none; font-weight: bolder; color: black" | ||
style="text-decoration: none; font-weight: bolder; color: #222" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would pass even without the change in style due to using the same color as the paragraph. |
||
href="#" | ||
id="pass-different-weight" | ||
> | ||
|
@@ -66,14 +66,40 @@ <h1>Non-color change tests</h1> | |
<p style="color: black"> | ||
paragraph of text (pass: link is larger that paragraph) | ||
<a | ||
style="text-decoration: none; font-size: larger; color: black" | ||
style="text-decoration: none; font-size: larger; color: #222" | ||
href="#" | ||
id="pass-different-size" | ||
> | ||
Link text</a | ||
> | ||
</p> | ||
|
||
<p style="color: black"> | ||
paragraph of text (pass: ancestor span is bolder than paragraph) | ||
<span style="font-weight: bolder"> | ||
<a | ||
style="text-decoration: none; color: #222" | ||
href="#" | ||
id="pass-ancestor-different-weight" | ||
> | ||
Link text</a | ||
> | ||
</span> | ||
</p> | ||
|
||
<p style="color: black"> | ||
paragraph of text (pass: ancestor span uses border) | ||
<span style="border-bottom: 1px solid"> | ||
<a | ||
style="text-decoration: none; color: #222" | ||
href="#" | ||
id="pass-ancestor-border" | ||
> | ||
Link text</a | ||
> | ||
</span> | ||
</p> | ||
|
||
<h1>Color change tests</h1> | ||
<b | ||
>Note that these tests limit changes to one variable per test. No attempt is | ||
|
This file contains 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
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.
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 don't think we can just push any inline ancestor. If the element has non-link text in it is no longer a distinguishing style. Take something like the following, that should not pass because it has a bold parent:
This probably does need to do some filtering. It doesn't matter if it's just a comma or something, but whole worlds I don't think counts anymore.
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.
The above issue was resolved for strong / underline, but not for pseudo elements. This shouldn't be passed because of that pseudoElm class:
It makes me wonder whether checking for pseudo elms should be done inside
elementIsDistinct
to avoid the repeat?