From 03a6103fbd33d7e1f53e648012d9319c3645a6f0 Mon Sep 17 00:00:00 2001 From: Masafumi NAKANE Date: Tue, 5 Mar 2024 08:41:25 +0900 Subject: [PATCH 01/68] =?UTF-8?q?axe-core=E3=82=92=E3=82=B5=E3=83=96?= =?UTF-8?q?=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=81=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 3 +++ vendor/axe-core | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 vendor/axe-core diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0551ddd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/axe-core"] + path = vendor/axe-core + url = https://github.com/dequelabs/axe-core diff --git a/vendor/axe-core b/vendor/axe-core new file mode 160000 index 0000000..ed737c7 --- /dev/null +++ b/vendor/axe-core @@ -0,0 +1 @@ +Subproject commit ed737c7270c1726ea8ff04e4d7891befd8aff653 From 664a8b6db067010ad5cee40bafea76109257f62c Mon Sep 17 00:00:00 2001 From: Masafumi NAKANE Date: Tue, 5 Mar 2024 11:28:01 +0900 Subject: [PATCH 02/68] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E3=81=95=E3=82=8C=E3=81=9F=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E3=81=AA=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/yaml2rst/a11y_guidelines.py | 3 -- tools/yaml2rst/yaml2rst.py | 54 ------------------------------- 2 files changed, 57 deletions(-) diff --git a/tools/yaml2rst/a11y_guidelines.py b/tools/yaml2rst/a11y_guidelines.py index 36e9cbf..a40cb87 100644 --- a/tools/yaml2rst/a11y_guidelines.py +++ b/tools/yaml2rst/a11y_guidelines.py @@ -284,10 +284,7 @@ def procedure_platforms(self): def template_object(self, lang, **kwargs): rel = RelationshipManager() - # if 'platform' in kwargs: gl_platform = kwargs.get('platform') - # else: - # gl_platform = [] template_object = { 'id': self.id, 'check': self.check[lang], diff --git a/tools/yaml2rst/yaml2rst.py b/tools/yaml2rst/yaml2rst.py index 828f355..137f85c 100644 --- a/tools/yaml2rst/yaml2rst.py +++ b/tools/yaml2rst/yaml2rst.py @@ -121,60 +121,6 @@ def get_miscdefs(lang): }) yield {'links': data} -# def generate_makefile(destfile, template, build_all, targets, lang, DEST_DIRS, MAKEFILE_VARS, makefile_vars, makefile_vars_list): -# rel = RelationshipManager() -# if build_all or destfile in targets: -# build_depends = [] -# makefile_vars['check_yaml'] = ' '.join(Check.list_all_src_paths()) -# makefile_vars['gl_yaml'] = ' '.join(Guideline.list_all_src_paths()) -# makefile_vars['faq_yaml'] = ' '.join(Faq.list_all_src_paths()) -# for cat in Category.list_all(): -# filename = f'{cat.id}.rst' -# target = os.path.join(DEST_DIRS['guidelines'], filename) -# makefile_vars_list['guideline_category_target'].append(target) -# build_depends.append({'target': target, 'depends': ' '.join(cat.get_dependency())}) - -# for tool in CheckTool.list_all(): -# filename = f'examples-{tool.id}.rst' -# target = os.path.join(DEST_DIRS['checks'], filename) -# makefile_vars_list['check_example_target'].append(target) -# build_depends.append({'target': target, 'depends': ' '.join(tool.get_dependency())}) - -# for faq in Faq.list_all(): -# filename = f'{faq.id}.rst' -# target = os.path.join(DEST_DIRS['faq_articles'], filename) -# makefile_vars_list['faq_article_target'].append(target) -# build_depends.append({'target': target, 'depends': ' '.join(faq.get_dependency())}) - -# for tag in FaqTag.list_all(): -# if tag.article_count() == 0: -# continue -# filename = f'{tag.id}.rst' -# target = os.path.join(DEST_DIRS['faq_tags'], filename) -# makefile_vars_list['faq_tagpage_target'].append(target) -# build_depends.append({'target': target, 'depends': [' '.join(faq.get_dependency()) for faq in rel.get_tag_to_faqs(tag)]}) - -# for info_id in rel.info_to_guidelines: -# info = InfoRef.get_by_id(info_id) -# if not info.internal: -# continue -# filename = f'{info.ref}.rst' -# target = os.path.join(DEST_DIRS['info2gl'], filename) -# makefile_vars_list['info_to_gl_target'].append(target) -# build_depends.append({'target': target, 'depends': ' '.join([guideline.src_path for guideline in rel.get_info_to_guidelines(info)])}) - -# for info_id in rel.info_to_faqs: -# info = InfoRef.get_by_id(info_id) -# filename = f'{info.ref}.rst' -# target = os.path.join(DEST_DIRS['info2faq'], filename) -# makefile_vars_list['info_to_faq_target'].append(target) -# build_depends.append({'target': target, 'depends': ' '.join([faq.src_path for faq in rel.get_info_to_faqs(info)])}) - -# for key, value in makefile_vars_list.items(): -# makefile_vars[key] = ' '.join(value) -# makefile_vars['depends'] = build_depends -# template.write_rst({**makefile_vars, **MAKEFILE_VARS}, destfile) - def get_makefile(lang, DEST_DIRS, MAKEFILE_VARS, makefile_vars, makefile_vars_list): rel = RelationshipManager() build_depends = [] From 2fedc96e4be506fb6cec0206fd97236b73c43119 Mon Sep 17 00:00:00 2001 From: Masafumi NAKANE Date: Thu, 7 Mar 2024 14:48:49 +0900 Subject: [PATCH 03/68] =?UTF-8?q?retrun/yield=E3=81=AE=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=AE=87=E6=89=80=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=A6=8B?= =?UTF-8?q?=E7=9B=B4=E3=81=97=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/yaml2rst/a11y_guidelines.py | 18 ++++++++++++------ tools/yaml2rst/yaml2rst.py | 18 ++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/tools/yaml2rst/a11y_guidelines.py b/tools/yaml2rst/a11y_guidelines.py index a40cb87..59360d8 100644 --- a/tools/yaml2rst/a11y_guidelines.py +++ b/tools/yaml2rst/a11y_guidelines.py @@ -257,7 +257,9 @@ def get_by_id(cls, guideline_id): @classmethod def list_all_src_paths(cls): - return [guideline.src_path for guideline in cls.all_guidelines.values()] + for guideline in cls.all_guidelines.values(): + yield guideline.src_path + class Check: all_checks = {} @@ -321,11 +323,13 @@ def get_by_id(cls, check_id): @classmethod def template_object_all(cls, lang): sorted_checks = sorted(cls.all_checks, key=lambda x: cls.all_checks[x].id) - return [cls.all_checks[check_id].template_object(lang) for check_id in sorted_checks] + for check_id in sorted_checks: + yield cls.all_checks[check_id].template_object(lang) @classmethod def list_all_src_paths(cls): - return [check.src_path for check in cls.all_checks.values()] + for check in cls.all_checks.values(): + yield check.src_path class Faq: all_faqs = {} @@ -410,7 +414,8 @@ def list_all(cls, **kwargs): @classmethod def list_all_src_paths(cls): - return [faq.src_path for faq in cls.all_faqs.values()] + for faq in cls.all_faqs.values(): + yield faq.src_path class Category: all_categories = {} @@ -569,8 +574,9 @@ def get_by_id(cls, ref_id): @classmethod def list_all_external(cls): - return [inforef for inforef in cls.all_inforefs.values() if not inforef.internal] - + for inforef in cls.all_inforefs.values(): + if not inforef.internal: + yield inforef class Procedure: def __init__(self, procedure, check): diff --git a/tools/yaml2rst/yaml2rst.py b/tools/yaml2rst/yaml2rst.py index 137f85c..d4e6162 100644 --- a/tools/yaml2rst/yaml2rst.py +++ b/tools/yaml2rst/yaml2rst.py @@ -36,16 +36,15 @@ def main(): def get_category_pages(lang): rel = RelationshipManager() for category, guidelines in rel.get_guidelines_to_category().items(): - data = { + yield { 'filename': category, 'lang': lang, 'guidelines': [gl.template_object(lang) for gl in guidelines] } - yield data def get_allchecks(lang): allchecks = Check.template_object_all(lang) - yield {'allchecks': allchecks} + return [{'allchecks': allchecks}] def get_example_pages(lang): for tool in CheckTool.list_all(): @@ -60,28 +59,27 @@ def get_faq_tagpages(lang): for tag in FaqTag.list_all(): if tag.article_count() == 0: continue - data = { + yield { 'filename': tag.id, 'tag': tag.id, 'label': tag.names[lang], 'articles': [faq.id for faq in rel.get_tag_to_faqs(tag)] } - yield data def get_faq_index(lang): sorted_tags = sorted(FaqTag.list_all(), key=lambda x: x.names[lang]) tags = [tag.template_object(lang) for tag in sorted_tags if tag.article_count() > 0] articles = [article.template_object(lang) for article in Faq.list_all(sort_by='date')] - yield {'articles': articles, 'tags': tags} + return [{'articles': articles, 'tags': tags}] def get_faq_tag_index(lang): sorted_tags = sorted(FaqTag.list_all(), key=lambda x: x.names[lang]) tagpages = [tagpage.template_object(lang) for tagpage in sorted_tags if tagpage.article_count() > 0] - yield {'tags': tagpages} + return [{'tags': tagpages}] def get_faq_article_index(lang): articles = [article.template_object(lang) for article in Faq.list_all(sort_by='sortKey')] - yield {'articles': articles} + return [{'articles': articles}] def get_info_to_guidelines(lang): rel = RelationshipManager() @@ -109,7 +107,7 @@ def get_wcag21mapping(lang): def get_priority_diff(lang): diffs = [sc.template_object(lang) for sc in WcagSc.get_all().values() if sc.level != sc.local_priority] - yield {'diffs': diffs} + return [{'diffs': diffs}] def get_miscdefs(lang): data = [] @@ -119,7 +117,7 @@ def get_miscdefs(lang): 'text': info.text[lang], 'url': info.url[lang] }) - yield {'links': data} + return [{'links': data}] def get_makefile(lang, DEST_DIRS, MAKEFILE_VARS, makefile_vars, makefile_vars_list): rel = RelationshipManager() From f96dca155e00d24ada9b5ba604c034c2b934c5f5 Mon Sep 17 00:00:00 2001 From: Masafumi NAKANE Date: Thu, 7 Mar 2024 14:56:00 +0900 Subject: [PATCH 04/68] =?UTF-8?q?WCAG=20SC=E3=81=AE=E3=83=86=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E7=94=A8=E3=82=AA=E3=83=96?= =?UTF-8?q?=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88=E7=94=9F=E6=88=90=E3=81=AB?= =?UTF-8?q?=E3=81=8A=E3=81=84=E3=81=A6=E3=80=81=E9=96=A2=E9=80=A3=E3=82=AC?= =?UTF-8?q?=E3=82=A4=E3=83=89=E3=83=A9=E3=82=A4=E3=83=B3=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E3=81=AE=E7=94=9F=E6=88=90=E3=82=92=E5=88=86=E9=9B=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/yaml2rst/a11y_guidelines.py | 3 --- tools/yaml2rst/yaml2rst.py | 10 ++++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/yaml2rst/a11y_guidelines.py b/tools/yaml2rst/a11y_guidelines.py index 59360d8..f1c8235 100644 --- a/tools/yaml2rst/a11y_guidelines.py +++ b/tools/yaml2rst/a11y_guidelines.py @@ -527,9 +527,6 @@ def template_object(self, lang): 'sc_en_url': self.url['en'], 'sc_ja_url': self.url['ja'] } - guidelines = rel.get_sc_to_guidelines(self) - if len(guidelines) > 0: - template_object['guidelines'] = [guideline.get_category_and_id(lang) for guideline in guidelines] return template_object @classmethod diff --git a/tools/yaml2rst/yaml2rst.py b/tools/yaml2rst/yaml2rst.py index d4e6162..f3bcc1e 100644 --- a/tools/yaml2rst/yaml2rst.py +++ b/tools/yaml2rst/yaml2rst.py @@ -102,8 +102,14 @@ def get_info_to_faqs(lang): def get_wcag21mapping(lang): rel = RelationshipManager() - sc_mapping = [sc.template_object(lang) for sc in WcagSc.get_all().values()] - yield {'mapping': sc_mapping} + mappings = [] + for sc in WcagSc.get_all().values(): + sc_object = sc.template_object(lang) + guidelines = rel.get_sc_to_guidelines(sc) + if len(guidelines) > 0: + sc_object['guidelines'] = [guideline.get_category_and_id(lang) for guideline in guidelines] + mappings.append(sc_object) + return [{'mapping': mappings}] def get_priority_diff(lang): diffs = [sc.template_object(lang) for sc in WcagSc.get_all().values() if sc.level != sc.local_priority] From 2bb53b469ec1c5c2ec3596c7e54aa2bb30a823d1 Mon Sep 17 00:00:00 2001 From: Masafumi NAKANE Date: Thu, 7 Mar 2024 15:18:59 +0900 Subject: [PATCH 05/68] =?UTF-8?q?axe-core=E3=81=AE=E3=83=AB=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=81=AE=E5=87=A6=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/yaml2rst/a11y_guidelines.py | 90 +++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/tools/yaml2rst/a11y_guidelines.py b/tools/yaml2rst/a11y_guidelines.py index f1c8235..92d8754 100644 --- a/tools/yaml2rst/a11y_guidelines.py +++ b/tools/yaml2rst/a11y_guidelines.py @@ -33,6 +33,8 @@ def __init__(self): self.check_to_info = {} self.faq_to_info = {} self.info_to_faqs = {} + self.axe_to_scs = {} + self.axe_to_guidelines = {} self._initialized = True def set_guideline_category(self, guideline): @@ -196,6 +198,18 @@ def get_info_to_faqs(self, info): return self.info_to_faqs.get(info.id) return [] + def associate_axe_with_scs(self, rule, sc): + if rule.id not in self.axe_to_scs: + self.axe_to_scs[rule.id] = [] + if sc not in self.axe_to_scs[rule.id]: + self.axe_to_scs[rule.id].append(sc) + if sc.id in self.sc_to_guidelines: + for guideline in self.sc_to_guidelines[sc.id]: + if rule.id not in self.axe_to_guidelines: + self.axe_to_guidelines[rule.id] = [] + if guideline not in self.axe_to_guidelines[rule.id]: + self.axe_to_guidelines[rule.id].append(guideline) + class Guideline: all_guidelines = {} @@ -735,6 +749,79 @@ def list_all_ids(cls): def get_by_id(cls, tool_id): return cls.all_tools.get(tool_id) +class AxeRule: + all_rules = {} + timestamp = None + version = None + major_version = None + deque_url = None + + def __init__(self, rule, messages_ja): + rule_id = rule['id'] + if rule_id in AxeRule.all_rules: + raise ValueError(f'Duplicate rule ID: {rule_id}') + self.id = rule_id + if not rule_id in messages_ja['rules']: + msg_ja = { + 'help': rule['metadata']['help'], + 'description': rule['metadata']['description'] + } + self.translated = None + else: + msg_ja = messages_ja['rules'][rule_id] + self.translated = True + self.message = { + 'help': { + 'en': rule['metadata']['help'], + 'ja': msg_ja['help'] + }, + 'description': { + 'en': rule['metadata']['description'], + 'ja': msg_ja['description'] + } + } + wcag_scs = [tag2sc(tag) for tag in rule['tags'] if re.match(r'wcag\d{3,}', tag) ] + rel = RelationshipManager() + for sc in wcag_scs: + if sc not in WcagSc.all_scs: + continue + # raise ValueError(f'Unknown SC: {sc} in rule {rule_id}') + rel.associate_axe_with_scs(self, WcagSc.get_by_id(sc)) + AxeRule.all_rules[rule_id] = self + + def template_object(self, lang): + rel = RelationshipManager() + data = { + 'id': self.id, + 'help': self.message['help'], + 'description': self.message['description'] + } + if self.translated: + data['translated'] = True + if self.id in rel.axe_to_scs: + scs = sorted(rel.axe_to_scs[self.id], key=lambda item: item.sort_key) + data['scs'] = [sc.template_object(lang) for sc in scs] + if self.id in rel.axe_to_guidelines: + guidelines = sorted(rel.axe_to_guidelines[self.id], key=lambda item: item.sort_key) + data['guidelines'] = [guideline.get_category_and_id(lang) for guideline in guidelines] + return data + + @classmethod + def list_all(cls): + rel = RelationshipManager() + sorted_all_rules = sorted(cls.all_rules, key=lambda rule: cls.all_rules[rule].id) + with_guidelines = [] + with_sc = [] + without_sc = [] + for rule in sorted_all_rules: + if rule in rel.axe_to_guidelines: + with_guidelines.append(cls.all_rules[rule]) + elif rule in rel.axe_to_scs: + with_sc.append(cls.all_rules[rule]) + else: + without_sc.append(cls.all_rules[rule]) + return with_guidelines + with_sc + without_sc + # Utility functions def join_items(items, lang): if lang == 'ja': @@ -746,3 +833,6 @@ def join_items(items, lang): def uniq(seq): seen = [] return [x for x in seq if x not in seen and not seen.append(x)] + +def tag2sc(tag): + return re.sub(r'wcag(\d)(\d)(\d+)', r'\1.\2.\3', tag) From 3c80ca2a3c4d104af4295db7e7bc8f1351eb020f Mon Sep 17 00:00:00 2001 From: Masafumi NAKANE Date: Thu, 7 Mar 2024 15:20:20 +0900 Subject: [PATCH 06/68] =?UTF-8?q?axe-rules.rst=E3=81=AE=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/yaml2rst/a11y_guidelines_initializer.py | 40 +++++++++++++++++-- tools/yaml2rst/app_initializer.py | 3 +- tools/yaml2rst/constants.py | 4 ++ tools/yaml2rst/path.py | 19 +++++++-- tools/yaml2rst/yaml2rst.py | 17 ++++++-- 5 files changed, 71 insertions(+), 12 deletions(-) diff --git a/tools/yaml2rst/a11y_guidelines_initializer.py b/tools/yaml2rst/a11y_guidelines_initializer.py index 82de5bc..aa9f9e4 100644 --- a/tools/yaml2rst/a11y_guidelines_initializer.py +++ b/tools/yaml2rst/a11y_guidelines_initializer.py @@ -1,10 +1,13 @@ import os import sys +import re import json import yaml +import datetime, time +from git import * from jsonschema import validate, ValidationError, RefResolver -from a11y_guidelines import Category, WcagSc, InfoRef, Guideline, Check, Faq, FaqTag, CheckTool, RelationshipManager -from constants import CHECK_TOOLS +from a11y_guidelines import Category, WcagSc, InfoRef, Guideline, Check, Faq, FaqTag, CheckTool, AxeRule, RelationshipManager +from constants import CHECK_TOOLS, DEQUE_URL from path import get_src_path def setup_instances(settings): @@ -40,13 +43,42 @@ def setup_instances(settings): for entity_type, srcdir, schema_filename, constructor in entity_config: process_entity_files(entity_type, srcdir, src_path['schema'], schema_filename, resolver, constructor) + process_axe_rules(src_path['axe_rules'], src_path['axe_msg_ja'], src_path['axe_pkg'], DEQUE_URL) + return RelationshipManager() -def ls_dir(dirname): +def process_axe_rules(axe_rules_dir, axe_msg_ja_file, axe_pkg_file, base_url): + try: + file_content = read_file_content(axe_msg_ja_file) + except Exception as e: + handle_file_error(e, rule_file) + messages_ja = json.loads(file_content) + rule_files = ls_dir(axe_rules_dir, '.json') + for rule_file in rule_files: + try: + file_content = read_file_content(rule_file) + except Exception as e: + handle_file_error(e, rule_file) + parsed_data = json.loads(file_content) + AxeRule(parsed_data, messages_ja) + try: + file_content = read_file_content(axe_pkg_file) + except Exception as e: + handle_file_error(e, rule_file) + parsed_data = json.loads(file_content) + version = parsed_data['version'] + AxeRule.version = version + AxeRule.major_version = re.sub(r'(\d+)\.(\d+)\.\d+', r'\1.\2', version) + AxeRule.deque_url = base_url + for item in Repo(os.path.dirname(axe_pkg_file)).iter_commits('develop', max_count=1): + AxeRule.timestamp = time.strftime("%F %T%z", time.localtime(item.authored_date)) + +def ls_dir(dirname, extension=None): files = [] for currentDir, dirs, fs in os.walk(dirname): for f in fs: - files.append(os.path.join(currentDir, f)) + if extension is None or f.endswith(extension): + files.append(os.path.join(currentDir, f)) return files def read_file_content(file_path): diff --git a/tools/yaml2rst/app_initializer.py b/tools/yaml2rst/app_initializer.py index 46dffcf..1ddcfd3 100644 --- a/tools/yaml2rst/app_initializer.py +++ b/tools/yaml2rst/app_initializer.py @@ -22,7 +22,8 @@ def setup_constants(settings): 'priority_diff_target': STATIC_FILES['priority_diff'], 'miscdefs_target': STATIC_FILES['miscdefs'], 'wcag_sc': src_path['wcag_sc'], - 'info_src': src_path['info'] + 'info_src': src_path['info'], + 'axe_rules_target': STATIC_FILES['axe_rules'], } return DEST_DIRS, STATIC_FILES, MAKEFILE_VARS diff --git a/tools/yaml2rst/constants.py b/tools/yaml2rst/constants.py index 089f7f5..bb51103 100644 --- a/tools/yaml2rst/constants.py +++ b/tools/yaml2rst/constants.py @@ -97,3 +97,7 @@ 'en': 'iOS' } } + +# for axe rules +DEQUE_URL = 'https://dequeuniversity.com/rules/axe/' + diff --git a/tools/yaml2rst/path.py b/tools/yaml2rst/path.py index 0c7534a..6cbbcff 100644 --- a/tools/yaml2rst/path.py +++ b/tools/yaml2rst/path.py @@ -7,6 +7,13 @@ JSON_DIR = 'json' DEST_DIR_BASE = 'source' +# axe-core directories +AXE_SRC_BASE = 'vendor/axe-core' +AXE_RULES_DIR = 'lib/rules' +AXE_LOCALE_DIR = 'locales' +AXE_LOCALE_JA_FILE = 'ja.json' +AXE_PKG_FILE = 'package.json' + # File paths FAQ_INDEX_FILENAME = 'index.rst' MAKEFILE_FILENAME = 'incfiles.mk' @@ -14,6 +21,7 @@ WCAG_MAPPING_FILENAME = "wcag21-mapping.rst" PRIORITY_DIFF_FILENAME = "priority-diff.rst" MISCDEFS_FILENAME = "defs.txt" +AXE_RULES_FILENAME = 'axe-rules.rst' TEMPLATE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates') TEMPLATE_FILENAMES = { @@ -30,7 +38,8 @@ 'wcag21mapping': 'wcag21-mapping.rst', 'priority_diff': 'priority-diff.rst', 'makefile': 'incfiles.mk', - 'miscdefs': 'misc-defs.txt' + 'miscdefs': 'misc-defs.txt', + 'axe_rules': 'axe-rules.rst' } def get_dest_dirnames(basedir, lang): @@ -79,7 +88,8 @@ def get_static_dest_files(basedir, lang): 'faq_index': os.path.join(dest_dirnames['faq_base'], FAQ_INDEX_FILENAME), 'faq_article_index': os.path.join(dest_dirnames['faq_articles'], FAQ_INDEX_FILENAME), 'faq_tag_index': os.path.join(dest_dirnames['faq_tags'], FAQ_INDEX_FILENAME), - 'makefile': os.path.join(dest_dirnames['base'], MAKEFILE_FILENAME) + 'makefile': os.path.join(dest_dirnames['base'], MAKEFILE_FILENAME), + 'axe_rules': os.path.join(dest_dirnames['misc'], AXE_RULES_FILENAME) } def get_src_path(basedir): @@ -102,6 +112,9 @@ def get_src_path(basedir): 'wcag_sc': os.path.join(json_basedir, 'wcag-sc.json'), 'gl_categories': os.path.join(json_basedir, 'guideline-categories.json'), 'faq_tags': os.path.join(json_basedir, 'faq-tags.json'), - 'info': os.path.join(json_basedir, 'info.json') + 'info': os.path.join(json_basedir, 'info.json'), + 'axe_rules': os.path.join(basedir, AXE_SRC_BASE, AXE_RULES_DIR), + 'axe_msg_ja': os.path.join(basedir, AXE_SRC_BASE, AXE_LOCALE_DIR, AXE_LOCALE_JA_FILE), + 'axe_pkg': os.path.join(basedir, AXE_SRC_BASE, AXE_PKG_FILE) } return src_path diff --git a/tools/yaml2rst/yaml2rst.py b/tools/yaml2rst/yaml2rst.py index f3bcc1e..b8abe1a 100644 --- a/tools/yaml2rst/yaml2rst.py +++ b/tools/yaml2rst/yaml2rst.py @@ -1,6 +1,6 @@ import os import app_initializer -from a11y_guidelines import Category, WcagSc, InfoRef, Guideline, Check, Faq, FaqTag, CheckTool, RelationshipManager +from a11y_guidelines import Category, WcagSc, InfoRef, Guideline, Check, Faq, FaqTag, CheckTool, AxeRule, RelationshipManager import a11y_guidelines_initializer def main(): @@ -24,7 +24,7 @@ def main(): generate_files(DEST_DIRS['info2gl'], templates['info_to_gl'], get_info_to_guidelines, settings['build_all'], settings['targets'], settings['lang']) generate_files(DEST_DIRS['info2faq'], templates['info_to_faq'], get_info_to_faqs, settings['build_all'], settings['targets'], settings['lang']) generate_files(STATIC_FILES['wcag21mapping'], templates['wcag21mapping'], get_wcag21mapping, settings['build_all'], settings['targets'], settings['lang']) - generate_files(STATIC_FILES['priority_diff'], templates['priority_diff'], get_priority_diff, settings['build_all'], settings['targets'], settings['lang']) + generate_files(STATIC_FILES['priority_diff'], templates['priority_diff'], get_priority_diff, settings['build_all'], settings['targets'], settings['lang']) generate_files(STATIC_FILES['miscdefs'], templates['miscdefs'], get_miscdefs, settings['build_all'], settings['targets'], settings['lang']) generate_files(STATIC_FILES['makefile'], templates['makefile'], get_makefile, settings['build_all'], settings['targets'], settings['lang'], { 'DEST_DIRS': DEST_DIRS, @@ -32,6 +32,7 @@ def main(): 'makefile_vars': makefile_vars, 'makefile_vars_list': makefile_vars_list }) + generate_files(STATIC_FILES['axe_rules'], templates['axe_rules'], get_axe_rules, settings['build_all'], settings['targets'], settings['lang']) def get_category_pages(lang): rel = RelationshipManager() @@ -176,8 +177,16 @@ def get_makefile(lang, DEST_DIRS, MAKEFILE_VARS, makefile_vars, makefile_vars_li for key, value in makefile_vars_list.items(): makefile_vars[key] = ' '.join(value) makefile_vars['depends'] = build_depends - yield {**makefile_vars, **MAKEFILE_VARS} - + return [{**makefile_vars, **MAKEFILE_VARS}] + +def get_axe_rules(lang): + return [{ + 'version': AxeRule.version, + 'major_version': AxeRule.major_version, + 'deque_url': AxeRule.deque_url, + 'timestamp': AxeRule.timestamp, + 'rules': [rule.template_object(lang) for rule in AxeRule.list_all()] + }] def generate_file(dest_path, template, data): """ From e1fd953edff60e917bdc8e6a519a29194a0458e0 Mon Sep 17 00:00:00 2001 From: Masafumi NAKANE Date: Thu, 7 Mar 2024 15:21:53 +0900 Subject: [PATCH 07/68] =?UTF-8?q?axe-rules.rst=E3=81=AE=E3=83=86=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/yaml2rst/templates/en/axe-rules.rst | 37 +++++++++++++++++++ tools/yaml2rst/templates/en/incfiles.mk | 2 +- tools/yaml2rst/templates/ja/axe-rules.rst | 44 +++++++++++++++++++++++ tools/yaml2rst/templates/ja/incfiles.mk | 2 +- 4 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 tools/yaml2rst/templates/en/axe-rules.rst create mode 100644 tools/yaml2rst/templates/ja/axe-rules.rst diff --git a/tools/yaml2rst/templates/en/axe-rules.rst b/tools/yaml2rst/templates/en/axe-rules.rst new file mode 100644 index 0000000..a7d0fe5 --- /dev/null +++ b/tools/yaml2rst/templates/en/axe-rules.rst @@ -0,0 +1,37 @@ +The information below is automatically generated based on the content of the develop branch of the `axe-core GitHub repository `_ as of the time indicated below. Please note that it may not always match the content of axe DevTools. + +Version + {{ version }} +Updated + {{ timestamp }} + +{% for rule in rules -%} +.. _axe-rule-{{ rule.id }}: + +{% filter make_heading(2) -%} +{{ rule.help.en }}{% if rule.translated is defined %} ({{ rule.help.ja }}){% endif -%} +{%- endfilter %} + +{{ rule.description.en }} + +CF: `Explanation on Deque University <{{ deque_url }}{{ major_version }}/{{ rule.id }}>`__ + +{% if rule.scs is defined -%} +{% filter make_heading(3) -%} +Related WCAG 2.1 Success Criteria +{%- endfilter %} + +{% for sc in rule.scs -%} +* Success Criterion {{ sc.sc }}: `{{ sc.sc_en_title }} <{{ sc.sc_en_url }}>`_ +{% endfor %} +{%- endif %} +{% if rule.guidelines is defined -%} +{% filter make_heading(3) -%} +Related Guidelines +{%- endfilter %} + +{% for gl in rule.guidelines -%} +* {{ gl.category }}: :ref:`{{ gl.guideline }}` +{% endfor %} +{%- endif %} +{% endfor %} diff --git a/tools/yaml2rst/templates/en/incfiles.mk b/tools/yaml2rst/templates/en/incfiles.mk index a0871ff..578f925 100644 --- a/tools/yaml2rst/templates/en/incfiles.mk +++ b/tools/yaml2rst/templates/en/incfiles.mk @@ -1,4 +1,4 @@ -ALL_INC_FILES = {{ info_to_gl_target }} {{ info_to_faq_target }} {{ guideline_category_target }} {{ check_example_target }} {{ wcag_mapping_target }} {{ priority_diff_target }} {{ all_checks_target }} {{ miscdefs_target }} +ALL_INC_FILES = {{ info_to_gl_target }} {{ info_to_faq_target }} {{ guideline_category_target }} {{ check_example_target }} {{ wcag_mapping_target }} {{ priority_diff_target }} {{ all_checks_target }} {{ miscdefs_target }} {{ axe_rules_target }} %.yaml: ; %.json: ; diff --git a/tools/yaml2rst/templates/ja/axe-rules.rst b/tools/yaml2rst/templates/ja/axe-rules.rst new file mode 100644 index 0000000..083980d --- /dev/null +++ b/tools/yaml2rst/templates/ja/axe-rules.rst @@ -0,0 +1,44 @@ +ここで掲載している情報は、 `axe-coreのGitHubリポジトリー `_ の以下に示す時点におけるdevelopブランチの内容に基づいて自動的に生成したものです。axe DevToolsの内容とは一致していない場合もあることにご注意ください。 + +バージョン + {{ version }} +更新日時 + {{ timestamp }} + +{% for rule in rules -%} +.. _axe-rule-{{ rule.id }}: + +{% filter make_heading(2) -%} +{% if rule.translated is defined %}{{ rule.help.ja }} ({% endif -%}{{ rule.help.en }}{%- if rule.translated is defined %}){% endif %} +{%- endfilter %} + +{{ rule.description.ja }} + +参考: `Deque Universityの解説(英語) <{{ deque_url }}{{ major_version }}/{{ rule.id }}>`__ + +{% if rule.scs is defined -%} +{% filter make_heading(3) -%} +関連するWCAG 2.1の達成基準 +{%- endfilter %} + +{% for sc in rule.scs -%} +* 達成基準 {{ sc.sc }} + + - `{{ sc.sc_en_title }} <{{ sc.sc_en_url }}>`_ + - `{{ sc.sc_ja_title }} <{{ sc.sc_ja_url }}>`_ + +{% endfor %} +{%- endif %} +{%- if rule.guidelines is defined -%} +{% filter make_heading(3) -%} +関連ガイドライン +{%- endfilter %} + +{% for gl in rule.guidelines -%} +* {{ gl.category }}: :ref:`{{ gl.guideline }}` +{% endfor %} +{%- endif %} +{% endfor %} + +.. translated:: true + diff --git a/tools/yaml2rst/templates/ja/incfiles.mk b/tools/yaml2rst/templates/ja/incfiles.mk index a0871ff..578f925 100644 --- a/tools/yaml2rst/templates/ja/incfiles.mk +++ b/tools/yaml2rst/templates/ja/incfiles.mk @@ -1,4 +1,4 @@ -ALL_INC_FILES = {{ info_to_gl_target }} {{ info_to_faq_target }} {{ guideline_category_target }} {{ check_example_target }} {{ wcag_mapping_target }} {{ priority_diff_target }} {{ all_checks_target }} {{ miscdefs_target }} +ALL_INC_FILES = {{ info_to_gl_target }} {{ info_to_faq_target }} {{ guideline_category_target }} {{ check_example_target }} {{ wcag_mapping_target }} {{ priority_diff_target }} {{ all_checks_target }} {{ miscdefs_target }} {{ axe_rules_target }} %.yaml: ; %.json: ; From 5aa80c85e756f8f6bcb2859a097e9814820a448c Mon Sep 17 00:00:00 2001 From: Masafumi NAKANE Date: Thu, 7 Mar 2024 15:22:21 +0900 Subject: [PATCH 08/68] =?UTF-8?q?GitPython=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 7e32c9b..7081601 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ sphinx_rtd_theme sphinxcontrib-trimblank pyyaml jsonschema < 4.18.0 +GitPython From 9f3ed76bb5418a30ee663cdbf953592904dbd6ca Mon Sep 17 00:00:00 2001 From: Masafumi NAKANE Date: Thu, 7 Mar 2024 15:26:51 +0900 Subject: [PATCH 09/68] =?UTF-8?q?axe-core=E3=81=AE=E3=83=AB=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E6=83=85=E5=A0=B1=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=80=81=E6=96=B0=E3=81=9F=E3=81=AB=E7=94=9F=E6=88=90=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92include=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E5=88=87=E3=82=8A=E6=9B=BF=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en/source/info/inc/axe-rules.rst | 2171 ------------------------------ ja/source/info/axe-rules.rst | 2 +- ja/source/info/inc/axe-rules.rst | 2171 ------------------------------ 3 files changed, 1 insertion(+), 4343 deletions(-) delete mode 100644 en/source/info/inc/axe-rules.rst delete mode 100644 ja/source/info/inc/axe-rules.rst diff --git a/en/source/info/inc/axe-rules.rst b/en/source/info/inc/axe-rules.rst deleted file mode 100644 index eddd290..0000000 --- a/en/source/info/inc/axe-rules.rst +++ /dev/null @@ -1,2171 +0,0 @@ -ここで掲載している情報は、 `axe-coreのGitHubリポジトリー `_ の以下に示す時点におけるdevelopブランチの内容に基づいて自動的に生成したものです。axe DevToolsの内容とは一致していない場合もあることにご注意ください。 - -バージョン - 4.8.1 -更新日時 - 2023-09-12 06:45:57+0900 - -.. _axe-rule-area-alt: - -****************************************************************************************************************** -アクティブな要素には代替テキストが存在しなければなりません (Active elements must have alternate text) -****************************************************************************************************************** - -イメージマップの要素に代替テキストが存在することを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 2.4.4 - - - `Link Purpose (In Context) `_ - - `リンクの目的 (コンテキスト内) `_ - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* リンク: :ref:`gl-link-text` -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-allowed-attr: - -******************************************************************************************************************* -要素にはサポートされているARIA属性のみを使用しなければなりません (Elements must only use supported ARIA attributes) -******************************************************************************************************************* - -要素のロールがARIA属性をサポートしていることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-braille-equivalent: - -**************************************************************************************************************************** -aria-braille属性には、点じ以外の同等のものがなければなりません (aria-braille attributes must have a non-braille equivalent) -**************************************************************************************************************************** - -aria-braillelabelとaria-brailleroledescriptionには、点字以外の同等のものが存在することを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-command-name: - -*************************************************************************************************** -ARIAコマンドにはアクセシブルな名前がなければなりません (ARIA commands must have an accessible name) -*************************************************************************************************** - -すべてのARIA button、link、menuitemにアクセシブルな名前があることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-conditional-attr: - -******************************************************************************************************************************* -ARIA属性は要素のロールの仕様に従って使用しなければなりません (ARIA attributes must be used as specified for the element's role) -******************************************************************************************************************************* - -ARIA属性が要素のロールの仕様に従って使用されていることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-deprecated-role: - -********************************************************************************* -非推奨のARIAロールを使用してはなりません (Deprecated ARIA roles must not be used) -********************************************************************************* - -要素に非推奨のロールが使用されていないことを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-hidden-body: - -************************************************************************************************************************ -ドキュメント本体にaria-hidden="true"が存在してはなりません (aria-hidden="true" must not be present on the document body) -************************************************************************************************************************ - -ドキュメント本体にaria-hidden="true"が存在しないことを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-hidden-focus: - -***************************************************************************************************************************************************************************************** -aria-hiddenが指定されている要素は、フォーカス可能であったり、フォーカス可能な要素を含んでいたりしてはなりません (ARIA hidden element must not be focusable or contain focusable elements) -***************************************************************************************************************************************************************************************** - -aria-hiddenが指定されている要素にフォーカスできないこと、その要素にフォーカス可能な要素が含まれていないことを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-input-field-name: - -***************************************************************************************************** -ARIA入力欄にはアクセシブルな名前がなければなりません (ARIA input fields must have an accessible name) -***************************************************************************************************** - -すべてのARIA入力欄にアクセシブルな名前があることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-meter-name: - -********************************************************************************************************** -ARIA meterノードにはアクセシブルな名前がなければなりません (ARIA meter nodes must have an accessible name) -********************************************************************************************************** - -すべてのARIA meterノードにアクセシブルな名前があることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 1.1.1 - - - `Non-text Content `_ - - `非テキストコンテンツ `_ - -関連ガイドライン -================ - -* 画像化されたテキスト: :ref:`gl-iot-provide-text` -* 画像: :ref:`gl-image-description` -* 画像: :ref:`gl-image-decorative` -* アイコン: :ref:`gl-icon-visible-label` -* フォーム: :ref:`gl-form-label` -* フォーム: :ref:`gl-form-hidden-label` -* 音声・映像コンテンツ: :ref:`gl-multimedia-perceivable` - -.. _axe-rule-aria-progressbar-name: - -********************************************************************************************************************** -ARIA progressbarノードにはアクセシブルな名前がなければなりません (ARIA progressbar nodes must have an accessible name) -********************************************************************************************************************** - -すべてのARIA progressbarノードにアクセシブルな名前があることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 1.1.1 - - - `Non-text Content `_ - - `非テキストコンテンツ `_ - -関連ガイドライン -================ - -* 画像化されたテキスト: :ref:`gl-iot-provide-text` -* 画像: :ref:`gl-image-description` -* 画像: :ref:`gl-image-decorative` -* アイコン: :ref:`gl-icon-visible-label` -* フォーム: :ref:`gl-form-label` -* フォーム: :ref:`gl-form-hidden-label` -* 音声・映像コンテンツ: :ref:`gl-multimedia-perceivable` - -.. _axe-rule-aria-prohibited-attr: - -******************************************************************************************************* -要素には禁止されているARIA属性を使用してはなりません (Elements must only use permitted ARIA attributes) -******************************************************************************************************* - -要素のロールでARIA属性が禁止されていないことを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-required-attr: - -****************************************************************************************** -必須のARIA属性が提供されていなければなりません (Required ARIA attributes must be provided) -****************************************************************************************** - -ARIAロールのある要素にすべての必須ARIA属性が存在することを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-required-children: - -**************************************************************************************************************** -特定のARIAロールには特定の子が含まれていなければなりません (Certain ARIA roles must contain particular children) -**************************************************************************************************************** - -子ロールを必須とするARIAロールが指定された要素に、それらが含まれていることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 1.3.1 - - - `Info and Relationships `_ - - `情報及び関係性 `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-semantics` -* マークアップと実装: :ref:`gl-markup-component-implementation` -* ページ全体: :ref:`gl-page-landmark` -* フォーム: :ref:`gl-form-label` -* フォーム: :ref:`gl-form-hidden-label` -* 動的コンテンツ: :ref:`gl-dynamic-content-maintain-dom-tree` - -.. _axe-rule-aria-required-parent: - -********************************************************************************************************************* -特定のARIAロールは特定の親に含まれていなければなりません (Certain ARIA roles must be contained by particular parents) -********************************************************************************************************************* - -親ロールを必須とするARIAロールが指定された要素に、それらが含まれていることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 1.3.1 - - - `Info and Relationships `_ - - `情報及び関係性 `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-semantics` -* マークアップと実装: :ref:`gl-markup-component-implementation` -* ページ全体: :ref:`gl-page-landmark` -* フォーム: :ref:`gl-form-label` -* フォーム: :ref:`gl-form-hidden-label` -* 動的コンテンツ: :ref:`gl-dynamic-content-maintain-dom-tree` - -.. _axe-rule-aria-roledescription: - -************************************************************************************************************************************************** -aria-roledescriptionはセマンティックなロールを持った要素に使用しなければなりません (aria-roledescription must be on elements with a semantic role) -************************************************************************************************************************************************** - -aria-roledescriptionが暗黙的もしくは明示的なロールを持った要素に使用されていることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-roles: - -*********************************************************************************************************** -使用されているARIAロールは有効な値に一致しなければなりません (ARIA roles used must conform to valid values) -*********************************************************************************************************** - -すべてのrole属性が指定された要素で、有効な値が使用されていることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-toggle-field-name: - -******************************************************************************************************** -ARIAトグル欄にはアクセシブルな名前がなければなりません (ARIA toggle fields must have an accessible name) -******************************************************************************************************** - -すべてのARIAトグル欄にアクセシブルな名前があることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-tooltip-name: - -************************************************************************************************************** -ARIA tooltipノードにはアクセシブルな名前がなければなりません (ARIA tooltip nodes must have an accessible name) -************************************************************************************************************** - -すべてのARIA tooltipノードにアクセシブルな名前があることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-valid-attr: - -******************************************************************************************** -ARIA属性は有効な名前に一致しなければなりません (ARIA attributes must conform to valid names) -******************************************************************************************** - -aria- で始まる属性が有効なARIA属性であることを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-aria-valid-attr-value: - -******************************************************************************************* -ARIA属性は有効な値に一致しなければなりません (ARIA attributes must conform to valid values) -******************************************************************************************* - -すべてのARIA属性に有効な値が存在することを確認します - -参考: `Deque Universityの解説(英語) `__ - -関連するWCAG 2.1の達成基準 -========================== - -* 達成基準 4.1.2 - - - `Name, Role, Value `_ - - `名前 (name) ・役割 (role) 及び値 (value) `_ - -関連ガイドライン -================ - -* マークアップと実装: :ref:`gl-markup-component` -* 入力ディバイス: :ref:`gl-input-device-support-mobile-assistive-tech` - -.. _axe-rule-audio-caption: - -*********************************************************************************************************** -