mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-11 14:14:36 +08:00
ARIAProperties.json5 represents the certain rules captured in the ARIA spec. This change also uses it to generate the list of ARIA attribute name constants, and to generate the ARIA autocompletion configuration for devtools. Also adds pyjson5 as a third_party library. Change-Id: I622e590196be667ed97288a73d040856380f3bf9 Reviewed-on: https://chromium-review.googlesource.com/737397 Commit-Queue: Alice Boxhall <aboxhall@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Dirk Pranke <dpranke@chromium.org> Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org> Reviewed-by: Joel Einbinder <einbinder@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#560222} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: a39ce6e61cd170b5b549f119f3b6f7a08253cba9
26 lines
764 B
Python
26 lines
764 B
Python
# Copyright 2018 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
import json
|
|
import os
|
|
import os.path
|
|
import sys
|
|
|
|
PYJSON5_DIR = os.path.join(os.path.dirname(__file__),
|
|
'..', '..', '..', '..', '..', 'pyjson5', 'src')
|
|
sys.path.append(PYJSON5_DIR)
|
|
|
|
import json5 # pylint: disable=import-error
|
|
|
|
|
|
def properties_from_file(file_name):
|
|
with open(os.path.abspath(file_name)) as json5_file:
|
|
properties = json5.loads(json5_file.read())
|
|
return properties
|
|
|
|
|
|
ARIA_PROPERTIES = properties_from_file(sys.argv[1])
|
|
with open(sys.argv[2], "w") as f:
|
|
f.write("Accessibility.ARIAMetadata._config = %s;" % json.dumps(ARIA_PROPERTIES))
|