Skip to content
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

Added font color assessment #238

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions EngineQuailConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ define( function() {
'aMustNotHaveJavascriptHref',
'aSuspiciousLinkText',
'blockquoteNotUsedForIndentation',
'colorFontContrast',
'documentVisualListsAreMarkedUp',
'headerH1',
'headerH2',
Expand Down
2 changes: 1 addition & 1 deletion tests/manual/a11ychecker.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@bender-include: %TEST_DIR%../_assets/jquery.min.js
@bender-ui: collapsed
@bender-ckeditor-plugins: a11ychecker,sourcearea,toolbar,undo,wysiwygarea,clipboard,basicstyles,list,link,format,image,table,floatingspace
@bender-ckeditor-plugins: a11ychecker,sourcearea,toolbar,undo,wysiwygarea,clipboard,basicstyles,list,link,format,image,table,floatingspace,colorbutton,colordialog

Play around with Accessiblity Checker.

Expand Down
34 changes: 34 additions & 0 deletions tests/manual/assessments/colorFontContrast.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<style>
/* Style the body this way due to a known issue with Balloon Panel in Bender */

body {
margin-left: 0px;
padding-left: 320px;
}

</style>
<textarea id="editor1" cols="10" rows="10">
&lt;h1&gt;Font contrast&lt;/h1&gt;&#10;&#9;&lt;p&gt;The following text (white text on a white background) should fail:&#10;&#9;&#9;&lt;span style=&quot;color:#ffffff&quot;&gt;&#10;&#9;&#9;&#9;&lt;span style=&quot;background-color:#ffffff&quot;&gt;foobar&lt;/span&gt;&#10;&#9;&#9;&lt;/span&gt;&#10;&#9;&lt;/p&gt;&#10;&#9;&lt;p&gt;The following text should also fail:&#10;&#9;&#9;&lt;span style=&quot;color:#9b59b6&quot;&gt;&#10;&#9;&#9;&#9;&lt;span style=&quot;background-color:#8e44ad&quot;&gt;foobar&lt;/span&gt;&#10;&#9;&#9;&lt;/span&gt;&#10;&#9;&lt;/p&gt;&#10;&#9;&lt;p&gt;&NonBreakingSpace;&lt;/p&gt;
</textarea>
<div contenteditable="true" id="editor2">
<h1>Font contrast</h1>
<p>The following text (white text on a white background) should fail:
<span style="color:#ffffff">
<span style="background-color:#ffffff">foobar</span>
</span>
</p>
<p>The following text should also fail:
<span style="color:#9b59b6">
<span style="background-color:#8e44ad">foobar</span>
</span>
</p>
</div>
<script>
CKEDITOR.replace( 'editor1', {
height: 500,
width: 900
} );

CKEDITOR.inline( 'editor2' );

</script>
16 changes: 16 additions & 0 deletions tests/manual/assessments/colorFontContrast.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@bender-tags: tc, 1.1.1, 237
@bender-include: %TEST_DIR%../../_assets/jquery.min.js
@bender-ui: collapsed
@bender-ckeditor-plugins: a11ychecker,sourcearea,toolbar,undo,wysiwygarea,basicstyles,format,floatingspace,colorbutton,colordialog

# colorFontContrast

1. Focus the first editor.
1. Click on the "Check Accessibility" button.

## Expected

* Accessibility Checker finds an error about font having an insufficient contrast ratio.
* Accessibility Checker reports **2** above errors.

Repeat steps for the second editor.