summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/chromeos/chromevox/speech_rules/mathml_store.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/chromeos/chromevox/speech_rules/mathml_store.js')
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/speech_rules/mathml_store.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/speech_rules/mathml_store.js b/chromium/chrome/browser/resources/chromeos/chromevox/speech_rules/mathml_store.js
new file mode 100644
index 00000000000..62fa35e975e
--- /dev/null
+++ b/chromium/chrome/browser/resources/chromeos/chromevox/speech_rules/mathml_store.js
@@ -0,0 +1,44 @@
+// Copyright 2014 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.
+
+/**
+ * @fileoverview Speech rule store for mathml and mathjax trees.
+ */
+
+goog.provide('cvox.MathmlStore');
+
+goog.require('cvox.MathStore');
+
+
+/**
+ * Rule initialization.
+ * @constructor
+ * @extends {cvox.MathStore}
+ */
+cvox.MathmlStore = function() {
+ goog.base(this);
+};
+goog.inherits(cvox.MathmlStore, cvox.MathStore);
+goog.addSingletonGetter(cvox.MathmlStore);
+
+
+/**
+ * Adds a new MathML speech rule.
+ * @param {string} name Rule name which corresponds to the MathML tag name.
+ * @param {string} domain Domain annotation of the rule.
+ * @param {string} rule String version of the speech rule.
+ */
+cvox.MathmlStore.prototype.defineMathmlRule = function(name, domain, rule) {
+ this.defineRule(name, domain, rule, 'self::mathml:' + name);
+};
+
+
+/**
+ * Adds a new MathML speech rule for the default.default domain.
+ * @param {string} name Rule name which corresponds to the MathML tag name.
+ * @param {string} rule String version of the speech rule.
+ */
+cvox.MathmlStore.prototype.defineDefaultMathmlRule = function(name, rule) {
+ this.defineRule(name, 'default.default', rule, 'self::mathml:' + name);
+};