diff --git a/accessibility-checker-engine/src/v4/rules/text_contrast_sufficient.ts b/accessibility-checker-engine/src/v4/rules/text_contrast_sufficient.ts index 1f31bbade..a107dfe85 100644 --- a/accessibility-checker-engine/src/v4/rules/text_contrast_sufficient.ts +++ b/accessibility-checker-engine/src/v4/rules/text_contrast_sufficient.ts @@ -17,40 +17,41 @@ import { ColorUtil } from "../../v2/dom/ColorUtil"; import { Rule, RuleResult, RuleFail, RuleContext, RulePotential, RulePass, RuleContextHierarchy } from "../api/IRule"; import { eRulePolicy, eToolkitLevel } from "../api/IRule"; //import { setCache } from "../util/CacheUtil"; -import { getWeightNumber, getFontInPixels } from "../util/CSSUtil"; +import { getWeightNumber, getFontInPixels} from "../util/CSSUtil"; +import { containsCKJ } from "../util/CommonUtil"; export let text_contrast_sufficient: Rule = { id: "text_contrast_sufficient", context: "dom:*", refactor: { "IBMA_Color_Contrast_WCAG2AA": { - "Pass_0": "Pass_0", - "Fail_1": "Fail_1", - "Potential_1": "Potential_same_color" + "Pass_0": "pass", + "Fail_1": "fail_contrast", + "Potential_1": "potential_same_color" }, "IBMA_Color_Contrast_WCAG2AA_PV": { - "Pass_0": "Pass_0", - "Potential_1": "Potential_graphic_background" + "pass_0": "pass", + "potential_1": "potential_graphic_background" } }, help: { "en-US": { "group": `text_contrast_sufficient.html`, - "Pass_0": `text_contrast_sufficient.html`, - "Fail_1": `text_contrast_sufficient.html`, - "Potential_same_color": `text_contrast_sufficient.html`, - "Potential_graphic_background": `text_contrast_sufficient.html`, - "Potential_text_shadow": `text_contrast_sufficient.html` + "pass": `text_contrast_sufficient.html`, + "fail_contrast": `text_contrast_sufficient.html`, + "potential_same_color": `text_contrast_sufficient.html`, + "potential_graphic_background": `text_contrast_sufficient.html`, + "potential_text_shadow": `text_contrast_sufficient.html` } }, messages: { "en-US": { "group": "The contrast ratio of text with its background must meet WCAG AA requirements", - "Pass_0": "Rule Passed", - "Fail_1": "Text contrast of {0} with its background is less than the WCAG AA minimum requirements for text of size {1}px and weight of {2}", - "Potential_same_color": "The foreground text and its background color are both detected as {3}. Verify the text meets the WCAG AA requirements for minimum contrast", - "Potential_graphic_background": "Verify the contrast ratio of the text against the lightest and the darkest colors of the background meets the WCAG AA minimum requirements for text of size {1}px and weight of {2}", - "Potential_text_shadow": "Verify the contrast ratio of the text with shadow meets the WCAG AA minimum requirements for text of size {1}px and weight of {2}" + "pass": "The contrast ratio of text with its background meets WCAG AA requirements", + "fail_contrast": "Text contrast of {0} with its background is less than the WCAG AA minimum requirements for text of size {1}px and weight of {2}", + "potential_same_color": "The foreground text and its background color are both detected as {3}. Verify the text meets the WCAG AA requirements for minimum contrast", + "potential_graphic_background": "Verify the contrast ratio of the text against the lightest and the darkest colors of the background meets the WCAG AA minimum requirements for text of size {1}px and weight of {2}", + "potential_text_shadow": "Verify the contrast ratio of the text with shadow meets the WCAG AA minimum requirements for text of size {1}px and weight of {2}" } }, rulesets: [{ @@ -104,9 +105,10 @@ export let text_contrast_sufficient: Rule = { * see https://stackoverflow.com/questions/3770117/what-is-the-range-of-unicode-printable-characters * (3) for now not consider unicode special characters that are different in different languages */ - let regex = /[^(a-zA-Z\d\s)\u0000-\u0008\u000B-\u001F\u007F-\u009F\u2000-\u200F\u2028-\u202F\u205F-\u206F\u3000\uFEFF]+/g; - const removed = childStr.trim().replace(regex, ''); - if (removed.trim().length === 0) + //let regex = /[^(a-zA-Z\d\s)\u0000-\u0008\u000B-\u001F\u007F-\u009F\u2000-\u200F\u2028-\u202F\u205F-\u206F\u3000\uFEFF]+/g; + let regex = /[^(a-zA-Z\d\s)\^(\u4e00-\u9fff\u3400-\u4dbf)\u0000-\u0008\u000B-\u001F\u007F-\u009F\u2000-\u200F\u2028-\u202F\u205F-\u206F\u3000\uFEFF]+/g; + childStr = childStr.trim().replace(regex, ''); + if (childStr.trim().length === 0) return null; } @@ -252,6 +254,12 @@ export let text_contrast_sufficient: Rule = { let weight = getWeightNumber(style.fontWeight); let size = getFontInPixels(style.fontSize, elem); let isLargeScale = size >= 24 || size >= 18.6 && weight >= 700; + + if (containsCKJ(childStr)) { + // https://github.com/act-rules/act-rules.github.io/pull/2121/files + // for CJK, 22 pt or 18 pt with font-weight >= 700, 1pt = 1.333 px + isLargeScale = size >= 29.3 || size >= 24 && weight >= 700; + } let passed = ratio >= 4.5 || (ratio >= 3 && isLargeScale); let hasBackground = colorCombo.hasBGImage || colorCombo.hasGradient; let textShadow = colorCombo.textShadow; @@ -287,19 +295,19 @@ export let text_contrast_sufficient: Rule = { if (!passed) { if (hasBackground) { // fire potential since a text on an image or gradient may be still viewable, depending on the text location on the gradient or image - return RulePotential("Potential_graphic_background", [ratio.toFixed(2), size, weight]);; + return RulePotential("potential_graphic_background", [ratio.toFixed(2), size, weight]);; } else if (textShadow) { // fire potential since a text with shadow may be still viewable, depending on the shadow efffects - return RulePotential("Potential_text_shadow", [ratio.toFixed(2), size, weight]);; + return RulePotential("potential_text_shadow", [ratio.toFixed(2), size, weight]);; } else { if (fg.toHex() === bg.toHex()) { - return RulePotential("Potential_same_color", [ratio.toFixed(2), size, weight, fg.toHex(), bg.toHex(), colorCombo.hasBGImage, colorCombo.hasGradient]); + return RulePotential("potential_same_color", [ratio.toFixed(2), size, weight, fg.toHex(), bg.toHex(), colorCombo.hasBGImage, colorCombo.hasGradient]); } else { - return RuleFail("Fail_1", [ratio.toFixed(2), size, weight, fg.toHex(), bg.toHex(), colorCombo.hasBGImage, colorCombo.hasGradient]); + return RuleFail("fail_contrast", [ratio.toFixed(2), size, weight, fg.toHex(), bg.toHex(), colorCombo.hasBGImage, colorCombo.hasGradient]); } } } else { - return RulePass("Pass_0", [ratio.toFixed(2), size, weight, fg.toHex(), bg.toHex(), colorCombo.hasBGImage, colorCombo.hasGradient]); + return RulePass("pass", [ratio.toFixed(2), size, weight, fg.toHex(), bg.toHex(), colorCombo.hasBGImage, colorCombo.hasGradient]); } } } diff --git a/accessibility-checker-engine/src/v4/util/CommonUtil.ts b/accessibility-checker-engine/src/v4/util/CommonUtil.ts index d2d773cfd..b5495f2a2 100644 --- a/accessibility-checker-engine/src/v4/util/CommonUtil.ts +++ b/accessibility-checker-engine/src/v4/util/CommonUtil.ts @@ -219,3 +219,20 @@ export function getDeprecatedAriaAttributes(element: Element) { } return ret; } + +/* + * string contains CJK (chinese, japaneses, or korea) + * return: boolean +*/ +export function containsCKJ(text: string) { + if (!text) return false; + + // https://en.wikipedia.org/wiki/CJK_Unified_Ideographs https://ayaka.shn.hk/hanregex/ + let regex =/(?:[\u4e00-\u9fff\u3400-\u4dbf])+/g; + + const replaced = text.trim().replace(regex, ''); + if (replaced.length === text.trim().length) + return false; + + return true; +} \ No newline at end of file diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-hidden.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-hidden.html index df432035c..cd02e46ee 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-hidden.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-hidden.html @@ -106,8 +106,8 @@

Test page

"dom": "/html[1]/body[1]/main[1]/h1[1]", "aria": "/document[1]/main[1]/heading[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 32, @@ -130,7 +130,7 @@

Test page

"dom": "/html[1]/body[1]/main[1]/div[1]/div[1]", "aria": "/document[1]/main[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 2.85 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.85", @@ -154,7 +154,7 @@

Test page

"dom": "/html[1]/body[1]/main[1]/div[1]/div[3]", "aria": "/document[1]/main[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 2.85 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.85", @@ -178,7 +178,7 @@

Test page

"dom": "/html[1]/body[1]/main[1]/div[1]/div[6]", "aria": "/document[1]/main[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 2.85 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.85", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-usingColorVariable.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-usingColorVariable.html index 69364f102..ade816087 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-usingColorVariable.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-usingColorVariable.html @@ -6775,8 +6775,8 @@ "dom": "/html[1]/body[1]/div[1]/div[1]/div[1]/section[1]/div[1]/div[1]/article[1]/div[1]/div[1]/div[1]", "aria": "/document[1]/article[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "5.33", 12, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-with-alpha2.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-with-alpha2.html index 143b3a091..e4f247b2f 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-with-alpha2.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Color-with-alpha2.html @@ -89,8 +89,8 @@

Color using Class Tests

"dom": "/html[1]/body[1]/h3[1]", "aria": "/document[1]/heading[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 18.72, @@ -113,8 +113,8 @@

Color using Class Tests

"dom": "/html[1]/body[1]/div[1]/div[1]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "8.59", 16, @@ -137,7 +137,7 @@

Color using Class Tests

"dom": "/html[1]/body[1]/div[2]/div[1]", "aria": "/document[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 1.13 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.13", @@ -161,7 +161,7 @@

Color using Class Tests

"dom": "/html[1]/body[1]/div[3]/div[1]", "aria": "/document[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 2.49 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.49", @@ -185,7 +185,7 @@

Color using Class Tests

"dom": "/html[1]/body[1]/div[4]/div[1]/div[1]", "aria": "/document[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 1.13 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.13", @@ -209,7 +209,7 @@

Color using Class Tests

"dom": "/html[1]/body[1]/div[5]/div[1]", "aria": "/document[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 2.49 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.49", @@ -233,8 +233,8 @@

Color using Class Tests

"dom": "/html[1]/body[1]/div[6]/div[1]/div[1]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "5.25", 16, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Shadow.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Shadow.html index 4804a1b1a..f62a27440 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Shadow.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/Shadow.html @@ -36,8 +36,8 @@ "dom": "/html[1]/body[1]/main[1]", "aria": "/document[1]/main[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 16, @@ -60,8 +60,8 @@ "dom": "/html[1]/body[1]/main[1]/div[1]/div[1]/#document-fragment[1]/div[1]", "aria": "/document[1]/main[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "15.61", 16, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_1.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_1.html index 8ade75e53..e37957a5d 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_1.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_1.html @@ -25,7 +25,7 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 2.32 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.32", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_10.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_10.html index 40a8552fc..185b42bba 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_10.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_10.html @@ -23,7 +23,7 @@ "dom": "/html[1]/body[1]/div[1]", "aria": "/document[1]/button[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 3.86 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "3.86", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_2.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_2.html index e4cc18cf9..20339b782 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_2.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_2.html @@ -25,7 +25,7 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Potential_graphic_background", + "reasonId": "potential_graphic_background", "message": "Verify the contrast ratio of the text against the lightest and the darkest colors of the background meets the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.00", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_3.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_3.html index d956be235..8c3e94a17 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_3.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_3.html @@ -27,7 +27,7 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Potential_graphic_background", + "reasonId": "potential_graphic_background", "message": "Verify the contrast ratio of the text against the lightest and the darkest colors of the background meets the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.82", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_4.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_4.html index 288341ff6..443681ced 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_4.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_4.html @@ -25,7 +25,7 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 2.11 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.11", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_5.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_5.html index 7b77c4532..e26dc0413 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_5.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_5.html @@ -27,7 +27,7 @@ "dom": "/html[1]/body[1]/div[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 2.11 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.11", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_6.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_6.html index c6aee973d..76879d256 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_6.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_6.html @@ -27,7 +27,7 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 2.32 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.32", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_7.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_7.html index 1a9effae9..4928aaaa9 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_7.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_7.html @@ -33,7 +33,7 @@ "dom": "/html[1]/body[1]/span[1]", "aria": "/document[1]" }, - "reasonId": "Potential_graphic_background", + "reasonId": "potential_graphic_background", "message": "Verify the contrast ratio of the text against the lightest and the darkest colors of the background meets the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.00", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_8.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_8.html index a23ca6df5..c5484eb03 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_8.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_8.html @@ -28,8 +28,8 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "12.63", 16, @@ -52,7 +52,7 @@ "dom": "/html[1]/body[1]/p[2]", "aria": "/document[1]/paragraph[2]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 3.86 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "3.86", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_9.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_9.html index aab8fc79b..62d541a86 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_9.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_fail_9.html @@ -23,7 +23,7 @@ "dom": "/html[1]/body[1]/button[1]", "aria": "/document[1]/button[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 3.86 with its background is less than the WCAG AA minimum requirements for text of size 13.3333px and weight of 400", "messageArgs": [ "3.86", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_3.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_3.html index 0456d970f..2252c46da 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_3.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_3.html @@ -23,7 +23,7 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Potential_same_color", + "reasonId": "potential_same_color", "message": "The foreground text and its background color are both detected as #ffffff. Verify the text meets the WCAG AA requirements for minimum contrast", "messageArgs": [ "1.00", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_6.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_6.html index 47c026ec7..19a555fdf 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_6.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_6.html @@ -26,8 +26,8 @@ "dom": "/html[1]/body[1]/label[1]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "3.54", 16, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_7.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_7.html index 2da9c9a4d..2e62d9c54 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_7.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_inapplicable_7.html @@ -33,8 +33,8 @@ "dom": "/html[1]/body[1]/label[1]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "3.54", 16, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_1.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_1.html index 95ebd4105..623fd7549 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_1.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_1.html @@ -25,8 +25,8 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "12.63", 16, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_10.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_10.html index 166b2fe2f..bf91bb311 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_10.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_10.html @@ -23,8 +23,8 @@ "dom": "/html[1]/body[1]/button[1]", "aria": "/document[1]/button[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "18.26", 13.3333, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_11.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_11.html index 65798e842..0106e7c75 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_11.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_11.html @@ -23,8 +23,8 @@ "dom": "/html[1]/body[1]/div[1]", "aria": "/document[1]/button[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 16, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_2.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_2.html index 9219f03a0..d0b57144a 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_2.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_2.html @@ -25,7 +25,7 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Potential_graphic_background", + "reasonId": "potential_graphic_background", "message": "Verify the contrast ratio of the text against the lightest and the darkest colors of the background meets the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.47", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_3.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_3.html index 74ca73d86..f383b0177 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_3.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_3.html @@ -32,8 +32,8 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "13.08", 16, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_4.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_4.html index 28e6dad5f..9abd5ba8e 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_4.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_4.html @@ -25,7 +25,7 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Potential_text_shadow", + "reasonId": "potential_text_shadow", "message": "Verify the contrast ratio of the text with shadow meets the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "4.43", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_5.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_5.html index 82c76520e..8f06c281c 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_5.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_5.html @@ -25,8 +25,8 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "3.66", 24, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_6.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_6.html index 22a9bb076..a02ad28df 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_6.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_6.html @@ -25,8 +25,8 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "3.66", 18.6667, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_8.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_8.html index f9b00d9b2..53528656f 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_8.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/act_pass_8.html @@ -23,8 +23,8 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 16, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-fail.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-fail.html index d79e08184..55b491cad 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-fail.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-fail.html @@ -62,8 +62,8 @@

Test page

"dom": "/html[1]/body[1]/a[1]", "aria": "/document[1]/link[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "9.40", 16, @@ -86,8 +86,8 @@

Test page

"dom": "/html[1]/body[1]/h2[1]", "aria": "/document[1]/heading[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 24, @@ -110,8 +110,8 @@

Test page

"dom": "/html[1]/body[1]/h1[1]", "aria": "/document[1]/heading[2]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 32, @@ -134,8 +134,8 @@

Test page

"dom": "/html[1]/body[1]/div[1]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 16, @@ -158,7 +158,7 @@

Test page

"dom": "/html[1]/body[1]/label[1]", "aria": "/document[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 1.71 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.71", @@ -182,7 +182,7 @@

Test page

"dom": "/html[1]/body[1]/div[2]", "aria": "/document[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 1.71 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.71", @@ -206,8 +206,8 @@

Test page

"dom": "/html[1]/body[1]/div[3]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 16, @@ -230,7 +230,7 @@

Test page

"dom": "/html[1]/body[1]/label[2]", "aria": "/document[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 1.71 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.71", @@ -254,7 +254,7 @@

Test page

"dom": "/html[1]/body[1]/div[4]", "aria": "/document[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 1.71 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.71", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-pass.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-pass.html index 28a96b5a2..cbab3dda6 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-pass.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-pass.html @@ -62,8 +62,8 @@

Test page

"dom": "/html[1]/body[1]/a[1]", "aria": "/document[1]/link[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "9.40", 16, @@ -86,8 +86,8 @@

Test page

"dom": "/html[1]/body[1]/h2[1]", "aria": "/document[1]/heading[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 24, @@ -110,8 +110,8 @@

Test page

"dom": "/html[1]/body[1]/h1[1]", "aria": "/document[1]/heading[2]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 32, @@ -134,8 +134,8 @@

Test page

"dom": "/html[1]/body[1]/div[1]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 16, @@ -158,8 +158,8 @@

Test page

"dom": "/html[1]/body[1]/label[1]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "1.71", 16, @@ -182,8 +182,8 @@

Test page

"dom": "/html[1]/body[1]/div[2]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "1.71", 16, @@ -206,8 +206,8 @@

Test page

"dom": "/html[1]/body[1]/div[3]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 16, @@ -230,8 +230,8 @@

Test page

"dom": "/html[1]/body[1]/label[2]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "1.71", 16, @@ -254,8 +254,8 @@

Test page

"dom": "/html[1]/body[1]/div[4]", "aria": "/document[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "1.71", 16, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-pass2.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-pass2.html index 221d52fde..af43f2b20 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-pass2.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/carbon-240-pass2.html @@ -52,8 +52,8 @@

Test page

"dom": "/html[1]/body[1]/main[1]/h1[1]", "aria": "/document[1]/main[1]/heading[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "18.10", 42, @@ -76,8 +76,8 @@

Test page

"dom": "/html[1]/body[1]/main[1]/div[1]/label[1]", "aria": "/document[1]/main[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "1.71", 12, @@ -100,8 +100,8 @@

Test page

"dom": "/html[1]/body[1]/main[1]/div[1]/div[1]/div[2]", "aria": "/document[1]/main[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "1.71", 12, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/cjk_fail.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/cjk_fail.html new file mode 100644 index 000000000..e5d201422 --- /dev/null +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/cjk_fail.html @@ -0,0 +1,427 @@ + + + + + Test Suite + + + + +

+ Test color contrast in CJK characters +

+ +

English default, font size: 16px

+

English text font size 19px bold

+

text font size: 24px

+ +

Chinese text font size: 14px

+ +
提交
+ +

Chinese text font size: 16px

+ +
提交
+ +

Chinese text font size: 24px bold

+ +
提交
+ +

Chinese text font size: 30px

+ +
提交
+ + + + \ No newline at end of file diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/cjk_pass.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/cjk_pass.html new file mode 100644 index 000000000..c3470d5c5 --- /dev/null +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/cjk_pass.html @@ -0,0 +1,131 @@ + + + + + Test Suite + + + + +

+ Test color contrast in CJK characters +

+ +

+ 早上好 with color contrast 21.1:1 +

+ +

+ 早上好 with color contrast 3.6:1 font-size 30px; +

+ +

+ 早上好 with color contrast 3.6:1 font-size 24px bold; +

+ + + + \ No newline at end of file diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent.html index 43fd2d937..c374d3bba 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent.html @@ -33,7 +33,7 @@ "dom": "/html[1]/body[1]/span[1]", "aria": "/document[1]" }, - "reasonId": "Potential_graphic_background", + "reasonId": "potential_graphic_background", "message": "Verify the contrast ratio of the text against the lightest and the darkest colors of the background meets the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.07", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent2.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent2.html index f229ee952..835278a08 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent2.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent2.html @@ -33,7 +33,7 @@ "dom": "/html[1]/body[1]/div[1]/span[1]", "aria": "/document[1]" }, - "reasonId": "Potential_graphic_background", + "reasonId": "potential_graphic_background", "message": "Verify the contrast ratio of the text against the lightest and the darkest colors of the background meets the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "2.33", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent3.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent3.html index 59f2a5f54..3d017a526 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent3.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_gradient_transparent3.html @@ -45,7 +45,7 @@ "dom": "/html[1]/body[1]/div[1]/span[1]", "aria": "/document[1]" }, - "reasonId": "Potential_graphic_background", + "reasonId": "potential_graphic_background", "message": "Verify the contrast ratio of the text against the lightest and the darkest colors of the background meets the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.07", @@ -65,7 +65,7 @@ "dom": "/html[1]/body[1]/div[2]/span[1]", "aria": "/document[1]" }, - "reasonId": "Potential_graphic_background", + "reasonId": "potential_graphic_background", "message": "Verify the contrast ratio of the text against the lightest and the darkest colors of the background meets the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "1.00", diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_with_transparency.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_with_transparency.html index a332bb68c..ee09a395b 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_with_transparency.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/color_with_transparency.html @@ -35,8 +35,8 @@

Test page

"dom": "/html[1]/body[1]/main[1]/h1[1]", "aria": "/document[1]/main[1]/heading[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 32, @@ -59,8 +59,8 @@

Test page

"dom": "/html[1]/body[1]/main[1]/div[1]/div[1]", "aria": "/document[1]/main[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "8.45", 16, @@ -83,8 +83,8 @@

Test page

"dom": "/html[1]/body[1]/main[1]/div[2]/div[1]/div[1]", "aria": "/document[1]/main[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "8.40", 16, diff --git a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/special-chars-1.html b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/special-chars-1.html index a7971ca95..88744e413 100644 --- a/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/special-chars-1.html +++ b/accessibility-checker-engine/test/v2/checker/accessibility/rules/text_contrast_sufficient_ruleunit/special-chars-1.html @@ -28,7 +28,7 @@ "dom": "/html[1]/body[1]/p[1]", "aria": "/document[1]/paragraph[1]" }, - "reasonId": "Fail_1", + "reasonId": "fail_contrast", "message": "Text contrast of 3.66 with its background is less than the WCAG AA minimum requirements for text of size 16px and weight of 400", "messageArgs": [ "3.66", diff --git a/accessibility-checker/test/baselines/JSONObjectStructureVerification.html.json b/accessibility-checker/test/baselines/JSONObjectStructureVerification.html.json index 54bd7960a..7bb063c6c 100644 --- a/accessibility-checker/test/baselines/JSONObjectStructureVerification.html.json +++ b/accessibility-checker/test/baselines/JSONObjectStructureVerification.html.json @@ -298,8 +298,8 @@ "dom": "/html[1]/body[1]/div[2]/h1[1]", "aria": "/document[1]/main[1]/heading[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 32, @@ -320,7 +320,7 @@ "category": "Accessibility", "ignored": false, "level": "pass", - "help": "https://able.ibm.com/rules/archives/preview/doc/en-US/text_contrast_sufficient.html#%7B%22message%22%3A%22Rule%20Passed%22%2C%22snippet%22%3A%22%3Ch1%3E%22%2C%22value%22%3A%5B%22VIOLATION%22%2C%22PASS%22%5D%2C%22reasonId%22%3A%22Pass_0%22%2C%22ruleId%22%3A%22text_contrast_sufficient%22%2C%22msgArgs%22%3A%5B%2221.00%22%2C32%2C700%2C%22%23000000%22%2C%22%23ffffff%22%2Cfalse%2Cfalse%5D%7D" + "help": "https://able.ibm.com/rules/archives/preview/doc/en-US/text_contrast_sufficient.html#%7B%22message%22%3A%22The%20contrast%20ratio%20of%20text%20with%20its%20background%20meets%20WCAG%20AA%20requirements%22%2C%22snippet%22%3A%22%3Ch1%3E%22%2C%22value%22%3A%5B%22VIOLATION%22%2C%22PASS%22%5D%2C%22reasonId%22%3A%22pass%22%2C%22ruleId%22%3A%22text_contrast_sufficient%22%2C%22msgArgs%22%3A%5B%2221.00%22%2C32%2C700%2C%22%23000000%22%2C%22%23ffffff%22%2Cfalse%2Cfalse%5D%7D" }, { "ruleId": "img_alt_background", @@ -468,7 +468,7 @@ "apiArgs": [], "bounds": { "left": 8, - "top": 144, + "top": 143, "height": 0, "width": 784 }, @@ -494,7 +494,7 @@ "apiArgs": [], "bounds": { "left": 8, - "top": 144, + "top": 143, "height": 0, "width": 784 }, @@ -520,7 +520,7 @@ "apiArgs": [], "bounds": { "left": 8, - "top": 144, + "top": 143, "height": 0, "width": 784 }, @@ -549,7 +549,7 @@ "apiArgs": [], "bounds": { "left": 8, - "top": 144, + "top": 143, "height": 0, "width": 784 }, @@ -575,7 +575,7 @@ "apiArgs": [], "bounds": { "left": 8, - "top": 144, + "top": 143, "height": 0, "width": 784 }, @@ -601,7 +601,7 @@ "apiArgs": [], "bounds": { "left": 8, - "top": 144, + "top": 143, "height": 0, "width": 784 }, @@ -627,7 +627,7 @@ "apiArgs": [], "bounds": { "left": 8, - "top": 144, + "top": 143, "height": 0, "width": 784 }, @@ -653,7 +653,7 @@ "apiArgs": [], "bounds": { "left": 8, - "top": 144, + "top": 143, "height": 0, "width": 784 }, @@ -679,7 +679,7 @@ "apiArgs": [], "bounds": { "left": 8, - "top": 144, + "top": 143, "height": 0, "width": 784 }, @@ -705,7 +705,7 @@ "apiArgs": [], "bounds": { "left": 8, - "top": 144, + "top": 143, "height": 0, "width": 784 }, @@ -1021,7 +1021,7 @@ "bounds": { "left": 8, "top": 8, - "height": 18, + "height": 17, "width": 56 }, "snippet": "", @@ -1047,7 +1047,7 @@ "bounds": { "left": 8, "top": 8, - "height": 18, + "height": 17, "width": 56 }, "snippet": "", @@ -1073,7 +1073,7 @@ "bounds": { "left": 8, "top": 8, - "height": 18, + "height": 17, "width": 56 }, "snippet": "", @@ -1099,7 +1099,7 @@ "bounds": { "left": 8, "top": 8, - "height": 18, + "height": 17, "width": 56 }, "snippet": "", @@ -1118,8 +1118,8 @@ "dom": "/html[1]/body[1]/div[1]/a[1]", "aria": "/document[1]/navigation[1]/link[1]" }, - "reasonId": "Pass_0", - "message": "Rule Passed", + "reasonId": "pass", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "9.40", 16, @@ -1133,14 +1133,14 @@ "bounds": { "left": 8, "top": 8, - "height": 18, + "height": 17, "width": 56 }, "snippet": "", "category": "Accessibility", "ignored": false, "level": "pass", - "help": "https://able.ibm.com/rules/archives/preview/doc/en-US/text_contrast_sufficient.html#%7B%22message%22%3A%22Rule%20Passed%22%2C%22snippet%22%3A%22%3Ca%20alt%3D%5C%22skip%20to%20main%20content%5C%22%20href%3D%5C%22%23navskip%5C%22%3E%22%2C%22value%22%3A%5B%22VIOLATION%22%2C%22PASS%22%5D%2C%22reasonId%22%3A%22Pass_0%22%2C%22ruleId%22%3A%22text_contrast_sufficient%22%2C%22msgArgs%22%3A%5B%229.40%22%2C16%2C400%2C%22%230000ee%22%2C%22%23ffffff%22%2Cfalse%2Cfalse%5D%7D" + "help": "https://able.ibm.com/rules/archives/preview/doc/en-US/text_contrast_sufficient.html#%7B%22message%22%3A%22The%20contrast%20ratio%20of%20text%20with%20its%20background%20meets%20WCAG%20AA%20requirements%22%2C%22snippet%22%3A%22%3Ca%20alt%3D%5C%22skip%20to%20main%20content%5C%22%20href%3D%5C%22%23navskip%5C%22%3E%22%2C%22value%22%3A%5B%22VIOLATION%22%2C%22PASS%22%5D%2C%22reasonId%22%3A%22pass%22%2C%22ruleId%22%3A%22text_contrast_sufficient%22%2C%22msgArgs%22%3A%5B%229.40%22%2C16%2C400%2C%22%230000ee%22%2C%22%23ffffff%22%2Cfalse%2Cfalse%5D%7D" }, { "ruleId": "style_focus_visible", @@ -1159,7 +1159,7 @@ "bounds": { "left": 8, "top": 8, - "height": 18, + "height": 17, "width": 56 }, "snippet": "", @@ -1185,7 +1185,7 @@ "bounds": { "left": 8, "top": 8, - "height": 18, + "height": 17, "width": 56 }, "snippet": "", @@ -1211,7 +1211,7 @@ "bounds": { "left": 8, "top": 8, - "height": 18, + "height": 17, "width": 56 }, "snippet": "", @@ -1237,7 +1237,7 @@ "bounds": { "left": 8, "top": 8, - "height": 18, + "height": 17, "width": 56 }, "snippet": "", @@ -1263,7 +1263,7 @@ "bounds": { "left": 8, "top": 8, - "height": 18, + "height": 17, "width": 56 }, "snippet": "", @@ -1289,7 +1289,7 @@ "bounds": { "left": 8, "top": 8, - "height": 19, + "height": 18, "width": 784 }, "snippet": "
", @@ -1315,7 +1315,7 @@ "bounds": { "left": 8, "top": 8, - "height": 19, + "height": 18, "width": 784 }, "snippet": "
", @@ -1341,7 +1341,7 @@ "bounds": { "left": 8, "top": 8, - "height": 19, + "height": 18, "width": 784 }, "snippet": "
", @@ -1370,7 +1370,7 @@ "bounds": { "left": 8, "top": 8, - "height": 19, + "height": 18, "width": 784 }, "snippet": "
", @@ -1396,7 +1396,7 @@ "bounds": { "left": 8, "top": 8, - "height": 19, + "height": 18, "width": 784 }, "snippet": "
", @@ -1422,7 +1422,7 @@ "bounds": { "left": 8, "top": 8, - "height": 19, + "height": 18, "width": 784 }, "snippet": "
", @@ -1448,7 +1448,7 @@ "bounds": { "left": 8, "top": 8, - "height": 19, + "height": 18, "width": 784 }, "snippet": "
", @@ -1604,7 +1604,7 @@ "bounds": { "left": 0, "top": 0, - "height": 144, + "height": 143, "width": 800 }, "snippet": "", @@ -1630,7 +1630,7 @@ "bounds": { "left": 0, "top": 0, - "height": 144, + "height": 143, "width": 800 }, "snippet": "", @@ -1656,7 +1656,7 @@ "bounds": { "left": 0, "top": 0, - "height": 144, + "height": 143, "width": 800 }, "snippet": "", @@ -1682,7 +1682,7 @@ "bounds": { "left": 0, "top": 0, - "height": 144, + "height": 143, "width": 800 }, "snippet": "", @@ -1710,7 +1710,7 @@ "bounds": { "left": 0, "top": 0, - "height": 144, + "height": 143, "width": 800 }, "snippet": "", @@ -1793,7 +1793,7 @@ }, "text_contrast_sufficient": { "0": "The contrast ratio of text with its background must meet WCAG AA requirements", - "Pass_0": "Rule Passed" + "pass": "The contrast ratio of text with its background meets WCAG AA requirements" }, "a_text_purpose": { "0": "Hyperlinks must have an accessible name for their purpose", diff --git a/accessibility-checker/test/baselines/JSONObjectStructureVerificationSelenium.html.json b/accessibility-checker/test/baselines/JSONObjectStructureVerificationSelenium.html.json index 2097236ff..8c90727d2 100644 --- a/accessibility-checker/test/baselines/JSONObjectStructureVerificationSelenium.html.json +++ b/accessibility-checker/test/baselines/JSONObjectStructureVerificationSelenium.html.json @@ -83,7 +83,7 @@ }, "text_contrast_sufficient": { "0": "The contrast ratio of text with its background must meet WCAG AA requirements", - "Pass_0": "Rule Passed" + "pass": "The contrast ratio of text with its background meets WCAG AA requirements" }, "text_quoted_correctly": { "0": "Quotations should be marked with or
elements", @@ -401,7 +401,7 @@ "width": 999 }, "category": "Accessibility", - "message": "Rule Passed", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "21.00", 32, @@ -415,7 +415,7 @@ "aria": "/document[1]/main[1]/heading[1]", "dom": "/html[1]/body[1]/div[2]/h1[1]" }, - "reasonId": "Pass_0", + "reasonId": "pass", "ruleId": "text_contrast_sufficient", "snippet": "

", "value": [ @@ -424,7 +424,7 @@ ], "ignored": false, "level": "pass", - "help": "https://able.ibm.com/rules/archives/preview/doc/en-US/text_contrast_sufficient.html#%7B%22message%22%3A%22Rule%20Passed%22%2C%22snippet%22%3A%22%3Ch1%3E%22%2C%22value%22%3A%5B%22VIOLATION%22%2C%22PASS%22%5D%2C%22reasonId%22%3A%22Pass_0%22%2C%22ruleId%22%3A%22text_contrast_sufficient%22%2C%22msgArgs%22%3A%5B%2221.00%22%2C32%2C700%2C%22%23000000%22%2C%22%23ffffff%22%2Cfalse%2Cfalse%5D%7D" + "help": "https://able.ibm.com/rules/archives/preview/doc/en-US/text_contrast_sufficient.html#%7B%22message%22%3A%22The%20contrast%20ratio%20of%20text%20with%20its%20background%20meets%20WCAG%20AA%20requirements%22%2C%22snippet%22%3A%22%3Ch1%3E%22%2C%22value%22%3A%5B%22VIOLATION%22%2C%22PASS%22%5D%2C%22reasonId%22%3A%22pass%22%2C%22ruleId%22%3A%22text_contrast_sufficient%22%2C%22msgArgs%22%3A%5B%2221.00%22%2C32%2C700%2C%22%23000000%22%2C%22%23ffffff%22%2Cfalse%2Cfalse%5D%7D" }, { "apiArgs": [], @@ -1221,7 +1221,7 @@ "width": 999 }, "category": "Accessibility", - "message": "Rule Passed", + "message": "The contrast ratio of text with its background meets WCAG AA requirements", "messageArgs": [ "9.40", 16, @@ -1235,7 +1235,7 @@ "aria": "/document[1]/navigation[1]/link[1]", "dom": "/html[1]/body[1]/div[1]/a[1]" }, - "reasonId": "Pass_0", + "reasonId": "pass", "ruleId": "text_contrast_sufficient", "snippet": "", "value": [ @@ -1244,7 +1244,7 @@ ], "ignored": false, "level": "pass", - "help": "https://able.ibm.com/rules/archives/preview/doc/en-US/text_contrast_sufficient.html#%7B%22message%22%3A%22Rule%20Passed%22%2C%22snippet%22%3A%22%3Ca%20alt%3D%5C%22skip%20to%20main%20content%5C%22%20href%3D%5C%22%23navskip%5C%22%3E%22%2C%22value%22%3A%5B%22VIOLATION%22%2C%22PASS%22%5D%2C%22reasonId%22%3A%22Pass_0%22%2C%22ruleId%22%3A%22text_contrast_sufficient%22%2C%22msgArgs%22%3A%5B%229.40%22%2C16%2C400%2C%22%230000ee%22%2C%22%23ffffff%22%2Cfalse%2Cfalse%5D%7D" + "help": "https://able.ibm.com/rules/archives/preview/doc/en-US/text_contrast_sufficient.html#%7B%22message%22%3A%22The%20contrast%20ratio%20of%20text%20with%20its%20background%20meets%20WCAG%20AA%20requirements%22%2C%22snippet%22%3A%22%3Ca%20alt%3D%5C%22skip%20to%20main%20content%5C%22%20href%3D%5C%22%23navskip%5C%22%3E%22%2C%22value%22%3A%5B%22VIOLATION%22%2C%22PASS%22%5D%2C%22reasonId%22%3A%22pass%22%2C%22ruleId%22%3A%22text_contrast_sufficient%22%2C%22msgArgs%22%3A%5B%229.40%22%2C16%2C400%2C%22%230000ee%22%2C%22%23ffffff%22%2Cfalse%2Cfalse%5D%7D" }, { "apiArgs": [], diff --git a/accessibility-checker/test/mocha/aChecker.Fast/aChecker.ObjectStructure/aChecker.getCompliance.JSONObjectVerification.test.js b/accessibility-checker/test/mocha/aChecker.Fast/aChecker.ObjectStructure/aChecker.getCompliance.JSONObjectVerification.test.js index 8df075f4a..7269c8405 100644 --- a/accessibility-checker/test/mocha/aChecker.Fast/aChecker.ObjectStructure/aChecker.getCompliance.JSONObjectVerification.test.js +++ b/accessibility-checker/test/mocha/aChecker.Fast/aChecker.ObjectStructure/aChecker.getCompliance.JSONObjectVerification.test.js @@ -127,7 +127,7 @@ describe("JSON Structure Verification Zombie", function () { return b.ruleId.localeCompare(a.ruleId); }) // Run the diff algo to get the list of differences - differences = aChecker.diffResultsWithExpected(report, expected, false); + differences = aChecker.diffResultsWithExpected(report, expected, false);console.log("report=" + JSON.stringify(report)); } expect(typeof differences).to.equal("undefined", "\nDoes not follow the correct JSON structure or can't load baselines" + JSON.stringify(differences, null, ' ')); // Mark the testcase as done.