Commit f90955af authored by David Tseng's avatar David Tseng Committed by Commit Bot

Clean up third_party/chromevox

- add a README.chromium for the Speech Rule Engine
- move all files out of ...chromevox/[injected|background] to chromevoxclassic (which is the only user).
- add a gni file for liblouis library generation (for classic)

TBR=dmazzoni@chromium.org

Change-Id: I7e0c38a360438845edc39f0b34aeda502c0a4aab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1892553
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711534}
parent f957c6b7
...@@ -466,6 +466,7 @@ js2gtest("chromevox_unitjs_tests") { ...@@ -466,6 +466,7 @@ js2gtest("chromevox_unitjs_tests") {
"braille/braille_input_handler_test.unitjs", "braille/braille_input_handler_test.unitjs",
"braille/expanding_braille_translator_test.unitjs", "braille/expanding_braille_translator_test.unitjs",
"braille/pan_strategy_test.unitjs", "braille/pan_strategy_test.unitjs",
"common/key_sequence_test.unitjs",
"common/spannable_test.unitjs", "common/spannable_test.unitjs",
"testing/mock_feedback_test.unitjs", "testing/mock_feedback_test.unitjs",
] ]
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
// Include test fixture. // Include test fixture.
GEN_INCLUDE(['//ui/accessibility/extensions/chromevoxclassic/testing/chromevox_unittest_base.js']); GEN_INCLUDE(['//chrome/browser/resources/chromeos/chromevox/testing/chromevox_unittest_base.js']);
/** /**
* Test fixture. * Test fixture.
......
...@@ -6,11 +6,9 @@ License: Apache 2.0 ...@@ -6,11 +6,9 @@ License: Apache 2.0
Security Critical: Yes Security Critical: Yes
Description: Description:
ChromeVox is the screen reader for Chrome OS. This directory contains pars of ChromeVox is the screen reader for Chrome OS. This directory contains third
ChromeVox that haven't been migrated to party js libraries specifically used with ChromeVox (which are not applicable to
chrome/browser/resources/chromeos/chromevox. any other part of Chrome).
Local Modifications: ChromeVox lives under trunk/chromevox/ in the upstream Local Modifications:
Google Code repository. The only modification is Chrome uses a different None
manifest. The one checked into the upstream repository should be deleted when
merging.
Name: Speech Rule Engine
URL: https://github.com/zorkow/speech-rule-engine
Version: 2.3.0-beta
License: Apache 2.0
Description:
Speech rule engine (SRE) can translate XML expressions into speech strings
according to rules that can be specified in a syntax using Xpath expressions.
It was originally designed for translation of MathML and MathJax DOM elements
for the ChromeVox screen reader. Besides the rules originally designed for the
use in ChromeVox, it also has an implemententation of the full set of Mathspeak
rules. In addition it contains a library for semantic interpretation and
enrichment of MathML expressions.
Local Modifications:
The lone js file is the packed browser version of SRE.
...@@ -3,67 +3,15 @@ ...@@ -3,67 +3,15 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//chromecast/chromecast.gni") import("//chromecast/chromecast.gni")
import("liblouis_library.gni")
chromevox_test_data_dir = "$root_build_dir/chromevox_test_data/braille"
# Build Liblouis library
#
# This target is used to build and assemble Liblouis braille translator.
#
# Variables:
# dest_dir: destination path for all translator files
# deps: private linked dependencies
# testonly: a target must only be used for testing
template("liblouis_library") {
assert(defined(invoker.dest_dir), "Must define dest_dir")
forward_variables_from(invoker, [ "dest_dir" ])
tables_json_target_name = "${target_name}_tables_json"
wasm_target_name = "${target_name}_wasm"
final_target_name = target_name
copy(tables_json_target_name) {
forward_variables_from(invoker, [ "testonly" ])
visibility = [ ":$final_target_name" ]
sources = [
"tables.json",
]
outputs = [
"$dest_dir/{{source_file_part}}",
]
}
copy(wasm_target_name) {
forward_variables_from(invoker, [ "testonly" ])
visibility = [ ":$final_target_name" ]
sources = [
"wasm/liblouis_wasm.data",
"wasm/liblouis_wasm.js",
"wasm/liblouis_wasm.wasm",
"wasm/liblouis_wrapper.js",
]
outputs = [
"$dest_dir/{{source_file_part}}",
]
}
group(target_name) {
forward_variables_from(invoker, [ "testonly" ])
deps = [
":$tables_json_target_name",
":$wasm_target_name",
]
if (defined(invoker.deps)) {
deps += invoker.deps
}
}
}
liblouis_library("liblouis") { liblouis_library("liblouis") {
dest_dir = "$root_build_dir/resources/chromeos/chromevox/braille" dest_dir = "$root_build_dir/resources/chromeos/chromevox/braille"
} }
if (!is_chromecast) { if (!is_chromecast) {
chromevox_test_data_dir = "$root_build_dir/chromevox_test_data/braille"
liblouis_library("liblouis_test_data") { liblouis_library("liblouis_test_data") {
testonly = true testonly = true
dest_dir = chromevox_test_data_dir dest_dir = chromevox_test_data_dir
......
# Copyright 2019 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.
# Build Liblouis library
#
# This target is used to build and assemble Liblouis braille translator.
#
# Variables:
# dest_dir: destination path for all translator files
# deps: private linked dependencies
# testonly: a target must only be used for testing
template("liblouis_library") {
assert(defined(invoker.dest_dir), "Must define dest_dir")
forward_variables_from(invoker, [ "dest_dir" ])
tables_json_target_name = "${target_name}_tables_json"
wasm_target_name = "${target_name}_wasm"
final_target_name = target_name
copy(tables_json_target_name) {
forward_variables_from(invoker, [ "testonly" ])
visibility = [ ":$final_target_name" ]
sources = [
"//third_party/liblouis/tables.json",
]
outputs = [
"$dest_dir/{{source_file_part}}",
]
}
copy(wasm_target_name) {
forward_variables_from(invoker, [ "testonly" ])
visibility = [ ":$final_target_name" ]
sources = [
"//third_party/liblouis/wasm/liblouis_wasm.data",
"//third_party/liblouis/wasm/liblouis_wasm.js",
"//third_party/liblouis/wasm/liblouis_wasm.wasm",
"//third_party/liblouis/wasm/liblouis_wrapper.js",
]
outputs = [
"$dest_dir/{{source_file_part}}",
]
}
group(target_name) {
forward_variables_from(invoker, [ "testonly" ])
deps = [
":$tables_json_target_name",
":$wasm_target_name",
]
if (defined(invoker.deps)) {
deps += invoker.deps
}
}
}
...@@ -12,6 +12,7 @@ import("//chrome/test/base/js2gtest.gni") ...@@ -12,6 +12,7 @@ import("//chrome/test/base/js2gtest.gni")
import("//testing/test.gni") import("//testing/test.gni")
import("//testing/test.gni") import("//testing/test.gni")
import("//third_party/closure_compiler/compile_js.gni") import("//third_party/closure_compiler/compile_js.gni")
import("//third_party/liblouis/liblouis_library.gni")
closure_library_dir = closure_library_dir =
"//third_party/chromevox/third_party/closure-library/closure/goog" "//third_party/chromevox/third_party/closure-library/closure/goog"
...@@ -230,8 +231,7 @@ group("chromevox") { ...@@ -230,8 +231,7 @@ group("chromevox") {
":chromevox_manifest", ":chromevox_manifest",
":chromevox_options_script", ":chromevox_options_script",
":chromevox_strings", ":chromevox_strings",
"//third_party/chromevox:chromevox_third_party_resources", ":chromevoxclassic_liblouis",
"//third_party/liblouis",
] ]
} }
...@@ -247,6 +247,7 @@ run_jsbundler("chromevox_copied_files") { ...@@ -247,6 +247,7 @@ run_jsbundler("chromevox_copied_files") {
dest_dir = chromevox_out_dir dest_dir = chromevox_out_dir
sources = [ sources = [
"chromevox/background/background.html", "chromevox/background/background.html",
"chromevox/background/chrome_shared2.css",
"chromevox/background/earcons/alert_modal.ogg", "chromevox/background/earcons/alert_modal.ogg",
"chromevox/background/earcons/alert_nonmodal.ogg", "chromevox/background/earcons/alert_nonmodal.ogg",
"chromevox/background/earcons/button.ogg", "chromevox/background/earcons/button.ogg",
...@@ -307,8 +308,13 @@ run_jsbundler("chromevox_copied_files") { ...@@ -307,8 +308,13 @@ run_jsbundler("chromevox_copied_files") {
"chromevox/background/mathmaps/symbols/math_symbols.json", "chromevox/background/mathmaps/symbols/math_symbols.json",
"chromevox/background/mathmaps/symbols/math_whitespace.json", "chromevox/background/mathmaps/symbols/math_whitespace.json",
"chromevox/background/mathmaps/symbols/other_stars.json", "chromevox/background/mathmaps/symbols/other_stars.json",
"chromevox/background/options.css",
"chromevox/background/options.html", "chromevox/background/options.html",
"chromevox/background/options_widgets.css",
"chromevox/injected/api.js", "chromevox/injected/api.js",
"chromevox/injected/api_util.js",
"chromevox/injected/mathjax.js",
"chromevox/injected/mathjax_external_util.js",
"cvox2/background/background.html", "cvox2/background/background.html",
"cvox2/background/earcons/control.wav", "cvox2/background/earcons/control.wav",
"cvox2/background/earcons/selection.wav", "cvox2/background/earcons/selection.wav",
...@@ -336,6 +342,10 @@ run_jsbundler("chromevox_copied_files") { ...@@ -336,6 +342,10 @@ run_jsbundler("chromevox_copied_files") {
] ]
} }
liblouis_library("chromevoxclassic_liblouis") {
dest_dir = chromevox_out_dir + "/braille"
}
# TODO(crbug/978200): refactor this into another file like generate_manifest.gni # TODO(crbug/978200): refactor this into another file like generate_manifest.gni
# to share with other extensions. # to share with other extensions.
template("manifest") { template("manifest") {
...@@ -594,7 +604,6 @@ js2gtest("chromevox_unitjs_tests") { ...@@ -594,7 +604,6 @@ js2gtest("chromevox_unitjs_tests") {
"common/editable_text_area_shadow_test.unitjs", "common/editable_text_area_shadow_test.unitjs",
"common/editable_text_test.unitjs", "common/editable_text_test.unitjs",
"common/find_util_test.unitjs", "common/find_util_test.unitjs",
"common/key_sequence_test.unitjs",
"common/math_semantic_tree_test.unitjs", "common/math_semantic_tree_test.unitjs",
"common/page_selection_test.unitjs", "common/page_selection_test.unitjs",
"common/selection_util_test.unitjs", "common/selection_util_test.unitjs",
......
...@@ -28,7 +28,7 @@ p { ...@@ -28,7 +28,7 @@ p {
h1, h1,
h2, h2,
h3 { h3 {
-webkit-user-select: none; -user-select: none;
font-weight: normal; font-weight: normal;
/* Makes the vertical size of the text the same for all fonts. */ /* Makes the vertical size of the text the same for all fonts. */
line-height: 1; line-height: 1;
......
...@@ -17,8 +17,8 @@ select, ...@@ -17,8 +17,8 @@ select,
input[type='checkbox'], input[type='checkbox'],
input[type='radio'] { input[type='radio'] {
-webkit-appearance: none; -webkit-appearance: none;
-webkit-user-select: none; -user-select: none;
background-image: -webkit-linear-gradient(#ededed, #ededed 38%, #dedede); background-image: -linear-gradient(#ededed, #ededed 38%, #dedede);
border: 1px solid rgba(0, 0, 0, 0.25); border: 1px solid rgba(0, 0, 0, 0.25);
border-radius: 2px; border-radius: 2px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
...@@ -55,7 +55,7 @@ select { ...@@ -55,7 +55,7 @@ select {
-webkit-padding-start: 6px; -webkit-padding-start: 6px;
/* OVERRIDE */ /* OVERRIDE */
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAWklEQVQokWNgoAOIAuI0PDiKaJMSgYCZmfkbkPkfHYPEQfJEG/b//3+FBQsWLGRjY/uJbBCIDxIHyRNtGDYDyTYI3UA+Pr4vFBmEbODbt2+bKDYIyUBWYtQBAIRzRP/XKJ//AAAAAElFTkSuQmCC"), background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAWklEQVQokWNgoAOIAuI0PDiKaJMSgYCZmfkbkPkfHYPEQfJEG/b//3+FBQsWLGRjY/uJbBCIDxIHyRNtGDYDyTYI3UA+Pr4vFBmEbODbt2+bKDYIyUBWYtQBAIRzRP/XKJ//AAAAAElFTkSuQmCC"),
-webkit-linear-gradient(#ededed, #ededed 38%, #dedede); -linear-gradient(#ededed, #ededed 38%, #dedede);
background-position: right center; background-position: right center;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
...@@ -109,7 +109,7 @@ input[type='search'] { ...@@ -109,7 +109,7 @@ input[type='search'] {
/* Checked ********************************************************************/ /* Checked ********************************************************************/
input[type='checkbox']:checked::before { input[type='checkbox']:checked::before {
-webkit-user-select: none; -user-select: none;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDBhYcG79aGIsAAACbSURBVBjTjdFBCkFhFAXgj4fp24PBy0SZ2ICRXRgYGb2xlKzBSEo2YgsiKWVoZgFKMjD5X/2Ux6lb99bpnNO5lKMR5i8MsEQHkhJiEzlS9HCqfiFWMUIt3AfsC3KKLCL30Qr7HfM4Ro4h6rhiEqmusIMKuphGqo+ogSPGcbYLzh91vdkXSHDDBk+0gxussS3rNcMCs+D6E18/9gLPPhbDshfzLgAAAABJRU5ErkJggg=="); background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDBhYcG79aGIsAAACbSURBVBjTjdFBCkFhFAXgj4fp24PBy0SZ2ICRXRgYGb2xlKzBSEo2YgsiKWVoZgFKMjD5X/2Ux6lb99bpnNO5lKMR5i8MsEQHkhJiEzlS9HCqfiFWMUIt3AfsC3KKLCL30Qr7HfM4Ro4h6rhiEqmusIMKuphGqo+ogSPGcbYLzh91vdkXSHDDBk+0gxussS3rNcMCs+D6E18/9gLPPhbDshfzLgAAAABJRU5ErkJggg==");
background-size: 100% 100%; background-size: 100% 100%;
content: ''; content: '';
...@@ -142,7 +142,7 @@ input[type='submit']:not(.custom-appearance):not(.link-button):enabled:hover, ...@@ -142,7 +142,7 @@ input[type='submit']:not(.custom-appearance):not(.link-button):enabled:hover,
select:enabled:hover, select:enabled:hover,
input[type='checkbox']:enabled:hover, input[type='checkbox']:enabled:hover,
input[type='radio']:enabled:hover { input[type='radio']:enabled:hover {
background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0); background-image: -linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
border-color: rgba(0, 0, 0, 0.3); border-color: rgba(0, 0, 0, 0.3);
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12),
inset 0 1px 2px rgba(255, 255, 255, 0.95); inset 0 1px 2px rgba(255, 255, 255, 0.95);
...@@ -152,7 +152,7 @@ input[type='radio']:enabled:hover { ...@@ -152,7 +152,7 @@ input[type='radio']:enabled:hover {
select:enabled:hover { select:enabled:hover {
/* OVERRIDE */ /* OVERRIDE */
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAWklEQVQokWNgoAOIAuI0PDiKaJMSgYCZmfkbkPkfHYPEQfJEG/b//3+FBQsWLGRjY/uJbBCIDxIHyRNtGDYDyTYI3UA+Pr4vFBmEbODbt2+bKDYIyUBWYtQBAIRzRP/XKJ//AAAAAElFTkSuQmCC"), background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAWklEQVQokWNgoAOIAuI0PDiKaJMSgYCZmfkbkPkfHYPEQfJEG/b//3+FBQsWLGRjY/uJbBCIDxIHyRNtGDYDyTYI3UA+Pr4vFBmEbODbt2+bKDYIyUBWYtQBAIRzRP/XKJ//AAAAAElFTkSuQmCC"),
-webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0); -linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
} }
/* Active *********************************************************************/ /* Active *********************************************************************/
...@@ -163,7 +163,7 @@ input[type='submit']:not(.custom-appearance):not(.link-button):enabled:active, ...@@ -163,7 +163,7 @@ input[type='submit']:not(.custom-appearance):not(.link-button):enabled:active,
select:enabled:active, select:enabled:active,
input[type='checkbox']:enabled:active, input[type='checkbox']:enabled:active,
input[type='radio']:enabled:active { input[type='radio']:enabled:active {
background-image: -webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7); background-image: -linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
box-shadow: none; box-shadow: none;
text-shadow: none; text-shadow: none;
} }
...@@ -171,7 +171,7 @@ input[type='radio']:enabled:active { ...@@ -171,7 +171,7 @@ input[type='radio']:enabled:active {
select:enabled:active { select:enabled:active {
/* OVERRIDE */ /* OVERRIDE */
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAWklEQVQokWNgoAOIAuI0PDiKaJMSgYCZmfkbkPkfHYPEQfJEG/b//3+FBQsWLGRjY/uJbBCIDxIHyRNtGDYDyTYI3UA+Pr4vFBmEbODbt2+bKDYIyUBWYtQBAIRzRP/XKJ//AAAAAElFTkSuQmCC"), background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAWklEQVQokWNgoAOIAuI0PDiKaJMSgYCZmfkbkPkfHYPEQfJEG/b//3+FBQsWLGRjY/uJbBCIDxIHyRNtGDYDyTYI3UA+Pr4vFBmEbODbt2+bKDYIyUBWYtQBAIRzRP/XKJ//AAAAAElFTkSuQmCC"),
-webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7); -linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
} }
/* Disabled *******************************************************************/ /* Disabled *******************************************************************/
...@@ -180,7 +180,7 @@ button:not(.custom-appearance):not(.link-button):disabled, ...@@ -180,7 +180,7 @@ button:not(.custom-appearance):not(.link-button):disabled,
input[type='button']:not(.custom-appearance):not(.link-button):disabled, input[type='button']:not(.custom-appearance):not(.link-button):disabled,
input[type='submit']:not(.custom-appearance):not(.link-button):disabled, input[type='submit']:not(.custom-appearance):not(.link-button):disabled,
select:disabled { select:disabled {
background-image: -webkit-linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6); background-image: -linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
border-color: rgba(80, 80, 80, 0.2); border-color: rgba(80, 80, 80, 0.2);
box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08), box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08),
inset 0 1px 2px rgba(255, 255, 255, 0.75); inset 0 1px 2px rgba(255, 255, 255, 0.75);
...@@ -189,7 +189,7 @@ select:disabled { ...@@ -189,7 +189,7 @@ select:disabled {
select:disabled { select:disabled {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAAXNSR0IArs4c6QAAAAd0SU1FB9sLAxYEBKriBmwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAABLSURBVCiRY2CgA4gC4jQ8OIpokxKBoKGh4T8uDJIn2rD///8rLFiwYCE2g0DiIHkSfIndQLIMwmYgRQYhG/j27dsmig1CMpCVGHUAo8FcsHfxfXQAAAAASUVORK5CYII="), background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAAXNSR0IArs4c6QAAAAd0SU1FB9sLAxYEBKriBmwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAABLSURBVCiRY2CgA4gC4jQ8OIpokxKBoKGh4T8uDJIn2rD///8rLFiwYCE2g0DiIHkSfIndQLIMwmYgRQYhG/j27dsmig1CMpCVGHUAo8FcsHfxfXQAAAAASUVORK5CYII="),
-webkit-linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6); -linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
} }
input[type='checkbox']:disabled, input[type='checkbox']:disabled,
...@@ -229,7 +229,7 @@ select:enabled:focus { ...@@ -229,7 +229,7 @@ select:enabled:focus {
/* Link buttons ***************************************************************/ /* Link buttons ***************************************************************/
.link-button { .link-button {
-webkit-box-shadow: none; flex-shadow: none;
background: transparent none; background: transparent none;
border: none; border: none;
color: rgb(17, 85, 204); color: rgb(17, 85, 204);
...@@ -277,7 +277,7 @@ select:enabled:focus { ...@@ -277,7 +277,7 @@ select:enabled:focus {
.checkbox label, .checkbox label,
.radio label { .radio label {
/* Don't expand horizontally: <http://crbug.com/112091>. */ /* Don't expand horizontally: <http://crbug.com/112091>. */
display: -webkit-inline-box; display: inline-flex;
} }
.checkbox label input ~ span, .checkbox label input ~ span,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment