Skip to content

Commit

Permalink
Add individual WCAG profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Dec 7, 2023
1 parent 30e3071 commit 2a06e8b
Show file tree
Hide file tree
Showing 64 changed files with 2,661 additions and 1,446 deletions.
2,624 changes: 1,312 additions & 1,312 deletions PDF_UA/WCAG-21-Complete.xml

Large diffs are not rendered by default.

77 changes: 14 additions & 63 deletions PDF_UA/WCAG-21.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2020-03-13T10:58:04.098+03:00">
<name>WCAG 2.1 - 1.3 Adaptable - 1.3.1 Info and Relationships - Repeated non space characters</name>
<description>Text should not contain repeated non space characters</description>
</details>
<hash></hash>
<rules>
<rule object="SARepeatedCharacters" tags="cosmetic,machine,text">
<id specification="WCAG_2_1" clause="1.3.1" testNumber="1"/>
<description>Text should not contain repeated non space characters</description>
<test>isNonSpace == false || numberOfRepeatedCharacters &lt; 5</test>
<error>
<message>Text contains %1 repeated non space characters</message>
<arguments>
<argument>numberOfRepeatedCharacters</argument>
</arguments>
</error>
<references/>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2020-03-13T10:58:04.098+03:00">
<name>WCAG 2.1 - 1.3 Adaptable - 1.3.1 Info and Relationships - Repeated space characters</name>
<description>Text should not contain repeated space characters</description>
</details>
<hash></hash>
<rules>
<rule object="SARepeatedCharacters" tags="cosmetic,machine,text">
<id specification="WCAG_2_1" clause="1.3.1" testNumber="2"/>
<description>Text should not contain repeated space characters</description>
<test>isNonSpace == true || numberOfRepeatedCharacters &lt; 3</test>
<error>
<message>Text contains %1 repeated space characters</message>
<arguments>
<argument>numberOfRepeatedCharacters</argument>
</arguments>
</error>
<references/>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2020-03-13T10:58:04.098+03:00">
<name>WCAG 2.1 - 1.3 Adaptable - 1.3.1 Info and Relationships - Underlined text</name>
<description>Underlined text</description>
</details>
<hash></hash>
<rules>
<rule object="SATextChunk" tags="cosmetic,human,text">
<id specification="WCAG_2_1" clause="1.3.1" testNumber="3"/>
<description>Underlined text</description>
<test>isUnderlined == false || parentsStandardTypes.split('&amp;').filter(elem =&gt; (elem == 'Link' || elem == 'Reference')).length &gt; 0</test>
<error>
<message>Underlined text is detected</message>
<arguments/>
</error>
<references/>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2020-03-13T10:58:04.098+03:00">
<name>WCAG 2.1 - 1.3 Adaptable - 1.3.1 Info and Relationships - Different text style</name>
<description>If text has a different style, it shall be tagged as Span, Em, Strong or other appropriate inline element</description>
</details>
<hash></hash>
<rules>
<rule object="SATextChunk" tags="minor,human,text,structure">
<id specification="WCAG_2_1" clause="1.3.1" testNumber="4"/>
<description>If text has a different style, it shall be tagged as Span, Em, Strong or other appropriate inline element</description>
<test>hasSpecialStyle == false || parentsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'Figure').length &gt; 0</test>
<error>
<message>Text has a different style and not tagged as Span, Em, Strong or other appropriate inline element</message>
<arguments/>
</error>
<references/>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="PDFUA_1">
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2020-03-13T10:58:04.098+03:00">
<name>ISO 14289-1:2014 - 1.3 Adaptable - 1.3.4 Orientation - Single display orientation</name>
<name>WCAG 2.1 - 1.3 Adaptable - 1.3.4 Orientation - Single display orientation</name>
<description>Pages shall have the same orientation</description>
</details>
<hash></hash>
<rules>
<rule object="PDPage">
<id specification="WCAG2.1" clause="1.3.4" testNumber="1"/>
<rule object="PDPage" tags="minor,machine,page">
<id specification="WCAG_2_1" clause="1.3.4" testNumber="1"/>
<description>Pages shall have the same orientation</description>
<test>orientation == 'Square' || gMostCommonPageOrientation == orientation</test>
<error>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2021-03-03T10:58:04.098+03:00">
<name>WCAG 2.1 - 1.4 Distinguishable - 1.4.10 Reflow - Bounding box of figure</name>
<description>Bounding box should be present for a figure appearing in its entirety on a single page to indicate the area of the figure on the page</description>
</details>
<hash></hash>
<rules>
<rule object="SAFigure" tags="minor,machine,structure,figure">
<id specification="WCAG_2_1" clause="1.4.10" testNumber="1"/>
<description>Bounding box should be present for a figure appearing in its entirety on a single page to indicate the area of the figure on the page</description>
<test>page != lastPage || hasBBox == true</test>
<error>
<message>"Figure" structure element on a single page with no bounding box</message>
<arguments/>
</error>
<references>
<reference specification="ISO 32000-1:2008" clause="14.8.5.4.3"/>
</references>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="PDFUA_1">
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2021-03-03T10:58:04.098+03:00">
<name>ISO 14289-1:2014 - 1.4 Distinguishable - 1.4.3 Contrast (Minimum)</name>
<name>WCAG 2.1 - 1.4 Distinguishable - 1.4.3 Contrast (Minimum)</name>
<description>The visual presentation of text and images of text has a contrast ratio of at least 4.5:1.
Large-scale text and images of large-scale text have a contrast ratio of at least 3:1</description>
</details>
<hash></hash>
<rules>
<rule object="SATextChunk">
<rule object="SATextChunk" tags="major,machine,contrast">
<id specification="WCAG_2_1" clause="1.4.3" testNumber="1"/>
<description>The visual presentation of text and images of text has a contrast ratio of at least 4.5:1.
Large-scale text and images of large-scale text have a contrast ratio of at least 3:1</description>
<test>textSize &lt; 4.5 || ((textSize &gt;= 18.0 || (textSize &gt;= 14.0 &amp;&amp; textWeight &gt;= 700.0)) ? (contrastRatio &gt;= 3) : (contrastRatio &gt;= 4.5))</test>
<test>textSize &lt; 4.5 || ((textSize &gt;= 18.0 || (textSize &gt;= 14.0 &amp;&amp; textWeight &gt;= 700.0)) ? (contrastRatio &gt;= 3) :
(contrastRatio &gt;= 4.5)) || parentsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'Figure').length &gt; 0</test>
<error>
<message>contrastRatio = %1</message>
<arguments>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2021-03-03T10:58:04.098+03:00">
<name>WCAG 2.1 - 1.4 Distinguishable - 1.4.4 Resize Text - Small text</name>
<description>Font size is too small: text may not be resized without assistive technology
up to 200 percent without loss of content or functionality</description>
</details>
<hash></hash>
<rules>
<rule object="SATextChunk" tags="major,machine,text">
<id specification="WCAG_2_1" clause="1.4.4" testNumber="1"/>
<description>Font size is too small: text may not be resized without assistive technology
up to 200 percent without loss of content or functionality</description>
<test>textSize &gt;= 4.5 || isWhiteSpaceChunk == true || parentsStandardTypes.split('&amp;').filter(elem =&gt; elem == 'Figure').length &gt; 0</test>
<error>
<message>textSize = %1</message>
<arguments>
<argument>textSize</argument>
</arguments>
</error>
<references/>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2021-03-03T10:58:04.098+03:00">
<name>WCAG 2.1 - 1.4 Distinguishable - 1.4.8 Visual Presentation - Illegible font</name>
<description>Document should not contain illegible font</description>
</details>
<hash></hash>
<rules>
<rule object="PDFont" tags="cosmetic,human,text">
<id specification="WCAG_2_1" clause="1.4.8" testNumber="1"/>
<description>Document should not contain illegible font</description>
<test>fontName != null &amp;&amp; fontName.indexOf('AdobeDevanagari') == -1 &amp;&amp; fontName.indexOf('AgencyFB') == -1 &amp;&amp;
fontName.indexOf('BlackadderITC') == -1 &amp;&amp; fontName.indexOf('BodoniMTPosterCompressed') == -1 &amp;&amp;
fontName.indexOf('BradleyHandITC') == -1 &amp;&amp; fontName.indexOf('BrushScriptMT') == -1 &amp;&amp;
fontName.indexOf('Chiller') == -1 &amp;&amp; fontName.indexOf('ColonnaMT') == -1 &amp;&amp;
fontName.indexOf('CurlzMT') == -1 &amp;&amp; fontName.indexOf('EdwardianScriptITC') == -1 &amp;&amp;
fontName.indexOf('ESRIArcGISTDN') == -1 &amp;&amp; fontName.indexOf('FreestyleScript') == -1 &amp;&amp;
fontName.indexOf('FrenchScriptMT') == -1 &amp;&amp; fontName.indexOf('Gabriola') == -1 &amp;&amp;
fontName.indexOf('Gigi') == -1 &amp;&amp; fontName.indexOf('GillSansMT-ExtraCondensedBold') == -1 &amp;&amp;
fontName.indexOf('HarlowSolidItalic') == -1 &amp;&amp; fontName.indexOf('Harrington') == -1 &amp;&amp;
fontName.indexOf('InformalRoman') == -1 &amp;&amp; fontName.indexOf('Jokerman') == -1 &amp;&amp;
fontName.indexOf('FrenchScriptMT') == -1 &amp;&amp; fontName.indexOf('Gabriola') == -1 &amp;&amp;
fontName.indexOf('JuiceITC') == -1 &amp;&amp; fontName.indexOf('KunstlerScript') == -1 &amp;&amp;
fontName.indexOf('Magneto') == -1 &amp;&amp; fontName.indexOf('MaturaMTScriptCapitals') == -1 &amp;&amp;
fontName.indexOf('MicrosoftUighur') == -1 &amp;&amp; fontName.indexOf('Mistral') == -1 &amp;&amp;
fontName.indexOf('OldEnglishTextMT') == -1 &amp;&amp; fontName.indexOf('Onyx') == -1 &amp;&amp;
fontName.indexOf('PalaceScriptMT') == -1 &amp;&amp; fontName.indexOf('Parchment') == -1 &amp;&amp;
fontName.indexOf('Playbill') == -1 &amp;&amp; fontName.indexOf('Pristina') == -1 &amp;&amp;
fontName.indexOf('RageItalic') == -1 &amp;&amp; fontName.indexOf('Ravie') == -1 &amp;&amp;
fontName.indexOf('SegoeScript') == -1 &amp;&amp; fontName.indexOf('ShowcardGothic') == -1 &amp;&amp;
fontName.indexOf('SnapITC') == -1 &amp;&amp; fontName.indexOf('Vivaldi') == -1 &amp;&amp;
fontName.indexOf('VladimirScript') == -1 &amp;&amp;
(fontName.indexOf('HarlowSolid') == -1 || isItalic != true)</test>
<error>
<message>Document contains illegible font</message>
<arguments/>
</error>
<references/>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2021-03-03T10:58:04.098+03:00">
<name>WCAG 2.1 - 2.4 Navigable - 2.4.9 Link Purpose (Link Only) - Alternate description of Link</name>
<description>Links shall contain an alternate description via their Contents or Alt keys or in the text value</description>
</details>
<hash></hash>
<rules>
<rule object="SALinkAnnotation" tags="major,machine,alt-text,structure,annotation">
<id specification="WCAG_2_1" clause="2.4.9" testNumber="1"/>
<description>Links shall contain an alternate description via their Contents or Alt keys or in the text value</description>
<test>(Contents != null &amp;&amp; Contents != '' &amp;&amp; contentsIsLink == false) || isOutsideCropBox == true ||
(F &amp; 2) == 2 || (textValue != null &amp;&amp; textValue != '' &amp;&amp; textValueIsLink == false) ||
(Alt != null &amp;&amp; Alt != '' &amp;&amp; altIsLink == false)</test>
<error>
<message>A link annotation does not include an alternate description in the Contents or Alt Keys or in the text value</message>
<arguments/>
</error>
<references>
<reference specification="ISO 32000-1:2008" clause="14.9.3"/>
</references>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2021-03-03T10:58:04.098+03:00">
<name>WCAG 2.1 - 4.1 Compatible - 4.1.1 Parsing - Merged table cells</name>
<description>Table shouldn't have merged cells</description>
</details>
<hash></hash>
<rules>
<rule object="SETD" tags="cosmetic,machine,structure,table">
<id specification="WCAG_2_1" clause="4.1.1" testNumber="1"/>
<description>Table shouldn't have merged cells</description>
<test>ColSpan == 1 &amp;&amp; RowSpan == 1</test>
<error>
<message>Table has merged cells</message>
<arguments/>
</error>
<references/>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2021-03-03T10:58:04.098+03:00">
<name>WCAG 2.1 - 4.1 Compatible - 4.1.1 Parsing - Merged table cells</name>
<description>Table shouldn't have merged cells</description>
</details>
<hash></hash>
<rules>
<rule object="SETH" tags="cosmetic,machine,structure,table">
<id specification="WCAG_2_1" clause="4.1.1" testNumber="2"/>
<description>Table shouldn't have merged cells</description>
<test>ColSpan == 1 &amp;&amp; RowSpan == 1</test>
<error>
<message>Table has merged cells</message>
<arguments/>
</error>
<references/>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2021-03-03T10:58:04.098+03:00">
<name>WCAG 2.1 - 4.1 Compatible - 4.1.1 Parsing - Merged table cells</name>
<description>Table shouldn't have merged cells</description>
</details>
<hash></hash>
<rules>
<rule object="SATableBorderCell" tags="cosmetic,human,structure,table">
<id specification="WCAG_2_1" clause="4.1.1" testNumber="3"/>
<description>Table shouldn't have merged cells</description>
<test>colSpan == 1 &amp;&amp; rowSpan == 1</test>
<error>
<message>Table has merged cells</message>
<arguments>
<argument></argument>
<argument></argument>
<argument name="structureID">structureID</argument>
</arguments>
</error>
<references/>
</rule>
</rules>
<variables/>
</profile>
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="PDFUA_1">
<profile xmlns="http://www.verapdf.org/ValidationProfile" flavour="WCAG2_1">
<details creator="veraPDF Consortium" created="2021-03-03T10:58:04.098+03:00">
<name>ISO 14289-1:2014 - 4.1 Compatible - 4.1.2 Name, Role, Value - Paragraph</name>
<description>The structure type and attributes of a paragraph shall be semantically appropriate</description>
<name>WCAG 2.1 - 4.1 Compatible - 4.1.2 Name, Role, Value - Paragraph</name>
<description>Incorrect use of a paragraph</description>
</details>
<hash></hash>
<rules>
<rule object="SAP">
<rule object="SAP" tags="minor,human,structure,paragraph">
<id specification="WCAG_2_1" clause="4.1.2" testNumber="1"/>
<description>The structure type and attributes of a paragraph shall be semantically appropriate</description>
<test>correctType == 'P' &amp;&amp; correctSemanticScore &gt;= 0.75</test>
<description>Incorrect use of a paragraph</description>
<test>correctSemanticScore &gt;= 0.75 || correctType == null || correctType == 'H'</test>
<error>
<message>score = %1, correct type = %2</message>
<arguments>
Expand Down
Loading

0 comments on commit 2a06e8b

Please sign in to comment.