office-gobmx/sw/source/core
Michael Weghorn a4b03fce93 tdf#164247 sw a11y check: Adhere to WCAG contrast threshold for large text
Quoting WCAG 2.2 "Success Criterion 1.4.3 Contrast (Minimum)" [1]:

> The visual presentation of text and images of text has a contrast
> ratio of at least 4.5:1, except for the following:
>
> Large Text
>
>     Large-scale text and images of large-scale text have a contrast
>     ratio of at least 3:1;

Regarding large text, the corresponding "Understanding SC 1.4.3" [2]
clarifies:

> Text that is larger and has wider character strokes is easier to read at
> lower contrast. The contrast requirement for larger text is therefore
> lower. This allows authors to use a wider range of color choices for
> large text, which is helpful for design of pages, particularly titles.
> 18 point text or 14 point bold text is judged to be large enough to
> require a lower contrast ratio.

Therefore, lower the text contrast requirement in
Writer's accessibility check from 4.5 to 3.0 for
text that is considered large according to that
specification.

Add a unit test with 2 test documents:

* one that adheres to the requirements and would have triggered false
  positives without this change in place
  (sw/qa/core/accessibilitycheck/data/ContrastTestOK.odt)
* one that doesn't adhere to the requirements and still fails the
  check, as it should
  (sw/qa/core/accessibilitycheck/data/ContrastTestFail.odt)

[1] https://www.w3.org/TR/WCAG22/#contrast-minimum
[2] https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html

Change-Id: I398f72aa5bdcd77c42834632575d6465a5ecd586
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178127
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2024-12-09 18:21:46 +01:00
..
access tdf#164247 sw a11y check: Adhere to WCAG contrast threshold for large text 2024-12-09 18:21:46 +01:00
attr tdf#163913 Implement font-relative margins 2024-11-28 22:10:05 +01:00
bastyp
crsr cid#1635776 Overflowed constant 2024-12-07 15:37:26 +01:00
doc tdf#159549 sw: fix style name in SwXStyle::getParentStyle() 2024-12-09 14:44:37 +01:00
docnode add assert in SwNodes::ForEach 2024-12-06 12:14:11 +01:00
draw cid#1636561 Dereference after null check 2024-12-04 13:29:36 +01:00
edit tdf#163913 Implement font-relative margins 2024-11-28 22:10:05 +01:00
fields tdf#119840 small tweaks 2024-12-06 12:14:02 +01:00
frmedt
graphic
inc tdf#152299 - Remove unused define(s) from C/C++ files 2024-12-07 02:37:15 +01:00
layout sw: layout: ignore Keep-With-Next on hidden frames, part3 2024-12-06 18:07:45 +01:00
model
objectpositioning tdf#163913 Implement font-relative margins 2024-11-28 22:10:05 +01:00
ole
para
sw3io
swg
SwNumberTree
table tdf#163913 Implement font-relative margins 2024-11-28 22:10:05 +01:00
text no need to do repeated lookups here 2024-12-09 10:45:33 +01:00
tox tdf#163913 Implement font-relative margins 2024-11-28 22:10:05 +01:00
txtnode Get SwFieldType after broadcast 2024-12-05 14:03:05 +01:00
undo make conversion operator explicit 2024-12-09 07:11:32 +01:00
unocore tdf#159549 sw: fix style name in SwXStyle::getParentStyle() 2024-12-09 14:44:37 +01:00
view cid#1636561 Dereference after null check 2024-12-04 13:29:36 +01:00