Bug 1859954 - Use XP_DARWIN rather than XP_MACOS in PHC r=glandium
[gecko.git] / devtools / shared / constants.js
blob62381fbb354be37e253eff1d93df7e1e5382643e
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 /**
8  * Constants used in various panels, shared between client and the server.
9  */
11 /* Accessibility Panel ====================================================== */
13 // List of audit types.
14 const AUDIT_TYPE = {
15   CONTRAST: "CONTRAST",
16   KEYBOARD: "KEYBOARD",
17   TEXT_LABEL: "TEXT_LABEL",
20 // Types of issues grouped by audit types.
21 const ISSUE_TYPE = {
22   [AUDIT_TYPE.KEYBOARD]: {
23     // Focusable accessible objects have no semantics.
24     FOCUSABLE_NO_SEMANTICS: "FOCUSABLE_NO_SEMANTICS",
25     // Tab index greater than 0 is provided.
26     FOCUSABLE_POSITIVE_TABINDEX: "FOCUSABLE_POSITIVE_TABINDEX",
27     // Interactive accesible objects do not have an associated action.
28     INTERACTIVE_NO_ACTION: "INTERACTIVE_NO_ACTION",
29     // Interative accessible objcets are not focusable.
30     INTERACTIVE_NOT_FOCUSABLE: "INTERACTIVE_NOT_FOCUSABLE",
31     // Accessible objects can only be interacted with a mouse.
32     MOUSE_INTERACTIVE_ONLY: "MOUSE_INTERACTIVE_ONLY",
33     // Focusable accessible objects have no focus styling.
34     NO_FOCUS_VISIBLE: "NO_FOCUS_VISIBLE",
35   },
36   [AUDIT_TYPE.TEXT_LABEL]: {
37     // <AREA> name is provided via "alt" attribute.
38     AREA_NO_NAME_FROM_ALT: "AREA_NO_NAME_FROM_ALT",
39     // Dialog name is not provided.
40     DIALOG_NO_NAME: "DIALOG_NO_NAME",
41     // Document title is not provided.
42     DOCUMENT_NO_TITLE: "DOCUMENT_NO_TITLE",
43     // <EMBED> name is not provided.
44     EMBED_NO_NAME: "EMBED_NO_NAME",
45     // <FIGURE> name is not provided.
46     FIGURE_NO_NAME: "FIGURE_NO_NAME",
47     // <FIELDSET> name is not provided.
48     FORM_FIELDSET_NO_NAME: "FORM_FIELDSET_NO_NAME",
49     // <FIELDSET> name is not provided via <LEGEND> element.
50     FORM_FIELDSET_NO_NAME_FROM_LEGEND: "FORM_FIELDSET_NO_NAME_FROM_LEGEND",
51     // Form element's name is not provided.
52     FORM_NO_NAME: "FORM_NO_NAME",
53     // Form element's name is not visible.
54     FORM_NO_VISIBLE_NAME: "FORM_NO_VISIBLE_NAME",
55     // <OPTGROUP> name is not provided via "label" attribute.
56     FORM_OPTGROUP_NO_NAME_FROM_LABEL: "FORM_OPTGROUP_NO_NAME_FROM_LABEL",
57     // <FRAME> name is not provided.
58     FRAME_NO_NAME: "FRAME_NO_NAME",
59     // <H{1, 2, ...}> has no content.
60     HEADING_NO_CONTENT: "HEADING_NO_CONTENT",
61     // <H{1, 2, ...}> name is not provided.
62     HEADING_NO_NAME: "HEADING_NO_NAME",
63     // <IFRAME> name is not provided via "title" attribute.
64     IFRAME_NO_NAME_FROM_TITLE: "IFRAME_NO_NAME_FROM_TITLE",
65     // <IMG> name is not provided (including empty name).
66     IMAGE_NO_NAME: "IMAGE_NO_NAME",
67     // Interactive element's name is not provided.
68     INTERACTIVE_NO_NAME: "INTERACTIVE_NO_NAME",
69     // <MGLYPH> name is no provided.
70     MATHML_GLYPH_NO_NAME: "MATHML_GLYPH_NO_NAME",
71     // Toolbar's name is not provided when more than one toolbar is present.
72     TOOLBAR_NO_NAME: "TOOLBAR_NO_NAME",
73   },
76 // Constants associated with WCAG guidelines score system.
77 const SCORES = {
78   // Satisfies WCAG AA guidelines.
79   AA: "AA",
80   // Satisfies WCAG AAA guidelines.
81   AAA: "AAA",
82   // Elevates accessibility experience.
83   BEST_PRACTICES: "BEST_PRACTICES",
84   // Does not satisfy the baseline WCAG guidelines.
85   FAIL: "FAIL",
86   // Partially satisfies the WCAG AA guidelines.
87   WARNING: "WARNING",
90 // List of simulation types.
91 const SIMULATION_TYPE = {
92   // No red color blindness
93   PROTANOPIA: "PROTANOPIA",
94   // No green color blindness
95   DEUTERANOPIA: "DEUTERANOPIA",
96   // No blue color blindness
97   TRITANOPIA: "TRITANOPIA",
98   // Absense of color vision
99   ACHROMATOPSIA: "ACHROMATOPSIA",
100   // Low contrast
101   CONTRAST_LOSS: "CONTRAST_LOSS",
104 /* Compatibility Panel ====================================================== */
106 const COMPATIBILITY_ISSUE_TYPE = {
107   CSS_PROPERTY: "CSS_PROPERTY",
108   CSS_PROPERTY_ALIASES: "CSS_PROPERTY_ALIASES",
111 /* Style Editor ============================================================= */
113 // The PageStyle actor flattens the DOM CSS objects a little bit, merging
114 // Rules and their Styles into one actor.  For elements (which have a style
115 // but no associated rule) we fake a rule with the following style id.
116 // This `id` is intended to be used instead of a regular CSSRule Type constant.
117 // See https://developer.mozilla.org/en-US/docs/Web/API/CSSRule#Type_constants
118 const ELEMENT_STYLE = 100;
120 /* WebConsole Panel ========================================================= */
122 const MESSAGE_CATEGORY = {
123   CSS_PARSER: "CSS Parser",
126 /* Debugger ============================================================= */
128 // Map protocol pause "why" reason to a valid L10N key (in devtools/shared/locales/en-US/debugger-paused-reasons.ftl)
129 const DEBUGGER_PAUSED_REASONS_L10N_MAPPING = {
130   debuggerStatement: "whypaused-debugger-statement",
131   breakpoint: "whypaused-breakpoint",
132   exception: "whypaused-exception",
133   resumeLimit: "whypaused-resume-limit",
134   breakpointConditionThrown: "whypaused-breakpoint-condition-thrown",
135   eventBreakpoint: "whypaused-event-breakpoint",
136   getWatchpoint: "whypaused-get-watchpoint",
137   setWatchpoint: "whypaused-set-watchpoint",
138   mutationBreakpoint: "whypaused-mutation-breakpoint",
139   interrupted: "whypaused-interrupted",
141   // V8
142   DOM: "whypaused-breakpoint",
143   EventListener: "whypaused-pause-on-dom-events",
144   XHR: "whypaused-xhr",
145   promiseRejection: "whypaused-promise-rejection",
146   assert: "whypaused-assert",
147   debugCommand: "whypaused-debug-command",
148   other: "whypaused-other",
151 /* Exports ============================================================= */
153 module.exports = {
154   accessibility: {
155     AUDIT_TYPE,
156     ISSUE_TYPE,
157     SCORES,
158     SIMULATION_TYPE,
159   },
160   COMPATIBILITY_ISSUE_TYPE,
161   DEBUGGER_PAUSED_REASONS_L10N_MAPPING,
162   MESSAGE_CATEGORY,
163   style: {
164     ELEMENT_STYLE,
165   },