office-gobmx/sw/qa
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
..
api
complex/indeterminateState
core tdf#164247 sw a11y check: Adhere to WCAG contrast threshold for large text 2024-12-09 18:21:46 +01:00
extras tdf#159549 sw: add unit test 2024-12-09 17:35:50 +01:00
filter
inc don't bother passing const std::[u16]string_view by reference 2024-12-03 15:18:31 +01:00
python
uibase tdf#146553 Enable additonal functions in editable section while in r/o mode 2024-11-29 01:15:51 +01:00
uitest tdf#163325: uitest: load the saved document 2024-12-02 12:22:57 +01:00
unit don't bother passing const std::[u16]string_view by reference 2024-12-03 15:18:31 +01:00
unoapi
writerfilter
README

You can find different types of Writer tests here, the following directories
are available:

- core:
  - filters-test: loads different file types (see SwFiltersTest::testCVEs() for
    the list of supported filter types), and only makes sure Writer does not
    crash. To add new tests, you just need to drop in the test files to the
    relevant directory, no code change is necessary.
  - uwriter: this test has access to private Writer symbols, add new tests here
    if you need that.
- extras:
  - see its own README -- executes import and export filters and asserts the
    UNO model to verify the resulting document is the expected one.
  - also, any new C++ test that links to libsw (but does not need access to
    private Writer symbols) should go in this directory, whether using the UNO
    API or the internal one.
- complex: JUnit-based tests using the UNO API
- unoapi: JUnit-based test trying to get/set every UNO property, etc.