diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /devtools/client/accessibility | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/accessibility')
128 files changed, 18559 insertions, 0 deletions
diff --git a/devtools/client/accessibility/accessibility-proxy.js b/devtools/client/accessibility/accessibility-proxy.js new file mode 100644 index 0000000000..287ea44b71 --- /dev/null +++ b/devtools/client/accessibility/accessibility-proxy.js @@ -0,0 +1,595 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +loader.lazyRequireGetter( + this, + "CombinedProgress", + "resource://devtools/client/accessibility/utils/audit.js", + true +); + +const { + accessibility: { AUDIT_TYPE }, +} = require("resource://devtools/shared/constants.js"); +const { + FILTERS, +} = require("resource://devtools/client/accessibility/constants.js"); + +/** + * Component responsible for tracking all Accessibility fronts in parent and + * content processes. + */ +class AccessibilityProxy { + #panel; + constructor(commands, panel) { + this.commands = commands; + this.#panel = panel; + + this._accessibilityWalkerFronts = new Set(); + this.lifecycleEvents = new Map(); + this.accessibilityEvents = new Map(); + this.supports = {}; + + this.audit = this.audit.bind(this); + this.enableAccessibility = this.enableAccessibility.bind(this); + this.getAccessibilityTreeRoot = this.getAccessibilityTreeRoot.bind(this); + this.resetAccessiblity = this.resetAccessiblity.bind(this); + this.startListeningForAccessibilityEvents = + this.startListeningForAccessibilityEvents.bind(this); + this.startListeningForLifecycleEvents = + this.startListeningForLifecycleEvents.bind(this); + this.startListeningForParentLifecycleEvents = + this.startListeningForParentLifecycleEvents.bind(this); + this.stopListeningForAccessibilityEvents = + this.stopListeningForAccessibilityEvents.bind(this); + this.stopListeningForLifecycleEvents = + this.stopListeningForLifecycleEvents.bind(this); + this.stopListeningForParentLifecycleEvents = + this.stopListeningForParentLifecycleEvents.bind(this); + this.highlightAccessible = this.highlightAccessible.bind(this); + this.unhighlightAccessible = this.unhighlightAccessible.bind(this); + this.onTargetAvailable = this.onTargetAvailable.bind(this); + this.onTargetDestroyed = this.onTargetDestroyed.bind(this); + this.onTargetSelected = this.onTargetSelected.bind(this); + this.onResourceAvailable = this.onResourceAvailable.bind(this); + this.onAccessibilityFrontAvailable = + this.onAccessibilityFrontAvailable.bind(this); + this.onAccessibilityFrontDestroyed = + this.onAccessibilityFrontDestroyed.bind(this); + this.onAccessibleWalkerFrontAvailable = + this.onAccessibleWalkerFrontAvailable.bind(this); + this.onAccessibleWalkerFrontDestroyed = + this.onAccessibleWalkerFrontDestroyed.bind(this); + this.unhighlightBeforeCalling = this.unhighlightBeforeCalling.bind(this); + this.toggleDisplayTabbingOrder = this.toggleDisplayTabbingOrder.bind(this); + } + + get enabled() { + return this.accessibilityFront && this.accessibilityFront.enabled; + } + + /** + * Indicates whether the accessibility service is enabled. + */ + get canBeEnabled() { + return this.parentAccessibilityFront.canBeEnabled; + } + + get currentTarget() { + return this.commands.targetCommand.selectedTargetFront; + } + + /** + * Perform an audit for a given filter. + * + * @param {String} filter + * Type of an audit to perform. + * @param {Function} onProgress + * Audit progress callback. + * + * @return {Promise} + * Resolves when the audit for every document, that each of the frame + * accessibility walkers traverse, completes. + */ + async audit(filter, onProgress) { + const types = filter === FILTERS.ALL ? Object.values(AUDIT_TYPE) : [filter]; + + const targetTypes = [this.commands.targetCommand.TYPES.FRAME]; + const targets = + await this.commands.targetCommand.getAllTargetsInSelectedTargetTree( + targetTypes + ); + + const progress = new CombinedProgress({ + onProgress, + totalFrames: targets.length, + }); + const audits = await this.withAllAccessibilityWalkerFronts( + async accessibleWalkerFront => + accessibleWalkerFront.audit({ + types, + onProgress: progress.onProgressForWalker.bind( + progress, + accessibleWalkerFront + ), + // If a frame was selected in the iframe picker, we don't want to retrieve the + // ancestries at it would mess with the tree structure and would make it misbehave. + retrieveAncestries: + this.commands.targetCommand.isTopLevelTargetSelected(), + }) + ); + + // Accumulate all audits into a single structure. + const combinedAudit = { ancestries: [] }; + for (const audit of audits) { + // If any of the audits resulted in an error, no need to continue. + if (audit.error) { + return audit; + } + + combinedAudit.ancestries.push(...audit.ancestries); + } + + return combinedAudit; + } + + async toggleDisplayTabbingOrder(displayTabbingOrder) { + if (displayTabbingOrder) { + const { walker: domWalkerFront } = await this.currentTarget.getFront( + "inspector" + ); + await this.accessibilityFront.accessibleWalkerFront.showTabbingOrder( + await domWalkerFront.getRootNode(), + 0 + ); + } else { + // we don't want to use withAllAccessibilityWalkerFronts as it only acts on selected + // target tree, and we want to hide _all_ highlighters. + const accessibilityFronts = + await this.commands.targetCommand.getAllFronts( + [this.commands.targetCommand.TYPES.FRAME], + "accessibility" + ); + await Promise.all( + accessibilityFronts.map(accessibilityFront => + accessibilityFront.accessibleWalkerFront.hideTabbingOrder() + ) + ); + } + } + + async enableAccessibility() { + // Accessibility service is initialized using the parent accessibility + // front. That, in turn, initializes accessibility service in all content + // processes. We need to wait until that happens to be sure platform + // accessibility is fully enabled. + const enabled = this.accessibilityFront.once("init"); + await this.parentAccessibilityFront.enable(); + await enabled; + } + + /** + * Return the topmost level accessibility walker to be used as the root of + * the accessibility tree view. + * + * @return {Object} + * Topmost accessibility walker. + */ + getAccessibilityTreeRoot() { + return this.accessibilityFront.accessibleWalkerFront; + } + + /** + * Look up accessibility fronts (get an existing one or create a new one) for + * all existing target fronts and run a task with each one of them. + * @param {Function} task + * Function to execute with each accessiblity front. + */ + async withAllAccessibilityFronts(taskFn) { + const accessibilityFronts = await this.commands.targetCommand.getAllFronts( + [this.commands.targetCommand.TYPES.FRAME], + "accessibility", + { + // only get the fronts for the selected frame tree, in case a specific document + // is selected in the iframe picker (if not, the top-level target is considered + // as the selected target) + onlyInSelectedTargetTree: true, + } + ); + const tasks = []; + for (const accessibilityFront of accessibilityFronts) { + tasks.push(taskFn(accessibilityFront)); + } + + return Promise.all(tasks); + } + + /** + * Look up accessibility walker fronts (get an existing one or create a new + * one using accessibility front) for all existing target fronts and run a + * task with each one of them. + * @param {Function} task + * Function to execute with each accessiblity walker front. + */ + withAllAccessibilityWalkerFronts(taskFn) { + return this.withAllAccessibilityFronts(async accessibilityFront => + taskFn(accessibilityFront.accessibleWalkerFront) + ); + } + + /** + * Unhighlight previous accessible object if we switched between processes and + * call the appropriate event handler. + */ + unhighlightBeforeCalling(listener) { + return async accessible => { + if (accessible) { + const accessibleWalkerFront = accessible.getParent(); + if (this._currentAccessibleWalkerFront !== accessibleWalkerFront) { + if (this._currentAccessibleWalkerFront) { + await this._currentAccessibleWalkerFront.unhighlight(); + } + + this._currentAccessibleWalkerFront = accessibleWalkerFront; + } + } + + await listener(accessible); + }; + } + + /** + * Start picking and add walker listeners. + * @param {Boolean} doFocus + * If true, move keyboard focus into content. + */ + pick(doFocus, onHovered, onPicked, onPreviewed, onCanceled) { + return this.withAllAccessibilityWalkerFronts( + async accessibleWalkerFront => { + this.startListening(accessibleWalkerFront, { + events: { + "picker-accessible-hovered": + this.unhighlightBeforeCalling(onHovered), + "picker-accessible-picked": this.unhighlightBeforeCalling(onPicked), + "picker-accessible-previewed": + this.unhighlightBeforeCalling(onPreviewed), + "picker-accessible-canceled": + this.unhighlightBeforeCalling(onCanceled), + }, + // Only register listeners once (for top level), no need to register + // them for all walkers again and again. + register: accessibleWalkerFront.targetFront.isTopLevel, + }); + await accessibleWalkerFront.pick( + // Only pass doFocus to the top level accessibility walker front. + doFocus && accessibleWalkerFront.targetFront.isTopLevel + ); + } + ); + } + + /** + * Stop picking and remove all walker listeners. + */ + async cancelPick() { + this._currentAccessibleWalkerFront = null; + return this.withAllAccessibilityWalkerFronts( + async accessibleWalkerFront => { + await accessibleWalkerFront.cancelPick(); + this.stopListening(accessibleWalkerFront, { + events: { + "picker-accessible-hovered": null, + "picker-accessible-picked": null, + "picker-accessible-previewed": null, + "picker-accessible-canceled": null, + }, + // Only unregister listeners once (for top level), no need to + // unregister them for all walkers again and again. + unregister: accessibleWalkerFront.targetFront.isTopLevel, + }); + } + ); + } + + async resetAccessiblity() { + const { enabled } = this.accessibilityFront; + const { canBeEnabled, canBeDisabled } = this.parentAccessibilityFront; + return { enabled, canBeDisabled, canBeEnabled }; + } + + startListening(front, { events, register = false } = {}) { + for (const [type, listener] of Object.entries(events)) { + front.on(type, listener); + if (register) { + this.registerEvent(front, type, listener); + } + } + } + + stopListening(front, { events, unregister = false } = {}) { + for (const [type, listener] of Object.entries(events)) { + front.off(type, listener); + if (unregister) { + this.unregisterEvent(front, type, listener); + } + } + } + + startListeningForAccessibilityEvents(events) { + for (const accessibleWalkerFront of this._accessibilityWalkerFronts.values()) { + this.startListening(accessibleWalkerFront, { + events, + // Only register listeners once (for top level), no need to register + // them for all walkers again and again. + register: accessibleWalkerFront.targetFront.isTopLevel, + }); + } + } + + stopListeningForAccessibilityEvents(events) { + for (const accessibleWalkerFront of this._accessibilityWalkerFronts.values()) { + this.stopListening(accessibleWalkerFront, { + events, + // Only unregister listeners once (for top level), no need to unregister + // them for all walkers again and again. + unregister: accessibleWalkerFront.targetFront.isTopLevel, + }); + } + } + + startListeningForLifecycleEvents(events) { + this.startListening(this.accessibilityFront, { events, register: true }); + } + + stopListeningForLifecycleEvents(events) { + this.stopListening(this.accessibilityFront, { events, unregister: true }); + } + + startListeningForParentLifecycleEvents(events) { + this.startListening(this.parentAccessibilityFront, { + events, + register: false, + }); + } + + stopListeningForParentLifecycleEvents(events) { + this.stopListening(this.parentAccessibilityFront, { + events, + unregister: false, + }); + } + + highlightAccessible(accessibleFront, options) { + if (!accessibleFront) { + return; + } + + const accessibleWalkerFront = accessibleFront.getParent(); + if (!accessibleWalkerFront) { + return; + } + + accessibleWalkerFront + .highlightAccessible(accessibleFront, options) + .catch(error => { + // Only report an error where there's still a commands instance. + // Ignore cases where toolbox is already destroyed. + if (this.commands) { + console.error(error); + } + }); + } + + unhighlightAccessible(accessibleFront) { + if (!accessibleFront) { + return; + } + + const accessibleWalkerFront = accessibleFront.getParent(); + if (!accessibleWalkerFront) { + return; + } + + accessibleWalkerFront.unhighlight().catch(error => { + // Only report an error where there's still a commands instance. + // Ignore cases where toolbox is already destroyed. + if (this.commands) { + console.error(error); + } + }); + } + + async initialize() { + await this.commands.targetCommand.watchTargets({ + types: [this.commands.targetCommand.TYPES.FRAME], + onAvailable: this.onTargetAvailable, + onSelected: this.onTargetSelected, + onDestroyed: this.onTargetDestroyed, + }); + await this.commands.resourceCommand.watchResources( + [this.commands.resourceCommand.TYPES.DOCUMENT_EVENT], + { + onAvailable: this.onResourceAvailable, + } + ); + this.parentAccessibilityFront = + await this.commands.targetCommand.rootFront.getFront( + "parentaccessibility" + ); + } + + destroy() { + this.commands.targetCommand.unwatchTargets({ + types: [this.commands.targetCommand.TYPES.FRAME], + onAvailable: this.onTargetAvailable, + onSelected: this.onTargetSelected, + onDestroyed: this.onTargetDestroyed, + }); + this.commands.resourceCommand.unwatchResources( + [this.commands.resourceCommand.TYPES.DOCUMENT_EVENT], + { onAvailable: this.onResourceAvailable } + ); + + this.lifecycleEvents.clear(); + this.accessibilityEvents.clear(); + + this.accessibilityFront = null; + this.accessibilityFrontGetPromise = null; + this.parentAccessibilityFront = null; + this.simulatorFront = null; + this.simulate = null; + this.commands = null; + } + + _getEvents(front) { + return front.typeName === "accessiblewalker" + ? this.accessibilityEvents + : this.lifecycleEvents; + } + + registerEvent(front, type, listener) { + const events = this._getEvents(front); + if (events.has(type)) { + events.get(type).add(listener); + } else { + events.set(type, new Set([listener])); + } + } + + unregisterEvent(front, type, listener) { + const events = this._getEvents(front); + if (!events.has(type)) { + return; + } + + if (!listener) { + events.delete(type); + return; + } + + const listeners = events.get(type); + if (listeners.has(listener)) { + listeners.delete(listener); + } + + if (!listeners.size) { + events.delete(type); + } + } + + onAccessibilityFrontAvailable(accessibilityFront) { + accessibilityFront.watchFronts( + "accessiblewalker", + this.onAccessibleWalkerFrontAvailable, + this.onAccessibleWalkerFrontDestroyed + ); + } + + onAccessibilityFrontDestroyed(accessibilityFront) { + accessibilityFront.unwatchFronts( + "accessiblewalker", + this.onAccessibleWalkerFrontAvailable, + this.onAccessibleWalkerFrontDestroyed + ); + } + + onAccessibleWalkerFrontAvailable(accessibleWalkerFront) { + this._accessibilityWalkerFronts.add(accessibleWalkerFront); + // Apply all existing accessible walker front event listeners to the new + // front. + for (const [type, listeners] of this.accessibilityEvents.entries()) { + for (const listener of listeners) { + accessibleWalkerFront.on(type, listener); + } + } + } + + onAccessibleWalkerFrontDestroyed(accessibleWalkerFront) { + this._accessibilityWalkerFronts.delete(accessibleWalkerFront); + // Remove all existing accessible walker front event listeners from the + // destroyed front. + for (const [type, listeners] of this.accessibilityEvents.entries()) { + for (const listener of listeners) { + accessibleWalkerFront.off(type, listener); + } + } + } + + async onTargetAvailable({ targetFront, isTargetSwitching }) { + targetFront.watchFronts( + "accessibility", + this.onAccessibilityFrontAvailable, + this.onAccessibilityFrontDestroyed + ); + + if (!targetFront.isTopLevel) { + return; + } + + this._accessibilityWalkerFronts.clear(); + + this.accessibilityFrontGetPromise = targetFront.getFront("accessibility"); + this.accessibilityFront = await this.accessibilityFrontGetPromise; + + // Check for backward compatibility. New API's must be described in the + // "getTraits" method of the AccessibilityActor. + this.supports = { ...this.accessibilityFront.traits }; + + this.simulatorFront = this.accessibilityFront.simulatorFront; + if (this.simulatorFront) { + this.simulate = types => this.simulatorFront.simulate({ types }); + } else { + this.simulate = null; + } + + // Move accessibility front lifecycle event listeners to a new top level + // front. + for (const [type, listeners] of this.lifecycleEvents.entries()) { + for (const listener of listeners.values()) { + this.accessibilityFront.on(type, listener); + } + } + } + + async onTargetDestroyed({ targetFront }) { + targetFront.unwatchFronts( + "accessibility", + this.onAccessibilityFrontAvailable, + this.onAccessibilityFrontDestroyed + ); + } + + async onTargetSelected({ targetFront }) { + await this.toggleDisplayTabbingOrder(false); + this.accessibilityFront = await targetFront.getFront("accessibility"); + + this.simulatorFront = this.accessibilityFront.simulatorFront; + if (this.simulatorFront) { + this.simulate = types => this.simulatorFront.simulate({ types }); + } else { + this.simulate = null; + } + + this.#panel.shouldRefresh = true; + this.#panel.refresh(); + } + + onResourceAvailable(resources) { + for (const resource of resources) { + // Only consider top level document, and ignore remote iframes top document + if ( + resource.resourceType === + this.commands.resourceCommand.TYPES.DOCUMENT_EVENT && + resource.name === "dom-complete" && + resource.targetFront.isTopLevel + ) { + this.#panel.forceRefresh(); + } + } + } +} + +exports.AccessibilityProxy = AccessibilityProxy; diff --git a/devtools/client/accessibility/accessibility-view.js b/devtools/client/accessibility/accessibility-view.js new file mode 100644 index 0000000000..36b5aa9e6e --- /dev/null +++ b/devtools/client/accessibility/accessibility-view.js @@ -0,0 +1,260 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +/* global EVENTS */ + +const nodeConstants = require("resource://devtools/shared/dom-node-constants.js"); + +// React & Redux +const { + createFactory, + createElement, +} = require("resource://devtools/client/shared/vendor/react.js"); +const ReactDOM = require("resource://devtools/client/shared/vendor/react-dom.js"); +const { + Provider, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); + +// Accessibility Panel +const MainFrame = createFactory( + require("resource://devtools/client/accessibility/components/MainFrame.js") +); + +// Store +const createStore = require("resource://devtools/client/shared/redux/create-store.js"); + +// Reducers +const { + reducers, +} = require("resource://devtools/client/accessibility/reducers/index.js"); +const thunkOptions = { options: {} }; +const store = createStore(reducers, { + // Thunk options will be updated, when we [re]initialize the accessibility + // view. + thunkOptions, +}); + +// Actions +const { + reset, +} = require("resource://devtools/client/accessibility/actions/ui.js"); +const { + select, + highlight, +} = require("resource://devtools/client/accessibility/actions/accessibles.js"); + +/** + * This object represents view of the Accessibility panel and is responsible + * for rendering the content. It renders the top level ReactJS + * component: the MainFrame. + */ +function AccessibilityView(localStore) { + addEventListener("devtools/chrome/message", this.onMessage.bind(this), true); + this.store = localStore; +} + +AccessibilityView.prototype = { + /** + * Initialize accessibility view, create its top level component and set the + * data store. + * + * @param {Object} + * Object that contains the following properties: + * - supports {JSON} + * a collection of flags indicating + * which accessibility panel features + * are supported by the current + * serverside version. + * - fluentBundles {Array} + * array of FluentBundles elements + * for localization + * - toolbox {Object} + * devtools toolbox. + * - getAccessibilityTreeRoot {Function} + * Returns the topmost accessibiliity + * walker that is used as the root of + * the accessibility tree. + * - startListeningForAccessibilityEvents {Function} + * Add listeners for specific + * accessibility events. + * - stopListeningForAccessibilityEvents {Function} + * Remove listeners for specific + * accessibility events. + * - audit {Function} + * Audit function that will start + * accessibility audit for given types + * of accessibility issues. + * - simulate {null|Function} + * Apply simulation of a given type + * (by setting color matrices in + * docShell). + * - toggleDisplayTabbingOrder {Function} + * Toggle the highlight of focusable + * elements along with their tabbing + * index. + * - enableAccessibility {Function} + * Enable accessibility services. + * - resetAccessiblity {Function} + * Reset the state of the + * accessibility services. + * - startListeningForLifecycleEvents {Function} + * Add listeners for accessibility + * service lifecycle events. + * - stopListeningForLifecycleEvents {Function} + * Remove listeners for accessibility + * service lifecycle events. + * - startListeningForParentLifecycleEvents {Function} + * Add listeners for parent process + * accessibility service lifecycle + * events. + * - stopListeningForParentLifecycleEvents {Function} + * Remove listeners for parent + * process accessibility service + * lifecycle events. + * - highlightAccessible {Function} + * Highlight accessible object. + * - unhighlightAccessible {Function} + * Unhighlight accessible object. + */ + async initialize({ + supports, + fluentBundles, + toolbox, + getAccessibilityTreeRoot, + startListeningForAccessibilityEvents, + stopListeningForAccessibilityEvents, + audit, + simulate, + toggleDisplayTabbingOrder, + enableAccessibility, + resetAccessiblity, + startListeningForLifecycleEvents, + stopListeningForLifecycleEvents, + startListeningForParentLifecycleEvents, + stopListeningForParentLifecycleEvents, + highlightAccessible, + unhighlightAccessible, + }) { + // Make sure state is reset every time accessibility panel is initialized. + await this.store.dispatch(reset(resetAccessiblity, supports)); + const container = document.getElementById("content"); + const mainFrame = MainFrame({ + fluentBundles, + toolbox, + getAccessibilityTreeRoot, + startListeningForAccessibilityEvents, + stopListeningForAccessibilityEvents, + audit, + simulate, + enableAccessibility, + resetAccessiblity, + startListeningForLifecycleEvents, + stopListeningForLifecycleEvents, + startListeningForParentLifecycleEvents, + stopListeningForParentLifecycleEvents, + highlightAccessible, + unhighlightAccessible, + }); + thunkOptions.options.toggleDisplayTabbingOrder = toggleDisplayTabbingOrder; + // Render top level component + const provider = createElement(Provider, { store: this.store }, mainFrame); + window.once(EVENTS.PROPERTIES_UPDATED).then(() => { + window.emit(EVENTS.INITIALIZED); + }); + this.mainFrame = ReactDOM.render(provider, container); + }, + + destroy() { + const container = document.getElementById("content"); + ReactDOM.unmountComponentAtNode(container); + }, + + async selectAccessible(accessible) { + await this.store.dispatch(select(accessible)); + window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED); + }, + + async highlightAccessible(accessible) { + await this.store.dispatch(highlight(accessible)); + window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_HIGHLIGHTED); + }, + + async selectNodeAccessible(node) { + if (!node) { + return; + } + + const accessibilityFront = await node.targetFront.getFront("accessibility"); + const accessibleWalkerFront = await accessibilityFront.getWalker(); + let accessible = await accessibleWalkerFront.getAccessibleFor(node); + if (accessible) { + await accessible.hydrate(); + } + + // If node does not have an accessible object, try to find node's child text node and + // try to retrieve an accessible object for that child instead. This is the best + // effort approach until there's accessibility API to retrieve accessible object at + // point. + if (!accessible || accessible.indexInParent < 0) { + const { nodes: children } = await node.walkerFront.children(node); + for (const child of children) { + if (child.nodeType === nodeConstants.TEXT_NODE) { + accessible = await accessibleWalkerFront.getAccessibleFor(child); + // indexInParent property is only available with additional request + // for data (hydration) about the accessible object. + if (accessible) { + await accessible.hydrate(); + if (accessible.indexInParent >= 0) { + break; + } + } + } + } + } + + // Attempt to find closest accessible ancestor for a given node. + if (!accessible || accessible.indexInParent < 0) { + let parentNode = node.parentNode(); + while (parentNode) { + accessible = await accessibleWalkerFront.getAccessibleFor(parentNode); + if (accessible) { + await accessible.hydrate(); + if (accessible.indexInParent >= 0) { + break; + } + } + + parentNode = parentNode.parentNode(); + } + } + + // Do not set the selected state if there is no corresponding accessible. + if (!accessible) { + console.warn( + `No accessible object found for a node or a node in its ancestry: ${node.actorID}` + ); + return; + } + + await this.store.dispatch(select(accessible)); + window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED); + }, + + /** + * Process message from accessibility panel. + * + * @param {Object} event message type and data. + */ + onMessage(event) { + const data = event.data; + const method = data.type; + + if (typeof this[method] === "function") { + this[method](...data.args); + } + }, +}; + +window.view = new AccessibilityView(store); diff --git a/devtools/client/accessibility/accessibility.css b/devtools/client/accessibility/accessibility.css new file mode 100644 index 0000000000..efb627a80c --- /dev/null +++ b/devtools/client/accessibility/accessibility.css @@ -0,0 +1,851 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +:root { + --accessibility-font-size: 12px; + --accessibility-toolbar-height-tall: 35px; + --accessibility-toolbar-focus: var(--blue-50); + --accessibility-toolbar-focus-alpha30: rgba(10, 132, 255, 0.3); + --accessibility-full-length-minus-splitter: calc(100% - 1px); + --accessibility-horizontal-padding: 5px; + --accessibility-horizontal-indent: 20px; + --accessibility-properties-item-width: calc(100% - var(--accessibility-horizontal-indent)); + /* The main content can use the full height minus the height of the toolbar + (including 1px border bottom) */ + --accessibility-main-height: calc(100vh - var(--theme-toolbar-height) - 1px); + /* The tree can use the main content height minus the height of the tree + header, which has the same height as the toolbar and a 1px border bottom */ + --accessibility-tree-height: calc(var(--accessibility-main-height) - var(--theme-toolbar-height) - 1px); + --accessibility-arrow-horizontal-padding: 4px; + --accessibility-tree-row-height: 21px; + --accessibility-unfocused-tree-focused-node-background: var(--grey-20); + --accessibility-unfocused-tree-focused-node-twisty-fill: var(--theme-icon-dimmed-color); + --accessibility-link-color: var(--blue-60); + --accessibility-link-color-active: var(--blue-70); + --accessibility-body-background-a90: rgba(255, 255, 255, 0.9); + --accessibility-code-background: var(--grey-20); +} + +:root.theme-dark { + --accessibility-unfocused-tree-focused-node-background: var(--grey-70); + --accessibility-unfocused-tree-focused-node-twisty-fill: var(--theme-selection-color); + --accessibility-link-color: var(--theme-highlight-blue); + --accessibility-link-color-active: var(--blue-40); + --accessibility-body-background-a90: rgba(42, 42, 46, 0.9); + --accessibility-code-background: var(--grey-70); +} + +/* General */ +html, +body { + height: 100%; + margin: 0; + padding: 0; + width: 100%; +} + +:root .flash-out { + animation: flash-out 0.5s ease-out; +} + +:root { + --theme-popup-border-radius: 0px; +} +:root[platform="mac"] { + --theme-popup-border-radius: 3.5px; +} + +@keyframes flash-out { + from { + background: var(--theme-contrast-background); + } +} + +.accessible .tree .node .theme-twisty { + width: var(--accessibility-horizontal-indent); +} + +.accessible .tree .node .theme-twisty:not(.open):dir(rtl) { + transform: rotate(-90deg); +} + +.accessible .tree .node.focused .theme-twisty, +.treeTable .treeRow.selected .theme-twisty { + fill: var(--theme-selection-color); +} + +.mainFrame { + height: 100%; + color: var(--theme-toolbar-color); +} + +.main-panel { + /* To compenstate for 1px splitter between the tree and sidebar. */ + width: var(--accessibility-full-length-minus-splitter); +} + +.devtools-button, +.toggle-button { + cursor: pointer; + border: 1px solid transparent; +} + +.mainFrame .devtools-button.devtools-throbber::before, +.mainFrame .toggle-button.devtools-throbber::before { + /* Default for .devtools-throbber is set to 1em which is too big for the + devtools toolbar. */ + height: 8px; + width: 8px; + margin-block-end: 1px; + margin-inline-end: 2px; +} + +.split-box.horz { + height: var(--accessibility-main-height); +} + +.mainFrame .devtools-button, +.description .devtools-button { + padding: unset; +} + +.mainFrame .devtools-button > .btn-content { + padding: 2px var(--accessibility-horizontal-padding); +} + +.description .devtools-button > .btn-content { + padding: 7px var(--accessibility-horizontal-padding); +} + +.devtools-button:focus, +.devtools-button > .btn-content:focus, +.devtools-button::-moz-focus-inner { + outline: none; +} + +.devtools-button:focus > .btn-content:not(.devtools-throbber) { + outline: 2px solid var(--accessibility-toolbar-focus); + outline-offset: -2px; + box-shadow: 0 0 0 2px var(--accessibility-toolbar-focus-alpha30); + border-radius: 2px; +} + +.devtools-toolbar { + display: flex; + align-items: center; + font: message-box; + font-size: var(--accessibility-font-size); +} + +/* Similarly to webconsole, add more padding before the toolbar group. */ +.devtools-toolbar .devtools-separator { + margin-inline: 5px; +} + +.devtools-toolbar .accessibility-tree-filters, +.devtools-toolbar .accessibility-simulation { + margin-inline-start: 4px; + display: flex; + flex-wrap: nowrap; + flex-direction: row; + align-items: center; + white-space: nowrap; +} + +.devtools-toolbar .toolbar-menu-button { + border-color: transparent; + padding: 0 3px; +} + +.devtools-toolbar .toolbar-menu-button.filters { + max-width: 100px; +} + +.devtools-toolbar .toolbar-menu-button.simulation { + max-width: 200px; +} + +.devtools-toolbar .toolbar-menu-button.filters, +.devtools-toolbar .toolbar-menu-button.simulation { + text-overflow: ellipsis; + overflow-x: hidden; + margin-inline-start: 3px; +} + +.devtools-toolbar .toolbar-menu-button::after, +.devtools-toolbar .toolbar-menu-button.simulation::before { + content: ""; + display: inline-block; + -moz-context-properties: fill; + fill: currentColor; + margin-inline-start: 3px; +} + +.devtools-toolbar .toolbar-menu-button.filters::after, +.devtools-toolbar .toolbar-menu-button.simulation::after { + background: url("chrome://devtools/skin/images/select-arrow.svg") no-repeat; + width: 8px; + height: 8px; +} + +.devtools-toolbar .toolbar-menu-button.prefs { + background-color: transparent; + height: 18px; + padding: 0; + margin-inline-start: auto; + margin-inline-end: 3px; +} + +.devtools-toolbar .toolbar-menu-button.prefs:active:hover { + background-color: var(--theme-selection-background-hover); +} + +.devtools-toolbar .toolbar-menu-button.prefs::after { + display: none; +} + +.devtools-toolbar .toolbar-menu-button.prefs::before { + background: url("chrome://devtools/skin/images/settings.svg") no-repeat; + width: 14px; + height: 14px; + background-size: contain; + margin: 0px 1px; + vertical-align: text-bottom; +} + +.devtools-toolbar .badge.toggle-button[disabled], +.tooltip-container .menuitem > .command[disabled] { + opacity: 0.5; +} + +:root .theme-body .tooltip-container.tooltip-visible[type="doorhanger"] > .tooltip-panel, +:root .theme-body .tooltip-container.tooltip-visible[type="doorhanger"] > .tooltip-arrow::before { + border: 1px solid var(--theme-popup-border-color); + border-radius: var(--theme-popup-border-radius); + box-shadow: 0 0 4px hsla(210,4%,10%,.2); +} + +.tooltip-container .menuitem > .command[role="link"] { + appearance: none; + border: none; + color: var(--theme-arrowpanel-color); + background-color: transparent; + text-align: start; + width: 100%; +} + +.devtools-toolbar .beta { + color: var(--theme-highlight-blue); + font-size: 80%; + font-weight: 500; + margin-inline-end: 3px; + margin-inline-start: 4px; +} + +#audit-progress-container { + position: fixed; + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + height: 100%; + z-index: 9999; + background: var(--accessibility-body-background-a90); + padding-block-start: 30vh; + font: message-box; + font-size: 12px; + font-style: italic; +} + +.audit-progress-progressbar { + width: 30vw; +} + +/* Description */ +.description { + color: var(--theme-toolbar-color); + font: message-box; + font-size: calc(var(--accessibility-font-size) + 1px); + margin: auto; + padding-top: 15vh; + width: 50vw; +} + +/* To ensure that the message does not look squished in vertical mode, increase its width + when the toolbox is narrow */ +@media (max-width: 700px) { + .description { + width: 80vw; + } +} + +.description .general { + display: flex; + align-items: center; + margin-bottom: 1em; +} + +.description img { + margin-inline-end: 12px; + flex-basis: 42px; + height: 42px; + flex-shrink: 0; + -moz-context-properties: fill; + fill: var(--grey-40); +} + +.description .devtools-button { + display: flex; + align-items: center; + margin: auto; +} + +.description .link, +.accessibility-check-annotation .link { + color: var(--accessibility-link-color); + cursor: pointer; + outline: 0; +} + +.description .link:hover:not(:focus), +.accessibility-check-annotation .link:hover:not(:focus) { + text-decoration: underline; +} + +.description .link:focus:not(:active), +.accessibility-check-annotation .link:focus:not(:active) { + box-shadow: 0 0 0 2px var(--accessibility-toolbar-focus), 0 0 0 4px var(--accessibility-toolbar-focus-alpha30); + border-radius: 2px; +} + +.description .link:active, +.accessibility-check-annotation .link:active { + color: var(--accessibility-link-color-active); + text-decoration: underline; +} + +/* TreeView Customization */ +.treeTable thead, .treeTable tbody { + display: block; +} + +.treeTable tr { + width: 100%; + display: table; +} + +.treeTable tbody { + overflow-y: auto; +} + +.split-box:not(.horz) .treeTable tbody { + height: var(--accessibility-tree-height); +} + +.split-box.horz .treeTable tbody { + /* Accessibility tree height depends on the height of the controlled panel + (sidebar) when in horz mode and also has an additional separator. */ + height: calc(var(--accessibility-tree-height) - var(--split-box-controlled-panel-size) - 1px); +} + +.treeTable { + width: 100%; +} + +.treeTable .treeRow.highlighted:not(.selected) { + background-color: var(--theme-selection-background-hover); +} + +.treeTable.filtered .treeRow .treeLabelCell { + /* Unset row indentation when the tree is filtered. */ + padding-inline-start: var(--accessibility-arrow-horizontal-padding); +} + +/* When the accesibility tree is filtered, we flatten the tree and want to hide + the expander icon (▶) for expandable tree rows. */ +.treeTable.filtered .treeRow .treeLabelCell .treeIcon { + display: none; +} + +.treeTable .treeLabelCell { + min-width: 50%; +} + +.treeTable:focus, .treeTable tbody:focus { + outline: 0; +} + +.treeTable::-moz-focus-inner { + border: 0; +} + +.treeTable:not(:focus, :focus-within) .treeRow.selected { + background-color: var(--accessibility-unfocused-tree-focused-node-background); +} + +.treeTable:not(:focus, :focus-within) .treeRow.selected .theme-twisty { + fill: var(--accessibility-unfocused-tree-focused-node-twisty-fill); +} + +.treeTable:not(:focus, :focus-within) .treeRow.selected *, +.treeTable:not(:focus, :focus-within) .treeRow.selected .treeLabelCell:after { + color: inherit; +} + +.treeTable:not(:focus, :focus-within) .treeRow.selected .objectBox-string { + color: var(--string-color); +} + +.treeTable > thead { + pointer-events: none; +} + +.treeTable > tbody tr { + height: var(--accessibility-tree-row-height); +} + +.treeTable > tbody td { + user-select: none; +} + +.treeTable > tbody td > span { + user-select: text; +} + +.mainFrame .treeTable .treeRow.hasChildren > .treeLabelCell > .treeLabel:hover { + cursor: unset; + text-decoration: none; +} + +.mainFrame .treeTable .treeHeaderRow > .treeHeaderCell:first-child > .treeHeaderCellBox, +.mainFrame .treeTable .treeHeaderRow > .treeHeaderCell > .treeHeaderCellBox { + padding: 0; + padding-inline-start: var(--accessibility-arrow-horizontal-padding); +} + +.mainFrame .treeTable .treeHeaderCell { + width: 50%; + border-bottom: 1px solid var(--theme-splitter-color); + background: var(--theme-toolbar-background); + font: message-box; + font-size: var(--accessibility-font-size); + height: var(--theme-toolbar-height); + color: var(--theme-toolbar-color); +} + +.badge { + display: inline-block; + font: message-box; + font-size: var(--theme-body-font-size); + border-radius: 3px; + padding: 0px 3px; + margin-inline-start: 5px; + color: var(--badge-color); + background-color: var(--badge-background-color); + border: 1px solid var(--badge-border-color); + user-select: none; +} + +.badge.audit-badge::before { + content: ""; + display: inline-block; + vertical-align: 0px; + width: 9px; + height: 9px; + margin-inline-end: 2px; + -moz-context-properties: fill; + fill: currentColor; + opacity: 0.9; +} + +.badge.audit-badge[data-score="BEST_PRACTICES"]::before { + background-image: url(chrome://devtools/skin/images/info-tiny.svg); + vertical-align: -1px; +} + +.badge.audit-badge[data-score="WARNING"]::before { + background-image: url(chrome://devtools/skin/images/alert-tiny.svg); +} + +.badge.audit-badge[data-score="FAIL"]::before { + background-image: url(chrome://devtools/skin/images/error-tiny.svg); + vertical-align: -1px; +} + +/* improve alignment in high res (where we can use half pixels) */ +@media (min-resolution: 1.5x) { + .badge.audit-badge[data-score="WARNING"]::before { + vertical-align: -0.5px; + } +} + +.badge.toggle-button { + color: var(--theme-body-color); + background-color: var(--badge-interactive-background-color); + border-color: transparent; +} + +.devtools-toolbar .badge.toggle-button:focus, +.devtools-toolbar .toolbar-menu-button:focus { + outline: 2px solid var(--accessibility-toolbar-focus); + outline-offset: -2px; + box-shadow: 0 0 0 2px var(--accessibility-toolbar-focus-alpha30); +} + +.treeTable:focus-within .treeRow.selected .badges .badge { + background-color: var(--badge-active-background-color); + border-color: var(--accessible-active-border-color); + color: var(--theme-selection-color); +} + +.treeTable:not(:focus, :focus-within) .treeRow.selected .badges .badge { + color: var(--badge-color); +} + +.badge.toggle-button.checked { + background-color: var(--badge-active-background-color); + color: var(--theme-selection-color); +} + +/* Avoid having a default dotted border on keyboard focus since we provide focus + styling*/ +.badge.toggle-button::-moz-focus-inner { + border: none; +} + +/* Right Sidebar */ +.right-sidebar { + display: flex; + flex-direction: column; + flex: 1; + overflow-y: auto; + white-space: nowrap; + font: message-box; + font-size: var(--accessibility-font-size); + background-color: var(--theme-sidebar-background); +} + +.split-box:not(.horz) .right-sidebar { + position: fixed; + width: inherit; + height: var(--accessibility-main-height) +} + +/* Tree customization */ +.accessible .tree { + flex: 1; + height: 100%; + white-space: nowrap; + overflow: auto; + display: block; + /* Force the properties list to always be displayed in LTR (bug 1575002) */ + direction: ltr; +} + +.split-box.horz .accessible .tree { + width: 100vw; +} + +.accessible .tree button { + display: block; +} + +/* NOTE: total height of the node (height + padding + border + margin) must + be exactly the same as the value of TREE_ROW_HEIGHT constant in + devtools/client/accessibility/constants.js */ +.accessible .tree .node { + padding: 0 var(--accessibility-horizontal-indent); + position: relative; + display: flex; + height: var(--accessibility-tree-row-height); + width: var(--accessibility-properties-item-width); + cursor: default; + align-items: center; +} + +.accessible .tree:focus { + outline: 0; +} + +.accessible .tree::-moz-focus-inner { + border: 0; +} + +/* Unset tree styles leaking from reps.css */ +.accessible .tree .tree-node:not(.focused):hover { + background-color: transparent; +} + +.accessible .tree:not(:focus) .node.focused { + background-color: var(--accessibility-unfocused-tree-focused-node-background); +} + +.accessible .tree:not(:focus) .node.focused .theme-twisty { + fill: var(--accessibility-unfocused-tree-focused-node-twisty-fill); +} + +.accessible .tree .node:not(.focused):hover { + background-color: var(--theme-selection-background-hover); +} + +.accessible .tree:focus .node.focused, +.accessible .tree .tree-node-active .node.focused { + background-color: var(--theme-selection-background); +} + +.accessible .tree:focus .node.focused *, +.accessible .tree .tree-node-active .node.focused * { + color: var(--theme-selection-color); +} + +/* Invert text selection color in selected rows */ +.accessible .tree:focus .node.focused ::selection, +.accessible .tree .tree-node-active .node.focused ::selection { + color: var(--theme-selection-background); + background-color: var(--theme-selection-color); +} + +.accessible .tree:focus .node.focused .open-inspector, +.accessible .tree .tree-node-active .node.focused .open-inspector { + fill: var(--grey-30); +} + +.accessible .tree:focus .node.focused:hover .open-inspector, +.accessible .tree .tree-node-active .node.focused:hover .open-inspector { + fill: var(--theme-selection-color); +} + +.accessible .tree .tree-node-active .node.focused .open-inspector:focus, +.accessible .tree .tree-node-active .node.focused:hover .open-inspector:focus { + fill: var(--grey-40); +} + +.accessible .tree .arrow { + flex-shrink: 0; +} + +.accessible .tree .object-value { + overflow: hidden; + text-overflow: ellipsis; +} + +.accessible .tree .object-delimiter { + padding-inline-end: var(--accessibility-arrow-horizontal-padding); +} + +.accessible .tree .object-label { + color: var(--theme-highlight-blue); +} + +.accessible .tree .objectBox-accessible .accessible-role { + background-color: var(--badge-background-color); + color: var(--badge-color); + border: 1px solid var(--badge-border-color); + border-radius: 3px; + padding: 0px 2px; + margin-inline-start: 5px; + user-select: none; +} + +.accessible .tree:focus .node.focused .objectBox-accessible .accessible-role, +.accessible .tree .tree-node-active .node.focused .objectBox-accessible .accessible-role { + background-color: var(--badge-active-background-color); + border-color: var(--badge-active-border-color); + color: var(--theme-selection-color); +} + +.accessible .tree:focus .node.focused .open-accessibility-inspector, +.accessible .tree .tree-node-active .node.focused .open-accessibility-inspector { + fill: var(--grey-30); +} + +.accessible .tree:focus .node.focused:hover .open-accessibility-inspector, +.accessible .tree .tree-node-active .node.focused:hover .open-accessibility-inspector { + fill: var(--theme-selection-color); +} + +.accessible .tree .tree-node-active .node.focused .open-accessibility-inspector:focus, +.accessible .tree .tree-node-active .node.focused:hover .open-accessibility-inspector:focus { + fill: var(--grey-40); +} + +.accessible .tree .objectBox-accessible, +.accessible .tree .objectBox-node { + width: 100%; + display: flex; + align-items: center; +} + +.accessible .tree .objectBox-accessible .accessible-name, +.accessible .tree .objectBox-node .attrName { + overflow: hidden; + text-overflow: ellipsis; +} + +.accessible .tree .objectBox-accessible .open-accessibility-inspector, +.accessible .tree .objectBox-node .open-inspector { + width: 17px; + cursor: pointer; + flex-shrink: 0; +} + +.accessible .tree .objectBox-object, +.accessible .tree .objectBox-string, +.accessible .tree .objectBox-text, +.accessible .tree .objectBox-table, +.accessible .tree .objectLink-textNode, +.accessible .tree .objectLink-event, +.accessible .tree .objectLink-eventLog, +.accessible .tree .objectLink-regexp, +.accessible .tree .objectLink-object, +.accessible .tree .objectLink-Date, +.theme-dark .accessible .tree .objectBox-object, +.theme-light .accessible .tree .objectBox-object { + white-space: nowrap; +} + +/* Styling for accessible details panel when accessible is not available */ +.accessible .info { + color: var(--theme-body-color); + font-size: 110%; + padding-inline-start: var(--accessibility-arrow-horizontal-padding); + height: var(--accessibility-toolbar-height-tall); + line-height: var(--accessibility-toolbar-height-tall); +} + +.checks-empty { + font-style: italic; + padding: 0.5em 20px; + user-select: none; + font-size: 12px; + white-space: initial; +} + +/* Checks */ +.checks .list li:last-of-type { + padding-block-end: 4px; +} + +.accessibility-check code { + background-color: var(--accessibility-code-background); + border-radius: 2px; + box-decoration-break: clone; + padding: 0 4px; +} + +.accessibility-check .icon { + display: inline; + -moz-context-properties: fill; + vertical-align: top; + margin-block-start: 2px; + margin-inline-end: 4px; +} + +.accessibility-check .icon[data-score="FAIL"] { + fill: var(--theme-icon-error-color); +} + +.accessibility-check .icon[data-score="WARNING"] { + fill: var(--theme-icon-warning-color); +} + +.accessibility-check .icon[data-score="BEST_PRACTICES"] { + fill: currentColor; +} + +.accessibility-check, +.accessibility-color-contrast { + position: relative; + display: flex; + cursor: default; + height: inherit; +} + +.accessibility-check { + flex-direction: column; + padding: 4px var(--accessibility-horizontal-indent); + line-height: 20px; +} + +.accessibility-check-header { + margin: 0; + font-weight: bold; + font-size: var(--accessibility-font-size); + line-height: var(--theme-toolbar-height); +} + +.accessibility-check-annotation { + display: inline; + margin: 0; + white-space: normal; + color: var(--badge-color); +} + +.accessibility-check-annotation .link { + white-space: nowrap; + font-style: normal; +} + +.accessibility-color-contrast .accessibility-contrast-value:not(:empty) { + margin-block-end: 4px; +} + +.accessibility-color-contrast .accessibility-contrast-value:not(:empty):before { + content: ""; + height: 14px; + width: 14px; + display: inline-flex; + background-color: var(--accessibility-contrast-color); + box-shadow: 0 0 0 1px var(--grey-40), 6px 5px var(--accessibility-contrast-bg), 6px 5px 0 1px var(--grey-40); + margin-inline-end: 11px; +} + +.accessibility-color-contrast .accessibility-contrast-value:first-child:not(:empty):before { + margin-inline-start: 1px; +} + +.accessibility-color-contrast .accessibility-contrast-value:not(:first-child, :empty):before { + margin-inline-start: 4px; +} + +.accessibility-color-contrast .accessibility-color-contrast-label:after { + content: ":"; +} + +.accessibility-color-contrast .accessibility-color-contrast-label, +.accessibility-color-contrast .accessibility-color-contrast-separator:before { + margin-inline-end: 3px; +} + +.devtools-toolbar .toolbar-menu-button.simulation::before { + width: 12px; + height: 12px; + margin-inline-end: 3px; + margin-inline-start: 0px; + background: url("chrome://devtools/skin/images/eye.svg") no-repeat; + -moz-context-properties: fill, stroke; + fill: var(--theme-icon-color); + stroke: var(--theme-icon-color); + vertical-align: -2px; +} + +.devtools-toolbar .toolbar-menu-button.active, +.devtools-toolbar .toolbar-menu-button.active.devtools-button:not(:empty, .checked, :disabled):focus { + color: var(--theme-toolbar-selected-color); +} + +.devtools-toolbar .toolbar-menu-button.simulation.active::before { + fill: var(--theme-toolbar-selected-color); + stroke: var(--theme-toolbar-selected-color); +} + +#simulation-menu-button-menu .link { + background-color: transparent; + border: none; +} + +#simulation-menu-button-menu .link:focus, +#simulation-menu-button-menu .link:hover { + background-color: var(--theme-arrowpanel-dimmed); +} diff --git a/devtools/client/accessibility/actions/accessibles.js b/devtools/client/accessibility/actions/accessibles.js new file mode 100644 index 0000000000..085157c445 --- /dev/null +++ b/devtools/client/accessibility/actions/accessibles.js @@ -0,0 +1,70 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { + FETCH_CHILDREN, + SELECT, + HIGHLIGHT, + UNHIGHLIGHT, +} = require("resource://devtools/client/accessibility/constants.js"); + +/** + * Fetch child accessibles for a given accessible object. + * @param {Object} accessible front + */ +exports.fetchChildren = + accessible => + ({ dispatch }) => + accessible + .children() + .then(response => + dispatch({ accessible, type: FETCH_CHILDREN, response }) + ) + .catch(error => dispatch({ accessible, type: FETCH_CHILDREN, error })); + +exports.select = + accessible => + ({ dispatch }) => { + const accessibleWalkerFront = accessible.getParent(); + if (!accessibleWalkerFront) { + dispatch({ + accessible, + type: SELECT, + error: new Error("AccessibleWalker front is not available."), + }); + + return Promise.reject(); + } + + return accessibleWalkerFront + .getAncestry(accessible) + .then(response => dispatch({ accessible, type: SELECT, response })) + .catch(error => dispatch({ accessible, type: SELECT, error })); + }; + +exports.highlight = + accessible => + ({ dispatch }) => { + const accessibleWalkerFront = accessible.getParent(); + if (!accessibleWalkerFront) { + dispatch({ + accessible, + type: SELECT, + error: new Error("AccessibleWalker front is not available."), + }); + + return Promise.reject(); + } + + return accessibleWalkerFront + .getAncestry(accessible) + .then(response => dispatch({ accessible, type: HIGHLIGHT, response })) + .catch(error => dispatch({ accessible, type: HIGHLIGHT, error })); + }; + +exports.unhighlight = + () => + ({ dispatch }) => + dispatch({ type: UNHIGHLIGHT }); diff --git a/devtools/client/accessibility/actions/audit.js b/devtools/client/accessibility/actions/audit.js new file mode 100644 index 0000000000..7d91299eea --- /dev/null +++ b/devtools/client/accessibility/actions/audit.js @@ -0,0 +1,36 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + AUDIT, + AUDIT_PROGRESS, + AUDITING, + FILTER_TOGGLE, + FILTERS, +} = require("resource://devtools/client/accessibility/constants.js"); + +exports.filterToggle = + filter => + ({ dispatch }) => + dispatch({ filter, type: FILTER_TOGGLE }); + +exports.auditing = + filter => + ({ dispatch }) => { + const auditing = filter === FILTERS.ALL ? Object.values(FILTERS) : [filter]; + return dispatch({ auditing, type: AUDITING }); + }; + +exports.audit = + (auditFunc, filter) => + ({ dispatch }) => + auditFunc(filter, progress => + dispatch({ type: AUDIT_PROGRESS, progress }) + ).then(({ error, ancestries }) => { + return error + ? dispatch({ type: AUDIT, error: true }) + : dispatch({ type: AUDIT, response: ancestries }); + }); diff --git a/devtools/client/accessibility/actions/details.js b/devtools/client/accessibility/actions/details.js new file mode 100644 index 0000000000..f25996589e --- /dev/null +++ b/devtools/client/accessibility/actions/details.js @@ -0,0 +1,40 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { + UPDATE_DETAILS, +} = require("resource://devtools/client/accessibility/constants.js"); + +/** + * Update details with the given accessible object. + * + * @param {Object} accessible front + */ +exports.updateDetails = + accessible => + async ({ dispatch }) => { + const { walker: domWalker } = await accessible.targetFront.getFront( + "inspector" + ); + // By the time getFront resolves, the accessibleFront may have been destroyed. + // This typically happens during navigations. + if (accessible.isDestroyed()) { + return; + } + try { + const response = await Promise.all([ + domWalker.getNodeFromActor(accessible.actorID, [ + "rawAccessible", + "DOMNode", + ]), + accessible.getRelations(), + accessible.audit(), + accessible.hydrate(), + ]); + dispatch({ accessible, type: UPDATE_DETAILS, response }); + } catch (error) { + dispatch({ accessible, type: UPDATE_DETAILS, error }); + } + }; diff --git a/devtools/client/accessibility/actions/moz.build b/devtools/client/accessibility/actions/moz.build new file mode 100644 index 0000000000..c4571d7998 --- /dev/null +++ b/devtools/client/accessibility/actions/moz.build @@ -0,0 +1,5 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +DevToolsModules("accessibles.js", "audit.js", "details.js", "simulation.js", "ui.js") diff --git a/devtools/client/accessibility/actions/simulation.js b/devtools/client/accessibility/actions/simulation.js new file mode 100644 index 0000000000..98d69d62f3 --- /dev/null +++ b/devtools/client/accessibility/actions/simulation.js @@ -0,0 +1,16 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + SIMULATE, +} = require("resource://devtools/client/accessibility/constants.js"); + +exports.simulate = + (simulateFunc, simTypes = []) => + ({ dispatch }) => + simulateFunc(simTypes) + .then(success => dispatch({ error: !success, simTypes, type: SIMULATE })) + .catch(error => dispatch({ error, type: SIMULATE })); diff --git a/devtools/client/accessibility/actions/ui.js b/devtools/client/accessibility/actions/ui.js new file mode 100644 index 0000000000..d4af5ba8fb --- /dev/null +++ b/devtools/client/accessibility/actions/ui.js @@ -0,0 +1,77 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { + ENABLE, + RESET, + UPDATE_CAN_BE_DISABLED, + UPDATE_CAN_BE_ENABLED, + UPDATE_PREF, + PREF_KEYS, + UPDATE_DISPLAY_TABBING_ORDER, +} = require("resource://devtools/client/accessibility/constants.js"); + +/** + * Reset accessibility panel UI. + */ +exports.reset = + (resetAccessiblity, supports) => + async ({ dispatch }) => { + try { + const { enabled, canBeDisabled, canBeEnabled } = + await resetAccessiblity(); + dispatch({ enabled, canBeDisabled, canBeEnabled, supports, type: RESET }); + } catch (error) { + dispatch({ type: RESET, error }); + } + }; + +/** + * Update a "canBeDisabled" flag for accessibility service. + */ +exports.updateCanBeDisabled = + canBeDisabled => + ({ dispatch }) => + dispatch({ canBeDisabled, type: UPDATE_CAN_BE_DISABLED }); + +/** + * Update a "canBeEnabled" flag for accessibility service. + */ +exports.updateCanBeEnabled = + canBeEnabled => + ({ dispatch }) => + dispatch({ canBeEnabled, type: UPDATE_CAN_BE_ENABLED }); + +exports.updatePref = + (name, value) => + ({ dispatch }) => { + dispatch({ type: UPDATE_PREF, name, value }); + Services.prefs.setBoolPref(PREF_KEYS[name], value); + }; + +/** + * Enable accessibility services in order to view accessible tree. + */ +exports.enable = + enableAccessibility => + async ({ dispatch }) => { + try { + await enableAccessibility(); + dispatch({ type: ENABLE }); + } catch (error) { + dispatch({ error, type: ENABLE }); + } + }; + +exports.updateDisplayTabbingOrder = + tabbingOrderDisplayed => + async ({ dispatch, options: { toggleDisplayTabbingOrder } }) => { + try { + await toggleDisplayTabbingOrder(tabbingOrderDisplayed); + dispatch({ tabbingOrderDisplayed, type: UPDATE_DISPLAY_TABBING_ORDER }); + } catch (error) { + dispatch({ error, type: UPDATE_DISPLAY_TABBING_ORDER }); + } + }; diff --git a/devtools/client/accessibility/components/AccessibilityPrefs.js b/devtools/client/accessibility/components/AccessibilityPrefs.js new file mode 100644 index 0000000000..8c5de5f15f --- /dev/null +++ b/devtools/client/accessibility/components/AccessibilityPrefs.js @@ -0,0 +1,109 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + createFactory, + Component, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +const { + hr, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +loader.lazyGetter(this, "MenuButton", function () { + return createFactory( + require("resource://devtools/client/shared/components/menu/MenuButton.js") + ); +}); +loader.lazyGetter(this, "MenuItem", function () { + return createFactory( + require("resource://devtools/client/shared/components/menu/MenuItem.js") + ); +}); +loader.lazyGetter(this, "MenuList", function () { + return createFactory( + require("resource://devtools/client/shared/components/menu/MenuList.js") + ); +}); + +const { + A11Y_LEARN_MORE_LINK, +} = require("resource://devtools/client/accessibility/constants.js"); +const { openDocLink } = require("resource://devtools/client/shared/link.js"); + +const { + updatePref, +} = require("resource://devtools/client/accessibility/actions/ui.js"); + +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); +const { + PREFS, +} = require("resource://devtools/client/accessibility/constants.js"); + +class AccessibilityPrefs extends Component { + static get propTypes() { + return { + dispatch: PropTypes.func.isRequired, + [PREFS.SCROLL_INTO_VIEW]: PropTypes.bool.isRequired, + toolboxDoc: PropTypes.object.isRequired, + }; + } + + togglePref(prefKey) { + this.props.dispatch(updatePref(prefKey, !this.props[prefKey])); + } + + onPrefClick(prefKey) { + this.togglePref(prefKey); + } + + onLearnMoreClick() { + openDocLink(A11Y_LEARN_MORE_LINK); + } + + render() { + return MenuButton( + { + menuId: "accessibility-tree-filters-prefs-menu", + toolboxDoc: this.props.toolboxDoc, + className: `devtools-button badge toolbar-menu-button prefs`, + title: L10N.getStr("accessibility.tree.filters.prefs"), + }, + MenuList({}, [ + MenuItem({ + key: "pref-scroll-into-view", + checked: this.props[PREFS.SCROLL_INTO_VIEW], + className: `pref ${PREFS.SCROLL_INTO_VIEW}`, + label: L10N.getStr("accessibility.pref.scroll.into.view.label"), + tooltip: L10N.getStr("accessibility.pref.scroll.into.view.title"), + onClick: this.onPrefClick.bind(this, PREFS.SCROLL_INTO_VIEW), + }), + hr({ key: "hr" }), + MenuItem({ + role: "link", + key: "accessibility-tree-filters-prefs-menu-help", + className: "help", + label: L10N.getStr("accessibility.documentation.label"), + tooltip: L10N.getStr("accessibility.learnMore"), + onClick: this.onLearnMoreClick, + }), + ]) + ); + } +} + +const mapStateToProps = ({ ui }) => ({ + [PREFS.SCROLL_INTO_VIEW]: ui[PREFS.SCROLL_INTO_VIEW], +}); + +// Exports from this module +module.exports = connect(mapStateToProps)(AccessibilityPrefs); diff --git a/devtools/client/accessibility/components/AccessibilityRow.js b/devtools/client/accessibility/components/AccessibilityRow.js new file mode 100644 index 0000000000..ffca5c74ef --- /dev/null +++ b/devtools/client/accessibility/components/AccessibilityRow.js @@ -0,0 +1,328 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +/* global gTelemetry, EVENTS */ + +// React & Redux +const { + Component, + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + findDOMNode, +} = require("resource://devtools/client/shared/vendor/react-dom.js"); +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); + +const TreeRow = require("resource://devtools/client/shared/components/tree/TreeRow.js"); +const AuditFilter = createFactory( + require("resource://devtools/client/accessibility/components/AuditFilter.js") +); +const AuditController = createFactory( + require("resource://devtools/client/accessibility/components/AuditController.js") +); + +// Utils +const { + flashElementOn, + flashElementOff, +} = require("resource://devtools/client/inspector/markup/utils.js"); +const { openDocLink } = require("resource://devtools/client/shared/link.js"); +const { + PREFS, + VALUE_FLASHING_DURATION, + VALUE_HIGHLIGHT_DURATION, +} = require("resource://devtools/client/accessibility/constants.js"); + +const nodeConstants = require("resource://devtools/shared/dom-node-constants.js"); + +// Actions +const { + updateDetails, +} = require("resource://devtools/client/accessibility/actions/details.js"); +const { + unhighlight, +} = require("resource://devtools/client/accessibility/actions/accessibles.js"); + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +loader.lazyRequireGetter( + this, + "Menu", + "resource://devtools/client/framework/menu.js" +); +loader.lazyRequireGetter( + this, + "MenuItem", + "resource://devtools/client/framework/menu-item.js" +); + +const { + scrollIntoView, +} = require("resource://devtools/client/shared/scroll.js"); + +const JSON_URL_PREFIX = "data:application/json;charset=UTF-8,"; + +const TELEMETRY_ACCESSIBLE_CONTEXT_MENU_OPENED = + "devtools.accessibility.accessible_context_menu_opened"; +const TELEMETRY_ACCESSIBLE_CONTEXT_MENU_ITEM_ACTIVATED = + "devtools.accessibility.accessible_context_menu_item_activated"; + +class HighlightableTreeRowClass extends TreeRow { + shouldComponentUpdate(nextProps) { + const shouldTreeRowUpdate = super.shouldComponentUpdate(nextProps); + if (shouldTreeRowUpdate) { + return shouldTreeRowUpdate; + } + + if ( + nextProps.highlighted !== this.props.highlighted || + nextProps.filtered !== this.props.filtered + ) { + return true; + } + + return false; + } +} + +const HighlightableTreeRow = createFactory(HighlightableTreeRowClass); + +// Component that expands TreeView's own TreeRow and is responsible for +// rendering an accessible object. +class AccessibilityRow extends Component { + static get propTypes() { + return { + ...TreeRow.propTypes, + dispatch: PropTypes.func.isRequired, + toolboxDoc: PropTypes.object.isRequired, + scrollContentNodeIntoView: PropTypes.bool.isRequired, + highlightAccessible: PropTypes.func.isRequired, + unhighlightAccessible: PropTypes.func.isRequired, + }; + } + + componentDidMount() { + const { + member: { selected, object }, + scrollContentNodeIntoView, + } = this.props; + if (selected) { + this.unhighlight(object); + this.update(); + this.highlight( + object, + { duration: VALUE_HIGHLIGHT_DURATION }, + scrollContentNodeIntoView + ); + } + + if (this.props.highlighted) { + this.scrollIntoView(); + } + } + + /** + * Update accessible object details that are going to be rendered inside the + * accessible panel sidebar. + */ + componentDidUpdate(prevProps) { + const { + member: { selected, object }, + scrollContentNodeIntoView, + } = this.props; + // If row is selected, update corresponding accessible details. + if (!prevProps.member.selected && selected) { + this.unhighlight(object); + this.update(); + this.highlight( + object, + { duration: VALUE_HIGHLIGHT_DURATION }, + scrollContentNodeIntoView + ); + } + + if (this.props.highlighted) { + this.scrollIntoView(); + } + + if (!selected && prevProps.member.value !== this.props.member.value) { + this.flashValue(); + } + } + + scrollIntoView() { + const row = findDOMNode(this); + // Row might not be rendered in the DOM tree if it is filtered out during + // audit. + if (!row) { + return; + } + + scrollIntoView(row); + } + + update() { + const { + dispatch, + member: { object }, + } = this.props; + if (!object.actorID) { + return; + } + + dispatch(updateDetails(object)); + window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_SELECTED, object); + } + + flashValue() { + const row = findDOMNode(this); + // Row might not be rendered in the DOM tree if it is filtered out during + // audit. + if (!row) { + return; + } + + const value = row.querySelector(".objectBox"); + + flashElementOn(value); + if (this._flashMutationTimer) { + clearTimeout(this._flashMutationTimer); + this._flashMutationTimer = null; + } + this._flashMutationTimer = setTimeout(() => { + flashElementOff(value); + }, VALUE_FLASHING_DURATION); + } + + /** + * Scroll the node that corresponds to a current accessible object into view. + * @param {Object} + * Accessible front that is rendered for this node. + * + * @returns {Promise} + * Promise that resolves when the node is scrolled into view if + * possible. + */ + async scrollNodeIntoViewIfNeeded(accessibleFront) { + if (accessibleFront.isDestroyed()) { + return; + } + + const domWalker = (await accessibleFront.targetFront.getFront("inspector")) + .walker; + if (accessibleFront.isDestroyed()) { + return; + } + + const node = await domWalker.getNodeFromActor(accessibleFront.actorID, [ + "rawAccessible", + "DOMNode", + ]); + if (!node) { + return; + } + + if (node.nodeType == nodeConstants.ELEMENT_NODE) { + await node.scrollIntoView(); + } else if (node.nodeType != nodeConstants.DOCUMENT_NODE) { + // scrollIntoView method is only part of the Element interface, in cases + // where node is a text node (and not a document node) scroll into view + // its parent. + await node.parentNode().scrollIntoView(); + } + } + + async highlight(accessibleFront, options, scrollContentNodeIntoView) { + this.props.dispatch(unhighlight()); + // If necessary scroll the node into view before showing the accessibility + // highlighter. + if (scrollContentNodeIntoView) { + await this.scrollNodeIntoViewIfNeeded(accessibleFront); + } + + this.props.highlightAccessible(accessibleFront, options); + } + + unhighlight(accessibleFront) { + this.props.dispatch(unhighlight()); + this.props.unhighlightAccessible(accessibleFront); + } + + async printToJSON() { + if (gTelemetry) { + gTelemetry.keyedScalarAdd( + TELEMETRY_ACCESSIBLE_CONTEXT_MENU_ITEM_ACTIVATED, + "print-to-json", + 1 + ); + } + + const snapshot = await this.props.member.object.snapshot(); + openDocLink( + `${JSON_URL_PREFIX}${encodeURIComponent(JSON.stringify(snapshot))}` + ); + } + + onContextMenu(e) { + e.stopPropagation(); + e.preventDefault(); + + if (!this.props.toolboxDoc) { + return; + } + + const menu = new Menu({ id: "accessibility-row-contextmenu" }); + menu.append( + new MenuItem({ + id: "menu-printtojson", + label: L10N.getStr("accessibility.tree.menu.printToJSON"), + click: () => this.printToJSON(), + }) + ); + + menu.popup(e.screenX, e.screenY, this.props.toolboxDoc); + + if (gTelemetry) { + gTelemetry.scalarAdd(TELEMETRY_ACCESSIBLE_CONTEXT_MENU_OPENED, 1); + } + } + + /** + * Render accessible row component. + * @returns acecssible-row React component. + */ + render() { + const { member } = this.props; + const props = { + ...this.props, + onContextMenu: e => this.onContextMenu(e), + onMouseOver: () => this.highlight(member.object), + onMouseOut: () => this.unhighlight(member.object), + key: `${member.path}-${member.active ? "active" : "inactive"}`, + }; + + return AuditController( + { + accessibleFront: member.object, + }, + AuditFilter({}, HighlightableTreeRow(props)) + ); + } +} + +const mapStateToProps = ({ + ui: { [PREFS.SCROLL_INTO_VIEW]: scrollContentNodeIntoView }, +}) => ({ + scrollContentNodeIntoView, +}); + +module.exports = connect(mapStateToProps, null, null, { withRef: true })( + AccessibilityRow +); diff --git a/devtools/client/accessibility/components/AccessibilityRowValue.js b/devtools/client/accessibility/components/AccessibilityRowValue.js new file mode 100644 index 0000000000..ab631fedb4 --- /dev/null +++ b/devtools/client/accessibility/components/AccessibilityRowValue.js @@ -0,0 +1,58 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + Component, + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + span, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +const Badges = createFactory( + require("resource://devtools/client/accessibility/components/Badges.js") +); +const AuditController = createFactory( + require("resource://devtools/client/accessibility/components/AuditController.js") +); + +const { + REPS, +} = require("resource://devtools/client/shared/components/reps/index.js"); +const { Grip } = REPS; +const Rep = createFactory(REPS.Rep); + +class AccessibilityRowValue extends Component { + static get propTypes() { + return { + member: PropTypes.shape({ + object: PropTypes.object, + }).isRequired, + }; + } + + render() { + return span( + { + role: "presentation", + }, + Rep({ + ...this.props, + defaultRep: Grip, + cropLimit: 50, + }), + AuditController( + { + accessibleFront: this.props.member.object, + }, + Badges() + ) + ); + } +} + +module.exports = AccessibilityRowValue; diff --git a/devtools/client/accessibility/components/AccessibilityTree.js b/devtools/client/accessibility/components/AccessibilityTree.js new file mode 100644 index 0000000000..df67377283 --- /dev/null +++ b/devtools/client/accessibility/components/AccessibilityTree.js @@ -0,0 +1,298 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +/* global EVENTS */ + +// React & Redux +const { + Component, + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); + +const TreeView = createFactory( + require("resource://devtools/client/shared/components/tree/TreeView.js") +); +// Reps +const { + MODE, +} = require("resource://devtools/client/shared/components/reps/index.js"); + +const { + fetchChildren, +} = require("resource://devtools/client/accessibility/actions/accessibles.js"); + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); +const { + isFiltered, +} = require("resource://devtools/client/accessibility/utils/audit.js"); +const AccessibilityRow = createFactory( + require("resource://devtools/client/accessibility/components/AccessibilityRow.js") +); +const AccessibilityRowValue = createFactory( + require("resource://devtools/client/accessibility/components/AccessibilityRowValue.js") +); +const { + Provider, +} = require("resource://devtools/client/accessibility/provider.js"); + +const { + scrollIntoView, +} = require("resource://devtools/client/shared/scroll.js"); + +/** + * Renders Accessibility panel tree. + */ +class AccessibilityTree extends Component { + static get propTypes() { + return { + toolboxDoc: PropTypes.object.isRequired, + dispatch: PropTypes.func.isRequired, + accessibles: PropTypes.object, + expanded: PropTypes.object, + selected: PropTypes.string, + highlighted: PropTypes.object, + filtered: PropTypes.bool, + getAccessibilityTreeRoot: PropTypes.func.isRequired, + startListeningForAccessibilityEvents: PropTypes.func.isRequired, + stopListeningForAccessibilityEvents: PropTypes.func.isRequired, + highlightAccessible: PropTypes.func.isRequired, + unhighlightAccessible: PropTypes.func.isRequired, + }; + } + + constructor(props) { + super(props); + + this.onNameChange = this.onNameChange.bind(this); + this.onReorder = this.onReorder.bind(this); + this.onTextChange = this.onTextChange.bind(this); + this.renderValue = this.renderValue.bind(this); + this.scrollSelectedRowIntoView = this.scrollSelectedRowIntoView.bind(this); + } + + /** + * Add accessibility event listeners that affect tree rendering and updates. + */ + // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507 + UNSAFE_componentWillMount() { + this.props.startListeningForAccessibilityEvents({ + reorder: this.onReorder, + "name-change": this.onNameChange, + "text-change": this.onTextChange, + }); + window.on( + EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED, + this.scrollSelectedRowIntoView + ); + return null; + } + + componentDidUpdate(prevProps) { + // When filtering is toggled, make sure that the selected row remains in + // view. + if (this.props.filtered !== prevProps.filtered) { + this.scrollSelectedRowIntoView(); + } + + window.emit(EVENTS.ACCESSIBILITY_INSPECTOR_UPDATED); + } + + /** + * Remove accessible event listeners. + */ + componentWillUnmount() { + this.props.stopListeningForAccessibilityEvents({ + reorder: this.onReorder, + "name-change": this.onNameChange, + "text-change": this.onTextChange, + }); + + window.off( + EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED, + this.scrollSelectedRowIntoView + ); + } + + /** + * Handle accessible reorder event. If the accessible is cached and rendered + * within the accessibility tree, re-fetch its children and re-render the + * corresponding subtree. + * @param {Object} accessibleFront + * accessible front that had its subtree reordered. + */ + onReorder(accessibleFront) { + if (this.props.accessibles.has(accessibleFront.actorID)) { + this.props.dispatch(fetchChildren(accessibleFront)); + } + } + + scrollSelectedRowIntoView() { + const { treeview } = this.refs; + if (!treeview) { + return; + } + + const treeEl = treeview.treeRef.current; + if (!treeEl) { + return; + } + + const selected = treeEl.ownerDocument.querySelector( + ".treeTable .treeRow.selected" + ); + if (selected) { + scrollIntoView(selected, { center: true }); + } + } + + /** + * Handle accessible name change event. If the name of an accessible changes + * and that accessible is cached and rendered within the accessibility tree, + * re-fetch its parent's children and re-render the corresponding subtree. + * @param {Object} accessibleFront + * accessible front that had its name changed. + * @param {Object} parentFront + * optional parent accessible front. Note: if it parent is not + * present, we assume that the top level document's name has changed + * and use accessible walker as a parent. + */ + onNameChange(accessibleFront, parentFront) { + const { accessibles, dispatch } = this.props; + const accessibleWalkerFront = accessibleFront.getParent(); + parentFront = parentFront || accessibleWalkerFront; + + if ( + accessibles.has(accessibleFront.actorID) || + accessibles.has(parentFront.actorID) + ) { + dispatch(fetchChildren(parentFront)); + } + } + + /** + * Handle accessible text change (change/insert/remove) event. If the text of + * an accessible changes and that accessible is cached and rendered within the + * accessibility tree, re-fetch its children and re-render the corresponding + * subtree. + * @param {Object} accessibleFront + * accessible front that had its child text changed. + */ + onTextChange(accessibleFront) { + const { accessibles, dispatch } = this.props; + if (accessibles.has(accessibleFront.actorID)) { + dispatch(fetchChildren(accessibleFront)); + } + } + + renderValue(props) { + return AccessibilityRowValue(props); + } + + /** + * Render Accessibility panel content + */ + render() { + const columns = [ + { + id: "default", + title: L10N.getStr("accessibility.role"), + }, + { + id: "value", + title: L10N.getStr("accessibility.name"), + }, + ]; + + const { + accessibles, + dispatch, + expanded, + selected, + highlighted: highlightedItem, + toolboxDoc, + filtered, + getAccessibilityTreeRoot, + highlightAccessible, + unhighlightAccessible, + } = this.props; + + const renderRow = rowProps => { + const { object } = rowProps.member; + const highlighted = object === highlightedItem; + return AccessibilityRow( + Object.assign({}, rowProps, { + toolboxDoc, + highlighted, + decorator: { + getRowClass() { + return highlighted ? ["highlighted"] : []; + }, + }, + highlightAccessible, + unhighlightAccessible, + }) + ); + }; + const className = filtered ? "filtered" : undefined; + + return TreeView({ + ref: "treeview", + object: getAccessibilityTreeRoot(), + mode: MODE.SHORT, + provider: new Provider(accessibles, filtered, dispatch), + columns, + className, + renderValue: this.renderValue, + renderRow, + label: L10N.getStr("accessibility.treeName"), + header: true, + expandedNodes: expanded, + selected, + onClickRow(nodePath, event) { + if (event.target.classList.contains("theme-twisty")) { + this.toggle(nodePath); + } + + this.selectRow( + this.rows.find(row => row.props.member.path === nodePath), + { preventAutoScroll: true } + ); + + return true; + }, + onContextMenuTree(e) { + // If context menu event is triggered on (or bubbled to) the TreeView, it was + // done via keyboard. Open context menu for currently selected row. + let row = this.getSelectedRow(); + if (!row) { + return; + } + + row = row.getWrappedInstance(); + row.onContextMenu(e); + }, + }); + } +} + +const mapStateToProps = ({ + accessibles, + ui: { expanded, selected, highlighted }, + audit: { filters }, +}) => ({ + accessibles, + expanded, + selected, + highlighted, + filtered: isFiltered(filters), +}); +// Exports from this module +module.exports = connect(mapStateToProps)(AccessibilityTree); diff --git a/devtools/client/accessibility/components/AccessibilityTreeFilter.js b/devtools/client/accessibility/components/AccessibilityTreeFilter.js new file mode 100644 index 0000000000..90eabd350a --- /dev/null +++ b/devtools/client/accessibility/components/AccessibilityTreeFilter.js @@ -0,0 +1,171 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +/* global gTelemetry */ + +// React +const { + createFactory, + Component, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + div, + hr, + span, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +loader.lazyGetter(this, "MenuButton", function () { + return createFactory( + require("resource://devtools/client/shared/components/menu/MenuButton.js") + ); +}); +loader.lazyGetter(this, "MenuItem", function () { + return createFactory( + require("resource://devtools/client/shared/components/menu/MenuItem.js") + ); +}); +loader.lazyGetter(this, "MenuList", function () { + return createFactory( + require("resource://devtools/client/shared/components/menu/MenuList.js") + ); +}); + +const actions = require("resource://devtools/client/accessibility/actions/audit.js"); + +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); +const { + FILTERS, +} = require("resource://devtools/client/accessibility/constants.js"); + +const TELEMETRY_AUDIT_ACTIVATED = "devtools.accessibility.audit_activated"; +const FILTER_LABELS = { + [FILTERS.NONE]: "accessibility.filter.none", + [FILTERS.ALL]: "accessibility.filter.all2", + [FILTERS.CONTRAST]: "accessibility.filter.contrast", + [FILTERS.KEYBOARD]: "accessibility.filter.keyboard", + [FILTERS.TEXT_LABEL]: "accessibility.filter.textLabel", +}; + +class AccessibilityTreeFilter extends Component { + static get propTypes() { + return { + auditing: PropTypes.array.isRequired, + filters: PropTypes.object.isRequired, + dispatch: PropTypes.func.isRequired, + describedby: PropTypes.string, + toolboxDoc: PropTypes.object.isRequired, + audit: PropTypes.func.isRequired, + }; + } + + async toggleFilter(filterKey) { + const { audit: auditFunc, dispatch, filters } = this.props; + + if (filterKey !== FILTERS.NONE && !filters[filterKey]) { + if (gTelemetry) { + gTelemetry.keyedScalarAdd(TELEMETRY_AUDIT_ACTIVATED, filterKey, 1); + } + + dispatch(actions.auditing(filterKey)); + await dispatch(actions.audit(auditFunc, filterKey)); + } + + // We wait to dispatch filter toggle until the tree is ready to be filtered + // right after the audit. This is to make sure that we render an empty tree + // (filtered) while the audit is running. + dispatch(actions.filterToggle(filterKey)); + } + + onClick(filterKey) { + this.toggleFilter(filterKey); + } + + render() { + const { auditing, filters, describedby, toolboxDoc } = this.props; + const toolbarLabelID = "accessibility-tree-filters-label"; + const filterNoneChecked = !Object.values(filters).includes(true); + const items = [ + MenuItem({ + key: FILTERS.NONE, + checked: filterNoneChecked, + className: `filter ${FILTERS.NONE}`, + label: L10N.getStr(FILTER_LABELS[FILTERS.NONE]), + onClick: this.onClick.bind(this, FILTERS.NONE), + disabled: !!auditing.length, + }), + hr({ key: "hr-1" }), + ]; + + const { [FILTERS.ALL]: filterAllChecked, ...filtersWithoutAll } = filters; + items.push( + MenuItem({ + key: FILTERS.ALL, + checked: filterAllChecked, + className: `filter ${FILTERS.ALL}`, + label: L10N.getStr(FILTER_LABELS[FILTERS.ALL]), + onClick: this.onClick.bind(this, FILTERS.ALL), + disabled: !!auditing.length, + }), + hr({ key: "hr-2" }), + Object.entries(filtersWithoutAll).map(([filterKey, active]) => + MenuItem({ + key: filterKey, + checked: active, + className: `filter ${filterKey}`, + label: L10N.getStr(FILTER_LABELS[filterKey]), + onClick: this.onClick.bind(this, filterKey), + disabled: !!auditing.length, + }) + ) + ); + + let label; + if (filterNoneChecked) { + label = L10N.getStr(FILTER_LABELS[FILTERS.NONE]); + } else if (filterAllChecked) { + label = L10N.getStr(FILTER_LABELS[FILTERS.ALL]); + } else { + label = Object.keys(filtersWithoutAll) + .filter(filterKey => filtersWithoutAll[filterKey]) + .map(filterKey => L10N.getStr(FILTER_LABELS[filterKey])) + .join(", "); + } + + return div( + { + role: "group", + className: "accessibility-tree-filters", + "aria-labelledby": toolbarLabelID, + "aria-describedby": describedby, + }, + span( + { id: toolbarLabelID, role: "presentation" }, + L10N.getStr("accessibility.tree.filters") + ), + MenuButton( + { + menuId: "accessibility-tree-filters-menu", + toolboxDoc, + className: `devtools-button badge toolbar-menu-button filters`, + label, + }, + MenuList({}, items) + ) + ); + } +} + +const mapStateToProps = ({ audit: { filters, auditing } }) => { + return { filters, auditing }; +}; + +// Exports from this module +module.exports = connect(mapStateToProps)(AccessibilityTreeFilter); diff --git a/devtools/client/accessibility/components/Accessible.js b/devtools/client/accessibility/components/Accessible.js new file mode 100644 index 0000000000..36f0068218 --- /dev/null +++ b/devtools/client/accessibility/components/Accessible.js @@ -0,0 +1,563 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +/* global EVENTS, gTelemetry */ + +// React & Redux +const { + createFactory, + Component, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + div, + span, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + findDOMNode, +} = require("resource://devtools/client/shared/vendor/react-dom.js"); +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); + +const { + TREE_ROW_HEIGHT, + ORDERED_PROPS, + ACCESSIBLE_EVENTS, + VALUE_FLASHING_DURATION, +} = require("resource://devtools/client/accessibility/constants.js"); +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); +const { + flashElementOn, + flashElementOff, +} = require("resource://devtools/client/inspector/markup/utils.js"); +const { + updateDetails, +} = require("resource://devtools/client/accessibility/actions/details.js"); +const { + select, + unhighlight, +} = require("resource://devtools/client/accessibility/actions/accessibles.js"); + +const Tree = createFactory( + require("resource://devtools/client/shared/components/VirtualizedTree.js") +); +// Reps +const { + REPS, + MODE, +} = require("resource://devtools/client/shared/components/reps/index.js"); +const { Rep, ElementNode, Accessible: AccessibleRep, Obj } = REPS; + +const { + translateNodeFrontToGrip, +} = require("resource://devtools/client/inspector/shared/utils.js"); + +loader.lazyRequireGetter( + this, + "openContentLink", + "resource://devtools/client/shared/link.js", + true +); + +const TELEMETRY_NODE_INSPECTED_COUNT = + "devtools.accessibility.node_inspected_count"; + +const TREE_DEPTH_PADDING_INCREMENT = 20; + +class AccessiblePropertyClass extends Component { + static get propTypes() { + return { + accessibleFrontActorID: PropTypes.string, + object: PropTypes.any, + focused: PropTypes.bool, + children: PropTypes.func, + }; + } + + componentDidUpdate({ + object: prevObject, + accessibleFrontActorID: prevAccessibleFrontActorID, + }) { + const { accessibleFrontActorID, object, focused } = this.props; + // Fast check if row is focused or if the value did not update. + if ( + focused || + accessibleFrontActorID !== prevAccessibleFrontActorID || + prevObject === object || + (object && prevObject && typeof object === "object") + ) { + return; + } + + this.flashRow(); + } + + flashRow() { + const row = findDOMNode(this); + flashElementOn(row); + if (this._flashMutationTimer) { + clearTimeout(this._flashMutationTimer); + this._flashMutationTimer = null; + } + this._flashMutationTimer = setTimeout(() => { + flashElementOff(row); + }, VALUE_FLASHING_DURATION); + } + + render() { + return this.props.children(); + } +} + +const AccessibleProperty = createFactory(AccessiblePropertyClass); + +class Accessible extends Component { + static get propTypes() { + return { + accessibleFront: PropTypes.object, + dispatch: PropTypes.func.isRequired, + nodeFront: PropTypes.object, + items: PropTypes.array, + labelledby: PropTypes.string.isRequired, + parents: PropTypes.object, + relations: PropTypes.object, + toolbox: PropTypes.object.isRequired, + toolboxHighlighter: PropTypes.object.isRequired, + highlightAccessible: PropTypes.func.isRequired, + unhighlightAccessible: PropTypes.func.isRequired, + }; + } + + constructor(props) { + super(props); + + this.state = { + expanded: new Set(), + active: null, + focused: null, + }; + + this.onAccessibleInspected = this.onAccessibleInspected.bind(this); + this.renderItem = this.renderItem.bind(this); + this.update = this.update.bind(this); + } + + // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507 + UNSAFE_componentWillMount() { + window.on( + EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED, + this.onAccessibleInspected + ); + } + + // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507 + UNSAFE_componentWillReceiveProps({ accessibleFront }) { + const oldAccessibleFront = this.props.accessibleFront; + + if (oldAccessibleFront) { + if ( + accessibleFront && + accessibleFront.actorID === oldAccessibleFront.actorID + ) { + return; + } + ACCESSIBLE_EVENTS.forEach(event => + oldAccessibleFront.off(event, this.update) + ); + } + + if (accessibleFront) { + ACCESSIBLE_EVENTS.forEach(event => + accessibleFront.on(event, this.update) + ); + } + } + + componentDidUpdate(prevProps) { + if ( + this.props.accessibleFront && + !this.props.accessibleFront.isDestroyed() && + this.props.accessibleFront !== prevProps.accessibleFront + ) { + window.emit(EVENTS.PROPERTIES_UPDATED); + } + } + + componentWillUnmount() { + window.off( + EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED, + this.onAccessibleInspected + ); + + const { accessibleFront } = this.props; + if (accessibleFront) { + ACCESSIBLE_EVENTS.forEach(event => + accessibleFront.off(event, this.update) + ); + } + } + + onAccessibleInspected() { + const { props } = this.refs; + if (props) { + props.refs.tree.focus(); + } + } + + update() { + const { dispatch, accessibleFront } = this.props; + if (accessibleFront.isDestroyed()) { + return; + } + + dispatch(updateDetails(accessibleFront)); + } + + setExpanded(item, isExpanded) { + const { expanded } = this.state; + + if (isExpanded) { + expanded.add(item.path); + } else { + expanded.delete(item.path); + } + + this.setState({ expanded }); + } + + async showHighlighter(nodeFront) { + if (!this.props.toolboxHighlighter) { + return; + } + + await this.props.toolboxHighlighter.highlight(nodeFront); + } + + async hideHighlighter() { + if (!this.props.toolboxHighlighter) { + return; + } + + await this.props.toolboxHighlighter.unhighlight(); + } + + showAccessibleHighlighter(accessibleFront) { + this.props.dispatch(unhighlight()); + this.props.highlightAccessible(accessibleFront); + } + + hideAccessibleHighlighter(accessibleFront) { + this.props.dispatch(unhighlight()); + this.props.unhighlightAccessible(accessibleFront); + } + + async selectNode(nodeFront, reason = "accessibility") { + if (gTelemetry) { + gTelemetry.scalarAdd(TELEMETRY_NODE_INSPECTED_COUNT, 1); + } + + if (!this.props.toolbox) { + return; + } + + const inspector = await this.props.toolbox.selectTool("inspector"); + inspector.selection.setNodeFront(nodeFront, reason); + } + + async selectAccessible(accessibleFront) { + if (!accessibleFront) { + return; + } + + await this.props.dispatch(select(accessibleFront)); + + const { props } = this.refs; + if (props) { + props.refs.tree.blur(); + } + await this.setState({ active: null, focused: null }); + + window.emit(EVENTS.NEW_ACCESSIBLE_FRONT_INSPECTED); + } + + openLink(link, e) { + openContentLink(link); + } + + renderItem(item, depth, focused, arrow, expanded) { + const object = item.contents; + const valueProps = { + object, + mode: MODE.TINY, + title: "Object", + openLink: this.openLink, + }; + + if (isNodeFront(object)) { + valueProps.defaultRep = ElementNode; + valueProps.onDOMNodeMouseOut = () => this.hideHighlighter(); + valueProps.onDOMNodeMouseOver = () => + this.showHighlighter(this.props.nodeFront); + + valueProps.inspectIconTitle = L10N.getStr( + "accessibility.accessible.selectNodeInInspector.title" + ); + valueProps.onInspectIconClick = () => + this.selectNode(this.props.nodeFront); + } else if (isAccessibleFront(object)) { + const target = findAccessibleTarget(this.props.relations, object.actor); + valueProps.defaultRep = AccessibleRep; + valueProps.onAccessibleMouseOut = () => + this.hideAccessibleHighlighter(target); + valueProps.onAccessibleMouseOver = () => + this.showAccessibleHighlighter(target); + valueProps.inspectIconTitle = L10N.getStr( + "accessibility.accessible.selectElement.title" + ); + valueProps.onInspectIconClick = (obj, e) => { + e.stopPropagation(); + this.selectAccessible(target); + }; + valueProps.separatorText = ""; + } else if (item.name === "relations") { + valueProps.defaultRep = Obj; + } else { + valueProps.noGrip = true; + } + + const classList = ["node", "object-node"]; + if (focused) { + classList.push("focused"); + } + + const depthPadding = depth * TREE_DEPTH_PADDING_INCREMENT; + + return AccessibleProperty( + { + object, + focused, + accessibleFrontActorID: this.props.accessibleFront.actorID, + }, + () => + div( + { + className: classList.join(" "), + style: { + paddingInlineStart: depthPadding, + inlineSize: `calc(var(--accessibility-properties-item-width) - ${depthPadding}px)`, + }, + onClick: e => { + if (e.target.classList.contains("theme-twisty")) { + this.setExpanded(item, !expanded); + } + }, + }, + arrow, + span({ className: "object-label" }, item.name), + span({ className: "object-delimiter" }, ":"), + span({ className: "object-value" }, Rep(valueProps) || "") + ) + ); + } + + render() { + const { expanded, active, focused } = this.state; + const { items, parents, accessibleFront, labelledby } = this.props; + + if (accessibleFront) { + return Tree({ + ref: "props", + key: "accessible-properties", + itemHeight: TREE_ROW_HEIGHT, + getRoots: () => items, + getKey: item => item.path, + getParent: item => parents.get(item), + getChildren: item => item.children, + isExpanded: item => expanded.has(item.path), + onExpand: item => this.setExpanded(item, true), + onCollapse: item => this.setExpanded(item, false), + onFocus: item => { + if (this.state.focused !== item.path) { + this.setState({ focused: item.path }); + } + }, + onActivate: item => { + if (item == null) { + this.setState({ active: null }); + } else if (this.state.active !== item.path) { + this.setState({ active: item.path }); + } + }, + focused: findByPath(focused, items), + active: findByPath(active, items), + renderItem: this.renderItem, + labelledby, + }); + } + + return div( + { className: "info" }, + L10N.getStr("accessibility.accessible.notAvailable") + ); + } +} + +/** + * Match accessibility object from relations targets to the grip that's being activated. + * @param {Object} relations Object containing relations grouped by type and targets. + * @param {String} actorID Actor ID to match to the relation target. + * @return {Object} Accessible front that matches the relation target. + */ +const findAccessibleTarget = (relations, actorID) => { + for (const relationType in relations) { + let targets = relations[relationType]; + targets = Array.isArray(targets) ? targets : [targets]; + for (const target of targets) { + if (target.actorID === actorID) { + return target; + } + } + } + + return null; +}; + +/** + * Find an item based on a given path. + * @param {String} path + * Key of the item to be looked up. + * @param {Array} items + * Accessibility properties array. + * @return {Object?} + * Possibly found item. + */ +const findByPath = (path, items) => { + for (const item of items) { + if (item.path === path) { + return item; + } + + const found = findByPath(path, item.children); + if (found) { + return found; + } + } + return null; +}; + +/** + * Check if a given property is a DOMNode front. + * @param {Object?} value A property to check for being a DOMNode. + * @return {Boolean} A flag that indicates whether a property is a DOMNode. + */ +const isNodeFront = value => value && value.typeName === "domnode"; + +/** + * Check if a given property is an Accessible front. + * @param {Object?} value A property to check for being an Accessible. + * @return {Boolean} A flag that indicates whether a property is an Accessible. + */ +const isAccessibleFront = value => value && value.typeName === "accessible"; + +/** + * While waiting for a reps fix in https://github.com/firefox-devtools/reps/issues/92, + * translate accessibleFront to a grip-like object that can be used with an Accessible + * rep. + * + * @params {accessibleFront} accessibleFront + * The AccessibleFront for which we want to create a grip-like object. + * @returns {Object} a grip-like object that can be used with Reps. + */ +const translateAccessibleFrontToGrip = accessibleFront => ({ + actor: accessibleFront.actorID, + typeName: accessibleFront.typeName, + preview: { + name: accessibleFront.name, + role: accessibleFront.role, + // All the grid containers are assumed to be in the Accessibility tree. + isConnected: true, + }, +}); + +const translateNodeFrontToGripWrapper = nodeFront => ({ + ...translateNodeFrontToGrip(nodeFront), + typeName: nodeFront.typeName, +}); + +/** + * Build props ingestible by Tree component. + * @param {Object} props Component properties to be processed. + * @param {String} parentPath Unique path that is used to identify a Tree Node. + * @return {Object} Processed properties. + */ +const makeItemsForDetails = (props, parentPath) => + Object.getOwnPropertyNames(props).map(name => { + let children = []; + const path = `${parentPath}/${name}`; + let contents = props[name]; + + if (contents) { + if (isNodeFront(contents)) { + contents = translateNodeFrontToGripWrapper(contents); + name = "DOMNode"; + } else if (isAccessibleFront(contents)) { + contents = translateAccessibleFrontToGrip(contents); + } else if (Array.isArray(contents) || typeof contents === "object") { + children = makeItemsForDetails(contents, path); + } + } + + return { name, path, contents, children }; + }); + +const makeParentMap = items => { + const map = new WeakMap(); + + function _traverse(item) { + if (item.children.length) { + for (const child of item.children) { + map.set(child, item); + _traverse(child); + } + } + } + + items.forEach(_traverse); + return map; +}; + +const mapStateToProps = ({ details }) => { + const { + accessible: accessibleFront, + DOMNode: nodeFront, + relations, + } = details; + if (!accessibleFront || !nodeFront) { + return {}; + } + + const items = makeItemsForDetails( + ORDERED_PROPS.reduce((props, key) => { + if (key === "DOMNode") { + props.nodeFront = nodeFront; + } else if (key === "relations") { + props.relations = relations; + } else { + props[key] = accessibleFront[key]; + } + + return props; + }, {}), + "" + ); + const parents = makeParentMap(items); + + return { accessibleFront, nodeFront, items, parents, relations }; +}; + +module.exports = connect(mapStateToProps)(Accessible); diff --git a/devtools/client/accessibility/components/AuditController.js b/devtools/client/accessibility/components/AuditController.js new file mode 100644 index 0000000000..e6ada9a0a9 --- /dev/null +++ b/devtools/client/accessibility/components/AuditController.js @@ -0,0 +1,90 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const React = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); + +class AuditController extends React.Component { + static get propTypes() { + return { + accessibleFront: PropTypes.object.isRequired, + children: PropTypes.any, + }; + } + + constructor(props) { + super(props); + + const { + accessibleFront: { checks }, + } = props; + this.state = { + checks, + }; + + this.onAudited = this.onAudited.bind(this); + } + + // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507 + UNSAFE_componentWillMount() { + const { accessibleFront } = this.props; + accessibleFront.on("audited", this.onAudited); + } + + componentDidMount() { + this.maybeRequestAudit(); + } + + componentDidUpdate() { + this.maybeRequestAudit(); + } + + componentWillUnmount() { + const { accessibleFront } = this.props; + accessibleFront.off("audited", this.onAudited); + } + + onAudited() { + const { accessibleFront } = this.props; + if (accessibleFront.isDestroyed()) { + // Accessible front is being removed, stop listening for 'audited' events. + accessibleFront.off("audited", this.onAudited); + return; + } + + this.setState({ checks: accessibleFront.checks }); + } + + maybeRequestAudit() { + const { accessibleFront } = this.props; + if (accessibleFront.isDestroyed()) { + // Accessible front is being removed, stop listening for 'audited' events. + accessibleFront.off("audited", this.onAudited); + return; + } + + if (accessibleFront.checks) { + return; + } + + accessibleFront.audit().catch(error => { + // If the actor was destroyed (due to a connection closed for instance) do + // nothing, otherwise log a warning + if (!accessibleFront.isDestroyed()) { + console.warn(error); + } + }); + } + + render() { + const { children } = this.props; + const { checks } = this.state; + + return React.Children.only(React.cloneElement(children, { checks })); + } +} + +module.exports = AuditController; diff --git a/devtools/client/accessibility/components/AuditFilter.js b/devtools/client/accessibility/components/AuditFilter.js new file mode 100644 index 0000000000..361a1c30a7 --- /dev/null +++ b/devtools/client/accessibility/components/AuditFilter.js @@ -0,0 +1,91 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const React = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); + +const { + isFiltered, +} = require("resource://devtools/client/accessibility/utils/audit.js"); +const { + FILTERS, +} = require("resource://devtools/client/accessibility/constants.js"); +const { + accessibility: { + AUDIT_TYPE, + SCORES: { BEST_PRACTICES, FAIL, WARNING }, + }, +} = require("resource://devtools/shared/constants.js"); + +function validateCheck({ error, score }) { + return !error && [BEST_PRACTICES, FAIL, WARNING].includes(score); +} + +const AUDIT_TYPE_TO_FILTER = { + [AUDIT_TYPE.CONTRAST]: { + filterKey: FILTERS.CONTRAST, + validator: validateCheck, + }, + [AUDIT_TYPE.KEYBOARD]: { + filterKey: FILTERS.KEYBOARD, + validator: validateCheck, + }, + [AUDIT_TYPE.TEXT_LABEL]: { + filterKey: FILTERS.TEXT_LABEL, + validator: validateCheck, + }, +}; + +class AuditFilter extends React.Component { + static get propTypes() { + return { + checks: PropTypes.object, + children: PropTypes.any, + filters: PropTypes.object.isRequired, + }; + } + + isVisible(filters) { + return !isFiltered(filters); + } + + shouldHide() { + const { filters, checks } = this.props; + if (this.isVisible(filters)) { + return false; + } + + if (!checks || Object.values(checks).every(check => check == null)) { + return true; + } + + for (const type in checks) { + if ( + AUDIT_TYPE_TO_FILTER[type] && + checks[type] && + filters[AUDIT_TYPE_TO_FILTER[type].filterKey] && + AUDIT_TYPE_TO_FILTER[type].validator(checks[type]) + ) { + return false; + } + } + + return true; + } + + render() { + return this.shouldHide() ? null : this.props.children; + } +} + +const mapStateToProps = ({ audit: { filters } }) => { + return { filters }; +}; + +module.exports = connect(mapStateToProps)(AuditFilter); diff --git a/devtools/client/accessibility/components/AuditProgressOverlay.js b/devtools/client/accessibility/components/AuditProgressOverlay.js new file mode 100644 index 0000000000..e9f4291286 --- /dev/null +++ b/devtools/client/accessibility/components/AuditProgressOverlay.js @@ -0,0 +1,95 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const React = require("resource://devtools/client/shared/vendor/react.js"); +const ReactDOM = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); +const { PluralForm } = require("resource://devtools/shared/plural-form.js"); + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +/** + * Helper functional component to render an accessible text progressbar. + * @param {Object} props + * - id for the progressbar element + * - valuetext for the progressbar element + */ +function TextProgressBar({ id, textStringKey }) { + const text = L10N.getStr(textStringKey); + return ReactDOM.span( + { + id, + key: id, + role: "progressbar", + "aria-valuetext": text, + }, + text + ); +} + +class AuditProgressOverlay extends React.Component { + static get propTypes() { + return { + auditing: PropTypes.array.isRequired, + total: PropTypes.number, + percentage: PropTypes.number, + }; + } + + render() { + const { auditing, percentage, total } = this.props; + if (auditing.length === 0) { + return null; + } + + const id = "audit-progress-container"; + + if (total == null) { + return TextProgressBar({ + id, + textStringKey: "accessibility.progress.initializing", + }); + } + + if (percentage === 100) { + return TextProgressBar({ + id, + textStringKey: "accessibility.progress.finishing", + }); + } + + const progressbarString = PluralForm.get( + total, + L10N.getStr("accessibility.progress.progressbar") + ); + + return ReactDOM.span( + { + id, + key: id, + }, + progressbarString.replace("#1", total), + ReactDOM.progress({ + max: 100, + value: percentage, + className: "audit-progress-progressbar", + "aria-labelledby": id, + }) + ); + } +} + +const mapStateToProps = ({ audit: { auditing, progress } }) => { + const { total, percentage } = progress || {}; + return { auditing, total, percentage }; +}; + +module.exports = connect(mapStateToProps)(AuditProgressOverlay); diff --git a/devtools/client/accessibility/components/Badge.js b/devtools/client/accessibility/components/Badge.js new file mode 100644 index 0000000000..207bb96f55 --- /dev/null +++ b/devtools/client/accessibility/components/Badge.js @@ -0,0 +1,40 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + Component, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + span, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); + +class Badge extends Component { + static get propTypes() { + return { + score: PropTypes.string.isRequired, + label: PropTypes.string.isRequired, + ariaLabel: PropTypes.string, + tooltip: PropTypes.string, + }; + } + + render() { + const { score, label, ariaLabel, tooltip } = this.props; + + return span( + { + className: `audit-badge badge`, + "data-score": score, + title: tooltip, + "aria-label": ariaLabel || label, + }, + label + ); + } +} + +module.exports = Badge; diff --git a/devtools/client/accessibility/components/Badges.js b/devtools/client/accessibility/components/Badges.js new file mode 100644 index 0000000000..00079d21b6 --- /dev/null +++ b/devtools/client/accessibility/components/Badges.js @@ -0,0 +1,88 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + Component, + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + span, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +const { + accessibility: { AUDIT_TYPE }, +} = require("resource://devtools/shared/constants.js"); + +loader.lazyGetter(this, "ContrastBadge", () => + createFactory( + require("resource://devtools/client/accessibility/components/ContrastBadge.js") + ) +); + +loader.lazyGetter(this, "KeyboardBadge", () => + createFactory( + require("resource://devtools/client/accessibility/components/KeyboardBadge.js") + ) +); + +loader.lazyGetter(this, "TextLabelBadge", () => + createFactory( + require("resource://devtools/client/accessibility/components/TextLabelBadge.js") + ) +); + +function getComponentForAuditType(type) { + const auditTypeToComponentMap = { + [AUDIT_TYPE.CONTRAST]: ContrastBadge, + [AUDIT_TYPE.KEYBOARD]: KeyboardBadge, + [AUDIT_TYPE.TEXT_LABEL]: TextLabelBadge, + }; + + return auditTypeToComponentMap[type]; +} + +class Badges extends Component { + static get propTypes() { + return { + checks: PropTypes.object, + }; + } + + render() { + const { checks } = this.props; + if (!checks) { + return null; + } + + const items = []; + for (const type in checks) { + const component = getComponentForAuditType(type); + if (checks[type] && component) { + items.push(component({ key: type, ...checks[type] })); + } + } + + if (items.length === 0) { + return null; + } + + return span( + { + className: "badges", + role: "group", + "aria-label": L10N.getStr("accessibility.badges"), + }, + items + ); + } +} + +module.exports = Badges; diff --git a/devtools/client/accessibility/components/Button.js b/devtools/client/accessibility/components/Button.js new file mode 100644 index 0000000000..92cd90a56c --- /dev/null +++ b/devtools/client/accessibility/components/Button.js @@ -0,0 +1,112 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + Component, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + button, + span, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +const defaultProps = { + disabled: false, + busy: false, + title: null, + children: null, + className: "", +}; + +/** + * Button component that handles keyboard in an accessible way. When user + * uses the mouse to hover/click on the button, there is no focus + * highlighting. However if the user uses a keyboard to focus on the button, + * it will have focus highlighting in the form of an outline. + */ +class Button extends Component { + static get propTypes() { + return { + disabled: PropTypes.bool, + busy: PropTypes.bool, + title: PropTypes.string, + children: PropTypes.string, + className: PropTypes.string, + }; + } + + static get defaultProps() { + return defaultProps; + } + + render() { + const className = [ + ...this.props.className.split(" "), + "devtools-button", + ].join(" "); + const props = Object.assign({}, this.props, { + className, + "aria-busy": this.props.busy.toString(), + busy: this.props.busy.toString(), + }); + + const classList = ["btn-content"]; + if (this.props.busy) { + classList.push("devtools-throbber"); + } + + return button( + props, + span( + { + className: classList.join(" "), + tabIndex: -1, + }, + this.props.children + ) + ); + } +} + +function ToggleButton(props) { + const { + active, + busy, + disabled, + label, + className, + onClick, + onKeyDown, + tooltip, + } = props; + const classList = [...className.split(" "), "toggle-button"]; + + if (active) { + classList.push("checked"); + } + + if (busy) { + classList.push("devtools-throbber"); + } + + return button( + { + disabled, + "aria-pressed": active === true, + "aria-busy": busy, + className: classList.join(" "), + onClick, + onKeyDown, + title: tooltip, + }, + label + ); +} + +module.exports = { + Button, + ToggleButton, +}; diff --git a/devtools/client/accessibility/components/Check.js b/devtools/client/accessibility/components/Check.js new file mode 100644 index 0000000000..3ca6c9c39a --- /dev/null +++ b/devtools/client/accessibility/components/Check.js @@ -0,0 +1,157 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + Component, + createFactory, + PureComponent, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const ReactDOM = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js"); +const Localized = createFactory(FluentReact.Localized); + +const { openDocLink } = require("resource://devtools/client/shared/link.js"); + +const { + accessibility: { + SCORES: { BEST_PRACTICES, FAIL, WARNING }, + }, +} = require("resource://devtools/shared/constants.js"); + +/** + * A map of accessibility scores to the text descriptions of check icons. + */ +const SCORE_TO_ICON_MAP = { + [BEST_PRACTICES]: { + l10nId: "accessibility-best-practices", + src: "chrome://devtools/skin/images/info.svg", + }, + [FAIL]: { + l10nId: "accessibility-fail", + src: "chrome://devtools/skin/images/error.svg", + }, + [WARNING]: { + l10nId: "accessibility-warning", + src: "chrome://devtools/skin/images/alert.svg", + }, +}; + +/** + * Localized "Learn more" link that opens a new tab with relevant documentation. + */ +class LearnMoreClass extends PureComponent { + static get propTypes() { + return { + href: PropTypes.string, + l10nId: PropTypes.string.isRequired, + onClick: PropTypes.func, + }; + } + + static get defaultProps() { + return { + href: "#", + l10nId: null, + onClick: LearnMoreClass.openDocOnClick, + }; + } + + static openDocOnClick(event) { + event.preventDefault(); + openDocLink(event.target.href); + } + + render() { + const { href, l10nId, onClick } = this.props; + const className = "link"; + + return Localized({ id: l10nId }, ReactDOM.a({ className, href, onClick })); + } +} + +const LearnMore = createFactory(LearnMoreClass); + +/** + * Renders icon with text description for the accessibility check. + * + * @param {Object} + * Options: + * - score: value from SCORES from "devtools/shared/constants" + */ +function Icon({ score }) { + const { l10nId, src } = SCORE_TO_ICON_MAP[score]; + + return Localized( + { id: l10nId, attrs: { alt: true } }, + ReactDOM.img({ src, "data-score": score, className: "icon" }) + ); +} + +/** + * Renders text description of the accessibility check. + * + * @param {Object} + * Options: + * - args: arguments for fluent localized string + * - href: url for the learn more link pointing to MDN + * - l10nId: fluent localization id + */ +function Annotation({ args, href, l10nId }) { + return Localized( + { + id: l10nId, + a: LearnMore({ l10nId: "accessibility-learn-more", href }), + ...args, + }, + ReactDOM.p({ className: "accessibility-check-annotation" }) + ); +} + +/** + * Component for rendering a check for accessibliity checks section, + * warnings and best practices suggestions association with a given + * accessibility object in the accessibility tree. + */ +class Check extends Component { + static get propTypes() { + return { + getAnnotation: PropTypes.func.isRequired, + id: PropTypes.string.isRequired, + issue: PropTypes.string.isRequired, + score: PropTypes.string.isRequired, + }; + } + + render() { + const { getAnnotation, id, issue, score } = this.props; + + return ReactDOM.div( + { + role: "presentation", + tabIndex: "-1", + className: "accessibility-check", + }, + Localized( + { + id, + }, + ReactDOM.h3({ className: "accessibility-check-header" }) + ), + ReactDOM.div( + { + role: "presentation", + tabIndex: "-1", + }, + Icon({ score }), + Annotation({ ...getAnnotation(issue) }) + ) + ); + } +} + +module.exports = Check; diff --git a/devtools/client/accessibility/components/Checks.js b/devtools/client/accessibility/components/Checks.js new file mode 100644 index 0000000000..f2b4e4835a --- /dev/null +++ b/devtools/client/accessibility/components/Checks.js @@ -0,0 +1,117 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + Component, + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + div, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +const List = createFactory( + require("resource://devtools/client/shared/components/List.js").List +); +const ColorContrastCheck = createFactory( + require("resource://devtools/client/accessibility/components/ColorContrastAccessibility.js") + .ColorContrastCheck +); +const TextLabelCheck = createFactory( + require("resource://devtools/client/accessibility/components/TextLabelCheck.js") +); +const KeyboardCheck = createFactory( + require("resource://devtools/client/accessibility/components/KeyboardCheck.js") +); +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +const { + accessibility: { AUDIT_TYPE }, +} = require("resource://devtools/shared/constants.js"); + +function EmptyChecks() { + return div( + { + className: "checks-empty", + role: "presentation", + tabIndex: "-1", + }, + L10N.getStr("accessibility.checks.empty2") + ); +} + +// Component that is responsible for rendering accessible audit data in the a11y panel +// sidebar. +class Checks extends Component { + static get propTypes() { + return { + audit: PropTypes.object, + labelledby: PropTypes.string.isRequired, + }; + } + + [AUDIT_TYPE.CONTRAST](contrastRatio) { + return ColorContrastCheck(contrastRatio); + } + + [AUDIT_TYPE.KEYBOARD](keyboardCheck) { + return KeyboardCheck(keyboardCheck); + } + + [AUDIT_TYPE.TEXT_LABEL](textLabelCheck) { + return TextLabelCheck(textLabelCheck); + } + + render() { + const { audit, labelledby } = this.props; + if (!audit) { + return EmptyChecks(); + } + + const items = []; + for (const name in audit) { + // There are going to be various audit reports for this object, sent by the server. + // Iterate over them and delegate rendering to the method with the corresponding + // name. + if (audit[name] && this[name]) { + items.push({ + component: this[name](audit[name]), + className: name, + key: name, + }); + } + } + + if (items.length === 0) { + return EmptyChecks(); + } + + return div( + { + className: "checks", + role: "presentation", + tabIndex: "-1", + }, + List({ items, labelledby }) + ); + } +} + +const mapStateToProps = ({ details, ui }) => { + const { audit } = details; + if (!audit) { + return {}; + } + + return { audit }; +}; + +module.exports = connect(mapStateToProps)(Checks); diff --git a/devtools/client/accessibility/components/ColorContrastAccessibility.js b/devtools/client/accessibility/components/ColorContrastAccessibility.js new file mode 100644 index 0000000000..117ab67593 --- /dev/null +++ b/devtools/client/accessibility/components/ColorContrastAccessibility.js @@ -0,0 +1,229 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + Component, + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + div, + span, + h3, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const LearnMoreLink = createFactory( + require("resource://devtools/client/accessibility/components/LearnMoreLink.js") +); + +const { + A11Y_CONTRAST_LEARN_MORE_LINK, +} = require("resource://devtools/client/accessibility/constants.js"); +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +/** + * Component that renders a colour contrast value along with a swatch preview of what the + * text and background colours are. + */ +class ContrastValueClass extends Component { + static get propTypes() { + return { + backgroundColor: PropTypes.array.isRequired, + color: PropTypes.array.isRequired, + value: PropTypes.number.isRequired, + score: PropTypes.string, + }; + } + + render() { + const { backgroundColor, color, value, score } = this.props; + + const className = ["accessibility-contrast-value", score].join(" "); + + return span( + { + className, + role: "presentation", + style: { + "--accessibility-contrast-color": `rgba(${color})`, + "--accessibility-contrast-bg": `rgba(${backgroundColor})`, + }, + }, + value.toFixed(2) + ); + } +} + +const ContrastValue = createFactory(ContrastValueClass); + +/** + * Component that renders labeled colour contrast values together with the large text + * indiscator. + */ +class ColorContrastAccessibilityClass extends Component { + static get propTypes() { + return { + error: PropTypes.string, + isLargeText: PropTypes.bool.isRequired, + color: PropTypes.array.isRequired, + value: PropTypes.number, + min: PropTypes.number, + max: PropTypes.number, + backgroundColor: PropTypes.array, + backgroundColorMin: PropTypes.array, + backgroundColorMax: PropTypes.array, + score: PropTypes.string, + scoreMin: PropTypes.string, + scoreMax: PropTypes.string, + }; + } + + render() { + const { + error, + isLargeText, + color, + value, + backgroundColor, + score, + min, + backgroundColorMin, + scoreMin, + max, + backgroundColorMax, + scoreMax, + } = this.props; + + const children = []; + + if (error) { + children.push( + span( + { + className: "accessibility-color-contrast-error", + role: "presentation", + }, + L10N.getStr("accessibility.contrast.error") + ) + ); + + return div( + { + role: "presentation", + tabIndex: "-1", + className: "accessibility-color-contrast", + }, + ...children + ); + } + + if (value) { + children.push(ContrastValue({ score, color, backgroundColor, value })); + } else { + children.push( + ContrastValue({ + score: scoreMin, + color, + backgroundColor: backgroundColorMin, + value: min, + }), + div({ + role: "presentation", + tabIndex: "-1", + className: "accessibility-color-contrast-separator", + }), + ContrastValue({ + score: scoreMax, + color, + backgroundColor: backgroundColorMax, + value: max, + }) + ); + } + + if (isLargeText) { + children.push( + span( + { + className: "accessibility-color-contrast-large-text", + role: "presentation", + title: L10N.getStr("accessibility.contrast.large.title"), + }, + L10N.getStr("accessibility.contrast.large.text") + ) + ); + } + + return div( + { + role: "presentation", + tabIndex: "-1", + className: "accessibility-color-contrast", + }, + ...children + ); + } +} + +const ColorContrastAccessibility = createFactory( + ColorContrastAccessibilityClass +); + +class ContrastAnnotationClass extends Component { + static get propTypes() { + return { + score: PropTypes.string, + }; + } + + render() { + const { score } = this.props; + + return LearnMoreLink({ + className: "accessibility-check-annotation", + href: A11Y_CONTRAST_LEARN_MORE_LINK, + learnMoreStringKey: "accessibility.learnMore", + l10n: L10N, + messageStringKey: `accessibility.contrast.annotation.${score}`, + }); + } +} + +const ContrastAnnotation = createFactory(ContrastAnnotationClass); + +class ColorContrastCheck extends Component { + static get propTypes() { + return { + error: PropTypes.string.isRequired, + }; + } + + render() { + const { error } = this.props; + + return div( + { + role: "presentation", + tabIndex: "-1", + className: "accessibility-check", + }, + h3( + { + className: "accessibility-check-header", + }, + L10N.getStr("accessibility.contrast.header") + ), + ColorContrastAccessibility(this.props), + !error && ContrastAnnotation(this.props) + ); + } +} + +module.exports = { + ColorContrastAccessibility: ColorContrastAccessibilityClass, + ColorContrastCheck, +}; diff --git a/devtools/client/accessibility/components/ContrastBadge.js b/devtools/client/accessibility/components/ContrastBadge.js new file mode 100644 index 0000000000..ee37958f1e --- /dev/null +++ b/devtools/client/accessibility/components/ContrastBadge.js @@ -0,0 +1,55 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + createFactory, + PureComponent, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +const { + accessibility: { SCORES }, +} = require("resource://devtools/shared/constants.js"); + +loader.lazyGetter(this, "Badge", () => + createFactory( + require("resource://devtools/client/accessibility/components/Badge.js") + ) +); + +/** + * Component for rendering a badge for contrast accessibliity check + * failures association with a given accessibility object in the accessibility + * tree. + */ +class ContrastBadge extends PureComponent { + static get propTypes() { + return { + error: PropTypes.string, + score: PropTypes.string, + }; + } + + render() { + const { error, score } = this.props; + if (error || score !== SCORES.FAIL) { + return null; + } + + return Badge({ + score, + label: L10N.getStr("accessibility.badge.contrast"), + ariaLabel: L10N.getStr("accessibility.badge.contrast.warning"), + tooltip: L10N.getStr("accessibility.badge.contrast.tooltip"), + }); + } +} + +module.exports = ContrastBadge; diff --git a/devtools/client/accessibility/components/Description.js b/devtools/client/accessibility/components/Description.js new file mode 100644 index 0000000000..a31dbcbfa6 --- /dev/null +++ b/devtools/client/accessibility/components/Description.js @@ -0,0 +1,56 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React & Redux +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + div, + p, + img, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const LearnMoreLink = createFactory( + require("resource://devtools/client/accessibility/components/LearnMoreLink.js") +); + +// Localization +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +const { + A11Y_LEARN_MORE_LINK, +} = require("resource://devtools/client/accessibility/constants.js"); + +/** + * Landing UI for the accessibility panel when Accessibility features are + * deactivated. + */ +function Description() { + return div( + { className: "description", role: "presentation", tabIndex: "-1" }, + div( + { className: "general", role: "presentation", tabIndex: "-1" }, + img({ + src: "chrome://devtools/skin/images/accessibility.svg", + alt: L10N.getStr("accessibility.logo"), + }), + div( + { role: "presentation", tabIndex: "-1" }, + LearnMoreLink({ + href: A11Y_LEARN_MORE_LINK, + learnMoreStringKey: "accessibility.learnMore", + l10n: L10N, + messageStringKey: "accessibility.description.general.p1", + }), + p({}, L10N.getStr("accessibility.enable.disabledTitle")) + ) + ) + ); +} + +// Exports from this module +exports.Description = Description; diff --git a/devtools/client/accessibility/components/DisplayTabbingOrder.js b/devtools/client/accessibility/components/DisplayTabbingOrder.js new file mode 100644 index 0000000000..f6e3fdf453 --- /dev/null +++ b/devtools/client/accessibility/components/DisplayTabbingOrder.js @@ -0,0 +1,79 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + PureComponent, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + label, + input, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); +const { + updateDisplayTabbingOrder, +} = require("resource://devtools/client/accessibility/actions/ui.js"); + +class DisplayTabbingOrder extends PureComponent { + static get propTypes() { + return { + dispatch: PropTypes.func.isRequired, + tabbingOrderDisplayed: PropTypes.bool.isRequired, + }; + } + + constructor(props) { + super(props); + + this.state = { + disabled: false, + }; + + this.onChange = this.onChange.bind(this); + } + + async onChange() { + const { dispatch, tabbingOrderDisplayed } = this.props; + + this.setState({ disabled: true }); + await dispatch(updateDisplayTabbingOrder(!tabbingOrderDisplayed)); + this.setState({ disabled: false }); + } + + render() { + const { tabbingOrderDisplayed } = this.props; + return label( + { + className: + "accessibility-tabbing-order devtools-checkbox-label devtools-ellipsis-text", + htmlFor: "devtools-display-tabbing-order-checkbox", + title: L10N.getStr("accessibility.toolbar.displayTabbingOrder.tooltip"), + }, + input({ + id: "devtools-display-tabbing-order-checkbox", + className: "devtools-checkbox", + type: "checkbox", + checked: tabbingOrderDisplayed, + disabled: this.state.disabled, + onChange: this.onChange, + }), + L10N.getStr("accessibility.toolbar.displayTabbingOrder.label") + ); + } +} + +const mapStateToProps = ({ ui: { tabbingOrderDisplayed } }) => ({ + tabbingOrderDisplayed, +}); + +module.exports = connect(mapStateToProps)(DisplayTabbingOrder); diff --git a/devtools/client/accessibility/components/KeyboardBadge.js b/devtools/client/accessibility/components/KeyboardBadge.js new file mode 100644 index 0000000000..ac6b6b8841 --- /dev/null +++ b/devtools/client/accessibility/components/KeyboardBadge.js @@ -0,0 +1,56 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +// React +const { + createFactory, + PureComponent, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +const { + accessibility: { + SCORES: { BEST_PRACTICES, FAIL, WARNING }, + }, +} = require("resource://devtools/shared/constants.js"); + +loader.lazyGetter(this, "Badge", () => + createFactory( + require("resource://devtools/client/accessibility/components/Badge.js") + ) +); + +/** + * Component for rendering a badge for keyboard accessibliity check failures + * association with a given accessibility object in the accessibility tree. + */ +class KeyboardBadge extends PureComponent { + static get propTypes() { + return { + error: PropTypes.string, + score: PropTypes.string, + }; + } + + render() { + const { error, score } = this.props; + if (error || ![BEST_PRACTICES, FAIL, WARNING].includes(score)) { + return null; + } + + return Badge({ + score, + label: L10N.getStr("accessibility.badge.keyboard"), + tooltip: L10N.getStr("accessibility.badge.keyboard.tooltip"), + }); + } +} + +module.exports = KeyboardBadge; diff --git a/devtools/client/accessibility/components/KeyboardCheck.js b/devtools/client/accessibility/components/KeyboardCheck.js new file mode 100644 index 0000000000..0109dd22b0 --- /dev/null +++ b/devtools/client/accessibility/components/KeyboardCheck.js @@ -0,0 +1,94 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + createFactory, + PureComponent, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const ReactDOM = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +const Check = createFactory( + require("resource://devtools/client/accessibility/components/Check.js") +); + +const { + A11Y_KEYBOARD_LINKS, +} = require("resource://devtools/client/accessibility/constants.js"); +const { + accessibility: { + AUDIT_TYPE: { KEYBOARD }, + ISSUE_TYPE: { + [KEYBOARD]: { + FOCUSABLE_NO_SEMANTICS, + FOCUSABLE_POSITIVE_TABINDEX, + INTERACTIVE_NO_ACTION, + INTERACTIVE_NOT_FOCUSABLE, + MOUSE_INTERACTIVE_ONLY, + NO_FOCUS_VISIBLE, + }, + }, + }, +} = require("resource://devtools/shared/constants.js"); + +/** + * A map from text label issues to annotation component properties. + */ +const ISSUE_TO_ANNOTATION_MAP = { + [FOCUSABLE_NO_SEMANTICS]: { + href: A11Y_KEYBOARD_LINKS.FOCUSABLE_NO_SEMANTICS, + l10nId: "accessibility-keyboard-issue-semantics", + }, + [FOCUSABLE_POSITIVE_TABINDEX]: { + href: A11Y_KEYBOARD_LINKS.FOCUSABLE_POSITIVE_TABINDEX, + l10nId: "accessibility-keyboard-issue-tabindex", + args: { + get code() { + return ReactDOM.code({}, "tabindex"); + }, + }, + }, + [INTERACTIVE_NO_ACTION]: { + href: A11Y_KEYBOARD_LINKS.INTERACTIVE_NO_ACTION, + l10nId: "accessibility-keyboard-issue-action", + }, + [INTERACTIVE_NOT_FOCUSABLE]: { + href: A11Y_KEYBOARD_LINKS.INTERACTIVE_NOT_FOCUSABLE, + l10nId: "accessibility-keyboard-issue-focusable", + }, + [MOUSE_INTERACTIVE_ONLY]: { + href: A11Y_KEYBOARD_LINKS.MOUSE_INTERACTIVE_ONLY, + l10nId: "accessibility-keyboard-issue-mouse-only", + }, + [NO_FOCUS_VISIBLE]: { + href: A11Y_KEYBOARD_LINKS.NO_FOCUS_VISIBLE, + l10nId: "accessibility-keyboard-issue-focus-visible", + }, +}; + +/** + * Component for rendering a check for text label accessibliity check failures, + * warnings and best practices suggestions association with a given + * accessibility object in the accessibility tree. + */ +class KeyboardCheck extends PureComponent { + static get propTypes() { + return { + issue: PropTypes.string.isRequired, + score: PropTypes.string.isRequired, + }; + } + + render() { + return Check({ + ...this.props, + getAnnotation: issue => ISSUE_TO_ANNOTATION_MAP[issue], + id: "accessibility-keyboard-header", + }); + } +} + +module.exports = KeyboardCheck; diff --git a/devtools/client/accessibility/components/LearnMoreLink.js b/devtools/client/accessibility/components/LearnMoreLink.js new file mode 100644 index 0000000000..2a21df4ea5 --- /dev/null +++ b/devtools/client/accessibility/components/LearnMoreLink.js @@ -0,0 +1,76 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + Component, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + p, + a, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +const { openDocLink } = require("resource://devtools/client/shared/link.js"); + +/** + * Localization friendly component for rendering a block of text with a "Learn more" link + * as a part of it. + */ +class LearnMoreLink extends Component { + static get propTypes() { + return { + className: PropTypes.string, + href: PropTypes.string, + learnMoreStringKey: PropTypes.string.isRequired, + l10n: PropTypes.object.isRequired, + messageStringKey: PropTypes.string.isRequired, + onClick: PropTypes.func, + }; + } + + static get defaultProps() { + return { + href: "#", + learnMoreStringKey: null, + l10n: null, + messageStringKey: null, + onClick: LearnMoreLink.openDocOnClick, + }; + } + + static openDocOnClick(event) { + event.preventDefault(); + openDocLink(event.target.href); + } + + render() { + const { + className, + href, + learnMoreStringKey, + l10n, + messageStringKey, + onClick, + } = this.props; + const learnMoreString = l10n.getStr(learnMoreStringKey); + const messageString = l10n.getFormatStr(messageStringKey, learnMoreString); + + // Split the paragraph string with the link as a separator, and include the link into + // results. + const re = new RegExp(`(\\b${learnMoreString}\\b)`); + const contents = messageString.split(re); + contents[1] = a({ className: "link", href, onClick }, contents[1]); + + return p( + { + className, + }, + ...contents + ); + } +} + +module.exports = LearnMoreLink; diff --git a/devtools/client/accessibility/components/MainFrame.js b/devtools/client/accessibility/components/MainFrame.js new file mode 100644 index 0000000000..d918dc7be0 --- /dev/null +++ b/devtools/client/accessibility/components/MainFrame.js @@ -0,0 +1,245 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React & Redux +const { + Component, + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + span, + div, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); +const { + enable, + reset, + updateCanBeEnabled, + updateCanBeDisabled, +} = require("resource://devtools/client/accessibility/actions/ui.js"); + +// Localization +const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js"); +const LocalizationProvider = createFactory(FluentReact.LocalizationProvider); + +// Constants +const { + SIDEBAR_WIDTH, + PORTRAIT_MODE_WIDTH, +} = require("resource://devtools/client/accessibility/constants.js"); + +// Accessibility Panel +const AccessibilityTree = createFactory( + require("resource://devtools/client/accessibility/components/AccessibilityTree.js") +); +const AuditProgressOverlay = createFactory( + require("resource://devtools/client/accessibility/components/AuditProgressOverlay.js") +); +const Description = createFactory( + require("resource://devtools/client/accessibility/components/Description.js") + .Description +); +const RightSidebar = createFactory( + require("resource://devtools/client/accessibility/components/RightSidebar.js") +); +const Toolbar = createFactory( + require("resource://devtools/client/accessibility/components/Toolbar.js") + .Toolbar +); +const SplitBox = createFactory( + require("resource://devtools/client/shared/components/splitter/SplitBox.js") +); + +/** + * Renders basic layout of the Accessibility panel. The Accessibility panel + * content consists of two main parts: tree and sidebar. + */ +class MainFrame extends Component { + static get propTypes() { + return { + fluentBundles: PropTypes.array.isRequired, + enabled: PropTypes.bool.isRequired, + dispatch: PropTypes.func.isRequired, + auditing: PropTypes.array.isRequired, + supports: PropTypes.object, + toolbox: PropTypes.object.isRequired, + getAccessibilityTreeRoot: PropTypes.func.isRequired, + startListeningForAccessibilityEvents: PropTypes.func.isRequired, + stopListeningForAccessibilityEvents: PropTypes.func.isRequired, + audit: PropTypes.func.isRequired, + simulate: PropTypes.func, + enableAccessibility: PropTypes.func.isRequired, + resetAccessiblity: PropTypes.func.isRequired, + startListeningForLifecycleEvents: PropTypes.func.isRequired, + stopListeningForLifecycleEvents: PropTypes.func.isRequired, + startListeningForParentLifecycleEvents: PropTypes.func.isRequired, + stopListeningForParentLifecycleEvents: PropTypes.func.isRequired, + highlightAccessible: PropTypes.func.isRequired, + unhighlightAccessible: PropTypes.func.isRequired, + }; + } + + constructor(props) { + super(props); + + this.resetAccessibility = this.resetAccessibility.bind(this); + this.onPanelWindowResize = this.onPanelWindowResize.bind(this); + this.onCanBeEnabledChange = this.onCanBeEnabledChange.bind(this); + this.onCanBeDisabledChange = this.onCanBeDisabledChange.bind(this); + } + + // FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=1774507 + UNSAFE_componentWillMount() { + this.props.startListeningForLifecycleEvents({ + init: this.resetAccessibility, + shutdown: this.resetAccessibility, + }); + this.props.startListeningForParentLifecycleEvents({ + "can-be-enabled-change": this.onCanBeEnabledChange, + "can-be-disabled-change": this.onCanBeDisabledChange, + }); + this.props.startListeningForAccessibilityEvents({ + "top-level-document-ready": this.resetAccessibility, + }); + window.addEventListener("resize", this.onPanelWindowResize, true); + } + + componentWillUnmount() { + this.props.stopListeningForLifecycleEvents({ + init: this.resetAccessibility, + shutdown: this.resetAccessibility, + }); + this.props.stopListeningForParentLifecycleEvents({ + "can-be-enabled-change": this.onCanBeEnabledChange, + "can-be-disabled-change": this.onCanBeDisabledChange, + }); + this.props.stopListeningForAccessibilityEvents({ + "top-level-document-ready": this.resetAccessibility, + }); + window.removeEventListener("resize", this.onPanelWindowResize, true); + } + + resetAccessibility() { + const { dispatch, resetAccessiblity, supports } = this.props; + dispatch(reset(resetAccessiblity, supports)); + } + + onCanBeEnabledChange(canBeEnabled) { + const { enableAccessibility, dispatch } = this.props; + dispatch(updateCanBeEnabled(canBeEnabled)); + if (canBeEnabled) { + dispatch(enable(enableAccessibility)); + } + } + + onCanBeDisabledChange(canBeDisabled) { + this.props.dispatch(updateCanBeDisabled(canBeDisabled)); + } + + get useLandscapeMode() { + const { clientWidth } = document.getElementById("content"); + return clientWidth > PORTRAIT_MODE_WIDTH; + } + + /** + * If panel width is less than PORTRAIT_MODE_WIDTH px, the splitter changes + * its mode to `horizontal` to support portrait view. + */ + onPanelWindowResize() { + if (this.refs.splitBox) { + this.refs.splitBox.setState({ vert: this.useLandscapeMode }); + } + } + + /** + * Render Accessibility panel content + */ + render() { + const { + fluentBundles, + enabled, + auditing, + simulate, + toolbox, + getAccessibilityTreeRoot, + startListeningForAccessibilityEvents, + stopListeningForAccessibilityEvents, + audit, + highlightAccessible, + unhighlightAccessible, + } = this.props; + + if (!enabled) { + return Description(); + } + + // Audit is currently running. + const isAuditing = !!auditing.length; + + return LocalizationProvider( + { bundles: fluentBundles }, + div( + { className: "mainFrame", role: "presentation", tabIndex: "-1" }, + Toolbar({ + audit, + simulate, + toolboxDoc: toolbox.doc, + }), + isAuditing && AuditProgressOverlay(), + span( + { + "aria-hidden": isAuditing, + role: "presentation", + style: { display: "contents" }, + }, + SplitBox({ + ref: "splitBox", + initialSize: SIDEBAR_WIDTH, + minSize: "10%", + maxSize: "80%", + splitterSize: 1, + endPanelControl: true, + startPanel: div( + { + className: "main-panel", + role: "presentation", + tabIndex: "-1", + }, + AccessibilityTree({ + toolboxDoc: toolbox.doc, + getAccessibilityTreeRoot, + startListeningForAccessibilityEvents, + stopListeningForAccessibilityEvents, + highlightAccessible, + unhighlightAccessible, + }) + ), + endPanel: RightSidebar({ + highlightAccessible, + unhighlightAccessible, + toolbox, + }), + vert: this.useLandscapeMode, + }) + ) + ) + ); + } +} + +const mapStateToProps = ({ + ui: { enabled, supports }, + audit: { auditing }, +}) => ({ + enabled, + supports, + auditing, +}); + +// Exports from this module +module.exports = connect(mapStateToProps)(MainFrame); diff --git a/devtools/client/accessibility/components/RightSidebar.js b/devtools/client/accessibility/components/RightSidebar.js new file mode 100644 index 0000000000..f525b96294 --- /dev/null +++ b/devtools/client/accessibility/components/RightSidebar.js @@ -0,0 +1,67 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + div, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); +const Accessible = createFactory( + require("resource://devtools/client/accessibility/components/Accessible.js") +); +const Accordion = createFactory( + require("resource://devtools/client/shared/components/Accordion.js") +); +const Checks = createFactory( + require("resource://devtools/client/accessibility/components/Checks.js") +); + +// Component that is responsible for rendering accessible panel's sidebar. +function RightSidebar({ highlightAccessible, unhighlightAccessible, toolbox }) { + const propertiesID = "accessibility-properties"; + const checksID = "accessibility-checks"; + + return div( + { + className: "right-sidebar", + role: "presentation", + tabIndex: "-1", + }, + Accordion({ + items: [ + { + className: "checks", + component: Checks, + componentProps: { labelledby: `${checksID}-header` }, + header: L10N.getStr("accessibility.checks"), + id: checksID, + opened: true, + }, + { + className: "accessible", + component: Accessible, + componentProps: { + highlightAccessible, + unhighlightAccessible, + toolboxHighlighter: toolbox.getHighlighter(), + toolbox, + labelledby: `${propertiesID}-header`, + }, + header: L10N.getStr("accessibility.properties"), + id: propertiesID, + opened: true, + }, + ], + }) + ); +} + +module.exports = RightSidebar; diff --git a/devtools/client/accessibility/components/SimulationMenuButton.js b/devtools/client/accessibility/components/SimulationMenuButton.js new file mode 100644 index 0000000000..6fd21f4cc8 --- /dev/null +++ b/devtools/client/accessibility/components/SimulationMenuButton.js @@ -0,0 +1,167 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +/* global gTelemetry */ + +// React +const { + createFactory, + Component, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + hr, + span, + div, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); +const MenuButton = createFactory( + require("resource://devtools/client/shared/components/menu/MenuButton.js") +); +const { openDocLink } = require("resource://devtools/client/shared/link.js"); +const { + A11Y_SIMULATION_DOCUMENTATION_LINK, +} = require("resource://devtools/client/accessibility/constants.js"); +const { + accessibility: { SIMULATION_TYPE }, +} = require("resource://devtools/shared/constants.js"); +const actions = require("resource://devtools/client/accessibility/actions/simulation.js"); + +loader.lazyGetter(this, "MenuItem", function () { + return createFactory( + require("resource://devtools/client/shared/components/menu/MenuItem.js") + ); +}); +loader.lazyGetter(this, "MenuList", function () { + return createFactory( + require("resource://devtools/client/shared/components/menu/MenuList.js") + ); +}); + +const TELEMETRY_SIMULATION_ACTIVATED = + "devtools.accessibility.simulation_activated"; +const SIMULATION_MENU_LABELS = { + NONE: "accessibility.filter.none", + [SIMULATION_TYPE.ACHROMATOPSIA]: "accessibility.simulation.achromatopsia", + [SIMULATION_TYPE.PROTANOPIA]: "accessibility.simulation.protanopia", + [SIMULATION_TYPE.DEUTERANOPIA]: "accessibility.simulation.deuteranopia", + [SIMULATION_TYPE.TRITANOPIA]: "accessibility.simulation.tritanopia", + [SIMULATION_TYPE.CONTRAST_LOSS]: "accessibility.simulation.contrastLoss", + DOCUMENTATION: "accessibility.documentation.label", +}; + +class SimulationMenuButton extends Component { + static get propTypes() { + return { + simulate: PropTypes.func, + simulation: PropTypes.object.isRequired, + dispatch: PropTypes.func.isRequired, + toolboxDoc: PropTypes.object.isRequired, + }; + } + + constructor(props) { + super(props); + + this.disableSimulation = this.disableSimulation.bind(this); + } + + disableSimulation() { + const { dispatch, simulate: simulateFunc } = this.props; + + dispatch(actions.simulate(simulateFunc)); + } + + toggleSimulation(simKey) { + const { dispatch, simulation, simulate: simulateFunc } = this.props; + + if (!simulation[simKey]) { + if (gTelemetry) { + gTelemetry.keyedScalarAdd(TELEMETRY_SIMULATION_ACTIVATED, simKey, 1); + } + + dispatch(actions.simulate(simulateFunc, [simKey])); + return; + } + + this.disableSimulation(); + } + + render() { + const { simulation, toolboxDoc } = this.props; + const simulationMenuButtonId = "simulation-menu-button"; + const toolbarLabelID = "accessibility-simulation-label"; + const currSimulation = Object.entries(simulation).find( + simEntry => simEntry[1] + ); + + const items = [ + // No simulation option + MenuItem({ + key: "simulation-none", + label: L10N.getStr(SIMULATION_MENU_LABELS.NONE), + checked: !currSimulation, + onClick: this.disableSimulation, + }), + hr({ key: "hr-1" }), + // Simulation options + ...Object.keys(SIMULATION_TYPE).map(simType => + MenuItem({ + key: `simulation-${simType}`, + label: L10N.getStr(SIMULATION_MENU_LABELS[simType]), + checked: simulation[simType], + onClick: this.toggleSimulation.bind(this, simType), + }) + ), + hr({ key: "hr-2" }), + // Documentation link + MenuItem({ + className: "link", + key: "simulation-documentation", + label: L10N.getStr(SIMULATION_MENU_LABELS.DOCUMENTATION), + role: "link", + onClick: () => openDocLink(A11Y_SIMULATION_DOCUMENTATION_LINK), + }), + ]; + + return div( + { + role: "group", + className: "accessibility-simulation", + "aria-labelledby": toolbarLabelID, + }, + span( + { id: toolbarLabelID, role: "presentation" }, + L10N.getStr("accessibility.simulation") + ), + MenuButton( + { + id: simulationMenuButtonId, + menuId: simulationMenuButtonId + "-menu", + className: `devtools-button toolbar-menu-button simulation${ + currSimulation ? " active" : "" + }`, + toolboxDoc, + label: L10N.getStr( + SIMULATION_MENU_LABELS[currSimulation ? currSimulation[0] : "NONE"] + ), + }, + MenuList({}, items) + ) + ); + } +} + +const mapStateToProps = ({ simulation }) => { + return { simulation }; +}; + +// Exports from this module +module.exports = connect(mapStateToProps)(SimulationMenuButton); diff --git a/devtools/client/accessibility/components/TextLabelBadge.js b/devtools/client/accessibility/components/TextLabelBadge.js new file mode 100644 index 0000000000..0ff54ef8e0 --- /dev/null +++ b/devtools/client/accessibility/components/TextLabelBadge.js @@ -0,0 +1,57 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +// React +const { + createFactory, + PureComponent, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +const { + accessibility: { + SCORES: { BEST_PRACTICES, FAIL, WARNING }, + }, +} = require("resource://devtools/shared/constants.js"); + +loader.lazyGetter(this, "Badge", () => + createFactory( + require("resource://devtools/client/accessibility/components/Badge.js") + ) +); + +/** + * Component for rendering a badge for text alternative accessibliity check + * failures association with a given accessibility object in the accessibility + * tree. + */ +class TextLabelBadge extends PureComponent { + static get propTypes() { + return { + error: PropTypes.string, + score: PropTypes.string, + }; + } + + render() { + const { error, score } = this.props; + if (error || ![BEST_PRACTICES, FAIL, WARNING].includes(score)) { + return null; + } + + return Badge({ + score, + label: L10N.getStr("accessibility.badge.textLabel"), + tooltip: L10N.getStr("accessibility.badge.textLabel.tooltip"), + }); + } +} + +module.exports = TextLabelBadge; diff --git a/devtools/client/accessibility/components/TextLabelCheck.js b/devtools/client/accessibility/components/TextLabelCheck.js new file mode 100644 index 0000000000..adfbb4b412 --- /dev/null +++ b/devtools/client/accessibility/components/TextLabelCheck.js @@ -0,0 +1,225 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + createFactory, + PureComponent, +} = require("resource://devtools/client/shared/vendor/react.js"); +const PropTypes = require("resource://devtools/client/shared/vendor/react-prop-types.js"); +const ReactDOM = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +const Check = createFactory( + require("resource://devtools/client/accessibility/components/Check.js") +); + +const { + A11Y_TEXT_LABEL_LINKS, +} = require("resource://devtools/client/accessibility/constants.js"); +const { + accessibility: { + AUDIT_TYPE: { TEXT_LABEL }, + ISSUE_TYPE: { + [TEXT_LABEL]: { + AREA_NO_NAME_FROM_ALT, + DIALOG_NO_NAME, + DOCUMENT_NO_TITLE, + EMBED_NO_NAME, + FIGURE_NO_NAME, + FORM_FIELDSET_NO_NAME, + FORM_FIELDSET_NO_NAME_FROM_LEGEND, + FORM_NO_NAME, + FORM_NO_VISIBLE_NAME, + FORM_OPTGROUP_NO_NAME_FROM_LABEL, + FRAME_NO_NAME, + HEADING_NO_CONTENT, + HEADING_NO_NAME, + IFRAME_NO_NAME_FROM_TITLE, + IMAGE_NO_NAME, + INTERACTIVE_NO_NAME, + MATHML_GLYPH_NO_NAME, + TOOLBAR_NO_NAME, + }, + }, + }, +} = require("resource://devtools/shared/constants.js"); + +/** + * A map from text label issues to annotation component properties. + */ +const ISSUE_TO_ANNOTATION_MAP = { + [AREA_NO_NAME_FROM_ALT]: { + href: A11Y_TEXT_LABEL_LINKS.AREA_NO_NAME_FROM_ALT, + l10nId: "accessibility-text-label-issue-area", + args: { + get code() { + return ReactDOM.code({}, "alt"); + }, + // Note: there is no way right now to use custom elements in privileged + // content. We have to use something like <div> since we can't provide + // three args with the same name. + get div() { + return ReactDOM.code({}, "area"); + }, + // Note: there is no way right now to use custom elements in privileged + // content. We have to use something like <span> since we can't provide + // three args with the same name. + get span() { + return ReactDOM.code({}, "href"); + }, + }, + }, + [DIALOG_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.DIALOG_NO_NAME, + l10nId: "accessibility-text-label-issue-dialog", + }, + [DOCUMENT_NO_TITLE]: { + href: A11Y_TEXT_LABEL_LINKS.DOCUMENT_NO_TITLE, + l10nId: "accessibility-text-label-issue-document-title", + args: { + get code() { + return ReactDOM.code({}, "title"); + }, + }, + }, + [EMBED_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.EMBED_NO_NAME, + l10nId: "accessibility-text-label-issue-embed", + }, + [FIGURE_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.FIGURE_NO_NAME, + l10nId: "accessibility-text-label-issue-figure", + }, + [FORM_FIELDSET_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.FORM_FIELDSET_NO_NAME, + l10nId: "accessibility-text-label-issue-fieldset", + args: { + get code() { + return ReactDOM.code({}, "fieldset"); + }, + }, + }, + [FORM_FIELDSET_NO_NAME_FROM_LEGEND]: { + href: A11Y_TEXT_LABEL_LINKS.FORM_FIELDSET_NO_NAME_FROM_LEGEND, + l10nId: "accessibility-text-label-issue-fieldset-legend2", + args: { + get code() { + return ReactDOM.code({}, "legend"); + }, + // Note: there is no way right now to use custom elements in privileged + // content. We have to use something like <span> since we can't provide + // two args with the same name. + get span() { + return ReactDOM.code({}, "fieldset"); + }, + }, + }, + [FORM_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.FORM_NO_NAME, + l10nId: "accessibility-text-label-issue-form", + }, + [FORM_NO_VISIBLE_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.FORM_NO_VISIBLE_NAME, + l10nId: "accessibility-text-label-issue-form-visible", + }, + [FORM_OPTGROUP_NO_NAME_FROM_LABEL]: { + href: A11Y_TEXT_LABEL_LINKS.FORM_OPTGROUP_NO_NAME_FROM_LABEL, + l10nId: "accessibility-text-label-issue-optgroup-label2", + args: { + get code() { + return ReactDOM.code({}, "label"); + }, + // Note: there is no way right now to use custom elements in privileged + // content. We have to use something like <span> since we can't provide + // two args with the same name. + get span() { + return ReactDOM.code({}, "optgroup"); + }, + }, + }, + [FRAME_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.FRAME_NO_NAME, + l10nId: "accessibility-text-label-issue-frame", + args: { + get code() { + return ReactDOM.code({}, "frame"); + }, + }, + }, + [HEADING_NO_CONTENT]: { + href: A11Y_TEXT_LABEL_LINKS.HEADING_NO_CONTENT, + l10nId: "accessibility-text-label-issue-heading-content", + }, + [HEADING_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.HEADING_NO_NAME, + l10nId: "accessibility-text-label-issue-heading", + }, + [IFRAME_NO_NAME_FROM_TITLE]: { + href: A11Y_TEXT_LABEL_LINKS.IFRAME_NO_NAME_FROM_TITLE, + l10nId: "accessibility-text-label-issue-iframe", + args: { + get code() { + return ReactDOM.code({}, "title"); + }, + // Note: there is no way right now to use custom elements in privileged + // content. We have to use something like <span> since we can't provide + // two args with the same name. + get span() { + return ReactDOM.code({}, "iframe"); + }, + }, + }, + [IMAGE_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.IMAGE_NO_NAME, + l10nId: "accessibility-text-label-issue-image", + }, + [INTERACTIVE_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.INTERACTIVE_NO_NAME, + l10nId: "accessibility-text-label-issue-interactive", + }, + [MATHML_GLYPH_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.MATHML_GLYPH_NO_NAME, + l10nId: "accessibility-text-label-issue-glyph", + args: { + get code() { + return ReactDOM.code({}, "alt"); + }, + // Note: there is no way right now to use custom elements in privileged + // content. We have to use something like <span> since we can't provide + // two args with the same name. + get span() { + return ReactDOM.code({}, "mglyph"); + }, + }, + }, + [TOOLBAR_NO_NAME]: { + href: A11Y_TEXT_LABEL_LINKS.TOOLBAR_NO_NAME, + l10nId: "accessibility-text-label-issue-toolbar", + }, +}; + +/** + * Component for rendering a check for text label accessibliity check failures, + * warnings and best practices suggestions association with a given + * accessibility object in the accessibility tree. + */ +class TextLabelCheck extends PureComponent { + static get propTypes() { + return { + issue: PropTypes.string.isRequired, + score: PropTypes.string.isRequired, + }; + } + + render() { + return Check({ + ...this.props, + getAnnotation: issue => ISSUE_TO_ANNOTATION_MAP[issue], + id: "accessibility-text-label-header", + }); + } +} + +module.exports = TextLabelCheck; diff --git a/devtools/client/accessibility/components/Toolbar.js b/devtools/client/accessibility/components/Toolbar.js new file mode 100644 index 0000000000..b5f27485ed --- /dev/null +++ b/devtools/client/accessibility/components/Toolbar.js @@ -0,0 +1,74 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +// React +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + div, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const AccessibilityTreeFilter = createFactory( + require("resource://devtools/client/accessibility/components/AccessibilityTreeFilter.js") +); +const AccessibilityPrefs = createFactory( + require("resource://devtools/client/accessibility/components/AccessibilityPrefs.js") +); +loader.lazyGetter(this, "SimulationMenuButton", function () { + return createFactory( + require("resource://devtools/client/accessibility/components/SimulationMenuButton.js") + ); +}); +const DisplayTabbingOrder = createFactory( + require("resource://devtools/client/accessibility/components/DisplayTabbingOrder.js") +); + +const { + connect, +} = require("resource://devtools/client/shared/vendor/react-redux.js"); + +function Toolbar({ audit, simulate, supportsTabbingOrder, toolboxDoc }) { + const optionalSimulationSection = simulate + ? [ + div({ + role: "separator", + className: "devtools-separator", + }), + SimulationMenuButton({ simulate, toolboxDoc }), + ] + : []; + const optionalDisplayTabbingOrderSection = supportsTabbingOrder + ? [ + div({ + role: "separator", + className: "devtools-separator", + }), + DisplayTabbingOrder(), + ] + : []; + + return div( + { + className: "devtools-toolbar", + role: "toolbar", + }, + AccessibilityTreeFilter({ audit, toolboxDoc }), + // Simulation section is shown if webrender is enabled + ...optionalSimulationSection, + ...optionalDisplayTabbingOrderSection, + AccessibilityPrefs({ toolboxDoc }) + ); +} + +const mapStateToProps = ({ + ui: { + supports: { tabbingOrder }, + }, +}) => ({ + supportsTabbingOrder: tabbingOrder, +}); + +// Exports from this module +exports.Toolbar = connect(mapStateToProps)(Toolbar); diff --git a/devtools/client/accessibility/components/moz.build b/devtools/client/accessibility/components/moz.build new file mode 100644 index 0000000000..23e01d42c6 --- /dev/null +++ b/devtools/client/accessibility/components/moz.build @@ -0,0 +1,33 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +DevToolsModules( + "AccessibilityPrefs.js", + "AccessibilityRow.js", + "AccessibilityRowValue.js", + "AccessibilityTree.js", + "AccessibilityTreeFilter.js", + "Accessible.js", + "AuditController.js", + "AuditFilter.js", + "AuditProgressOverlay.js", + "Badge.js", + "Badges.js", + "Button.js", + "Check.js", + "Checks.js", + "ColorContrastAccessibility.js", + "ContrastBadge.js", + "Description.js", + "DisplayTabbingOrder.js", + "KeyboardBadge.js", + "KeyboardCheck.js", + "LearnMoreLink.js", + "MainFrame.js", + "RightSidebar.js", + "SimulationMenuButton.js", + "TextLabelBadge.js", + "TextLabelCheck.js", + "Toolbar.js", +) diff --git a/devtools/client/accessibility/constants.js b/devtools/client/accessibility/constants.js new file mode 100644 index 0000000000..192c5eaf8c --- /dev/null +++ b/devtools/client/accessibility/constants.js @@ -0,0 +1,197 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { + accessibility: { + AUDIT_TYPE, + ISSUE_TYPE: { + [AUDIT_TYPE.KEYBOARD]: { + FOCUSABLE_NO_SEMANTICS, + FOCUSABLE_POSITIVE_TABINDEX, + INTERACTIVE_NO_ACTION, + INTERACTIVE_NOT_FOCUSABLE, + MOUSE_INTERACTIVE_ONLY, + NO_FOCUS_VISIBLE, + }, + [AUDIT_TYPE.TEXT_LABEL]: { + AREA_NO_NAME_FROM_ALT, + DIALOG_NO_NAME, + DOCUMENT_NO_TITLE, + EMBED_NO_NAME, + FIGURE_NO_NAME, + FORM_FIELDSET_NO_NAME, + FORM_FIELDSET_NO_NAME_FROM_LEGEND, + FORM_NO_NAME, + FORM_NO_VISIBLE_NAME, + FORM_OPTGROUP_NO_NAME_FROM_LABEL, + FRAME_NO_NAME, + HEADING_NO_CONTENT, + HEADING_NO_NAME, + IFRAME_NO_NAME_FROM_TITLE, + IMAGE_NO_NAME, + INTERACTIVE_NO_NAME, + MATHML_GLYPH_NO_NAME, + TOOLBAR_NO_NAME, + }, + }, + }, +} = require("resource://devtools/shared/constants.js"); + +// Used in accessible component for properties tree rendering. +exports.TREE_ROW_HEIGHT = 21; + +// Initial sidebar width. +exports.SIDEBAR_WIDTH = "350px"; + +// When value is updated either in the tree or sidebar. +exports.VALUE_FLASHING_DURATION = 500; +// When new row is selected, flash highlighter. +exports.VALUE_HIGHLIGHT_DURATION = 1000; + +// If the panel width is smaller than given amount of pixels, +// the sidebar automatically switches from 'landscape' to 'portrait' mode. +exports.PORTRAIT_MODE_WIDTH = 700; + +// Names for Redux actions. +exports.FETCH_CHILDREN = "FETCH_CHILDREN"; +exports.UPDATE_DETAILS = "UPDATE_DETAILS"; +exports.RESET = "RESET"; +exports.SELECT = "SELECT"; +exports.HIGHLIGHT = "HIGHLIGHT"; +exports.UNHIGHLIGHT = "UNHIGHLIGHT"; +exports.ENABLE = "ENABLE"; +exports.UPDATE_CAN_BE_DISABLED = "UPDATE_CAN_BE_DISABLED"; +exports.UPDATE_CAN_BE_ENABLED = "UPDATE_CAN_BE_ENABLED"; +exports.UPDATE_PREF = "UPDATE_PREF"; +exports.FILTER_TOGGLE = "FILTER_TOGGLE"; +exports.AUDIT = "AUDIT"; +exports.AUDITING = "AUDITING"; +exports.AUDIT_PROGRESS = "AUDIT_PROGRESS"; +exports.SIMULATE = "SIMULATE"; +exports.UPDATE_DISPLAY_TABBING_ORDER = "UPDATE_DISPLAY_TABBING_ORDER"; + +// List of filters for accessibility checks. +exports.FILTERS = { + NONE: "NONE", + ALL: "ALL", + [AUDIT_TYPE.CONTRAST]: "CONTRAST", + [AUDIT_TYPE.KEYBOARD]: "KEYBOARD", + [AUDIT_TYPE.TEXT_LABEL]: "TEXT_LABEL", +}; + +// Ordered accessible properties to be displayed by the accessible component. +exports.ORDERED_PROPS = [ + "name", + "role", + "actions", + "value", + "DOMNode", + "description", + "keyboardShortcut", + "childCount", + "indexInParent", + "states", + "relations", + "attributes", +]; + +// Accessible events (emitted by accessible front) that the accessible component +// listens to for a current accessible. +exports.ACCESSIBLE_EVENTS = [ + "actions-change", + "attributes-change", + "description-change", + "name-change", + "reorder", + "shortcut-change", + "states-change", + "text-change", + "value-change", + "index-in-parent-change", +]; + +// Telemetry name constants. +exports.A11Y_SERVICE_DURATION = + "DEVTOOLS_ACCESSIBILITY_SERVICE_TIME_ACTIVE_SECONDS"; + +// URL constants +exports.A11Y_LEARN_MORE_LINK = + "https://firefox-source-docs.mozilla.org/devtools-user/accessibility_inspector/"; +exports.A11Y_CONTRAST_LEARN_MORE_LINK = + "https://developer.mozilla.org/docs/Web/Accessibility/Understanding_WCAG/Perceivable/" + + "Color_contrast?utm_source=devtools&utm_medium=a11y-panel-checks-color-contrast"; +exports.A11Y_SIMULATION_DOCUMENTATION_LINK = + "https://firefox-source-docs.mozilla.org/devtools-user/accessibility_inspector/simulation/"; + +const A11Y_TEXT_LABEL_LINK_BASE = + "https://developer.mozilla.org/docs/Web/Accessibility/Understanding_WCAG/Text_labels_and_names" + + "?utm_source=devtools&utm_medium=a11y-panel-checks-text-label"; + +const A11Y_TEXT_LABEL_LINK_IDS = { + [AREA_NO_NAME_FROM_ALT]: + "Use_alt_attribute_to_label_area_elements_that_have_the_href_attribute", + [DIALOG_NO_NAME]: "Dialogs_should_be_labeled", + [DOCUMENT_NO_TITLE]: "Documents_must_have_a_title", + [EMBED_NO_NAME]: "Embedded_content_must_be_labeled", + [FIGURE_NO_NAME]: "Figures_with_optional_captions_should_be_labeled", + [FORM_FIELDSET_NO_NAME]: "Fieldset_elements_must_be_labeled", + [FORM_FIELDSET_NO_NAME_FROM_LEGEND]: "Use_a_legend_to_label_a_fieldset", + [FORM_NO_NAME]: "Form_elements_must_be_labeled", + [FORM_NO_VISIBLE_NAME]: "Form_elements_should_have_a_visible_text_label", + [FORM_OPTGROUP_NO_NAME_FROM_LABEL]: + "Use_label_attribute_on_optgroup_elements", + [FRAME_NO_NAME]: "Frame_elements_must_be_labeled", + [HEADING_NO_NAME]: "Headings_must_be_labeled", + [HEADING_NO_CONTENT]: "Headings_should_have_visible_text_content", + [IFRAME_NO_NAME_FROM_TITLE]: "Use_title_attribute_to_describe_iframe_content", + [IMAGE_NO_NAME]: "Content_with_images_must_be_labeled", + [INTERACTIVE_NO_NAME]: "Interactive_elements_must_be_labeled", + [MATHML_GLYPH_NO_NAME]: "Use_alt_attribute_to_label_mglyph_elements", + [TOOLBAR_NO_NAME]: + "Toolbars_must_be_labeled_when_there_is_more_than_one_toolbar", +}; + +const A11Y_TEXT_LABEL_LINKS = {}; +for (const key in A11Y_TEXT_LABEL_LINK_IDS) { + A11Y_TEXT_LABEL_LINKS[ + key + ] = `${A11Y_TEXT_LABEL_LINK_BASE}#${A11Y_TEXT_LABEL_LINK_IDS[key]}`; +} +exports.A11Y_TEXT_LABEL_LINKS = A11Y_TEXT_LABEL_LINKS; + +const A11Y_KEYBOARD_LINK_BASE = + "https://developer.mozilla.org/docs/Web/Accessibility/Understanding_WCAG/Keyboard" + + "?utm_source=devtools&utm_medium=a11y-panel-checks-keyboard"; + +const A11Y_KEYBOARD_LINK_IDS = { + [FOCUSABLE_NO_SEMANTICS]: + "Focusable_elements_should_have_interactive_semantics", + [FOCUSABLE_POSITIVE_TABINDEX]: + "Avoid_using_tabindex_attribute_greater_than_zero", + [INTERACTIVE_NO_ACTION]: + "Interactive_elements_must_be_able_to_be_activated_using_a_keyboard", + [INTERACTIVE_NOT_FOCUSABLE]: "Interactive_elements_must_be_focusable", + [MOUSE_INTERACTIVE_ONLY]: + "Clickable_elements_must_be_focusable_and_should_have_interactive_semantics", + [NO_FOCUS_VISIBLE]: "Focusable_element_must_have_focus_styling", +}; + +const A11Y_KEYBOARD_LINKS = {}; +for (const key in A11Y_KEYBOARD_LINK_IDS) { + A11Y_KEYBOARD_LINKS[ + key + ] = `${A11Y_KEYBOARD_LINK_BASE}#${A11Y_KEYBOARD_LINK_IDS[key]}`; +} +exports.A11Y_KEYBOARD_LINKS = A11Y_KEYBOARD_LINKS; + +// Lists of preference names and keys. +const PREFS = { + SCROLL_INTO_VIEW: "SCROLL_INTO_VIEW", +}; + +exports.PREFS = PREFS; +exports.PREF_KEYS = { + [PREFS.SCROLL_INTO_VIEW]: "devtools.accessibility.scroll-into-view", +}; diff --git a/devtools/client/accessibility/index.html b/devtools/client/accessibility/index.html new file mode 100644 index 0000000000..74e5057769 --- /dev/null +++ b/devtools/client/accessibility/index.html @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<!DOCTYPE html> +<html dir=""> + <head> + <meta charset="utf-8" /> + + <link href="chrome://devtools/skin/badge.css" rel="stylesheet" /> + <link + href="chrome://devtools/skin/accessibility-color-contrast.css" + rel="stylesheet" + /> + <link + href="chrome://devtools/content/accessibility/accessibility.css" + rel="stylesheet" + /> + <link + href="chrome://devtools/content/shared/components/splitter/SplitBox.css" + rel="stylesheet" + /> + <link + href="chrome://devtools/content/shared/components/Accordion.css" + rel="stylesheet" + /> + <link + href="chrome://devtools/content/shared/components/List.css" + rel="stylesheet" + /> + <link + href="chrome://devtools/content/shared/components/tree/TreeView.css" + rel="stylesheet" + /> + + <script src="chrome://devtools/content/shared/theme-switching.js"></script> + </head> + <body class="theme-body devtools-monospace" role="application"> + <div id="content" role="presentation" tabindex="-1"></div> + <script src="./main.js"></script> + </body> +</html> diff --git a/devtools/client/accessibility/main.js b/devtools/client/accessibility/main.js new file mode 100644 index 0000000000..c658d05825 --- /dev/null +++ b/devtools/client/accessibility/main.js @@ -0,0 +1,17 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { BrowserLoader } = ChromeUtils.import( + "resource://devtools/shared/loader/browser-loader.js" +); + +// Module Loader +const require = BrowserLoader({ + baseURI: "resource://devtools/client/accessibility/", + window, +}).require; + +// Load accessibility panel content +require("resource://devtools/client/accessibility/accessibility-view.js"); diff --git a/devtools/client/accessibility/moz.build b/devtools/client/accessibility/moz.build new file mode 100644 index 0000000000..0b6874dfee --- /dev/null +++ b/devtools/client/accessibility/moz.build @@ -0,0 +1,20 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +MOCHITEST_CHROME_MANIFESTS += ["test/chrome/chrome.ini"] +BROWSER_CHROME_MANIFESTS += ["test/browser/browser.ini"] + +DIRS += ["actions", "components", "reducers", "utils"] + +DevToolsModules( + "accessibility-proxy.js", + "accessibility-view.js", + "constants.js", + "panel.js", + "picker.js", + "provider.js", +) + +with Files("**"): + BUG_COMPONENT = ("DevTools", "Accessibility Tools") diff --git a/devtools/client/accessibility/panel.js b/devtools/client/accessibility/panel.js new file mode 100644 index 0000000000..02c6c8f415 --- /dev/null +++ b/devtools/client/accessibility/panel.js @@ -0,0 +1,350 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const EventEmitter = require("resource://devtools/shared/event-emitter.js"); + +loader.lazyRequireGetter( + this, + "AccessibilityProxy", + "resource://devtools/client/accessibility/accessibility-proxy.js", + true +); +loader.lazyRequireGetter( + this, + "Picker", + "resource://devtools/client/accessibility/picker.js", + true +); +const { + A11Y_SERVICE_DURATION, +} = require("resource://devtools/client/accessibility/constants.js"); + +// The panel's window global is an EventEmitter firing the following events: +const EVENTS = { + // When the accessibility inspector has a new accessible front selected. + NEW_ACCESSIBLE_FRONT_SELECTED: "Accessibility:NewAccessibleFrontSelected", + // When the accessibility inspector has a new accessible front highlighted. + NEW_ACCESSIBLE_FRONT_HIGHLIGHTED: + "Accessibility:NewAccessibleFrontHighlighted", + // When the accessibility inspector has a new accessible front inspected. + NEW_ACCESSIBLE_FRONT_INSPECTED: "Accessibility:NewAccessibleFrontInspected", + // When the accessibility inspector is updated. + ACCESSIBILITY_INSPECTOR_UPDATED: + "Accessibility:AccessibilityInspectorUpdated", + // When accessibility panel UI is initialized (rendered). + INITIALIZED: "Accessibility:Initialized", + // When accessibile object properties are updated in the panel sidebar for a + // new accessible object. + PROPERTIES_UPDATED: "Accessibility:PropertiesUpdated", +}; + +/** + * This object represents Accessibility panel. It's responsibility is to + * render Accessibility Tree of the current debugger target and the sidebar that + * displays current relevant accessible details. + */ +function AccessibilityPanel(iframeWindow, toolbox, commands) { + this.panelWin = iframeWindow; + this._toolbox = toolbox; + this._commands = commands; + + this.onPanelVisibilityChange = this.onPanelVisibilityChange.bind(this); + this.onNewAccessibleFrontSelected = + this.onNewAccessibleFrontSelected.bind(this); + this.onAccessibilityInspectorUpdated = + this.onAccessibilityInspectorUpdated.bind(this); + this.updateA11YServiceDurationTimer = + this.updateA11YServiceDurationTimer.bind(this); + this.forceUpdatePickerButton = this.forceUpdatePickerButton.bind(this); + this.onLifecycleEvent = this.onLifecycleEvent.bind(this); + + EventEmitter.decorate(this); +} + +AccessibilityPanel.prototype = { + /** + * Open is effectively an asynchronous constructor. + */ + async open() { + if (this._opening) { + await this._opening; + return this._opening; + } + + let resolver; + this._opening = new Promise(resolve => { + resolver = resolve; + }); + + this._telemetry = this._toolbox.telemetry; + this.panelWin.gTelemetry = this._telemetry; + + this._toolbox.on("select", this.onPanelVisibilityChange); + + this.panelWin.EVENTS = EVENTS; + EventEmitter.decorate(this.panelWin); + this.panelWin.on( + EVENTS.NEW_ACCESSIBLE_FRONT_SELECTED, + this.onNewAccessibleFrontSelected + ); + this.panelWin.on( + EVENTS.ACCESSIBILITY_INSPECTOR_UPDATED, + this.onAccessibilityInspectorUpdated + ); + + this.accessibilityProxy = new AccessibilityProxy(this._commands, this); + await this.accessibilityProxy.initialize(); + + // Enable accessibility service if necessary. + if ( + this.accessibilityProxy.canBeEnabled && + !this.accessibilityProxy.enabled + ) { + await this.accessibilityProxy.enableAccessibility(); + } + + this.picker = new Picker(this); + this.fluentBundles = await this.createFluentBundles(); + + this.updateA11YServiceDurationTimer(); + this.accessibilityProxy.startListeningForLifecycleEvents({ + init: this.onLifecycleEvent, + shutdown: this.onLifecycleEvent, + }); + + // Force refresh to render the UI and wait for the INITIALIZED event. + const onInitialized = this.panelWin.once(EVENTS.INITIALIZED); + this.shouldRefresh = true; + this.refresh(); + await onInitialized; + + resolver(this); + return this._opening; + }, + + /** + * Retrieve message contexts for the current locales, and return them as an + * array of FluentBundles elements. + */ + async createFluentBundles() { + const locales = Services.locale.appLocalesAsBCP47; + const generator = L10nRegistry.getInstance().generateBundles(locales, [ + "devtools/client/accessibility.ftl", + ]); + + // Return value of generateBundles is a generator and should be converted to + // a sync iterable before using it with React. + const contexts = []; + for await (const message of generator) { + contexts.push(message); + } + + return contexts; + }, + + onLifecycleEvent() { + this.updateA11YServiceDurationTimer(); + this.forceUpdatePickerButton(); + }, + + onNewAccessibleFrontSelected(selected) { + this.emit("new-accessible-front-selected", selected); + }, + + onAccessibilityInspectorUpdated() { + this.emit("accessibility-inspector-updated"); + }, + + /** + * Make sure the panel is refreshed when the page is reloaded. The panel is + * refreshed immediatelly if it's currently selected or lazily when the user + * actually selects it. + */ + async forceRefresh() { + this.shouldRefresh = true; + await this._opening; + + await this.accessibilityProxy.accessibilityFrontGetPromise; + const onUpdated = this.panelWin.once(EVENTS.INITIALIZED); + this.refresh(); + await onUpdated; + + this.emit("reloaded"); + }, + + /** + * Make sure the panel is refreshed (if needed) when it's selected. + */ + onPanelVisibilityChange() { + this._opening.then(() => this.refresh()); + }, + + refresh() { + this.cancelPicker(); + + if (!this.isVisible) { + // Do not refresh if the panel isn't visible. + return; + } + + // Do not refresh if it isn't necessary. + if (!this.shouldRefresh) { + return; + } + // Alright reset the flag we are about to refresh the panel. + this.shouldRefresh = false; + const { + supports, + getAccessibilityTreeRoot, + startListeningForAccessibilityEvents, + stopListeningForAccessibilityEvents, + audit, + simulate, + toggleDisplayTabbingOrder, + enableAccessibility, + resetAccessiblity, + startListeningForLifecycleEvents, + stopListeningForLifecycleEvents, + startListeningForParentLifecycleEvents, + stopListeningForParentLifecycleEvents, + highlightAccessible, + unhighlightAccessible, + } = this.accessibilityProxy; + this.postContentMessage("initialize", { + fluentBundles: this.fluentBundles, + toolbox: this._toolbox, + supports, + getAccessibilityTreeRoot, + startListeningForAccessibilityEvents, + stopListeningForAccessibilityEvents, + audit, + simulate, + toggleDisplayTabbingOrder, + enableAccessibility, + resetAccessiblity, + startListeningForLifecycleEvents, + stopListeningForLifecycleEvents, + startListeningForParentLifecycleEvents, + stopListeningForParentLifecycleEvents, + highlightAccessible, + unhighlightAccessible, + }); + }, + + updateA11YServiceDurationTimer() { + if (this.accessibilityProxy.enabled) { + this._telemetry.start(A11Y_SERVICE_DURATION, this); + } else { + this._telemetry.finish(A11Y_SERVICE_DURATION, this, true); + } + }, + + selectAccessible(accessibleFront) { + this.postContentMessage("selectAccessible", accessibleFront); + }, + + selectAccessibleForNode(nodeFront, reason) { + if (reason) { + this._telemetry.keyedScalarAdd( + "devtools.accessibility.select_accessible_for_node", + reason, + 1 + ); + } + + this.postContentMessage("selectNodeAccessible", nodeFront); + }, + + highlightAccessible(accessibleFront) { + this.postContentMessage("highlightAccessible", accessibleFront); + }, + + postContentMessage(type, ...args) { + const event = new this.panelWin.MessageEvent("devtools/chrome/message", { + bubbles: true, + cancelable: true, + data: { type, args }, + }); + + this.panelWin.dispatchEvent(event); + }, + + updatePickerButton() { + this.picker && this.picker.updateButton(); + }, + + forceUpdatePickerButton() { + // Only update picker button when the panel is selected. + if (!this.isVisible) { + return; + } + + this.updatePickerButton(); + // Calling setToolboxButtons to make sure toolbar is forced to re-render. + this._toolbox.component.setToolboxButtons(this._toolbox.toolbarButtons); + }, + + togglePicker(focus) { + this.picker && this.picker.toggle(); + }, + + cancelPicker() { + this.picker && this.picker.cancel(); + }, + + stopPicker() { + this.picker && this.picker.stop(); + }, + + /** + * Return true if the Accessibility panel is currently selected. + */ + get isVisible() { + return this._toolbox.currentToolId === "accessibility"; + }, + + destroy() { + if (this._destroyed) { + return; + } + this._destroyed = true; + + this.postContentMessage("destroy"); + + if (this.accessibilityProxy) { + this.accessibilityProxy.stopListeningForLifecycleEvents({ + init: this.onLifecycleEvent, + shutdown: this.onLifecycleEvent, + }); + this.accessibilityProxy.destroy(); + this.accessibilityProxy = null; + } + + this._toolbox.off("select", this.onPanelVisibilityChange); + + this.panelWin.off( + EVENTS.NEW_ACCESSIBLE_FRONT_SELECTED, + this.onNewAccessibleFrontSelected + ); + this.panelWin.off( + EVENTS.ACCESSIBILITY_INSPECTOR_UPDATED, + this.onAccessibilityInspectorUpdated + ); + + // Older versions of devtools server do not support picker functionality. + if (this.picker) { + this.picker.release(); + this.picker = null; + } + + this._telemetry = null; + this.panelWin.gTelemetry = null; + + this.emit("destroyed"); + }, +}; + +// Exports from this module +exports.AccessibilityPanel = AccessibilityPanel; diff --git a/devtools/client/accessibility/picker.js b/devtools/client/accessibility/picker.js new file mode 100644 index 0000000000..49ba2b5bfc --- /dev/null +++ b/devtools/client/accessibility/picker.js @@ -0,0 +1,189 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +class Picker { + constructor(panel) { + this._panel = panel; + + this.isPicking = false; + + this.onPickerAccessibleHovered = this.onPickerAccessibleHovered.bind(this); + this.onPickerAccessiblePicked = this.onPickerAccessiblePicked.bind(this); + this.onPickerAccessiblePreviewed = + this.onPickerAccessiblePreviewed.bind(this); + this.onPickerAccessibleCanceled = + this.onPickerAccessibleCanceled.bind(this); + } + + get toolbox() { + return this._panel._toolbox; + } + + get accessibilityProxy() { + return this._panel.accessibilityProxy; + } + + get pickerButton() { + return this.toolbox.pickerButton; + } + + get _telemetry() { + return this._panel._telemetry; + } + + release() { + this._panel = null; + } + + emit(event, data) { + this.toolbox.emit(event, data); + } + + /** + * Select accessible object in the tree. + * @param {Object} accessible + * Accessiblle object to be selected in the inspector tree. + */ + select(accessible) { + this._panel.selectAccessible(accessible); + } + + /** + * Highlight accessible object in the tree. + * @param {Object} accessible + * Accessiblle object to be selected in the inspector tree. + */ + highlight(accessible) { + this._panel.highlightAccessible(accessible); + } + + getStr(key) { + return L10N.getStr(key); + } + + /** + * Override the default presentation of the picker button in toolbox's top + * level toolbar. + */ + updateButton() { + this.pickerButton.description = this.getStr("accessibility.pick"); + this.pickerButton.className = "accessibility"; + this.pickerButton.disabled = !this.accessibilityProxy.enabled; + if (!this.accessibilityProxy.enabled && this.isPicking) { + this.cancel(); + } + } + + /** + * Handle an event when a new accessible object is hovered over. + * @param {Object} accessible + * newly hovered accessible object + */ + onPickerAccessibleHovered(accessible) { + if (accessible) { + this.emit("picker-accessible-hovered", accessible); + this.highlight(accessible); + } + } + + /** + * Handle an event when a new accessible is picked by the user. + * @param {Object} accessible + * newly picked accessible object + */ + onPickerAccessiblePicked(accessible) { + if (accessible) { + this.select(accessible); + } + this.stop(); + } + + /** + * Handle an event when a new accessible is previewed by the user. + * @param {Object} accessible + * newly previewed accessible object + */ + onPickerAccessiblePreviewed(accessible) { + if (accessible) { + this.select(accessible); + } + } + + /** + * Handle an event when picking is cancelled by the user.s + */ + onPickerAccessibleCanceled() { + this.cancel(); + this.emit("picker-accessible-canceled"); + } + + /** + * Cancel picking. + */ + async cancel() { + await this.stop(); + } + + /** + * Stop picking. + */ + async stop() { + if (!this.isPicking) { + return; + } + + this.isPicking = false; + this.pickerButton.isChecked = false; + + await this.accessibilityProxy.cancelPick(); + this._telemetry.toolClosed("accessibility_picker", this); + this.emit("picker-stopped"); + } + + /** + * Start picking. + * @param {Boolean} doFocus + * If true, move keyboard focus into content. + */ + async start(doFocus = true) { + if (this.isPicking) { + return; + } + + this.isPicking = true; + this.pickerButton.isChecked = true; + + await this.accessibilityProxy.pick( + doFocus, + this.onPickerAccessibleHovered, + this.onPickerAccessiblePicked, + this.onPickerAccessiblePreviewed, + this.onPickerAccessibleCanceled + ); + + this._telemetry.toolOpened("accessibility_picker", this); + this.emit("picker-started"); + } + + /** + * Toggle between starting and canceling the picker. + * @param {Boolean} doFocus + * If true, move keyboard focus into content. + */ + toggle(doFocus) { + if (this.isPicking) { + return this.cancel(); + } + + return this.start(doFocus); + } +} + +exports.Picker = Picker; diff --git a/devtools/client/accessibility/provider.js b/devtools/client/accessibility/provider.js new file mode 100644 index 0000000000..f0fc05c628 --- /dev/null +++ b/devtools/client/accessibility/provider.js @@ -0,0 +1,112 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { + fetchChildren, +} = require("resource://devtools/client/accessibility/actions/accessibles.js"); + +/** + * Data provider that is responsible for mapping of an accessibles cache to the + * data format that is supported by the TreeView component. + * @param {Map} accessibles accessibles object cache + * @param {Function} dispatch react dispatch function that triggers a redux + * action. + */ + +class Provider { + constructor(accessibles, filtered, dispatch) { + this.accessibles = accessibles; + this.filtered = filtered; + this.dispatch = dispatch; + } + + /** + * Get accessible's cached children if available, if not fetch them from + * backend. + * @param {Object} accessible accessible object whose children to get. + * @returns {Array} arraof of accessible children. + */ + getChildren(accessible) { + if (!accessible || !accessible.actorID || accessible.childCount === 0) { + return []; + } + + const obj = this.accessibles.get(accessible.actorID); + if (!obj || !obj.children) { + return this.dispatch(fetchChildren(accessible)); + } + + return obj.children; + } + + /** + * Return a flag indicating if an accessible object has any children. + * @param {Object} accessible accessible object whose children to get. + * @returns {Boolean} idicator of whether accessible object has children. + */ + hasChildren(accessible) { + return accessible.childCount > 0; + } + + /** + * Get a value for an accessible object. Used to render the second (value) + * column of the accessible tree. Corresponds to an accesible object name, if + * available. + * @param {Object} accessible accessible object + * @returns {String} accessible object value. + */ + getValue(accessible) { + return accessible.name || ""; + } + + /** + * Get a label for an accessible object. Used to render the first column of + * the accessible tree. Corresponds to an accessible object role. + * @param {Object} accessible accessible object + * @returns {String} accessible object label. + */ + getLabel(accessible) { + return accessible.role; + } + + /** + * Get a unique key for an accessible object. Corresponds to an accessible + * front's actorID. + * @param {Object} accessible accessible object + * @returns {String} a key for an accessible object. + */ + getKey(accessible) { + return accessible.actorID; + } + + /** + * Get a type of an accesible object. Corresponds to the type of an accessible + * front. + * @param {Object} accessible accessible object + * @returns {String} accessible object type + */ + getType(accessible) { + return accessible.typeName; + } + + /** + * Get the depth of the accesible object in the accessibility tree. When the + * tree is filtered it is flattened and the level is set to 0. Otherwise use + * internal TreeView level. + * + * @param {Object} accessible + * accessible object + * @param {Number} defaultLevel + * default level provided by the TreeView component. + * + * @returns {null|Number} + * depth level of the accessible object. + */ + getLevel(accessible, defaultLevel) { + return this.filtered ? 0 : defaultLevel; + } +} + +exports.Provider = Provider; diff --git a/devtools/client/accessibility/reducers/accessibles.js b/devtools/client/accessibility/reducers/accessibles.js new file mode 100644 index 0000000000..908d1b734d --- /dev/null +++ b/devtools/client/accessibility/reducers/accessibles.js @@ -0,0 +1,158 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { + AUDIT, + FETCH_CHILDREN, + HIGHLIGHT, + RESET, + SELECT, +} = require("resource://devtools/client/accessibility/constants.js"); + +/** + * Initial state definition + */ +function getInitialState() { + return new Map(); +} + +/** + * Maintain a cache of received accessibles responses from the backend. + */ +function accessibles(state = getInitialState(), action) { + switch (action.type) { + case FETCH_CHILDREN: + return onReceiveChildren(state, action); + case HIGHLIGHT: + case SELECT: + return onReceiveAncestry(state, action); + case AUDIT: + return onAudit(state, action); + case RESET: + return getInitialState(); + default: + return state; + } +} + +function getActorID(accessible) { + return accessible.actorID || accessible._form?.actor; +} + +/** + * If accessible is cached recursively remove all its children and remove itself + * from cache. + * @param {Map} cache Previous state maintaining a cache of previously + * fetched accessibles. + * @param {Object} accessible Accessible object to remove from cache. + */ +function cleanupChild(cache, accessible) { + const actorID = getActorID(accessible); + const cached = cache.get(actorID); + if (!cached) { + return; + } + + for (const child of cached.children) { + cleanupChild(cache, child); + } + + cache.delete(actorID); +} + +/** + * Determine if accessible in cache is stale. Accessible object is stale if its + * cached children array has the size other than the value of its childCount + * property that updates on accessible actor event. + * @param {Map} cache Previous state maintaining a cache of previously + * fetched accessibles. + * @param {Object} accessible Accessible object to test for staleness. + */ +function staleChildren(cache, accessible) { + const cached = cache.get(getActorID(accessible)); + if (!cached) { + return false; + } + + return cached.children.length !== accessible.childCount; +} + +function updateChildrenCache(cache, accessible, children) { + const actorID = getActorID(accessible); + + if (cache.has(actorID)) { + const cached = cache.get(actorID); + for (const child of cached.children) { + // If exhisting children cache includes an accessible that is not present + // any more or if child accessible is stale remove it and all its children + // from cache. + if (!children.includes(child) || staleChildren(cache, child)) { + cleanupChild(cache, child); + } + } + cached.children = children; + cache.set(actorID, cached); + } else { + cache.set(actorID, { children }); + } + + return cache; +} + +function updateAncestry(cache, ancestry) { + ancestry.forEach(({ accessible, children }) => + updateChildrenCache(cache, accessible, children) + ); + + return cache; +} + +/** + * Handles fetching of accessible children. + * @param {Map} cache Previous state maintaining a cache of previously + * fetched accessibles. + * @param {Object} action Redux action object. + * @return {Object} updated state + */ +function onReceiveChildren(cache, action) { + const { error, accessible, response: children } = action; + if (!error) { + return updateChildrenCache(new Map(cache), accessible, children); + } + + if (!accessible.isDestroyed()) { + console.warn(`Error fetching children: `, error); + return cache; + } + + const newCache = new Map(cache); + cleanupChild(newCache, accessible); + return newCache; +} + +function onReceiveAncestry(cache, action) { + const { error, response: ancestry } = action; + if (error) { + console.warn(`Error fetching ancestry: `, error); + return cache; + } + + return updateAncestry(new Map(cache), ancestry); +} + +function onAudit(cache, action) { + const { error, response: ancestries } = action; + if (error) { + console.warn(`Error performing an audit: `, error); + return cache; + } + + const newCache = new Map(cache); + ancestries.forEach(ancestry => updateAncestry(newCache, ancestry)); + + return newCache; +} + +exports.accessibles = accessibles; diff --git a/devtools/client/accessibility/reducers/audit.js b/devtools/client/accessibility/reducers/audit.js new file mode 100644 index 0000000000..e65251ba64 --- /dev/null +++ b/devtools/client/accessibility/reducers/audit.js @@ -0,0 +1,109 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + accessibility: { AUDIT_TYPE }, +} = require("resource://devtools/shared/constants.js"); +const { + AUDIT, + AUDITING, + AUDIT_PROGRESS, + FILTER_TOGGLE, + FILTERS, + RESET, + SELECT, +} = require("resource://devtools/client/accessibility/constants.js"); + +/** + * Initial state definition + */ +function getInitialState() { + return { + filters: { + [FILTERS.ALL]: false, + [FILTERS.CONTRAST]: false, + [FILTERS.KEYBOARD]: false, + [FILTERS.TEXT_LABEL]: false, + }, + auditing: [], + progress: null, + }; +} + +/** + * State with all filters active. + */ +function allActiveFilters() { + return { + [FILTERS.ALL]: true, + [FILTERS.CONTRAST]: true, + [FILTERS.KEYBOARD]: true, + [FILTERS.TEXT_LABEL]: true, + }; +} + +function audit(state = getInitialState(), action) { + switch (action.type) { + case FILTER_TOGGLE: + const { filter } = action; + let { filters } = state; + const isToggledToActive = !filters[filter]; + + if (filter === FILTERS.NONE) { + filters = getInitialState().filters; + } else if (filter === FILTERS.ALL) { + filters = isToggledToActive + ? allActiveFilters() + : getInitialState().filters; + } else { + filters = { + ...filters, + [filter]: isToggledToActive, + }; + + const allAuditTypesActive = Object.values(AUDIT_TYPE) + .filter(filterKey => filters.hasOwnProperty(filterKey)) + .every(filterKey => filters[filterKey]); + if (isToggledToActive && !filters[FILTERS.ALL] && allAuditTypesActive) { + filters[FILTERS.ALL] = true; + } else if (!isToggledToActive && filters[FILTERS.ALL]) { + filters[FILTERS.ALL] = false; + } + } + + return { + ...state, + filters, + }; + case AUDITING: + const { auditing } = action; + + return { + ...state, + auditing, + }; + case AUDIT: + return { + ...state, + auditing: getInitialState().auditing, + progress: null, + }; + case AUDIT_PROGRESS: + const { progress } = action; + + return { + ...state, + progress, + }; + case SELECT: + case RESET: + return getInitialState(); + default: + return state; + } +} + +exports.audit = audit; diff --git a/devtools/client/accessibility/reducers/details.js b/devtools/client/accessibility/reducers/details.js new file mode 100644 index 0000000000..25a1c42ed2 --- /dev/null +++ b/devtools/client/accessibility/reducers/details.js @@ -0,0 +1,60 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { + UPDATE_DETAILS, + RESET, +} = require("resource://devtools/client/accessibility/constants.js"); + +/** + * Initial state definition + */ +function getInitialState() { + return {}; +} + +/** + * Maintain details of a current relevant accessible. + */ +function details(state = getInitialState(), action) { + switch (action.type) { + case UPDATE_DETAILS: + return onUpdateDetails(state, action); + case RESET: + return getInitialState(); + default: + return state; + } +} + +/** + * Handle details update for an accessible object + * @param {Object} state Current accessible object details. + * @param {Object} action Redux action object + * @return {Object} updated state + */ +function onUpdateDetails(state, action) { + const { accessible, response, error } = action; + if (error) { + if (!accessible.isDestroyed()) { + console.warn( + `Error fetching accessible details: `, + accessible.actorID, + error + ); + } + + return getInitialState(); + } + + const [DOMNode, relationObjects, audit] = response; + const relations = {}; + relationObjects.forEach(({ type, targets }) => { + relations[type] = targets.length === 1 ? targets[0] : targets; + }); + return { accessible, DOMNode, relations, audit }; +} + +exports.details = details; diff --git a/devtools/client/accessibility/reducers/index.js b/devtools/client/accessibility/reducers/index.js new file mode 100644 index 0000000000..d9ca8467ff --- /dev/null +++ b/devtools/client/accessibility/reducers/index.js @@ -0,0 +1,28 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { + accessibles, +} = require("resource://devtools/client/accessibility/reducers/accessibles.js"); +const { + audit, +} = require("resource://devtools/client/accessibility/reducers/audit.js"); +const { + details, +} = require("resource://devtools/client/accessibility/reducers/details.js"); +const { + simulation, +} = require("resource://devtools/client/accessibility/reducers/simulation.js"); +const { + ui, +} = require("resource://devtools/client/accessibility/reducers/ui.js"); + +exports.reducers = { + accessibles, + audit, + details, + simulation, + ui, +}; diff --git a/devtools/client/accessibility/reducers/moz.build b/devtools/client/accessibility/reducers/moz.build new file mode 100644 index 0000000000..0c7398f397 --- /dev/null +++ b/devtools/client/accessibility/reducers/moz.build @@ -0,0 +1,7 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +DevToolsModules( + "accessibles.js", "audit.js", "details.js", "index.js", "simulation.js", "ui.js" +) diff --git a/devtools/client/accessibility/reducers/simulation.js b/devtools/client/accessibility/reducers/simulation.js new file mode 100644 index 0000000000..1b68331d93 --- /dev/null +++ b/devtools/client/accessibility/reducers/simulation.js @@ -0,0 +1,52 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + accessibility: { SIMULATION_TYPE }, +} = require("resource://devtools/shared/constants.js"); +const { + SIMULATE, +} = require("resource://devtools/client/accessibility/constants.js"); + +/** + * Initial state definition + */ +function getInitialState() { + return { + [SIMULATION_TYPE.ACHROMATOPSIA]: false, + [SIMULATION_TYPE.PROTANOPIA]: false, + [SIMULATION_TYPE.DEUTERANOPIA]: false, + [SIMULATION_TYPE.TRITANOPIA]: false, + [SIMULATION_TYPE.CONTRAST_LOSS]: false, + }; +} + +function simulation(state = getInitialState(), action) { + switch (action.type) { + case SIMULATE: + if (action.error) { + console.warn("Error running simulation", action.error); + return state; + } + + const simTypes = action.simTypes; + + if (simTypes.length === 0) { + return getInitialState(); + } + + const updatedState = getInitialState(); + simTypes.forEach(simType => { + updatedState[simType] = true; + }); + + return updatedState; + default: + return state; + } +} + +exports.simulation = simulation; diff --git a/devtools/client/accessibility/reducers/ui.js b/devtools/client/accessibility/reducers/ui.js new file mode 100644 index 0000000000..828889680c --- /dev/null +++ b/devtools/client/accessibility/reducers/ui.js @@ -0,0 +1,217 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { + AUDIT, + ENABLE, + RESET, + SELECT, + HIGHLIGHT, + UNHIGHLIGHT, + UPDATE_CAN_BE_DISABLED, + UPDATE_CAN_BE_ENABLED, + UPDATE_PREF, + UPDATE_DETAILS, + PREF_KEYS, + PREFS, + UPDATE_DISPLAY_TABBING_ORDER, +} = require("resource://devtools/client/accessibility/constants.js"); + +const TreeView = require("resource://devtools/client/shared/components/tree/TreeView.js"); + +/** + * Initial state definition + */ +function getInitialState() { + return { + enabled: false, + canBeDisabled: true, + canBeEnabled: true, + selected: null, + highlighted: null, + expanded: new Set(), + [PREFS.SCROLL_INTO_VIEW]: Services.prefs.getBoolPref( + PREF_KEYS[PREFS.SCROLL_INTO_VIEW], + false + ), + tabbingOrderDisplayed: false, + supports: {}, + }; +} + +/** + * Maintain ui components of the accessibility panel. + */ +function ui(state = getInitialState(), action) { + switch (action.type) { + case ENABLE: + return onToggle(state, action, true); + case UPDATE_CAN_BE_DISABLED: + return onCanBeDisabledChange(state, action); + case UPDATE_CAN_BE_ENABLED: + return onCanBeEnabledChange(state, action); + case UPDATE_PREF: + return onPrefChange(state, action); + case UPDATE_DETAILS: + return onUpdateDetails(state, action); + case HIGHLIGHT: + return onHighlight(state, action); + case AUDIT: + return onAudit(state, action); + case UNHIGHLIGHT: + return onUnhighlight(state, action); + case SELECT: + return onSelect(state, action); + case RESET: + return onReset(state, action); + case UPDATE_DISPLAY_TABBING_ORDER: + return onUpdateDisplayTabbingOrder(state, action); + default: + return state; + } +} + +function onUpdateDetails(state) { + if (!state.selected) { + return state; + } + + // Clear selected state that should only be set when select action is + // performed. + return Object.assign({}, state, { selected: null }); +} + +function onUnhighlight(state) { + return Object.assign({}, state, { highlighted: null }); +} + +function updateExpandedNodes(expanded, ancestry) { + expanded = new Set(expanded); + const path = ancestry.reduceRight((accPath, { accessible }) => { + accPath = TreeView.subPath(accPath, accessible.actorID); + expanded.add(accPath); + return accPath; + }, ""); + + return { path, expanded }; +} + +function onAudit(state, { response: ancestries, error }) { + if (error) { + console.warn("Error running audit", error); + return state; + } + + let expanded = new Set(state.expanded); + for (const ancestry of ancestries) { + ({ expanded } = updateExpandedNodes(expanded, ancestry)); + } + + return { + ...state, + expanded, + }; +} + +function onHighlight(state, { accessible, response: ancestry, error }) { + if (error) { + console.warn("Error fetching ancestry", error); + return state; + } + + const { expanded } = updateExpandedNodes(state.expanded, ancestry); + return Object.assign({}, state, { expanded, highlighted: accessible }); +} + +function onSelect(state, { accessible, response: ancestry, error }) { + if (error) { + console.warn("Error fetching ancestry", error); + return state; + } + + const { path, expanded } = updateExpandedNodes(state.expanded, ancestry); + const selected = TreeView.subPath(path, accessible.actorID); + + return Object.assign({}, state, { expanded, selected }); +} + +/** + * Handle "canBeDisabled" flag update for accessibility service + * @param {Object} state Current ui state + * @param {Object} action Redux action object + * @return {Object} updated state + */ +function onCanBeDisabledChange(state, { canBeDisabled }) { + return Object.assign({}, state, { canBeDisabled }); +} + +/** + * Handle "canBeEnabled" flag update for accessibility service + * @param {Object} state Current ui state. + * @param {Object} action Redux action object + * @return {Object} updated state + */ +function onCanBeEnabledChange(state, { canBeEnabled }) { + return Object.assign({}, state, { canBeEnabled }); +} + +/** + * Handle pref update for accessibility panel. + * @param {Object} state Current ui state. + * @param {Object} action Redux action object + * @return {Object} updated state + */ +function onPrefChange(state, { name, value }) { + return { + ...state, + [name]: value, + }; +} + +/** + * Handle reset action for the accessibility panel UI. + * @param {Object} state Current ui state. + * @param {Object} action Redux action object + * @return {Object} updated state + */ +function onReset(state, { enabled, canBeDisabled, canBeEnabled, supports }) { + const newState = { + ...getInitialState(), + enabled, + canBeDisabled, + canBeEnabled, + supports, + }; + + return newState; +} + +/** + * Handle accessibilty service enabling/disabling. + * @param {Object} state Current accessibility services enabled state. + * @param {Object} action Redux action object + * @param {Boolean} enabled New enabled state. + * @return {Object} updated state + */ +function onToggle(state, { error }, enabled) { + if (error) { + console.warn("Error enabling accessibility service: ", error); + return state; + } + + return Object.assign({}, state, { enabled }); +} + +function onUpdateDisplayTabbingOrder(state, { error, tabbingOrderDisplayed }) { + if (error) { + console.warn("Error updating displaying tabbing order: ", error); + return state; + } + + return Object.assign({}, state, { tabbingOrderDisplayed }); +} + +exports.ui = ui; diff --git a/devtools/client/accessibility/test/browser/browser.ini b/devtools/client/accessibility/test/browser/browser.ini new file mode 100644 index 0000000000..3058fac933 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser.ini @@ -0,0 +1,49 @@ +[DEFAULT] +tags = devtools +subsuite = devtools +skip-if = (os == 'win' && processor == 'aarch64') +support-files = + head.js + !/devtools/client/shared/test/shared-head.js + !/devtools/client/shared/test/highlighter-test-actor.js + !/devtools/client/inspector/test/shared-head.js + !/devtools/client/shared/test/telemetry-test-helpers.js + +[browser_accessibility_context_menu_browser.js] +skip-if = (os == 'win' && processor == 'aarch64') # bug 1533184 +[browser_accessibility_context_menu_inspector.js] +skip-if = + (os == 'win' && processor == 'aarch64') # bug 1533484 + win10_2004 # Bug 1723573 + apple_catalina # Bug 1713392 +[browser_accessibility_fission_switch_target.js] +https_first_disabled = true +skip-if = (os == 'linux' && asan) # bug 1666940 +[browser_accessibility_mutations.js] +skip-if = + os == 'win' && processor == 'aarch64' # bug 1533534 + os == 'linux' && bits == 64 && fission # Bug 1675445 +[browser_accessibility_panel_audit_hidden_iframe.js] +[browser_accessibility_panel_audit_oop.js] +[browser_accessibility_panel_toolbar_checks.js] +[browser_accessibility_panel_toolbar_pref_scroll.js] +skip-if = true # bug 1674060 +[browser_accessibility_print_to_json.js] +[browser_accessibility_relation_navigation.js] +[browser_accessibility_reload.js] +[browser_accessibility_sidebar_checks.js] +[browser_accessibility_sidebar_dom_nodes.js] +[browser_accessibility_sidebar.js] +[browser_accessibility_simulation.js] +skip-if = true # bug 1674060 +[browser_accessibility_tabbing_order_highlighter_iframe_picker.js] +[browser_accessibility_tabbing_order_highlighter.js] +[browser_accessibility_tree_audit_long.js] +[browser_accessibility_tree_audit_reset.js] +[browser_accessibility_tree_audit_toolbar.js] +[browser_accessibility_tree_audit.js] +[browser_accessibility_tree_contrast.js] +[browser_accessibility_tree_iframe_picker.js] +[browser_accessibility_tree_navigation_oop.js] +[browser_accessibility_tree_navigation.js] +[browser_accessibility_tree.js] diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_browser.js b/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_browser.js new file mode 100644 index 0000000000..0491b29eb4 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_browser.js @@ -0,0 +1,74 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI = '<h1 id="h1">header</h1><p id="p">paragraph</p>'; + +addA11YPanelTask( + "Test show accessibility properties context menu in browser.", + TEST_URI, + async function ({ panel, toolbox, browser }) { + // Load the inspector to ensure it to use in this test. + await toolbox.loadTool("inspector"); + + const headerSelector = "#h1"; + + const contextMenu = document.getElementById("contentAreaContextMenu"); + const awaitPopupShown = BrowserTestUtils.waitForEvent( + contextMenu, + "popupshown" + ); + await BrowserTestUtils.synthesizeMouse( + headerSelector, + 0, + 0, + { + type: "contextmenu", + button: 2, + centered: true, + }, + browser + ); + await awaitPopupShown; + + const inspectA11YPropsItem = contextMenu.querySelector( + "#context-inspect-a11y" + ); + + info( + "Triggering 'Inspect Accessibility Properties' and waiting for " + + "accessibility panel to open" + ); + const popupHidden = BrowserTestUtils.waitForEvent( + contextMenu, + "popuphidden" + ); + contextMenu.activateItem(inspectA11YPropsItem); + await popupHidden; + + const selected = await panel.once("new-accessible-front-selected"); + const expectedSelectedNode = await getNodeFront( + headerSelector, + toolbox.getPanel("inspector") + ); + const expectedSelected = + await panel.accessibilityProxy.accessibilityFront.accessibleWalkerFront.getAccessibleFor( + expectedSelectedNode + ); + is( + toolbox.getCurrentPanel(), + panel, + "Accessibility panel is currently selected" + ); + is(selected, expectedSelected, "Accessible front selected correctly"); + + const doc = panel.panelWin.document; + const propertiesTree = doc.querySelector(".tree"); + is(doc.activeElement, propertiesTree, "Properties list must be focused."); + ok( + isVisible(doc.querySelector(".treeTable .treeRow.selected")), + "Selected row is visible." + ); + } +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_inspector.js b/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_inspector.js new file mode 100644 index 0000000000..03273a30c2 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_context_menu_inspector.js @@ -0,0 +1,104 @@ +/* Any copyright is dedicated to the Public Domain. +http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +const TEST_URI = ` + <h1 id="h1">header</h1> + <p id="p">paragraph</p> + <span id="span-1">text</span> + <span id="span-2"> + IamaverylongtextwhichdoesntfitinInlineTextChildReallyIdontIamtoobig + </span>`; + +async function openContextMenuForNode({ toolbox }, selector) { + info("Selecting Inspector tab and opening a context menu"); + const inspector = await toolbox.selectTool("inspector"); + + if (!selector) { + ok(inspector.selection.isBodyNode(), "Default selection is a body node."); + } else if (typeof selector === "string") { + await selectNode(selector, inspector, "test"); + } else { + const updated = inspector.once("inspector-updated"); + inspector.selection.setNodeFront(selector, { reason: "test" }); + await updated; + } + + return openContextMenuAndGetAllItems(inspector); +} + +function checkShowA11YPropertiesNode(allMenuItems) { + const showA11YPropertiesNode = allMenuItems.find( + item => item.id === "node-menu-showaccessibilityproperties" + ); + ok( + showA11YPropertiesNode, + "the popup menu now has a show accessibility properties item" + ); + return showA11YPropertiesNode; +} + +async function checkAccessibleObjectSelection( + { toolbox, panel }, + menuItem, + isText +) { + const inspector = await toolbox.getPanel("inspector"); + info( + "Triggering 'Show Accessibility Properties' and waiting for " + + "accessibility panel to open" + ); + const panelSelected = toolbox.once("accessibility-selected"); + const objectSelected = panel.once("new-accessible-front-selected"); + menuItem.click(); + await panelSelected; + const selected = await objectSelected; + + const expectedNode = isText + ? inspector.selection.nodeFront.inlineTextChild + : inspector.selection.nodeFront; + const expectedSelected = + await panel.accessibilityProxy.accessibilityFront.accessibleWalkerFront.getAccessibleFor( + expectedNode + ); + is(selected, expectedSelected, "Accessible front selected correctly"); + + const doc = panel.panelWin.document; + const propertiesTree = doc.querySelector(".tree"); + is(doc.activeElement, propertiesTree, "Properties list must be focused."); + ok( + isVisible(doc.querySelector(".treeTable .treeRow.selected")), + "Selected row is visible." + ); +} + +addA11YPanelTask( + "Test show accessibility properties context menu.", + TEST_URI, + async function testShowAccessibilityPropertiesContextMenu(env) { + // Load the inspector to ensure it to use in this test. + await env.toolbox.loadTool("inspector"); + + let allMenuItems = await openContextMenuForNode(env); + let showA11YPropertiesNode = checkShowA11YPropertiesNode(allMenuItems); + + allMenuItems = await openContextMenuForNode(env, "#h1"); + showA11YPropertiesNode = checkShowA11YPropertiesNode(allMenuItems); + await checkAccessibleObjectSelection(env, showA11YPropertiesNode); + + allMenuItems = await openContextMenuForNode(env, "#span-1"); + showA11YPropertiesNode = checkShowA11YPropertiesNode(allMenuItems); + await checkAccessibleObjectSelection(env, showA11YPropertiesNode, true); + + allMenuItems = await openContextMenuForNode(env, "#span-2"); + showA11YPropertiesNode = checkShowA11YPropertiesNode(allMenuItems); + + const inspector = env.toolbox.getPanel("inspector"); + const span2 = await getNodeFront("#span-2", inspector); + await inspector.markup.expandNode(span2); + const { nodes } = await inspector.walker.children(span2); + allMenuItems = await openContextMenuForNode(env, nodes[0]); + showA11YPropertiesNode = checkShowA11YPropertiesNode(allMenuItems); + await checkAccessibleObjectSelection(env, showA11YPropertiesNode, false); + } +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_fission_switch_target.js b/devtools/client/accessibility/test/browser/browser_accessibility_fission_switch_target.js new file mode 100644 index 0000000000..9da56a0b1b --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_fission_switch_target.js @@ -0,0 +1,58 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test switching for the top-level target. + +const MAIN_PROCESS_URL = "about:robots"; +const MAIN_PROCESS_EXPECTED = [ + { + expected: { + sidebar: { + name: "Gort! Klaatu barada nikto!", + role: "document", + }, + }, + }, +]; + +const CONTENT_PROCESS_URL = buildURL(`<title>Test page</title>`); +const CONTENT_PROCESS_EXPECTED = [ + { + expected: { + sidebar: { + name: "Test page", + role: "document", + relations: { + "containing document": { + role: "document", + name: "Test page", + }, + embeds: { + role: "document", + name: "Test page", + }, + }, + }, + }, + }, +]; + +add_task(async () => { + info( + "Open a test page running on the content process and accessibility panel" + ); + const env = await addTestTab(CONTENT_PROCESS_URL); + await runA11yPanelTests(CONTENT_PROCESS_EXPECTED, env); + + info("Navigate to a page running on the main process"); + await navigateTo(MAIN_PROCESS_URL); + await runA11yPanelTests(MAIN_PROCESS_EXPECTED, env); + + info("Back to a page running on the content process"); + await navigateTo(CONTENT_PROCESS_URL); + await runA11yPanelTests(CONTENT_PROCESS_EXPECTED, env); + + await closeTabToolboxAccessibility(env.tab); +}); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_mutations.js b/devtools/client/accessibility/test/browser/browser_accessibility_mutations.js new file mode 100644 index 0000000000..4c564747f9 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_mutations.js @@ -0,0 +1,217 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1 id="h1">Top level header</h1> + <p id="p">This is a paragraph.</p> + </body> +</html>`; + +const documentRow = { + role: "document", + name: `"Accessibility Panel Test"`, +}; +const documentRowOOP = { + role: "document", + name: `""text label`, + badges: ["text label"], +}; +const subtree = [ + { + role: "heading", + name: `"Top level header"`, + }, + { + role: "text leaf", + name: `"Top level header"`, + }, + { + role: "paragraph", + name: `""`, + }, +]; +const frameSubtree = [ + { role: "internal frame", name: `"Accessibility Panel Test (OOP)"` }, + { + role: "document", + name: `"Accessibility Panel Test (OOP)"`, + }, +]; +const subtreeOOP = [...frameSubtree, ...subtree]; +const renamed = [ + { + role: "heading", + name: `"New Header"`, + }, + { + role: "text leaf", + name: `"New Header"`, + }, +]; +const paragraphSidebar = { + name: null, + role: "paragraph", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 1, + indexInParent: 1, + states: ["selectable text", "opaque", "enabled", "sensitive"], +}; +const headerSidebar = { + name: "Top level header", + role: "text leaf", +}; +const newHeaderSidebar = { + name: "New Header", +}; + +function removeRow(rowNumber) { + return async ({ doc, browser }) => { + is( + doc.querySelectorAll(".treeRow").length, + rowNumber, + "Tree size is correct." + ); + await SpecialPowers.spawn(browser, [], async () => { + const iframe = content.document.getElementsByTagName("iframe")[0]; + if (iframe) { + await SpecialPowers.spawn(iframe, [], () => + content.document.getElementById("p").remove() + ); + return; + } + + content.document.getElementById("p").remove(); + }); + await BrowserTestUtils.waitForCondition( + () => doc.querySelectorAll(".treeRow").length === rowNumber - 1, + "Tree updated." + ); + }; +} + +async function rename({ browser }) { + await SpecialPowers.spawn(browser, [], async () => { + const iframe = content.document.getElementsByTagName("iframe")[0]; + if (iframe) { + await SpecialPowers.spawn( + iframe, + [], + () => (content.document.getElementById("h1").textContent = "New Header") + ); + return; + } + + content.document.getElementById("h1").textContent = "New Header"; + }); +} + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const testsTopLevel = [ + { + desc: "Expand first and second rows, select third row.", + setup: async ({ doc }) => { + await toggleRow(doc, 0); + await toggleRow(doc, 1); + selectRow(doc, 3); + }, + expected: { + tree: [documentRow, ...subtree], + sidebar: paragraphSidebar, + }, + }, + { + desc: "Remove a child from a document.", + setup: removeRow(4), + expected: { + tree: [documentRow, ...subtree.slice(0, -1)], + sidebar: headerSidebar, + }, + }, + { + desc: "Update child's text content.", + setup: rename, + expected: { + tree: [documentRow, ...renamed], + }, + }, + { + desc: "Select third row in the tree.", + setup: ({ doc }) => selectRow(doc, 1), + expected: { + sidebar: newHeaderSidebar, + }, + }, +]; + +const testsOOP = [ + { + desc: "Expand rows until we reach an internal OOP frame.", + setup: async ({ doc }) => { + await toggleRow(doc, 0); + await toggleRow(doc, 1); + await toggleRow(doc, 2); + await toggleRow(doc, 3); + selectRow(doc, 5); + }, + expected: { + tree: [documentRowOOP, ...subtreeOOP], + sidebar: paragraphSidebar, + }, + }, + { + desc: "Remove a child from a document.", + setup: removeRow(6), + expected: { + tree: [documentRowOOP, ...subtreeOOP.slice(0, -1)], + sidebar: headerSidebar, + }, + }, + { + desc: "Update child's text content.", + setup: rename, + expected: { + tree: [documentRowOOP, ...frameSubtree, ...renamed], + }, + }, + { + desc: "Select third row in the tree.", + setup: ({ doc }) => selectRow(doc, 1), + expected: { + sidebar: newHeaderSidebar, + }, + }, +]; + +/** + * Tests that checks the Accessibility panel after DOM tree mutations. + */ +addA11yPanelTestsTask( + testsTopLevel, + TEST_URI, + "Test Accessibility panel after DOM tree mutations." +); + +addA11yPanelTestsTask( + testsOOP, + TEST_URI, + "Test Accessibility panel after DOM tree mutations in the OOP frame.", + { remoteIframe: true } +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_hidden_iframe.js b/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_hidden_iframe.js new file mode 100644 index 0000000000..1e7d0e26c2 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_hidden_iframe.js @@ -0,0 +1,66 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* global toggleMenuItem, TREE_FILTERS_MENU_ID */ + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);"> + Top level header + </h1> + <iframe style="display: none"></iframe> + <iframe style="display: none" src="data:text/html,iframe"></iframe> + <iframe style="display: none" src="https://example.com/document-builder.sjs?html=oop"></iframe> + </body> + </html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Initial state.", + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + ], + }, + }, + { + desc: "Click on the Check for issues - all.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + tree: [ + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + level: 1, + }, + ], + }, + }, +]; + +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel tree audit on a page with hidden iframes." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_oop.js b/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_oop.js new file mode 100644 index 0000000000..d1ccbe9d5c --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_panel_audit_oop.js @@ -0,0 +1,109 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* global toggleMenuItem, TREE_FILTERS_MENU_ID */ + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);"> + Top level header + </h1> + </body> + </html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Initial state.", + expected: { + tree: [ + { + role: "document", + name: `""text label`, + badges: ["text label"], + level: 1, + }, + ], + }, + }, + { + desc: "Click on the Check for issues - all.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + tree: [ + { + role: "document", + name: `""text label`, + badges: ["text label"], + level: 1, + }, + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + level: 1, + }, + ], + }, + }, + { + desc: "Click on the Check for issues - all again.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + tree: [ + { + role: "document", + name: `""text label`, + badges: ["text label"], + level: 1, + }, + { + role: "internal frame", + name: `"Accessibility Panel Test (OOP)"`, + level: 2, + }, + { + role: "document", + name: `"Accessibility Panel Test (OOP)"`, + level: 3, + }, + { + role: "heading", + name: `"Top level header"`, + level: 4, + }, + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + level: 5, + }, + ], + }, + }, +]; + +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel tree audit on a page with an OOP document.", + { remoteIframe: true } +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_checks.js b/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_checks.js new file mode 100644 index 0000000000..b7d541853b --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_checks.js @@ -0,0 +1,114 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* global toggleMenuItem, TREE_FILTERS_MENU_ID */ + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body></body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Check initial state.", + expected: { + activeToolbarFilters: [true, false, false, false, false], + }, + }, + { + desc: "Toggle first filter (all) to activate.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + activeToolbarFilters: [false, true, true, true, true], + }, + }, + { + desc: "Click on the filter again.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + activeToolbarFilters: [true, false, false, false, false], + }, + }, + { + desc: "Toggle first custom filter to activate.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 2); + }, + expected: { + activeToolbarFilters: [false, false, true, false, false], + }, + }, + { + desc: "Click on the filter again.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 2); + }, + expected: { + activeToolbarFilters: [true, false, false, false, false], + }, + }, + { + desc: "Toggle first custom filter to activate.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 2); + }, + expected: { + activeToolbarFilters: [false, false, true, false, false], + }, + }, + { + desc: "Toggle second custom filter to activate.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 3); + }, + expected: { + activeToolbarFilters: [false, false, true, true, false], + }, + }, + { + desc: "Toggle third custom filter to activate.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 4); + }, + expected: { + activeToolbarFilters: [false, true, true, true, true], + }, + }, + { + desc: "Click on the none filter to de-activate all.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 0); + }, + expected: { + activeToolbarFilters: [true, false, false, false, false], + }, + }, +]; + +/** + * Simple test that checks toggle states for filters in the Accessibility panel + * toolbar. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel filter toggle states." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_pref_scroll.js b/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_pref_scroll.js new file mode 100644 index 0000000000..9f8434f695 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_panel_toolbar_pref_scroll.js @@ -0,0 +1,73 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* global toggleMenuItem, PREFS_MENU_ID */ + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body></body> +</html>`; + +const { + PREFS: { SCROLL_INTO_VIEW }, +} = require("resource://devtools/client/accessibility/constants.js"); + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Check initial state. All filters are disabled (except none). Scroll into view pref disabled.", + expected: { + activeToolbarFilters: [true, false, false, false], + toolbarPrefValues: { + [SCROLL_INTO_VIEW]: false, + }, + }, + }, + { + desc: "Toggle scroll into view checkbox to set the pref. Scroll into view pref should be enabled.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, PREFS_MENU_ID, 0); + }, + expected: { + activeToolbarFilters: [true, false, false, false], + toolbarPrefValues: { + [SCROLL_INTO_VIEW]: true, + }, + }, + }, + { + desc: "Toggle off scroll into view checkbox to unset the pref. Scroll into view pref disabled.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, PREFS_MENU_ID, 0); + }, + expected: { + activeToolbarFilters: [true, false, false, false], + toolbarPrefValues: { + [SCROLL_INTO_VIEW]: false, + }, + }, + }, +]; + +/** + * Simple test that checks toggle state and pref set for automatic scroll into + * view setting. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel scroll into view pref." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_print_to_json.js b/devtools/client/accessibility/test/browser/browser_accessibility_print_to_json.js new file mode 100644 index 0000000000..b7641430c0 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_print_to_json.js @@ -0,0 +1,245 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI = "<h1>Top level header</h1>"; + +function getMenuItems(toolbox) { + const menuDoc = toolbox.doc.defaultView.windowRoot.ownerGlobal.document; + const menu = menuDoc.getElementById("accessibility-row-contextmenu"); + return { + menu, + items: [...menu.getElementsByTagName("menuitem")], + }; +} + +async function newTabSelected(tab) { + info("Waiting for the JSON viewer tab."); + await BrowserTestUtils.waitForCondition( + () => gBrowser.selectedTab !== tab, + "Current tab updated." + ); + return gBrowser.selectedTab; +} + +function parseSnapshotFromTabURI(tab) { + let snapshot = tab.label.split("data:application/json;charset=UTF-8,")[1]; + snapshot = decodeURIComponent(snapshot); + return JSON.parse(snapshot); +} + +async function checkJSONSnapshotForRow({ doc, tab, toolbox }, index, expected) { + info(`Triggering context menu for row #${index}.`); + EventUtils.synthesizeMouseAtCenter( + doc.querySelectorAll(".treeRow")[index], + { type: "contextmenu" }, + doc.defaultView + ); + + info(`Triggering "Print To JSON" menu item for row ${index}.`); + const { + menu, + items: [printToJSON], + } = getMenuItems(toolbox); + + await BrowserTestUtils.waitForPopupEvent(menu, "shown"); + + menu.activateItem(printToJSON); + + const jsonViewTab = await newTabSelected(tab); + Assert.deepEqual( + parseSnapshotFromTabURI(jsonViewTab), + expected, + "JSON snapshot for the whole document is correct" + ); + + await removeTab(jsonViewTab); +} + +const OOP_FRAME_DOCUMENT_SNAPSHOT = { + childCount: 1, + description: "", + indexInParent: 0, + keyboardShortcut: "", + name: "Accessibility Panel Test (OOP)", + nodeCssSelector: "", + nodeType: 9, + role: "document", + value: "", + actions: [], + attributes: { + display: "block", + "explicit-name": "true", + "margin-bottom": "8px", + "margin-left": "8px", + "margin-right": "8px", + "margin-top": "8px", + tag: "body", + "text-align": "start", + "text-indent": "0px", + }, + states: ["readonly", "focusable", "opaque", "enabled", "sensitive"], + children: [ + { + childCount: 1, + description: "", + indexInParent: 0, + keyboardShortcut: "", + name: "Top level header", + nodeCssSelector: "body > h1:nth-child(1)", + nodeType: 1, + role: "heading", + value: "", + actions: [], + attributes: { + display: "block", + formatting: "block", + level: "1", + "margin-bottom": "21.44px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "0px", + tag: "h1", + "text-align": "start", + "text-indent": "0px", + }, + states: ["selectable text", "opaque", "enabled", "sensitive"], + children: [ + { + childCount: 0, + description: "", + indexInParent: 0, + keyboardShortcut: "", + name: "Top level header", + nodeCssSelector: "body > h1:nth-child(1)#text", + nodeType: 3, + role: "text leaf", + value: "", + actions: [], + attributes: { + "explicit-name": "true", + }, + states: ["opaque", "enabled", "sensitive"], + children: [], + }, + ], + }, + ], +}; + +const OOP_FRAME_SNAPSHOT = { + childCount: 1, + description: "", + indexInParent: 0, + keyboardShortcut: "", + name: "Accessibility Panel Test (OOP)", + nodeCssSelector: "body > iframe:nth-child(1)", + nodeType: 1, + role: "internal frame", + value: "", + actions: [], + attributes: { + display: "inline", + "explicit-name": "true", + "margin-bottom": "0px", + "margin-left": "0px", + "margin-right": "0px", + "margin-top": "0px", + tag: "iframe", + "text-align": "start", + "text-indent": "0px", + }, + states: ["focusable", "opaque", "enabled", "sensitive"], + children: [OOP_FRAME_DOCUMENT_SNAPSHOT], +}; + +const EXPECTED_SNAPSHOT = { + childCount: 1, + description: "", + indexInParent: 0, + keyboardShortcut: "", + name: "", + nodeCssSelector: "", + nodeType: 9, + role: "document", + value: "", + actions: [], + attributes: { + display: "block", + "explicit-name": "true", + "margin-bottom": "8px", + "margin-left": "8px", + "margin-right": "8px", + "margin-top": "8px", + tag: "body", + "text-align": "start", + "text-indent": "0px", + }, + states: ["readonly", "focusable", "opaque", "enabled", "sensitive"], + children: [OOP_FRAME_SNAPSHOT], +}; + +addA11YPanelTask( + "Test print to JSON functionality.", + TEST_URI, + async env => { + const { doc } = env; + await runA11yPanelTests( + [ + { + desc: "Test the initial accessibility tree.", + expected: { + tree: [ + { + role: "document", + name: `""text label`, + badges: ["text label"], + }, + ], + }, + }, + ], + env + ); + + await toggleRow(doc, 0); + await toggleRow(doc, 1); + + await runA11yPanelTests( + [ + { + desc: "Test expanded accessibility tree.", + expected: { + tree: [ + { + role: "document", + name: `""text label`, + badges: ["text label"], + }, + { + role: "internal frame", + name: `"Accessibility Panel Test (OOP)"`, + }, + { + role: "document", + name: `"Accessibility Panel Test (OOP)"`, + }, + ], + }, + }, + ], + env + ); + + // Complete snapshot that includes OOP frame document (crossing process boundry). + await checkJSONSnapshotForRow(env, 0, EXPECTED_SNAPSHOT); + // Snapshot of an OOP frame (crossing process boundry). + await checkJSONSnapshotForRow(env, 1, OOP_FRAME_SNAPSHOT); + // Snapshot of an OOP frame document (not crossing process boundry). + await checkJSONSnapshotForRow(env, 2, OOP_FRAME_DOCUMENT_SNAPSHOT); + }, + { + remoteIframe: true, + } +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_relation_navigation.js b/devtools/client/accessibility/test/browser/browser_accessibility_relation_navigation.js new file mode 100644 index 0000000000..5f9b5e6eb5 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_relation_navigation.js @@ -0,0 +1,169 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1>Top level header</h1> + <p>This is a paragraph.</p> + </body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Test the initial accessibility tree and sidebar states.", + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + ], + sidebar: { + name: "Accessibility Panel Test", + role: "document", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 2, + indexInParent: 0, + states: [ + // The focused state is an outdated state, since the toolbox should now + // have the focus and not the content page. See Bug 1702709. + "focused", + "readonly", + "focusable", + "opaque", + "enabled", + "sensitive", + ], + }, + }, + }, + { + desc: "Expand first tree node.", + setup: ({ doc }) => toggleRow(doc, 0), + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + { + role: "heading", + name: `"Top level header"`, + }, + { + role: "paragraph", + name: `""`, + }, + ], + }, + }, + { + desc: "Select second tree node.", + setup: ({ doc }) => selectRow(doc, 1), + expected: { + sidebar: { + name: "Top level header", + role: "heading", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 1, + indexInParent: 0, + relations: { + "containing document": { + role: "document", + name: "Accessibility Panel Test", + }, + }, + states: ["selectable text", "opaque", "enabled", "sensitive"], + }, + }, + }, + { + desc: "Select containing document.", + setup: async ({ doc, win }) => { + const relations = await selectProperty(doc, "/relations"); + AccessibilityUtils.setEnv({ + // Keyboard navigation is handled on the container level using arrow + // keys. + mustHaveAccessibleRule: false, + }); + EventUtils.sendMouseEvent( + { type: "click" }, + relations.querySelector(".arrow"), + win + ); + AccessibilityUtils.resetEnv(); + const containingDocRelation = await selectProperty( + doc, + "/relations/containing document" + ); + AccessibilityUtils.setEnv({ + // Keyboard interaction is only enabled when the row is selected and + // activated. + nonNegativeTabIndexRule: false, + }); + + const selectElementInTreeButton = containingDocRelation.querySelector( + ".open-accessibility-inspector" + ); + ok(!!selectElementInTreeButton, "There's a button to select the element"); + is( + selectElementInTreeButton.getAttribute("title"), + L10N.getStr("accessibility.accessible.selectElement.title"), + "The button has the expected title" + ); + EventUtils.sendMouseEvent( + { type: "click" }, + selectElementInTreeButton, + win + ); + AccessibilityUtils.resetEnv(); + }, + expected: { + sidebar: { + name: "Accessibility Panel Test", + role: "document", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 2, + indexInParent: 0, + states: ["readonly", "focusable", "opaque", "enabled", "sensitive"], + }, + }, + }, +]; + +/** + * Check navigation within the tree. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel relation navigation." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_reload.js b/devtools/client/accessibility/test/browser/browser_accessibility_reload.js new file mode 100644 index 0000000000..c4ffdf30dd --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_reload.js @@ -0,0 +1,107 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI_1 = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1>Top level header</h1> + <p>This is a paragraph.</p> + </body> +</html>`; + +const TEST_URI_2 = `<html> + <head> + <meta charset="utf-8"/> + <title>Navigation Accessibility Panel</title> + </head> + <body></body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Test the initial accessibility tree state after first row is expanded.", + setup: async ({ doc }) => toggleRow(doc, 0), + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + { + role: "heading", + name: `"Top level header"`, + }, + { + role: "paragraph", + name: `""`, + }, + ], + sidebar: { + name: "Accessibility Panel Test", + role: "document", + }, + }, + }, + { + desc: "Reload the page.", + setup: async ({ panel }) => { + const onReloaded = panel.once("reloaded"); + panel.accessibilityProxy.commands.targetCommand.reloadTopLevelTarget(); + await onReloaded; + }, + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + ], + sidebar: { + name: "Accessibility Panel Test", + role: "document", + }, + }, + }, + { + desc: "Navigate to a new page.", + setup: async () => { + // `navigate` waits for the "reloaded" event so we don't need to do it explicitly here + await navigateTo(buildURL(TEST_URI_2)); + }, + expected: { + tree: [ + { + role: "document", + name: `"Navigation Accessibility Panel"`, + }, + ], + sidebar: { + name: "Navigation Accessibility Panel", + role: "document", + }, + }, + }, +]; + +/** + * Simple test that checks content of the Accessibility panel tree on reload. + */ +addA11yPanelTestsTask( + tests, + TEST_URI_1, + "Test Accessibility panel tree on reload." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_sidebar.js b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar.js new file mode 100644 index 0000000000..e7c2795ced --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar.js @@ -0,0 +1,81 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body></body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Test the initial accessibility sidebar state.", + expected: { + sidebar: { + name: "Accessibility Panel Test", + role: "document", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 0, + indexInParent: 0, + states: [ + // The focused state is an outdated state, since the toolbox should now + // have the focus and not the content page. See Bug 1702709. + "focused", + "readonly", + "focusable", + "opaque", + "enabled", + "sensitive", + ], + }, + }, + }, + { + desc: "Mark document as disabled for accessibility.", + setup: async ({ browser }) => + SpecialPowers.spawn(browser, [], () => + content.document.body.setAttribute("aria-disabled", true) + ), + expected: { + sidebar: { + states: ["unavailable", "readonly", "focusable", "opaque"], + }, + }, + }, + { + desc: "Append a new child to the document.", + setup: async ({ browser }) => + SpecialPowers.spawn(browser, [], () => { + const doc = content.document; + const button = doc.createElement("button"); + button.textContent = "Press Me!"; + doc.body.appendChild(button); + }), + expected: { + sidebar: { + childCount: 1, + }, + }, + }, +]; + +/** + * Test that checks the Accessibility panel sidebar. + */ +addA11yPanelTestsTask(tests, TEST_URI, "Test Accessibility panel sidebar."); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_checks.js b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_checks.js new file mode 100644 index 0000000000..304d562189 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_checks.js @@ -0,0 +1,80 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const { + accessibility: { SCORES }, +} = require("resource://devtools/shared/constants.js"); + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <p style="color: red;">Red</p> + <p style="color: blue;">Blue</p> + <p style="color: gray; background: linear-gradient(#e66465, #9198e5);">Gray</p> + </body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Test the initial accessibility audit state.", + expected: { + audit: { CONTRAST: null }, + }, + }, + { + desc: "Check accessible representing text node in red.", + setup: async ({ doc }) => { + await toggleRow(doc, 0); + await toggleRow(doc, 1); + await selectRow(doc, 2); + }, + expected: { + audit: { + CONTRAST: { + value: 4.0, + color: [255, 0, 0, 1], + backgroundColor: [255, 255, 255, 1], + isLargeText: false, + score: SCORES.FAIL, + }, + }, + }, + }, + { + desc: "Check accessible representing text node in blue.", + setup: async ({ doc }) => { + await toggleRow(doc, 3); + await selectRow(doc, 4); + }, + expected: { + audit: { + CONTRAST: { + value: 8.59, + color: [0, 0, 255, 1], + backgroundColor: [255, 255, 255, 1], + isLargeText: false, + score: SCORES.AAA, + }, + }, + }, + }, +]; + +/** + * Test that checks the Accessibility panel sidebar. + */ +addA11yPanelTestsTask(tests, TEST_URI, "Test Accessibility panel sidebar."); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_dom_nodes.js b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_dom_nodes.js new file mode 100644 index 0000000000..075354b0c3 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_sidebar_dom_nodes.js @@ -0,0 +1,111 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const { + L10N, +} = require("resource://devtools/client/accessibility/utils/l10n.js"); + +// Check that DOM nodes in the sidebar can be highlighted and that clicking on the icon +// next to them opens the inspector. + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Sidebar DOM Nodes Test</title> + </head> + <body> + <h1 id="select-me">Hello</h1> + </body> +</html>`; + +/** + * Test that checks the Accessibility panel sidebar. + */ +addA11YPanelTask( + "Check behavior of DOM nodes in side panel", + TEST_URI, + async ({ toolbox, doc }) => { + info("Select an item having an actual associated DOM node"); + await toggleRow(doc, 0); + selectRow(doc, 1); + + await BrowserTestUtils.waitForCondition( + () => getPropertyValue(doc, "name") === `"Hello"`, + "Wait until the sidebar is updated" + ); + + info("Check DOMNode"); + const domNodeEl = getPropertyItem(doc, "DOMNode"); + ok(domNodeEl, "The DOMNode item was retrieved"); + + const openInspectorButton = domNodeEl.querySelector(".open-inspector"); + ok(openInspectorButton, "The open inspector button is displayed"); + is( + openInspectorButton.getAttribute("title"), + L10N.getStr("accessibility.accessible.selectNodeInInspector.title"), + "The open inspector button has expected title" + ); + + info("Check that hovering DOMNode triggers the highlight"); + // Loading the inspector panel at first, to make it possible to listen for + // new node selections + await toolbox.loadTool("inspector"); + const highlighter = toolbox.getHighlighter(); + const highlighterTestFront = await getHighlighterTestFront(toolbox); + + const onHighlighterShown = highlighter.waitForHighlighterShown(); + + EventUtils.synthesizeMouseAtCenter( + openInspectorButton, + { type: "mousemove" }, + doc.defaultView + ); + + const { nodeFront } = await onHighlighterShown; + is(nodeFront.displayName, "h1", "The correct node was highlighted"); + isVisible = await highlighterTestFront.isHighlighting(); + ok(isVisible, "Highlighter is displayed"); + + info("Unhighlight the node by moving away from the node"); + const onHighlighterHidden = highlighter.waitForHighlighterHidden(); + EventUtils.synthesizeMouseAtCenter( + getPropertyItem(doc, "name"), + { type: "mousemove" }, + doc.defaultView + ); + + await onHighlighterHidden; + ok(true, "The highlighter was closed when moving away from the node"); + + info( + "Clicking on the inspector icon and waiting for the inspector to be selected" + ); + const onNewNode = toolbox.selection.once("new-node-front"); + openInspectorButton.click(); + const inspectorSelectedNodeFront = await onNewNode; + + ok(true, "Inspector selected and new node got selected"); + is( + inspectorSelectedNodeFront.id, + "select-me", + "The expected node was selected" + ); + } +); + +function getPropertyItem(doc, label) { + const labelEl = Array.from( + doc.querySelectorAll("#accessibility-properties .object-label") + ).find(el => el.textContent === label); + if (!labelEl) { + return null; + } + return labelEl.closest(".node"); +} + +function getPropertyValue(doc, label) { + return getPropertyItem(doc, label)?.querySelector(".object-value") + ?.textContent; +} diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_simulation.js b/devtools/client/accessibility/test/browser/browser_accessibility_simulation.js new file mode 100644 index 0000000000..85a9be6b36 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_simulation.js @@ -0,0 +1,99 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* global openSimulationMenu, toggleSimulationOption */ + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Simulations Test</title> + </head> + <body> + <h1 style="color:blue; background-color:rgba(255,255,255,1);"> + Top level header + </h1> + <h2 style="color:green; background-color:rgba(255,255,255,1);"> + Second level header + </h2> + </body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the simulation components can be checked. + * expected {JSON} An expected states for the simulation components. + * } + */ +const tests = [ + { + desc: "Check that the menu button is inactivate and the menu is closed initially.", + expected: { + simulation: { + buttonActive: false, + }, + }, + }, + { + desc: "Clicking the menu button shows the menu with No Simulation selected.", + setup: async ({ doc }) => { + await openSimulationMenu(doc); + }, + expected: { + simulation: { + buttonActive: false, + checkedOptionIndices: [0], + }, + }, + }, + { + desc: "Selecting an option renders the menu button active and closes the menu.", + setup: async ({ doc }) => { + await toggleSimulationOption(doc, 2); + }, + expected: { + simulation: { + buttonActive: true, + checkedOptionIndices: [2], + }, + }, + }, + { + desc: "Reopening the menu preserves the previously selected option.", + setup: async ({ doc }) => { + await openSimulationMenu(doc); + }, + expected: { + simulation: { + buttonActive: true, + checkedOptionIndices: [2], + }, + }, + }, + { + desc: "Unselecting the option renders the button inactive and closes the menu.", + setup: async ({ doc }) => { + await toggleSimulationOption(doc, 2); + }, + expected: { + simulation: { + buttonActive: false, + checkedOptionIndices: [0], + }, + }, + }, +]; + +/** + * Test that checks state of simulation button and menu when + * options are selected/unselected with web render enabled. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test selecting and unselecting simulation options updates UI." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter.js b/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter.js new file mode 100644 index 0000000000..ed872f46e0 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter.js @@ -0,0 +1,140 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Check "Show tabbing order" works as expected + +const TEST_URI = `https://example.com/document-builder.sjs?html= + <button id=top-btn-1>Top level button before iframe</button> + <iframe src="https://example.org/document-builder.sjs?html=${encodeURIComponent(` + <button id=iframe-org-btn-1>in iframe button 1</button> + <button id=iframe-org-btn-2>in iframe button 2</button> + `)}"></iframe> + <button id=top-btn-2>Top level button after iframe</button> + <iframe src="https://example.net/document-builder.sjs?html=${encodeURIComponent(` + <button id=iframe-net-btn-1>in iframe button 1</button> + `)}"></iframe>`; + +add_task(async () => { + const { doc, store, tab, toolbox } = await addTestTab(TEST_URI); + + const topLevelFrameHighlighterTestFront = await toolbox.target.getFront( + "highlighterTest" + ); + + const frameTargets = toolbox.commands.targetCommand.getAllTargets([ + toolbox.commands.targetCommand.TYPES.FRAME, + ]); + const orgIframeTarget = frameTargets.find(t => + t.url.startsWith("https://example.org") + ); + const netIframeTarget = frameTargets.find(t => + t.url.startsWith("https://example.net") + ); + + // The iframe only has a dedicated target when Fission or EFT is enabled + const orgIframeHighlighterTestFront = orgIframeTarget + ? await orgIframeTarget.getFront("highlighterTest") + : null; + const netIframeHighlighterTestFront = netIframeTarget + ? await netIframeTarget.getFront("highlighterTest") + : null; + + let tabbingOrderHighlighterData = + await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData(); + is( + tabbingOrderHighlighterData.length, + 0, + "Tabbing order is not visible at first" + ); + + info(`Click on "Show Tabbing Order" checkbox`); + const tabbingOrderCheckbox = doc.getElementById( + "devtools-display-tabbing-order-checkbox" + ); + tabbingOrderCheckbox.click(); + + await waitUntilState(store, state => state.ui.tabbingOrderDisplayed === true); + + is(tabbingOrderCheckbox.checked, true, "Checkbox is checked"); + tabbingOrderHighlighterData = + await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData(); + if (isFissionEnabled()) { + // ⚠️ We don't get the highlighter for the <html> node of the iframe when Fission is enabled. + // This should be fix as part of Bug 1740509. + is( + JSON.stringify(tabbingOrderHighlighterData), + JSON.stringify([`button#top-btn-1 : 1`, `button#top-btn-2 : 4`]), + "Tabbing order is visible for the top level target after clicking the checkbox" + ); + + const orgIframeTabingOrderHighlighterData = + await orgIframeHighlighterTestFront.getTabbingOrderHighlighterData(); + is( + JSON.stringify(orgIframeTabingOrderHighlighterData), + JSON.stringify([ + `button#iframe-org-btn-1 : 2`, + `button#iframe-org-btn-2 : 3`, + ]), + "Tabbing order is visible for the org iframe after clicking the checkbox" + ); + + const netIframeTabingOrderHighlighterData = + await netIframeHighlighterTestFront.getTabbingOrderHighlighterData(); + is( + JSON.stringify(netIframeTabingOrderHighlighterData), + JSON.stringify([`button#iframe-net-btn-1 : 5`]), + "Tabbing order is visible for the net iframe after clicking the checkbox" + ); + } else { + is( + JSON.stringify(tabbingOrderHighlighterData), + JSON.stringify([ + `button#top-btn-1 : 1`, + `html : 2`, + `button#iframe-org-btn-1 : 3`, + `button#iframe-org-btn-2 : 4`, + `button#top-btn-2 : 5`, + `html : 6`, + `button#iframe-net-btn-1 : 7`, + ]), + "Tabbing order is visible for the top level target after clicking the checkbox" + ); + } + + info(`Clicking on the checkbox again hides the highlighter`); + tabbingOrderCheckbox.click(); + await waitUntilState( + store, + state => state.ui.tabbingOrderDisplayed === false + ); + + is(tabbingOrderCheckbox.checked, false, "Checkbox is unchecked"); + tabbingOrderHighlighterData = + await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData(); + is( + tabbingOrderHighlighterData.length, + 0, + "Tabbing order is not visible anymore after unchecking the checkbox" + ); + + if (isFissionEnabled()) { + const orgIframeTabingOrderHighlighterData = + await orgIframeHighlighterTestFront.getTabbingOrderHighlighterData(); + is( + orgIframeTabingOrderHighlighterData.length, + 0, + "Tabbing order is also hidden on the org iframe target" + ); + const netIframeTabingOrderHighlighterData = + await netIframeHighlighterTestFront.getTabbingOrderHighlighterData(); + is( + netIframeTabingOrderHighlighterData.length, + 0, + "Tabbing order is also hidden on the net iframe target" + ); + } + + await closeTabToolboxAccessibility(tab); +}); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter_iframe_picker.js b/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter_iframe_picker.js new file mode 100644 index 0000000000..788813d343 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tabbing_order_highlighter_iframe_picker.js @@ -0,0 +1,195 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Check "Show tabbing order" works as expected when used with the iframe picker + +const TEST_URI = `https://example.com/document-builder.sjs?html= + <button id=top-btn-1>Top level button before iframe</button> + <iframe src="https://example.org/document-builder.sjs?html=${encodeURIComponent(` + <button id=iframe-btn-1>in iframe button 1</button> + <button id=iframe-btn-2>in iframe button 2</button> + `)}"></iframe> + <button id=top-btn-2>Top level button after iframe</button>`; + +add_task(async () => { + const env = await addTestTab(TEST_URI); + const { doc, panel, store, toolbox, win } = env; + + const topLevelFrameHighlighterTestFront = await toolbox.target.getFront( + "highlighterTest" + ); + + const iframeTarget = toolbox.commands.targetCommand + .getAllTargets([toolbox.commands.targetCommand.TYPES.FRAME]) + .find(t => t.url.startsWith("https://example.org")); + + // The iframe only has a dedicated target when Fission or EFT is enabled + const iframeHighlighterTestFront = iframeTarget + ? await iframeTarget.getFront("highlighterTest") + : null; + + const topLevelAccessibilityFrontActorID = + panel.accessibilityProxy.accessibilityFront.actorID; + + const iframeAccessibilityFrontActorID = iframeTarget + ? (await iframeTarget.getFront("accessibility")).actorID + : null; + + info(`Click on "Show Tabbing Order" checkbox`); + const tabbingOrderCheckbox = doc.getElementById( + "devtools-display-tabbing-order-checkbox" + ); + tabbingOrderCheckbox.click(); + await waitUntilState(store, state => state.ui.tabbingOrderDisplayed === true); + + is(tabbingOrderCheckbox.checked, true, "Checkbox is checked"); + let tabbingOrderHighlighterData = + await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData( + topLevelAccessibilityFrontActorID + ); + if (isFissionEnabled()) { + // ⚠️ We don't get the highlighter for the <html> node of the iframe when Fission is enabled. + // This should be fix as part of Bug 1740509. + is( + JSON.stringify(tabbingOrderHighlighterData), + JSON.stringify([`button#top-btn-1 : 1`, `button#top-btn-2 : 4`]), + "Tabbing order is visible for the top level target after clicking the checkbox" + ); + + const iframeTabingOrderHighlighterData = + await iframeHighlighterTestFront.getTabbingOrderHighlighterData( + iframeAccessibilityFrontActorID + ); + + is( + JSON.stringify(iframeTabingOrderHighlighterData), + JSON.stringify([`button#iframe-btn-1 : 2`, `button#iframe-btn-2 : 3`]), + "Tabbing order is visible for the top level target after clicking the checkbox" + ); + } else { + is( + JSON.stringify(tabbingOrderHighlighterData), + JSON.stringify([ + `button#top-btn-1 : 1`, + `html : 2`, + `button#iframe-btn-1 : 3`, + `button#iframe-btn-2 : 4`, + `button#top-btn-2 : 5`, + ]), + "Tabbing order is visible for the top level target after clicking the checkbox" + ); + } + + info("Select the iframe in the iframe picker"); + // Get the iframe picker items + const menuList = toolbox.doc.getElementById("toolbox-frame-menu"); + + if (isFissionEnabled() && !isEveryFrameTargetEnabled()) { + is( + menuList, + null, + "iframe picker does not show remote frames when Fission is enabled and EFT is disabled" + ); + return; + } + + const frames = Array.from(menuList.querySelectorAll(".command")); + + let onInitialized = win.once(win.EVENTS.INITIALIZED); + frames[1].click(); + await onInitialized; + await waitUntilState( + store, + state => state.ui.tabbingOrderDisplayed === false + ); + + is( + tabbingOrderCheckbox.checked, + false, + "Checkbox is unchecked after selecting an iframe" + ); + + tabbingOrderHighlighterData = + await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData( + topLevelAccessibilityFrontActorID + ); + is( + tabbingOrderHighlighterData.length, + 0, + "Tabbing order is not visible anymore" + ); + + info( + `Click on "Show Tabbing Order" checkbox and check that highlighter is only displayed for selected frame` + ); + tabbingOrderCheckbox.click(); + await waitUntilState(store, state => state.ui.tabbingOrderDisplayed === true); + + tabbingOrderHighlighterData = + await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData( + topLevelAccessibilityFrontActorID + ); + if (isFissionEnabled() || isEveryFrameTargetEnabled()) { + is( + tabbingOrderHighlighterData.length, + 0, + "There's no highlighter displayed on the top level target when focused on specific iframe" + ); + + const iframeTabingOrderHighlighterData = + await iframeHighlighterTestFront.getTabbingOrderHighlighterData( + iframeAccessibilityFrontActorID + ); + + is( + JSON.stringify(iframeTabingOrderHighlighterData), + JSON.stringify([`button#iframe-btn-1 : 1`, `button#iframe-btn-2 : 2`]), + "Tabbing order has expected data when a specific iframe is selected" + ); + } else { + // When Fission/EFT are not enabled, the highlighter is displayed from the top-level + // target, but only for the iframe + is( + JSON.stringify(tabbingOrderHighlighterData), + JSON.stringify([`button#iframe-btn-1 : 1`, `button#iframe-btn-2 : 2`]), + "Tabbing order has expected data when a specific iframe is selected" + ); + } + + info("Select the top level document back"); + onInitialized = win.once(win.EVENTS.INITIALIZED); + toolbox.doc.querySelector("#toolbox-frame-menu .command").click(); + await onInitialized; + + is( + tabbingOrderCheckbox.checked, + false, + "Checkbox is unchecked after selecting the top level frame" + ); + await waitUntilState( + store, + state => state.ui.tabbingOrderDisplayed === false + ); + + tabbingOrderHighlighterData = + await topLevelFrameHighlighterTestFront.getTabbingOrderHighlighterData( + topLevelAccessibilityFrontActorID + ); + + if (isFissionEnabled() || isEveryFrameTargetEnabled()) { + const iframeTabingOrderHighlighterData = + await iframeHighlighterTestFront.getTabbingOrderHighlighterData( + iframeAccessibilityFrontActorID + ); + + is( + iframeTabingOrderHighlighterData.length, + 0, + "Highlighter is hidden on the frame after selecting back the top level target" + ); + } + + await closeTabToolboxAccessibility(env.tab); +}); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree.js new file mode 100644 index 0000000000..d1be57ee2d --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree.js @@ -0,0 +1,75 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1>Top level header</h1> + <p>This is a paragraph.</p> + </body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Test the initial accessibility tree state.", + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + ], + }, + }, + { + desc: "Expand first tree node.", + setup: async ({ doc }) => toggleRow(doc, 0), + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + { + role: "heading", + name: `"Top level header"`, + }, + { + role: "paragraph", + name: `""`, + }, + ], + }, + }, + { + desc: "Collapse first tree node.", + setup: async ({ doc }) => toggleRow(doc, 0), + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + ], + }, + }, +]; + +/** + * Simple test that checks content of the Accessibility panel tree. + */ +addA11yPanelTestsTask(tests, TEST_URI, "Test Accessibility panel tree."); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit.js new file mode 100644 index 0000000000..b321fafba2 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit.js @@ -0,0 +1,137 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* global toggleRow, toggleMenuItem, TREE_FILTERS_MENU_ID */ + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);"> + Top level header + </h1> + <h2 style="color:rgba(0,255,0,0.1); background-color:rgba(255,255,255,1);"> + Second level header + </h2> + </body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Expand first and second tree nodes.", + setup: async ({ doc }) => { + await toggleRow(doc, 0); + await toggleRow(doc, 1); + }, + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + level: 1, + }, + { + role: "heading", + name: `"Top level header"`, + level: 2, + }, + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + level: 3, + }, + { + role: "heading", + name: `"Second level header"`, + level: 2, + }, + ], + }, + }, + { + desc: "Click on the all filter.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + tree: [ + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + level: 1, + }, + { + role: "text leaf", + name: `"Second level header "contrast`, + badges: ["contrast"], + selected: true, + level: 1, + }, + ], + }, + }, + { + desc: "Click on the all filter again.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + level: 1, + }, + { + role: "heading", + name: `"Top level header"`, + level: 2, + }, + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + level: 3, + }, + { + role: "heading", + name: `"Second level header"`, + level: 2, + }, + { + role: "text leaf", + name: `"Second level header "contrast`, + badges: ["contrast"], + selected: true, + level: 3, + }, + ], + }, + }, +]; + +/** + * Simple test that checks content of the Accessibility panel tree when one of + * the tree rows has a "contrast" badge and auditing is activated via toolbar + * filter. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel tree with contrast badge present." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_long.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_long.js new file mode 100644 index 0000000000..a8e295c504 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_long.js @@ -0,0 +1,104 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* global toggleMenuItem, TREE_FILTERS_MENU_ID */ + +const header = + '<h1 style="color:rgba(255,0,0,0.1); ' + + 'background-color:rgba(255,255,255,1);">header</h1>'; + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + ${header.repeat(20)} + </body> +</html>`; + +const docRow = { + role: "document", + name: `"Accessibility Panel Test"`, +}; +const headingRow = { + role: "heading", + name: `"header"`, +}; +const textLeafRow = { + role: "text leaf", + name: `"header"contrast`, + badges: ["contrast"], +}; +const audit = new Array(20).fill(textLeafRow); + +const auditInitial = audit.map(check => ({ ...check })); +auditInitial[0].selected = true; + +const auditSecondLastSelected = audit.map(check => ({ ...check })); +auditSecondLastSelected[19].selected = true; + +const resetAfterAudit = [docRow]; +for (let i = 0; i < 20; i++) { + resetAfterAudit.push(headingRow); + resetAfterAudit.push({ ...textLeafRow, selected: i === 19 }); +} + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Check initial state.", + expected: { + tree: [{ ...docRow, selected: true }], + }, + }, + { + desc: "Run an audit from a11y panel toolbar by activating a filter.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + tree: auditInitial, + }, + }, + { + desc: "Select a row that is guaranteed to have to be scrolled into view.", + setup: async ({ doc }) => { + selectRow(doc, 0); + EventUtils.synthesizeKey("VK_END", {}, doc.defaultView); + }, + expected: { + tree: auditSecondLastSelected, + }, + }, + { + desc: "Click on the filter again.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + tree: resetAfterAudit, + }, + }, +]; + +/** + * Simple test that checks content of the Accessibility panel tree when the + * audit is activated via the panel's toolbar and the selection persists when + * the filter is toggled off. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel tree with persistent selected row." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_reset.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_reset.js new file mode 100644 index 0000000000..084a46dc89 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_reset.js @@ -0,0 +1,109 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* global toggleMenuItem, selectAccessibleForNode, TREE_FILTERS_MENU_ID */ + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);"> + Top level header + </h1> + <h2 style="color:rgba(0,255,0,0.1); background-color:rgba(255,255,255,1);"> + Second level header + </h2> + </body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Check initial state.", + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + selected: true, + }, + ], + }, + }, + { + desc: "Run an audit from a11y panel toolbar by activating a filter.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + tree: [ + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + selected: true, + }, + { + role: "text leaf", + name: `"Second level header "contrast`, + badges: ["contrast"], + }, + ], + }, + }, + { + desc: "Select an accessible object.", + setup: async env => { + await selectAccessibleForNode(env, "h1"); + }, + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + { + role: "heading", + name: `"Top level header"`, + selected: true, + }, + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + }, + { + role: "heading", + name: `"Second level header"`, + }, + { + role: "text leaf", + name: `"Second level header "contrast`, + badges: ["contrast"], + }, + ], + }, + }, +]; + +/** + * Simple test that checks content of the Accessibility panel tree when the + * audit is activated via the panel's toolbar. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel tree with contrast filter audit activation." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_toolbar.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_toolbar.js new file mode 100644 index 0000000000..9a1b9ba4c7 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_audit_toolbar.js @@ -0,0 +1,112 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* global toggleMenuItem, TREE_FILTERS_MENU_ID */ + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);"> + Top level header + </h1> + <h2 style="color:rgba(0,255,0,0.1); background-color:rgba(255,255,255,1);"> + Second level header + </h2> + </body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Check initial state.", + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + selected: true, + }, + ], + activeToolbarFilters: [true, false, false, false, false], + }, + }, + { + desc: "Run an audit (all) from a11y panel toolbar by activating a filter.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + tree: [ + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + selected: true, + }, + { + role: "text leaf", + name: `"Second level header "contrast`, + badges: ["contrast"], + }, + ], + activeToolbarFilters: [false, true, true, true, true], + }, + }, + { + desc: "Click on the filter again.", + setup: async ({ doc, toolbox }) => { + await toggleMenuItem(doc, toolbox.doc, TREE_FILTERS_MENU_ID, 1); + }, + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + { + role: "heading", + name: `"Top level header"`, + }, + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + selected: true, + }, + { + role: "heading", + name: `"Second level header"`, + }, + { + role: "text leaf", + name: `"Second level header "contrast`, + badges: ["contrast"], + }, + ], + activeToolbarFilters: [true, false, false, false, false], + }, + }, +]; + +/** + * Simple test that checks content of the Accessibility panel tree when the + * audit is activated via the panel's toolbar. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel tree with 'all' filter audit activation." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_contrast.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_contrast.js new file mode 100644 index 0000000000..2abfabd324 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_contrast.js @@ -0,0 +1,62 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1 style="color:rgba(255,0,0,0.1); background-color:rgba(255,255,255,1);"> + Top level header + </h1> + </body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Expand first and second tree nodes.", + setup: async ({ doc }) => { + await toggleRow(doc, 0); + await toggleRow(doc, 1); + }, + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + { + role: "heading", + name: `"Top level header"`, + }, + { + role: "text leaf", + name: `"Top level header "contrast`, + badges: ["contrast"], + }, + ], + }, + }, +]; + +/** + * Simple test that checks content of the Accessibility panel tree when one of + * the tree rows has a "contrast" badge. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel tree with contrast badge." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_iframe_picker.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_iframe_picker.js new file mode 100644 index 0000000000..dc146a32d5 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_iframe_picker.js @@ -0,0 +1,121 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Check that the accessibility panel works as expected when using the iframe picker + +const TEST_URI = `data:text/html,<meta charset=utf8> + <head> + <title>TopLevel</title> + <style>h1 { color: lightgrey; }</style> + </head> + <body> + <h1>Top level header</h1> + <p>This is a paragraph.</p> + <iframe src="data:text/html,<meta charset=utf8> + <head> + <title>iframe</title> + <style>h2 { color: aliceblue }</style> + </head> + <body> + <h2>Iframe header</h2> + + <iframe src='data:text/html,<meta charset=utf8> + <head> + <title>nested iframe</title> + <style>h2 { color: lightpink }</style> + </head> + <body> + <h2>Nested Iframe header</h2> + </body> + '></iframe> + + </body> + "></iframe>`; + +add_task(async () => { + const env = await addTestTab(TEST_URI); + const { doc, toolbox, win } = env; + + await checkTree(env, [ + { + role: "document", + name: `"TopLevel"`, + }, + ]); + + info("Select the iframe in the iframe picker"); + // Get the iframe picker items + const menuList = toolbox.doc.getElementById("toolbox-frame-menu"); + const frames = Array.from(menuList.querySelectorAll(".command")); + + let onInitialized = win.once(win.EVENTS.INITIALIZED); + frames[1].click(); + await onInitialized; + + await checkTree(env, [ + { + role: "document", + name: `"iframe"`, + }, + ]); + + info( + "Run a constrast audit to check only issues from selected iframe tree are displayed" + ); + const CONTRAST_MENU_ITEM_INDEX = 2; + const onUpdated = win.once(win.EVENTS.ACCESSIBILITY_INSPECTOR_UPDATED); + await toggleMenuItem( + doc, + toolbox.doc, + TREE_FILTERS_MENU_ID, + CONTRAST_MENU_ITEM_INDEX + ); + await onUpdated; + // wait until the tree is filtered (i.e. the audit is done and only nodes with issues + // should be displayed) + await waitFor(() => doc.querySelector(".treeTable.filtered")); + + await checkTree(env, [ + { + role: "text leaf", + name: `"Iframe header"contrast`, + badges: ["contrast"], + level: 1, + }, + { + role: "text leaf", + name: `"Nested Iframe header"contrast`, + badges: ["contrast"], + level: 1, + }, + ]); + + info("Select the top level document back"); + onInitialized = win.once(win.EVENTS.INITIALIZED); + frames[0].click(); + await onInitialized; + + await checkTree(env, [ + { + role: "document", + name: `"TopLevel"`, + }, + ]); + + await closeTabToolboxAccessibility(env.tab); +}); + +function checkTree(env, tree) { + return runA11yPanelTests( + [ + { + expected: { + tree, + }, + }, + ], + env + ); +} diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation.js new file mode 100644 index 0000000000..d98c3d8e35 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation.js @@ -0,0 +1,186 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI = `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test</title> + </head> + <body> + <h1>Top level header</h1> + <p>This is a paragraph.</p> + </body> +</html>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Test the initial accessibility tree and sidebar states.", + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + ], + sidebar: { + name: "Accessibility Panel Test", + role: "document", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 2, + indexInParent: 0, + states: [ + // The focused state is an outdated state, since the toolbox should now + // have the focus and not the content page. See Bug 1702709. + "focused", + "readonly", + "focusable", + "opaque", + "enabled", + "sensitive", + ], + }, + }, + }, + { + desc: "Expand first tree node.", + setup: async ({ doc }) => toggleRow(doc, 0), + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + { + role: "heading", + name: `"Top level header"`, + }, + { + role: "paragraph", + name: `""`, + }, + ], + }, + }, + { + desc: "Expand second tree node.", + setup: async ({ doc }) => toggleRow(doc, 1), + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + { + role: "heading", + name: `"Top level header"`, + }, + { + role: "text leaf", + name: `"Top level header"`, + }, + { + role: "paragraph", + name: `""`, + }, + ], + sidebar: { + name: "Top level header", + role: "heading", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 1, + indexInParent: 0, + states: ["selectable text", "opaque", "enabled", "sensitive"], + }, + }, + }, + { + desc: "Select third tree node.", + setup: ({ doc }) => selectRow(doc, 2), + expected: { + sidebar: { + name: "Top level header", + role: "text leaf", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 0, + indexInParent: 0, + states: ["opaque", "enabled", "sensitive"], + }, + }, + }, + { + desc: "Collapse first tree node.", + setup: async ({ doc }) => toggleRow(doc, 0), + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + ], + sidebar: { + name: "Accessibility Panel Test", + role: "document", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 2, + indexInParent: 0, + states: ["readonly", "focusable", "opaque", "enabled", "sensitive"], + }, + }, + }, + { + desc: "Expand first tree node again.", + setup: async ({ doc }) => toggleRow(doc, 0), + expected: { + tree: [ + { + role: "document", + name: `"Accessibility Panel Test"`, + }, + { + role: "heading", + name: `"Top level header"`, + }, + { + role: "text leaf", + name: `"Top level header"`, + }, + { + role: "paragraph", + name: `""`, + }, + ], + }, + }, +]; + +/** + * Check navigation within the tree. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel tree navigation." +); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation_oop.js b/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation_oop.js new file mode 100644 index 0000000000..dc710c82e4 --- /dev/null +++ b/devtools/client/accessibility/test/browser/browser_accessibility_tree_navigation_oop.js @@ -0,0 +1,149 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_URI = `<h1>Top level header</h1><p>This is a paragraph.</p>`; + +/** + * Test data has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be performed before + * the state of the tree and the sidebar can be checked. + * expected {JSON} An expected states for the tree and the sidebar. + * } + */ +const tests = [ + { + desc: "Test the initial accessibility tree and sidebar states.", + expected: { + tree: [ + { + role: "document", + name: `""text label`, + badges: ["text label"], + }, + ], + sidebar: { + name: "", + role: "document", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 1, + indexInParent: 0, + states: [ + // The focused state is an outdated state, since the toolbox should now + // have the focus and not the content page. See Bug 1702709. + "focused", + "readonly", + "focusable", + "opaque", + "enabled", + "sensitive", + ], + }, + }, + }, + { + desc: "Expand first tree node.", + setup: ({ doc }) => toggleRow(doc, 0), + expected: { + tree: [ + { + role: "document", + name: `""text label`, + badges: ["text label"], + }, + { + role: "internal frame", + name: `"Accessibility Panel Test (OOP)"`, + }, + ], + }, + }, + { + desc: "Expand second tree node. Display OOP document.", + setup: ({ doc }) => toggleRow(doc, 1), + expected: { + tree: [ + { + role: "document", + name: `""text label`, + badges: ["text label"], + }, + { + role: "internal frame", + name: `"Accessibility Panel Test (OOP)"`, + }, + { + role: "document", + name: `"Accessibility Panel Test (OOP)"`, + }, + ], + sidebar: { + name: "Accessibility Panel Test (OOP)", + role: "internal frame", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 1, + indexInParent: 0, + states: ["focusable", "opaque", "enabled", "sensitive"], + }, + }, + }, + { + desc: "Expand third tree node. Display OOP frame content.", + setup: ({ doc }) => toggleRow(doc, 2), + expected: { + tree: [ + { + role: "document", + name: `""text label`, + badges: ["text label"], + }, + { + role: "internal frame", + name: `"Accessibility Panel Test (OOP)"`, + }, + { + role: "document", + name: `"Accessibility Panel Test (OOP)"`, + }, + { + role: "heading", + name: `"Top level header"`, + }, + { + role: "paragraph", + name: `""`, + }, + ], + sidebar: { + name: "Accessibility Panel Test (OOP)", + role: "document", + actions: [], + value: "", + description: "", + keyboardShortcut: "", + childCount: 2, + indexInParent: 0, + states: ["readonly", "focusable", "opaque", "enabled", "sensitive"], + }, + }, + }, +]; + +/** + * Check navigation within the tree. + */ +addA11yPanelTestsTask( + tests, + TEST_URI, + "Test Accessibility panel tree navigation with OOP frame.", + { remoteIframe: true } +); diff --git a/devtools/client/accessibility/test/browser/head.js b/devtools/client/accessibility/test/browser/head.js new file mode 100644 index 0000000000..1a94c723e0 --- /dev/null +++ b/devtools/client/accessibility/test/browser/head.js @@ -0,0 +1,823 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/* global waitUntilState, gBrowser */ +/* exported addTestTab, checkTreeState, checkSidebarState, checkAuditState, selectRow, + toggleRow, toggleMenuItem, addA11yPanelTestsTask, navigate, + openSimulationMenu, toggleSimulationOption, TREE_FILTERS_MENU_ID, + PREFS_MENU_ID */ + +"use strict"; + +// Import framework's shared head. +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js", + this +); + +// Import inspector's shared head. +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/devtools/client/inspector/test/shared-head.js", + this +); + +const { + ORDERED_PROPS, + PREF_KEYS, +} = require("resource://devtools/client/accessibility/constants.js"); + +// Enable the Accessibility panel +Services.prefs.setBoolPref("devtools.accessibility.enabled", true); + +const SIMULATION_MENU_BUTTON_ID = "#simulation-menu-button"; +const TREE_FILTERS_MENU_ID = "accessibility-tree-filters-menu"; +const PREFS_MENU_ID = "accessibility-tree-filters-prefs-menu"; + +const MENU_INDEXES = { + [TREE_FILTERS_MENU_ID]: 0, + [PREFS_MENU_ID]: 1, +}; + +/** + * Wait for accessibility service to shut down. We consider it shut down when + * an "a11y-init-or-shutdown" event is received with a value of "0". + */ +function waitForAccessibilityShutdown() { + return new Promise(resolve => { + if (!Services.appinfo.accessibilityEnabled) { + resolve(); + return; + } + + const observe = (subject, topic, data) => { + if (data === "0") { + Services.obs.removeObserver(observe, "a11y-init-or-shutdown"); + // Sanity check + ok( + !Services.appinfo.accessibilityEnabled, + "Accessibility disabled in this process" + ); + resolve(); + } + }; + // This event is coming from Gecko accessibility module when the + // accessibility service is shutdown or initialzied. We attempt to shutdown + // accessibility service naturally if there are no more XPCOM references to + // a11y related objects (after GC/CC). + Services.obs.addObserver(observe, "a11y-init-or-shutdown"); + + // Force garbage collection. + SpecialPowers.gc(); + SpecialPowers.forceShrinkingGC(); + SpecialPowers.forceCC(); + }); +} + +/** + * Ensure that accessibility is completely shutdown. + */ +async function shutdownAccessibility(browser) { + await waitForAccessibilityShutdown(); + await SpecialPowers.spawn(browser, [], waitForAccessibilityShutdown); +} + +registerCleanupFunction(async () => { + info("Cleaning up..."); + Services.prefs.clearUserPref("devtools.accessibility.enabled"); +}); + +const EXPANDABLE_PROPS = ["actions", "states", "attributes"]; + +/** + * Add a new test tab in the browser and load the given url. + * @param {String} url + * The url to be loaded in the new tab + * @return a promise that resolves to the tab object when + * the url is loaded + */ +async function addTestTab(url) { + info("Adding a new test tab with URL: '" + url + "'"); + + const tab = await addTab(url); + const panel = await initAccessibilityPanel(tab); + const win = panel.panelWin; + const doc = win.document; + const store = win.view.store; + + const enableButton = doc.getElementById("accessibility-enable-button"); + // If enable button is not found, asume the tool is already enabled. + if (enableButton) { + EventUtils.sendMouseEvent({ type: "click" }, enableButton, win); + } + + await waitUntilState( + store, + state => + state.accessibles.size === 1 && + state.details.accessible && + state.details.accessible.role === "document" + ); + + return { + tab, + browser: tab.linkedBrowser, + panel, + win, + toolbox: panel._toolbox, + doc, + store, + }; +} + +/** + * Open the Accessibility panel for the given tab. + * + * @param {Element} tab + * Optional tab element for which you want open the Accessibility panel. + * The default tab is taken from the global variable |tab|. + * @return a promise that is resolved once the panel is open. + */ +async function initAccessibilityPanel(tab = gBrowser.selectedTab) { + const toolbox = await gDevTools.showToolboxForTab(tab, { + toolId: "accessibility", + }); + return toolbox.getCurrentPanel(); +} + +/** + * Compare text within the list of potential badges rendered for accessibility + * tree row when its accessible object has accessibility failures. + * @param {DOMNode} badges + * Container element that contains badge elements. + * @param {Array|null} expected + * List of expected badge labels for failing accessibility checks. + */ +function compareBadges(badges, expected = []) { + const badgeEls = badges ? [...badges.querySelectorAll(".badge")] : []; + return ( + badgeEls.length === expected.length && + badgeEls.every((badge, i) => badge.textContent === expected[i]) + ); +} + +/** + * Find an ancestor that is scrolled for a given DOMNode. + * + * @param {DOMNode} node + * DOMNode that to find an ancestor for that is scrolled. + */ +function closestScrolledParent(node) { + if (node == null) { + return null; + } + + if (node.scrollHeight > node.clientHeight) { + return node; + } + + return closestScrolledParent(node.parentNode); +} + +/** + * Check if a given element is visible to the user and is not scrolled off + * because of the overflow. + * + * @param {Element} element + * Element to be checked whether it is visible and is not scrolled off. + * + * @returns {Boolean} + * True if the element is visible. + */ +function isVisible(element) { + const { top, bottom } = element.getBoundingClientRect(); + const scrolledParent = closestScrolledParent(element.parentNode); + const scrolledParentRect = scrolledParent + ? scrolledParent.getBoundingClientRect() + : null; + return ( + !scrolledParent || + (top >= scrolledParentRect.top && bottom <= scrolledParentRect.bottom) + ); +} + +/** + * Check selected styling and visibility for a given row in the accessibility + * tree. + * @param {DOMNode} row + * DOMNode for a given accessibility row. + * @param {Boolean} expected + * Expected selected state. + * + * @returns {Boolean} + * True if visibility and styling matches expected selected state. + */ +function checkSelected(row, expected) { + if (!expected) { + return true; + } + + if (row.classList.contains("selected") !== expected) { + return false; + } + + return isVisible(row); +} + +/** + * Check level for a given row in the accessibility tree. + * @param {DOMNode} row + * DOMNode for a given accessibility row. + * @param {Boolean} expected + * Expected row level (aria-level). + * + * @returns {Boolean} + * True if the aria-level for the row is as expected. + */ +function checkLevel(row, expected) { + if (!expected) { + return true; + } + + return parseInt(row.getAttribute("aria-level"), 10) === expected; +} + +/** + * Check the state of the accessibility tree. + * @param {document} doc panel documnent. + * @param {Array} expected an array that represents an expected row list. + */ +async function checkTreeState(doc, expected) { + info("Checking tree state."); + const hasExpectedStructure = await BrowserTestUtils.waitForCondition(() => { + const rows = [...doc.querySelectorAll(".treeRow")]; + if (rows.length !== expected.length) { + return false; + } + + return rows.every((row, i) => { + const { role, name, badges, selected, level } = expected[i]; + return ( + row.querySelector(".treeLabelCell").textContent === role && + row.querySelector(".treeValueCell").textContent === name && + compareBadges(row.querySelector(".badges"), badges) && + checkSelected(row, selected) && + checkLevel(row, level) + ); + }); + }, "Wait for the right tree update."); + + ok(hasExpectedStructure, "Tree structure is correct."); +} + +/** + * Check if relations object matches what is expected. Note: targets are matched by their + * name and role. + * @param {Object} relations Relations to test. + * @param {Object} expected Expected relations. + * @return {Boolean} True if relation types and their targers match what is + * expected. + */ +function relationsMatch(relations, expected) { + for (const relationType in expected) { + let expTargets = expected[relationType]; + expTargets = Array.isArray(expTargets) ? expTargets : [expTargets]; + + let targets = relations ? relations[relationType] : []; + targets = Array.isArray(targets) ? targets : [targets]; + + for (const index in expTargets) { + if (!targets[index]) { + return false; + } + if ( + expTargets[index].name !== targets[index].name || + expTargets[index].role !== targets[index].role + ) { + return false; + } + } + } + + return true; +} + +/** + * When comparing numerical values (for example contrast), we only care about the 2 + * decimal points. + * @param {String} _ + * Key of the property that is parsed. + * @param {Any} value + * Value of the property that is parsed. + * @return {Any} + * Newly formatted value in case of the numeric value. + */ +function parseNumReplacer(_, value) { + if (typeof value === "number") { + return value.toFixed(2); + } + + return value; +} + +/** + * Check the state of the accessibility sidebar audit(checks). + * @param {Object} store React store for the panel (includes store for + * the audit). + * @param {Object} expectedState Expected state of the sidebar audit(checks). + */ +async function checkAuditState(store, expectedState) { + info("Checking audit state."); + await waitUntilState(store, ({ details }) => { + const { audit } = details; + + for (const key in expectedState) { + const expected = expectedState[key]; + if (expected && typeof expected === "object") { + if ( + JSON.stringify(audit[key], parseNumReplacer) !== + JSON.stringify(expected, parseNumReplacer) + ) { + return false; + } + } else if (audit && audit[key] !== expected) { + return false; + } + } + + ok(true, "Audit state is correct."); + return true; + }); +} + +/** + * Check the state of the accessibility sidebar. + * @param {Object} store React store for the panel (includes store for + * the sidebar). + * @param {Object} expectedState Expected state of the sidebar. + */ +async function checkSidebarState(store, expectedState) { + info("Checking sidebar state."); + await waitUntilState(store, ({ details }) => { + for (const key of ORDERED_PROPS) { + const expected = expectedState[key]; + if (expected === undefined) { + continue; + } + + if (key === "relations") { + if (!relationsMatch(details.relations, expected)) { + return false; + } + } else if (EXPANDABLE_PROPS.includes(key)) { + if ( + JSON.stringify(details.accessible[key]) !== JSON.stringify(expected) + ) { + return false; + } + } else if (details.accessible && details.accessible[key] !== expected) { + return false; + } + } + + ok(true, "Sidebar state is correct."); + return true; + }); +} + +/** + * Check the state of the accessibility related prefs. + * @param {Document} doc + * accessibility inspector panel document. + * @param {Object} toolbarPrefValues + * Expected state of the panel prefs as well as the redux state that + * keeps track of it. Includes: + * - SCROLL_INTO_VIEW (devtools.accessibility.scroll-into-view) + * @param {Object} store + * React store for the panel (includes store for the sidebar). + */ +async function checkToolbarPrefsState(doc, toolbarPrefValues, store) { + info("Checking toolbar prefs state."); + const [hasExpectedStructure] = await Promise.all([ + // Check that appropriate preferences are set as expected. + BrowserTestUtils.waitForCondition(() => { + return Object.keys(toolbarPrefValues).every( + name => + Services.prefs.getBoolPref(PREF_KEYS[name], false) === + toolbarPrefValues[name] + ); + }, "Wait for the right prefs state."), + // Check that ui state is set as expected. + waitUntilState(store, ({ ui }) => { + for (const name in toolbarPrefValues) { + if (ui[name] !== toolbarPrefValues[name]) { + return false; + } + } + + ok(true, "UI pref state is correct."); + return true; + }), + ]); + ok(hasExpectedStructure, "Prefs state is correct."); +} + +/** + * Check the state of the accessibility checks toolbar. + * @param {Object} store + * React store for the panel (includes store for the sidebar). + * @param {Object} activeToolbarFilters + * Expected active state of the filters in the toolbar. + */ +async function checkToolbarState(doc, activeToolbarFilters) { + info("Checking toolbar state."); + const hasExpectedStructure = await BrowserTestUtils.waitForCondition( + () => + [ + ...doc.querySelectorAll("#accessibility-tree-filters-menu .command"), + ].every( + (filter, i) => + (activeToolbarFilters[i] ? "true" : null) === + filter.getAttribute("aria-checked") + ), + "Wait for the right toolbar state." + ); + + ok(hasExpectedStructure, "Toolbar state is correct."); +} + +/** + * Check the state of the simulation button and menu components. + * @param {Object} doc Panel document. + * @param {Object} expected Expected states of the simulation components: + * menuVisible, buttonActive, checkedOptionIndices (Optional) + */ +async function checkSimulationState(doc, expected) { + const { buttonActive, checkedOptionIndices } = expected; + const simulationMenuOptions = doc + .querySelector(SIMULATION_MENU_BUTTON_ID + "-menu") + .querySelectorAll(".menuitem"); + + // Check simulation menu button state + is( + doc.querySelector(SIMULATION_MENU_BUTTON_ID).className, + `devtools-button toolbar-menu-button simulation${ + buttonActive ? " active" : "" + }`, + `Simulation menu button contains ${buttonActive ? "active" : "base"} class.` + ); + + // Check simulation menu options states, if specified + if (checkedOptionIndices) { + simulationMenuOptions.forEach((menuListItem, index) => { + const isChecked = checkedOptionIndices.includes(index); + const button = menuListItem.firstChild; + + is( + button.getAttribute("aria-checked"), + isChecked ? "true" : null, + `Simulation option ${index} is ${isChecked ? "" : "not "}selected.` + ); + }); + } +} + +/** + * Focus accessibility properties tree in the a11y inspector sidebar. If focused for the + * first time, the tree will select first rendered node as defult selection for keyboard + * purposes. + * + * @param {Document} doc accessibility inspector panel document. + */ +async function focusAccessibleProperties(doc) { + const tree = doc.querySelector(".tree"); + if (doc.activeElement !== tree) { + tree.focus(); + await BrowserTestUtils.waitForCondition( + () => tree.querySelector(".node.focused"), + "Tree selected." + ); + } +} + +/** + * Select accessibility property in the sidebar. + * @param {Document} doc accessibility inspector panel document. + * @param {String} id id of the property to be selected. + * @return {DOMNode} Node that corresponds to the selected accessibility property. + */ +async function selectProperty(doc, id) { + const win = doc.defaultView; + let selected = false; + let node; + + await focusAccessibleProperties(doc); + await BrowserTestUtils.waitForCondition(() => { + node = doc.getElementById(`${id}`); + if (node) { + if (selected) { + return node.firstChild.classList.contains("focused"); + } + + AccessibilityUtils.setEnv({ + // Keyboard navigation is handled on the container level using arrow + // keys. + nonNegativeTabIndexRule: false, + }); + EventUtils.sendMouseEvent({ type: "click" }, node, win); + AccessibilityUtils.resetEnv(); + selected = true; + } else { + const tree = doc.querySelector(".tree"); + tree.scrollTop = parseFloat(win.getComputedStyle(tree).height); + } + + return false; + }); + + return node; +} + +/** + * Select tree row. + * @param {document} doc panel documnent. + * @param {Number} rowNumber number of the row/tree node to be selected. + */ +function selectRow(doc, rowNumber) { + info(`Selecting row ${rowNumber}.`); + AccessibilityUtils.setEnv({ + // Keyboard navigation is handled on the container level using arrow keys. + nonNegativeTabIndexRule: false, + }); + EventUtils.sendMouseEvent( + { type: "click" }, + doc.querySelectorAll(".treeRow")[rowNumber], + doc.defaultView + ); + AccessibilityUtils.resetEnv(); +} + +/** + * Toggle an expandable tree row. + * @param {document} doc panel documnent. + * @param {Number} rowNumber number of the row/tree node to be toggled. + */ +async function toggleRow(doc, rowNumber) { + const win = doc.defaultView; + const row = doc.querySelectorAll(".treeRow")[rowNumber]; + const twisty = row.querySelector(".theme-twisty"); + const expected = !twisty.classList.contains("open"); + + info(`${expected ? "Expanding" : "Collapsing"} row ${rowNumber}.`); + + AccessibilityUtils.setEnv({ + // We intentionally remove the twisty from the accessibility tree in the + // TreeView component and handle keyboard navigation using the arrow keys. + mustHaveAccessibleRule: false, + }); + EventUtils.sendMouseEvent({ type: "click" }, twisty, win); + AccessibilityUtils.resetEnv(); + await BrowserTestUtils.waitForCondition( + () => + !twisty.classList.contains("devtools-throbber") && + expected === twisty.classList.contains("open"), + "Twisty updated." + ); +} + +/** + * Toggle a specific menu item based on its index in the menu. + * @param {document} toolboxDoc + * toolbox document. + * @param {document} doc + * panel document. + * @param {String} menuId + * The id of the menu (menuId passed to the MenuButton component) + * @param {Number} menuItemIndex + * index of the menu item to be toggled. + */ +async function toggleMenuItem(doc, toolboxDoc, menuId, menuItemIndex) { + const toolboxWin = toolboxDoc.defaultView; + const panelWin = doc.defaultView; + + const menuButton = doc.querySelectorAll(".toolbar-menu-button")[ + MENU_INDEXES[menuId] + ]; + ok(menuButton, "Expected menu button"); + + const menuEl = toolboxDoc.getElementById(menuId); + const menuItem = menuEl.querySelectorAll(".command")[menuItemIndex]; + ok(menuItem, "Expected menu item"); + + const expected = + menuItem.getAttribute("aria-checked") === "true" ? null : "true"; + + // Make the menu visible first. + const onPopupShown = new Promise(r => + toolboxDoc.addEventListener("popupshown", r, { once: true }) + ); + EventUtils.synthesizeMouseAtCenter(menuButton, {}, panelWin); + await onPopupShown; + const boundingRect = menuItem.getBoundingClientRect(); + ok( + boundingRect.width > 0 && boundingRect.height > 0, + "Menu item is visible." + ); + + EventUtils.synthesizeMouseAtCenter(menuItem, {}, toolboxWin); + await BrowserTestUtils.waitForCondition( + () => expected === menuItem.getAttribute("aria-checked"), + "Menu item updated." + ); +} + +async function openSimulationMenu(doc) { + doc.querySelector(SIMULATION_MENU_BUTTON_ID).click(); + + await BrowserTestUtils.waitForCondition(() => + doc + .querySelector(SIMULATION_MENU_BUTTON_ID + "-menu") + .classList.contains("tooltip-visible") + ); +} + +async function toggleSimulationOption(doc, optionIndex) { + const simulationMenu = doc.querySelector(SIMULATION_MENU_BUTTON_ID + "-menu"); + simulationMenu.querySelectorAll(".menuitem")[optionIndex].firstChild.click(); + + await BrowserTestUtils.waitForCondition( + () => !simulationMenu.classList.contains("tooltip-visible") + ); +} + +async function findAccessibleFor( + { + toolbox: { target }, + panel: { + accessibilityProxy: { + accessibilityFront: { accessibleWalkerFront }, + }, + }, + }, + selector +) { + const domWalker = (await target.getFront("inspector")).walker; + const node = await domWalker.querySelector(domWalker.rootNode, selector); + return accessibleWalkerFront.getAccessibleFor(node); +} + +async function selectAccessibleForNode(env, selector) { + const { panel, win } = env; + const front = await findAccessibleFor(env, selector); + const { EVENTS } = win; + const onSelected = win.once(EVENTS.NEW_ACCESSIBLE_FRONT_SELECTED); + panel.selectAccessible(front); + await onSelected; +} + +/** + * Iterate over setups/tests structure and test the state of the + * accessibility panel. + * @param {JSON} tests + * test data that has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be + * performed before the state of the + * tree and the sidebar can be checked + * expected {JSON} An expected states for parts of + * accessibility panel: + * - tree: state of the accessibility tree widget + * - sidebar: state of the accessibility panel sidebar + * - audit: state of the audit redux state of the + * panel + * - toolbarPrefValues: state of the accessibility panel + * toolbar prefs and corresponding user + * preferences. + * - activeToolbarFilters: state of the accessibility panel + * toolbar filters. + * } + * @param {Object} env + * contains all relevant environment objects (same structure as the + * return value of 'addTestTab' funciton) + */ +async function runA11yPanelTests(tests, env) { + for (const { desc, setup, expected } of tests) { + info(desc); + + if (setup) { + await setup(env); + } + + const { + tree, + sidebar, + audit, + toolbarPrefValues, + activeToolbarFilters, + simulation, + } = expected; + if (tree) { + await checkTreeState(env.doc, tree); + } + + if (sidebar) { + await checkSidebarState(env.store, sidebar); + } + + if (activeToolbarFilters) { + await checkToolbarState(env.doc, activeToolbarFilters); + } + + if (toolbarPrefValues) { + await checkToolbarPrefsState(env.doc, toolbarPrefValues, env.store); + } + + if (typeof audit !== "undefined") { + await checkAuditState(env.store, audit); + } + + if (simulation) { + await checkSimulationState(env.doc, simulation); + } + } +} + +/** + * Build a valid URL from an HTML snippet. + * @param {String} uri HTML snippet + * @param {Object} options options for the test + * @return {String} built URL + */ +function buildURL(uri, options = {}) { + if (options.remoteIframe) { + const srcURL = new URL(`http://example.net/document-builder.sjs`); + srcURL.searchParams.append( + "html", + `<html> + <head> + <meta charset="utf-8"/> + <title>Accessibility Panel Test (OOP)</title> + </head> + <body>${uri}</body> + </html>` + ); + uri = `<iframe title="Accessibility Panel Test (OOP)" src="${srcURL.href}"/>`; + } + + return `data:text/html;charset=UTF-8,${encodeURIComponent(uri)}`; +} + +/** + * Add a test task based on the test structure and a test URL. + * @param {JSON} tests test data that has the format of: + * { + * desc {String} description for better logging + * setup {Function} An optional setup that needs to be + * performed before the state of the + * tree and the sidebar can be checked + * expected {JSON} An expected states for the tree and + * the sidebar + * } + * @param {String} uri test URL + * @param {String} msg a message that is printed for the test + * @param {Object} options options for the test + */ +function addA11yPanelTestsTask(tests, uri, msg, options) { + addA11YPanelTask(msg, uri, env => runA11yPanelTests(tests, env), options); +} + +/** + * Borrowed from framework's shared head. Close toolbox, completely disable + * accessibility and remove the tab. + * @param {Tab} + * tab The tab to close. + * @return {Promise} + * Resolves when the toolbox and tab have been destroyed and closed. + */ +async function closeTabToolboxAccessibility(tab = gBrowser.selectedTab) { + if (gDevTools.hasToolboxForTab(tab)) { + await gDevTools.closeToolboxForTab(tab); + } + + await shutdownAccessibility(gBrowser.getBrowserForTab(tab)); + await removeTab(tab); + await new Promise(resolve => setTimeout(resolve, 0)); +} + +/** + * A wrapper function around add_task that sets up the test environment, runs + * the test and then disables accessibility tools. + * @param {String} msg a message that is printed for the test + * @param {String} uri test URL + * @param {Function} task task function containing the tests. + * @param {Object} options options for the test + */ +function addA11YPanelTask(msg, uri, task, options = {}) { + add_task(async function a11YPanelTask() { + info(msg); + + const env = await addTestTab(buildURL(uri, options)); + await task(env); + await closeTabToolboxAccessibility(env.tab); + }); +} diff --git a/devtools/client/accessibility/test/chrome/chrome.ini b/devtools/client/accessibility/test/chrome/chrome.ini new file mode 100644 index 0000000000..58a6a144bd --- /dev/null +++ b/devtools/client/accessibility/test/chrome/chrome.ini @@ -0,0 +1,11 @@ +[DEFAULT] +support-files = + head.js + contrast.snapshots.js + !/devtools/client/shared/components/test/chrome/head.js + +[test_accessible_contrast.html] +[test_accessible_learnMoreLink.html] +[test_accessible_openLink.html] +[test_accessible_relations.html] +[test_accessible_row_context_menu.html] diff --git a/devtools/client/accessibility/test/chrome/contrast.snapshots.js b/devtools/client/accessibility/test/chrome/contrast.snapshots.js new file mode 100644 index 0000000000..3b14ff8d66 --- /dev/null +++ b/devtools/client/accessibility/test/chrome/contrast.snapshots.js @@ -0,0 +1,262 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +window._snapshots = { + "ColorContrastAccessibility error render.": { + type: "div", + props: { + role: "presentation", + tabIndex: "-1", + className: "accessibility-check", + }, + children: [ + { + type: "h3", + props: { + className: "accessibility-check-header", + }, + children: ["Color and Contrast"], + }, + { + type: "div", + props: { + role: "presentation", + tabIndex: "-1", + className: "accessibility-color-contrast", + }, + children: [ + { + type: "span", + props: { + className: "accessibility-color-contrast-error", + role: "presentation", + }, + children: ["Unable to calculate"], + }, + ], + }, + ], + }, + "ColorContrastAccessibility basic render.": { + type: "div", + props: { + role: "presentation", + tabIndex: "-1", + className: "accessibility-check", + }, + children: [ + { + type: "h3", + props: { + className: "accessibility-check-header", + }, + children: ["Color and Contrast"], + }, + { + type: "div", + props: { + role: "presentation", + tabIndex: "-1", + className: "accessibility-color-contrast", + }, + children: [ + { + type: "span", + props: { + className: "accessibility-contrast-value FAIL", + role: "presentation", + style: { + "--accessibility-contrast-color": "rgba(255,0,0,1)", + "--accessibility-contrast-bg": "rgba(255,255,255,1)", + }, + }, + children: ["4.00"], + }, + ], + }, + { + type: "p", + props: { + className: "accessibility-check-annotation", + }, + children: [ + "Does not meet WCAG standards for accessible text. ", + { + type: "a", + props: { + className: "link", + href: + "https://developer.mozilla.org/docs/Web/Accessibility/" + + "Understanding_WCAG/Perceivable/Color_contrast?utm_source=" + + "devtools&utm_medium=a11y-panel-checks-color-contrast", + onClick: + "openDocOnClick(event) {\n event.preventDefault();\n " + + "openDocLink(event.target.href);\n }", + }, + children: ["Learn more"], + }, + "", + ], + }, + ], + }, + "ColorContrastAccessibility range render.": { + type: "div", + props: { + role: "presentation", + tabIndex: "-1", + className: "accessibility-check", + }, + children: [ + { + type: "h3", + props: { + className: "accessibility-check-header", + }, + children: ["Color and Contrast"], + }, + { + type: "div", + props: { + role: "presentation", + tabIndex: "-1", + className: "accessibility-color-contrast", + }, + children: [ + { + type: "span", + props: { + className: "accessibility-contrast-value FAIL", + role: "presentation", + style: { + "--accessibility-contrast-color": "rgba(128,128,128,1)", + "--accessibility-contrast-bg": "rgba(219,106,116,1)", + }, + }, + children: ["1.19"], + }, + { + type: "div", + props: { + role: "presentation", + tabIndex: "-1", + className: "accessibility-color-contrast-separator", + }, + children: null, + }, + { + type: "span", + props: { + className: "accessibility-contrast-value FAIL", + role: "presentation", + style: { + "--accessibility-contrast-color": "rgba(128,128,128,1)", + "--accessibility-contrast-bg": "rgba(156,145,211,1)", + }, + }, + children: ["1.39"], + }, + ], + }, + { + type: "p", + props: { + className: "accessibility-check-annotation", + }, + children: [ + "Does not meet WCAG standards for accessible text. ", + { + type: "a", + props: { + className: "link", + href: + "https://developer.mozilla.org/docs/Web/Accessibility/" + + "Understanding_WCAG/Perceivable/Color_contrast?utm_source=" + + "devtools&utm_medium=a11y-panel-checks-color-contrast", + onClick: + "openDocOnClick(event) {\n event.preventDefault();\n " + + "openDocLink(event.target.href);\n }", + }, + children: ["Learn more"], + }, + "", + ], + }, + ], + }, + "ColorContrastAccessibility large text render.": { + type: "div", + props: { + role: "presentation", + tabIndex: "-1", + className: "accessibility-check", + }, + children: [ + { + type: "h3", + props: { + className: "accessibility-check-header", + }, + children: ["Color and Contrast"], + }, + { + type: "div", + props: { + role: "presentation", + tabIndex: "-1", + className: "accessibility-color-contrast", + }, + children: [ + { + type: "span", + props: { + className: "accessibility-contrast-value AA", + role: "presentation", + style: { + "--accessibility-contrast-color": "rgba(255,0,0,1)", + "--accessibility-contrast-bg": "rgba(255,255,255,1)", + }, + }, + children: ["4.00"], + }, + { + type: "span", + props: { + className: "accessibility-color-contrast-large-text", + role: "presentation", + title: + "Text is 14 point and bold or larger, or 18 point or larger.", + }, + children: ["large text"], + }, + ], + }, + { + type: "p", + props: { + className: "accessibility-check-annotation", + }, + children: [ + "Meets WCAG AA standards for accessible text. ", + { + type: "a", + props: { + className: "link", + href: + "https://developer.mozilla.org/docs/Web/Accessibility/" + + "Understanding_WCAG/Perceivable/Color_contrast?utm_source=" + + "devtools&utm_medium=a11y-panel-checks-color-contrast", + onClick: + "openDocOnClick(event) {\n event.preventDefault();\n " + + "openDocLink(event.target.href);\n }", + }, + children: ["Learn more"], + }, + "", + ], + }, + ], + }, +}; diff --git a/devtools/client/accessibility/test/chrome/head.js b/devtools/client/accessibility/test/chrome/head.js new file mode 100644 index 0000000000..a1a02df8a8 --- /dev/null +++ b/devtools/client/accessibility/test/chrome/head.js @@ -0,0 +1,32 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* eslint no-unused-vars: [2, {"vars": "local"}] */ + +"use strict"; + +var { require } = ChromeUtils.importESModule( + "resource://devtools/shared/loader/Loader.sys.mjs" +); +var { BrowserLoader } = ChromeUtils.import( + "resource://devtools/shared/loader/browser-loader.js" +); +var DevToolsUtils = require("resource://devtools/shared/DevToolsUtils.js"); + +var { require: browserRequire } = BrowserLoader({ + baseURI: "resource://devtools/client/shared/", + window, +}); + +window.EVENTS = {}; +window.on = function () {}; +window.off = function () {}; + +SimpleTest.registerCleanupFunction(() => { + window.EVENTS = null; + window.on = null; + window.off = null; +}); + +// All tests are asynchronous. +SimpleTest.waitForExplicitFinish(); diff --git a/devtools/client/accessibility/test/chrome/test_accessible_contrast.html b/devtools/client/accessibility/test/chrome/test_accessible_contrast.html new file mode 100644 index 0000000000..aeb1cc47a5 --- /dev/null +++ b/devtools/client/accessibility/test/chrome/test_accessible_contrast.html @@ -0,0 +1,84 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<!DOCTYPE HTML> +<html> +<!-- +Test that Color Contrast component renders correctly. +--> +<head> + <meta charset="utf-8"> + <title>Color Contrast accessibility component test</title> + <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> + <link rel="stylesheet" href="chrome://devtools/skin/light-theme.css" type="text/css"> +</head> +<body> +<pre id="test"> +<script src="head.js" type="application/javascript"></script> +<script src="chrome://mochitests/content/chrome/devtools/client/shared/components/test/chrome/head.js" type="application/javascript"/> +<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" type="application/javascript"></script> +<script src="contrast.snapshots.js" type="application/javascript"></script> +<script type="application/javascript"> + +"use strict"; + +/* global matchSnapshot */ + +window.onload = async function() { + try { + const React = browserRequire("devtools/client/shared/vendor/react"); + const { ColorContrastCheck } = browserRequire( + "devtools/client/accessibility/components/ColorContrastAccessibility"); + + const { + accessibility: { SCORES }, + } = browserRequire("devtools/shared/constants"); + + matchSnapshot("ColorContrastAccessibility error render.", + React.createElement(ColorContrastCheck, { error: true }) + ); + + matchSnapshot("ColorContrastAccessibility basic render.", + React.createElement(ColorContrastCheck, { + "value": 4.00, + "color": [255, 0, 0, 1], + "backgroundColor": [255, 255, 255, 1], + "isLargeText": false, + "score": SCORES.FAIL, + }) + ); + + matchSnapshot("ColorContrastAccessibility range render.", + React.createElement(ColorContrastCheck, { + "min": 1.19, + "max": 1.39, + "color": [128, 128, 128, 1], + "backgroundColorMin": [219, 106, 116, 1], + "backgroundColorMax": [156, 145, 211, 1], + "isLargeText": false, + "score": SCORES.FAIL, + "scoreMin": SCORES.FAIL, + "scoreMax": SCORES.FAIL, + }) + ); + + matchSnapshot("ColorContrastAccessibility large text render.", + React.createElement(ColorContrastCheck, { + "value": 4.00, + "color": [255, 0, 0, 1], + "backgroundColor": [255, 255, 255, 1], + "isLargeText": true, + "score": SCORES.AA, + }) + ); + } catch (e) { + ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e)); + } finally { + SimpleTest.finish(); + } +}; +</script> +</pre> +</body> +</html> diff --git a/devtools/client/accessibility/test/chrome/test_accessible_learnMoreLink.html b/devtools/client/accessibility/test/chrome/test_accessible_learnMoreLink.html new file mode 100644 index 0000000000..4644b21cd0 --- /dev/null +++ b/devtools/client/accessibility/test/chrome/test_accessible_learnMoreLink.html @@ -0,0 +1,97 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<!DOCTYPE HTML> +<html> +<!-- +Test that LearnMoreLink parses and renders correctly text with learn more links. +--> +<head> + <meta charset="utf-8"> + <title>LearnMoreLink component test</title> + <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> + <link rel="stylesheet" href="chrome://devtools/skin/light-theme.css" type="text/css"> +</head> +<body> +<pre id="test"> +<script src="head.js" type="application/javascript"></script> +<script type="application/javascript"> + +"use strict"; + +window.onload = async function() { + try { + const { gDevTools } = require("devtools/client/framework/devtools"); + const ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom"); + const { createFactory } = browserRequire("devtools/client/shared/vendor/react"); + const { Simulate } = + browserRequire("devtools/client/shared/vendor/react-dom-test-utils"); + const LearnMoreLink = createFactory( + browserRequire("devtools/client/accessibility/components/LearnMoreLink")); + + class MockL10N { + constructor(bundle) { + this.bundle = bundle; + } + + getStr(name) { + return this.bundle[name]; + } + + getFormatStr(name, ...args) { + let index = 0; + return this.bundle[name].replace("%S", () => args[index++]); + } + } + + function testLinkClicked(link, expectedUrl) { + const browserWindow = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType); + const defaultOpenWebLinkIn = browserWindow.openWebLinkIn; + + const checker = Symbol(); + let onClickUrl = checker; + browserWindow.openWebLinkIn = url => { + onClickUrl = url; + }; + + Simulate.click(link); + + ok(onClickUrl !== checker, "Link was clicked"); + is(onClickUrl, expectedUrl, "Correct URL is opened"); + + browserWindow.openWebLinkIn = defaultOpenWebLinkIn; + } + + const href = "http://example.com/"; + const className = "test-class"; + const l10n = new MockL10N({ + message: "This is a message that contains a link. %S", + link: "Learn more", + }); + const learnMoreLink = LearnMoreLink( + { href, className, l10n, learnMoreStringKey: "link", messageStringKey: "message" }); + ok(LearnMoreLink, "Should be able to create LearnMoreLink instances"); + + ReactDOM.render(learnMoreLink, document.body); + const p = document.querySelector("p"); + is(p.textContent, "This is a message that contains a link. Learn more", + "Text content for the whole paragraph is correct"); + + is(p.className, className, "Class name is set correctly."); + + const link = p.querySelector(".link"); + ok(link, "Link was rendered"); + is(link.textContent, "Learn more", "Text content for link is correct"); + + testLinkClicked(link, href); + } catch (e) { + ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e)); + } finally { + SimpleTest.finish(); + } +}; +</script> +</pre> +</body> +</html> diff --git a/devtools/client/accessibility/test/chrome/test_accessible_openLink.html b/devtools/client/accessibility/test/chrome/test_accessible_openLink.html new file mode 100644 index 0000000000..1ed351e2fb --- /dev/null +++ b/devtools/client/accessibility/test/chrome/test_accessible_openLink.html @@ -0,0 +1,111 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<!DOCTYPE HTML> +<html> +<!-- +Test that openLink function is called if accessible object property is rendered as a link. +--> +<head> + <meta charset="utf-8"> + <title>Accessible component test</title> + <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> + <link rel="stylesheet" href="chrome://devtools/skin/light-theme.css" type="text/css"> +</head> +<body> +<pre id="test"> +<script src="head.js" type="application/javascript"></script> +<script type="application/javascript"> + +"use strict"; + +window.onload = async function() { + try { + const { gDevTools } = require("devtools/client/framework/devtools"); + const ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom"); + const { createFactory, createElement } = + browserRequire("devtools/client/shared/vendor/react"); + const { Provider } = require("devtools/client/shared/vendor/react-redux"); + const createStore = require("devtools/client/shared/redux/create-store"); + const { Simulate } = + browserRequire("devtools/client/shared/vendor/react-dom-test-utils"); + const Accessible = createFactory( + browserRequire("devtools/client/accessibility/components/Accessible")); + + function testLinkClicked(link, event, expectedUrl, expectedWhere) { + const browserWindow = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType); + const defaultOpenWebLinkIn = browserWindow.openWebLinkIn; + + const checker = Symbol(); + let onClickArgs = checker; + browserWindow.openWebLinkIn = (url, where) => { + onClickArgs = { url, where }; + }; + + Simulate.click(link, event); + + ok(onClickArgs !== checker, "Link was clicked"); + is(onClickArgs.url, expectedUrl, "Correct URL is opened"); + is(onClickArgs.where, expectedWhere, "URL was opened correctly"); + + browserWindow.openWebLinkIn = defaultOpenWebLinkIn; + } + + const a = Accessible({ labelledby: "Test Accessible" }); + ok(a, "Should be able to create Accessible instances"); + + let URL = "http://example.com"; + const mockStore = createStore((state, action) => + action ? { ...state, ...action } : state, + { + initialState: { + details: { + DOMNode: {}, + accessible: { + // This accessible mock has no actorID and should be treated as + // destroyed. + isDestroyed: () => true, + value: URL, + } + }, + ui: { + supports: {} + } + }, + } + ); + const provider = createElement(Provider, { store: mockStore }, a); + const accessible = ReactDOM.render(provider, window.document.body); + ok(accessible, "Should be able to mount Accessible instances"); + + let link = document.querySelector(".url"); + testLinkClicked(link, null, URL, "tab"); + + URL = "non-URL"; + await mockStore.dispatch( + { + type: "update", + details: { + DOMNode: {}, + accessible: { + // This accessible mock has no actorID and should be treated as + // destroyed. + isDestroyed: () => true, + value: URL, + } + } + } + ); + link = document.querySelector(".url"); + ok(!link, "Non URL link should not be rendered as a link."); + } catch (e) { + ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e)); + } finally { + SimpleTest.finish(); + } +}; +</script> +</pre> +</body> +</html> diff --git a/devtools/client/accessibility/test/chrome/test_accessible_relations.html b/devtools/client/accessibility/test/chrome/test_accessible_relations.html new file mode 100644 index 0000000000..c2d868b50c --- /dev/null +++ b/devtools/client/accessibility/test/chrome/test_accessible_relations.html @@ -0,0 +1,103 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<!DOCTYPE HTML> +<html> +<!-- +Test that openLink function is called if accessible object property is rendered as a link. +--> +<head> + <meta charset="utf-8"> + <title>Accessible component test</title> + <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> + <link rel="stylesheet" href="chrome://devtools/skin/light-theme.css" type="text/css"> +</head> +<body> +<pre id="test"> +<script src="head.js" type="application/javascript"></script> +<script type="application/javascript"> + +"use strict"; + +window.onload = async function() { + try { + const ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom"); + const { createFactory, createElement } = + browserRequire("devtools/client/shared/vendor/react"); + const { Provider } = require("devtools/client/shared/vendor/react-redux"); + const createStore = require("devtools/client/shared/redux/create-store"); + const { Simulate } = + browserRequire("devtools/client/shared/vendor/react-dom-test-utils"); + const Accessible = createFactory( + browserRequire("devtools/client/accessibility/components/Accessible")); + + const a = Accessible({ labelledby: "Test Accessible" }); + ok(a, "Should be able to create Accessible instances"); + + const mockState = { + details: { + DOMNode: {}, + accessible: { + on: () => {}, + off: () => {}, + // This accessible mock has no actorID and should be treated as + // destroyed. + isDestroyed: () => true, + }, + }, + ui: { supports: {} } + }; + + const mockStore = createStore((state, action) => + action ? { ...state, ...action } : state, { initialState: mockState }); + const provider = createElement(Provider, { store: mockStore }, a); + const accessible = ReactDOM.render(provider, window.document.body); + ok(accessible, "Should be able to mount Accessible instances"); + let relationsNode = document.getElementById("/relations"); + ok(relationsNode, "Relations are rendered when supported."); + let arrow = relationsNode.querySelector(".arrow.theme-twisty"); + is(arrow.style.visibility, "hidden", "Relations are empty."); + + info("Render accessible object with relations."); + const state = { + details: { + ...mockState.details, + relations: { + "containing document": { + actorID: "server1.conn2.child1/accessible29", + typeName: "accessible", + name: "New Tab", + role: "document", + }, + }, + }, + }; + await mockStore.dispatch({ type: "update", ...state }); + relationsNode = document.getElementById("/relations"); + ok(relationsNode, "Relations are rendered when supported."); + arrow = relationsNode.querySelector(".arrow.theme-twisty"); + ok(!arrow.style.visibility, + "There is at least one relation for the current accessible object."); + + Simulate.click(arrow, null); + const relationNode = document.getElementById("/relations/containing document"); + ok(relationNode, "Relation node is rendered."); + ok(relationNode.textContent.includes( + state.details.relations["containing document"].name), + "Relation target's name is rendered"); + ok(relationNode.textContent.includes( + state.details.relations["containing document"].role), + "Relation target's name is rendered"); + ok(relationNode.querySelector(".open-accessibility-inspector"), + "Select accessible button is rendered."); + } catch (e) { + ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e)); + } finally { + SimpleTest.finish(); + } +}; +</script> +</pre> +</body> +</html> diff --git a/devtools/client/accessibility/test/chrome/test_accessible_row_context_menu.html b/devtools/client/accessibility/test/chrome/test_accessible_row_context_menu.html new file mode 100644 index 0000000000..7cc2e6f005 --- /dev/null +++ b/devtools/client/accessibility/test/chrome/test_accessible_row_context_menu.html @@ -0,0 +1,148 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<!DOCTYPE HTML> +<html> +<!-- +Test that openLink function is called if accessible object property is rendered as a link. +--> +<head> + <meta charset="utf-8"> + <title>AccessibilityRow context menu test</title> + <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"> + <link rel="stylesheet" href="chrome://devtools/skin/light-theme.css" type="text/css"> +</head> +<body> +<pre id="test"> +<script src="head.js" type="application/javascript"></script> +<script type="application/javascript"> + +"use strict"; + +window.onload = async function() { + try { + const { gDevTools } = require("devtools/client/framework/devtools"); + const ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom"); + const { createFactory, createElement } = + browserRequire("devtools/client/shared/vendor/react"); + const { Provider } = require("devtools/client/shared/vendor/react-redux"); + const createStore = require("devtools/client/shared/redux/create-store"); + const { Simulate } = + browserRequire("devtools/client/shared/vendor/react-dom-test-utils"); + const AccessibilityRow = createFactory( + browserRequire("devtools/client/accessibility/components/AccessibilityRow")); + const { FILTERS } = browserRequire("devtools/client/accessibility/constants"); + + async function withMockEnv(func) { + const { gTelemetry: originalTelemetry } = window; + window.gTelemetry = null; + + await func(); + + window.gTelemetry = originalTelemetry; + } + + function renderAccessibilityRow(newProps, newState) { + let container = document.getElementById("container"); + if (container) { + container.remove(); + } + + const accRow = AccessibilityRow(newProps); + const mockStore = createStore((state, action) => + action ? { ...state, ...action } : state, { initialState: newState }); + const provider = createElement(Provider, { store: mockStore }, accRow); + + container = document.createElement("div"); + container.id = "container"; + document.body.appendChild(container); + return ReactDOM.render(provider, container); + } + + const ROW_ID = "test-row"; + const JSON_URL_PREFIX = "data:application/json;charset=UTF-8,"; + const SNAPSHOT = { "snapshot": true }; + const defaultProps = { + id: ROW_ID, + member: { + object: { + name: "test", + value: "test", + loading: false, + selected: false, + hasChildren: false, + snapshot: async () => SNAPSHOT, + on: () => {}, + off: () => {}, + // This accessible mock has no actorID and should be treated as + // destroyed. + isDestroyed: () => true, + }, + }, + columns: [ + { "id": "default", "title": "role" }, + { "id": "value", "title": "name" }, + ], + provider: { + getValue: (object, id) => object[id], + }, + hasContextMenu: true, + toolboxDoc: document, + }; + + const auditState = { audit: { filters: { [FILTERS.CONTRAST]: false }}}; + + const defaultState = { + ui: { supports: {} }, + ...auditState, + }; + + info("Check contextmenu default behaviour."); + renderAccessibilityRow(defaultProps, defaultState); + const row = document.getElementById(ROW_ID); + + info("Get topmost document where the context meny will be rendered"); + const menuDoc = document.defaultView.windowRoot.ownerGlobal.document; + await withMockEnv(async function() { + Simulate.contextMenu(row); + + const menu = menuDoc.getElementById("accessibility-row-contextmenu"); + const printtojsonMenuItem = menuDoc.getElementById("menu-printtojson"); + + ok(menu, "Accessibility row context menu is open"); + ok(printtojsonMenuItem, "Print to JSON menu item is visible"); + + const browserWindow = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType); + const defaultOpenWebLinkIn = browserWindow.openWebLinkIn; + + let openWebLinkInCalled; + const openWebLinkInPromise = new Promise(resolve => { + openWebLinkInCalled = resolve; + }); + + // Mock top chrome window's @openWebLinkIn method. + browserWindow.openWebLinkIn = (...args) => { + openWebLinkInCalled(args); + }; + printtojsonMenuItem.click(); + + const [ url, where ] = await openWebLinkInPromise; + is(url, `${JSON_URL_PREFIX}${encodeURIComponent(JSON.stringify(SNAPSHOT))}`, + "Correct URL is opened"); + is(where, "tab", "URL was opened correctly"); + + // Reset @openWebLinkIn to default. + browserWindow.openWebLinkIn = defaultOpenWebLinkIn; + menu.remove(); + }); + } catch (e) { + ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e)); + } finally { + SimpleTest.finish(); + } +}; +</script> +</pre> +</body> +</html> diff --git a/devtools/client/accessibility/test/node/.eslintrc.js b/devtools/client/accessibility/test/node/.eslintrc.js new file mode 100644 index 0000000000..698a392120 --- /dev/null +++ b/devtools/client/accessibility/test/node/.eslintrc.js @@ -0,0 +1,11 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +module.exports = { + env: { + jest: true, + }, +}; diff --git a/devtools/client/accessibility/test/node/README.md b/devtools/client/accessibility/test/node/README.md new file mode 100644 index 0000000000..4b40aacffe --- /dev/null +++ b/devtools/client/accessibility/test/node/README.md @@ -0,0 +1,22 @@ +# Jest Tests for devtools/client/accessibility + +## About + +DevTools React components can be tested using [jest](https://jestjs.io/). Jest allows to test our UI components in isolation and complement our end to end mochitests. + +## Run locally + +We use yarn for dependency management. To run the tests locally: +``` + cd devtools/client/accessibility/test/node + yarn && yarn test +``` + +## Run on try + +The tests run on try on linux64 platforms. The complete name of try job is `devtools-tests`. In treeherder, they will show up as `node(devtools)`. + +Adding the tests to a try push depends on the try selector you are using. +- try fuzzy: look for the job named `source-test-node-devtools-tests` + +The configuration file for try can be found at `taskcluster/ci/source-test/node.yml` diff --git a/devtools/client/accessibility/test/node/babel.config.js b/devtools/client/accessibility/test/node/babel.config.js new file mode 100644 index 0000000000..eb289b73e7 --- /dev/null +++ b/devtools/client/accessibility/test/node/babel.config.js @@ -0,0 +1,15 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +module.exports = { + plugins: [ + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-async-generator-functions", + "@babel/plugin-proposal-optional-chaining", + "@babel/plugin-proposal-nullish-coalescing-operator", + "transform-amd-to-commonjs", + ], +}; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-prefs.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-prefs.test.js.snap new file mode 100644 index 0000000000..eea9c7ece4 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-prefs.test.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AccessibilityPrefs component: prefs checked 1`] = `"<button class=\\"devtools-button badge toolbar-menu-button prefs\\" title=\\"Configure preferences\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-prefs-menu\\"></button>"`; + +exports[`AccessibilityPrefs component: prefs not set by default 1`] = `"<button class=\\"devtools-button badge toolbar-menu-button prefs\\" title=\\"Configure preferences\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-prefs-menu\\"></button>"`; + +exports[`AccessibilityPrefs component: toggle pref 1`] = `"<button class=\\"devtools-button badge toolbar-menu-button prefs\\" title=\\"Configure preferences\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-prefs-menu\\"></button>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-row-value.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-row-value.test.js.snap new file mode 100644 index 0000000000..e35558e016 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-row-value.test.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AccessibilityRowValue component: basic render 1`] = `"<span role=\\"presentation\\"><span class=\\"objectBox objectBox-undefined\\">undefined</span></span>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-tree-filter.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-tree-filter.test.js.snap new file mode 100644 index 0000000000..8d54471f0b --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/accessibility-tree-filter.test.js.snap @@ -0,0 +1,39 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AccessibilityTreeFilter component: audit all filter filtered auditing 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">All Issues</button></div>"`; + +exports[`AccessibilityTreeFilter component: audit all filter not filtered auditing 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`; + +exports[`AccessibilityTreeFilter component: audit filter not filtered 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`; + +exports[`AccessibilityTreeFilter component: audit filters filtered 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">All Issues</button></div>"`; + +exports[`AccessibilityTreeFilter component: audit other filter filtered auditing 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">Contrast</button></div>"`; + +exports[`AccessibilityTreeFilter component: audit other filter not filtered auditing 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 2`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 3`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 4`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">All Issues</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 5`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">Keyboard, Text Labels</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 6`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">Keyboard, Text Labels</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 7`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">Keyboard, Text Labels</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 8`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">All Issues</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 9`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 10`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 11`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`; + +exports[`AccessibilityTreeFilter component: render filters after state changes 12`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">Text Labels</button></div>"`; + +exports[`AccessibilityTreeFilter component: toggle filter 1`] = `"<div role=\\"group\\" class=\\"accessibility-tree-filters\\" aria-labelledby=\\"accessibility-tree-filters-label\\"><span id=\\"accessibility-tree-filters-label\\" role=\\"presentation\\">Check for issues:</span><button class=\\"devtools-button badge toolbar-menu-button filters\\" aria-expanded=\\"false\\" aria-haspopup=\\"menu\\" aria-controls=\\"accessibility-tree-filters-menu\\">None</button></div>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/audit-controller.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/audit-controller.test.js.snap new file mode 100644 index 0000000000..b510bd22d3 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/audit-controller.test.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AuditController component: accessible with checks 1`] = `"<span class=\\"child\\" checks=\\"[object Object]\\"></span>"`; + +exports[`AuditController component: accessible without checks 1`] = `"<span></span>"`; + +exports[`AuditController component: dead accessible actor 1`] = `"<span></span>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/audit-filter.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/audit-filter.test.js.snap new file mode 100644 index 0000000000..32564ff6d7 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/audit-filter.test.js.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AuditController component: audit filter filtered contrast checks fail 1`] = `"<span></span>"`; + +exports[`AuditController component: audit filter filtered contrast checks fail range 1`] = `"<span></span>"`; + +exports[`AuditController component: audit filter filtered contrast checks success 1`] = `""`; + +exports[`AuditController component: audit filter filtered no checks 1`] = `""`; + +exports[`AuditController component: audit filter filtered unknown checks 1`] = `""`; + +exports[`AuditController component: audit filter not filtered 1`] = `"<span></span>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/audit-progress-overlay.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/audit-progress-overlay.test.js.snap new file mode 100644 index 0000000000..8ae235d352 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/audit-progress-overlay.test.js.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AuditProgressOverlay component: render auditing finishing up 1`] = `"<span id=\\"audit-progress-container\\" role=\\"progressbar\\" aria-valuetext=\\"Finishing up…\\">Finishing up…</span>"`; + +exports[`AuditProgressOverlay component: render auditing initializing 1`] = `"<span id=\\"audit-progress-container\\" role=\\"progressbar\\" aria-valuetext=\\"Initializing…\\">Initializing…</span>"`; + +exports[`AuditProgressOverlay component: render auditing progress 1`] = `"<span id=\\"audit-progress-container\\">Checking 5 nodes<progress max=\\"100\\" value=\\"0\\" class=\\"audit-progress-progressbar\\" aria-labelledby=\\"audit-progress-container\\"></progress></span>"`; + +exports[`AuditProgressOverlay component: render auditing progress 2`] = `"<span id=\\"audit-progress-container\\">Checking 5 nodes<progress max=\\"100\\" value=\\"50\\" class=\\"audit-progress-progressbar\\" aria-labelledby=\\"audit-progress-container\\"></progress></span>"`; + +exports[`AuditProgressOverlay component: render auditing progress 3`] = `"<span id=\\"audit-progress-container\\">Checking 5 nodes<progress max=\\"100\\" value=\\"75\\" class=\\"audit-progress-progressbar\\" aria-labelledby=\\"audit-progress-container\\"></progress></span>"`; + +exports[`AuditProgressOverlay component: render not auditing 1`] = `""`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/badge.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/badge.test.js.snap new file mode 100644 index 0000000000..324c72105b --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/badge.test.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Badge component: basic render 1`] = `"<span class=\\"audit-badge badge\\" title=\\"Does not meet WCAG standards for accessible text.\\" aria-label=\\"Contrast\\">Contrast</span>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/badges.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/badges.test.js.snap new file mode 100644 index 0000000000..5065d172d0 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/badges.test.js.snap @@ -0,0 +1,15 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Badges component: contrast ratio fail range render 1`] = `"<span class=\\"badges\\" role=\\"group\\" aria-label=\\"Accessibility checks\\"><span class=\\"audit-badge badge\\" data-score=\\"FAIL\\" title=\\"Does not meet WCAG standards for accessible text.\\" aria-label=\\"contrast warning\\">contrast</span></span>"`; + +exports[`Badges component: contrast ratio fail render 1`] = `"<span class=\\"badges\\" role=\\"group\\" aria-label=\\"Accessibility checks\\"><span class=\\"audit-badge badge\\" data-score=\\"FAIL\\" title=\\"Does not meet WCAG standards for accessible text.\\" aria-label=\\"contrast warning\\">contrast</span></span>"`; + +exports[`Badges component: contrast ratio success render 1`] = `"<span class=\\"badges\\" role=\\"group\\" aria-label=\\"Accessibility checks\\"></span>"`; + +exports[`Badges component: empty checks render 1`] = `""`; + +exports[`Badges component: no props render 1`] = `""`; + +exports[`Badges component: null checks render 1`] = `""`; + +exports[`Badges component: unsupported checks render 1`] = `""`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/check.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/check.test.js.snap new file mode 100644 index 0000000000..06d9cb60c5 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/check.test.js.snap @@ -0,0 +1,5 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Check component: basic render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; + +exports[`Check component: basic render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/contrast-badge.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/contrast-badge.test.js.snap new file mode 100644 index 0000000000..f24c7a92ab --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/contrast-badge.test.js.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ContrastBadge component: error render 1`] = `null`; + +exports[`ContrastBadge component: fail render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"FAIL\\" title=\\"Does not meet WCAG standards for accessible text.\\" aria-label=\\"contrast warning\\">contrast</span>"`; + +exports[`ContrastBadge component: success large text render 1`] = `null`; + +exports[`ContrastBadge component: success range render 1`] = `null`; + +exports[`ContrastBadge component: success render 1`] = `null`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/display-tabbing-order.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/display-tabbing-order.test.js.snap new file mode 100644 index 0000000000..d7e8c1ebdb --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/display-tabbing-order.test.js.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`DisplayTabbingOrder component: default render 1`] = `"<label class=\\"accessibility-tabbing-order devtools-checkbox-label devtools-ellipsis-text\\" for=\\"devtools-display-tabbing-order-checkbox\\" title=\\"Show tabbing order of elements and their tabbing index.\\"><input id=\\"devtools-display-tabbing-order-checkbox\\" class=\\"devtools-checkbox\\" type=\\"checkbox\\">Show Tabbing Order</label>"`; + +exports[`DisplayTabbingOrder component: displaying tabbing order render/update 1`] = `"<label class=\\"accessibility-tabbing-order devtools-checkbox-label devtools-ellipsis-text\\" for=\\"devtools-display-tabbing-order-checkbox\\" title=\\"Show tabbing order of elements and their tabbing index.\\"><input id=\\"devtools-display-tabbing-order-checkbox\\" class=\\"devtools-checkbox\\" type=\\"checkbox\\">Show Tabbing Order</label>"`; + +exports[`DisplayTabbingOrder component: displaying tabbing order render/update 2`] = `"<label class=\\"accessibility-tabbing-order devtools-checkbox-label devtools-ellipsis-text\\" for=\\"devtools-display-tabbing-order-checkbox\\" title=\\"Show tabbing order of elements and their tabbing index.\\"><input id=\\"devtools-display-tabbing-order-checkbox\\" class=\\"devtools-checkbox\\" type=\\"checkbox\\">Show Tabbing Order</label>"`; + +exports[`DisplayTabbingOrder component: toggle tabbing order overlay 1`] = `"<label class=\\"accessibility-tabbing-order devtools-checkbox-label devtools-ellipsis-text\\" for=\\"devtools-display-tabbing-order-checkbox\\" title=\\"Show tabbing order of elements and their tabbing index.\\"><input id=\\"devtools-display-tabbing-order-checkbox\\" class=\\"devtools-checkbox\\" type=\\"checkbox\\">Show Tabbing Order</label>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-badge.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-badge.test.js.snap new file mode 100644 index 0000000000..f1d9bc5c76 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-badge.test.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`KeyboardBadge component: error render 1`] = `null`; + +exports[`KeyboardBadge component: fail render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"FAIL\\" title=\\"Does not meet WCAG standards for keyboard accessibility.\\" aria-label=\\"keyboard\\">keyboard</span>"`; + +exports[`KeyboardBadge component: warning render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"WARNING\\" title=\\"Does not meet WCAG standards for keyboard accessibility.\\" aria-label=\\"keyboard\\">keyboard</span>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-check.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-check.test.js.snap new file mode 100644 index 0000000000..60b66cc6dc --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/keyboard-check.test.js.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`KeyboardCheck component: FAIL render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; + +exports[`KeyboardCheck component: FAIL render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; + +exports[`KeyboardCheck component: WARNING render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/alert.svg\\" data-score=\\"WARNING\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; + +exports[`KeyboardCheck component: WARNING render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/alert.svg\\" data-score=\\"WARNING\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/text-label-badge.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/text-label-badge.test.js.snap new file mode 100644 index 0000000000..4f43a73a62 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/text-label-badge.test.js.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TextLabelBadge component: best practices render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"BEST_PRACTICES\\" title=\\"Does not meet WCAG standards for text alternative.\\" aria-label=\\"text label\\">text label</span>"`; + +exports[`TextLabelBadge component: error render 1`] = `null`; + +exports[`TextLabelBadge component: fail render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"FAIL\\" title=\\"Does not meet WCAG standards for text alternative.\\" aria-label=\\"text label\\">text label</span>"`; + +exports[`TextLabelBadge component: warning render 1`] = `"<span class=\\"audit-badge badge\\" data-score=\\"WARNING\\" title=\\"Does not meet WCAG standards for text alternative.\\" aria-label=\\"text label\\">text label</span>"`; diff --git a/devtools/client/accessibility/test/node/components/__snapshots__/text-label-check.test.js.snap b/devtools/client/accessibility/test/node/components/__snapshots__/text-label-check.test.js.snap new file mode 100644 index 0000000000..7a5735f3e0 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/__snapshots__/text-label-check.test.js.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TextLabelCheck component: BEST_PRACTICES render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/info.svg\\" data-score=\\"BEST_PRACTICES\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; + +exports[`TextLabelCheck component: BEST_PRACTICES render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/info.svg\\" data-score=\\"BEST_PRACTICES\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; + +exports[`TextLabelCheck component: FAIL render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; + +exports[`TextLabelCheck component: FAIL render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/error.svg\\" data-score=\\"FAIL\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; + +exports[`TextLabelCheck component: WARNING render 1`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/alert.svg\\" data-score=\\"WARNING\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; + +exports[`TextLabelCheck component: WARNING render 2`] = `"<div role=\\"presentation\\" tabindex=\\"-1\\" class=\\"accessibility-check\\"><h3 class=\\"accessibility-check-header\\"></h3><div role=\\"presentation\\" tabindex=\\"-1\\"><img src=\\"chrome://devtools/skin/images/alert.svg\\" data-score=\\"WARNING\\" class=\\"icon\\"><p class=\\"accessibility-check-annotation\\"></p></div></div>"`; diff --git a/devtools/client/accessibility/test/node/components/accessibility-prefs.test.js b/devtools/client/accessibility/test/node/components/accessibility-prefs.test.js new file mode 100644 index 0000000000..efd247d789 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/accessibility-prefs.test.js @@ -0,0 +1,107 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); + +const MenuButton = require("resource://devtools/client/shared/components/menu/MenuButton.js"); +const ConnectedAccessibilityPrefsClass = require("resource://devtools/client/accessibility/components/AccessibilityPrefs.js"); +const AccessibilityPrefsClass = + ConnectedAccessibilityPrefsClass.WrappedComponent; +const AccessibilityPrefs = createFactory(ConnectedAccessibilityPrefsClass); +const { + checkMenuItem, + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const { + PREFS, +} = require("resource://devtools/client/accessibility/constants.js"); + +function checkTogglePrefCheckbox(wrapper, pref) { + const prefsInstance = wrapper.find(AccessibilityPrefsClass).instance(); + prefsInstance.togglePref = jest.fn(); + pref instanceof Node ? pref.click() : pref.simulate("click"); + expect(prefsInstance.togglePref.mock.calls.length).toBe(1); +} + +function getMenuItems(wrapper, selector) { + const menuButton = wrapper.find(MenuButton); + // Focusing on the menu button will trigger rendering of the HTMLTooltip with + // the menu list. + menuButton.childAt(0).getDOMNode().focus(); + + return menuButton + .instance() + .tooltip.panel.querySelectorAll(`.menuitem ${selector}`); +} + +function checkPrefsState(wrapper, expected) { + const prefs = getMenuItems(wrapper, ".pref"); + for (let i = 0; i < prefs.length; i++) { + checkMenuItem(prefs[i], { + checked: expected.prefs[i].active, + label: expected.prefs[i].text, + }); + } + checkMenuItem(getMenuItems(wrapper, ".help")[0], { + role: "link", + label: "Documentation…", + }); +} + +describe("AccessibilityPrefs component:", () => { + it("prefs not set by default", () => { + const store = setupStore(); + const wrapper = mount( + Provider({ store }, AccessibilityPrefs({ toolboxDoc: document })) + ); + const accPrefs = wrapper.find(AccessibilityPrefsClass); + const menuButton = accPrefs.childAt(0); + + expect(wrapper.html()).toMatchSnapshot(); + expect(accPrefs.children().length).toBe(1); + expect(menuButton.is(MenuButton)).toBe(true); + + checkPrefsState(wrapper, { + prefs: [{ active: false, text: "Scroll into view" }], + }); + }); + + it("prefs checked", () => { + const store = setupStore({ + preloadedState: { + ui: { + [PREFS.SCROLL_INTO_VIEW]: true, + }, + }, + }); + const wrapper = mount( + Provider({ store }, AccessibilityPrefs({ toolboxDoc: document })) + ); + expect(wrapper.html()).toMatchSnapshot(); + checkPrefsState(wrapper, { + prefs: [{ active: true, text: "Scroll into view" }], + }); + }); + + it("toggle pref", () => { + const store = setupStore(); + const wrapper = mount( + Provider({ store }, AccessibilityPrefs({ toolboxDoc: document })) + ); + + expect(wrapper.html()).toMatchSnapshot(); + for (const pref of getMenuItems(wrapper, ".pref")) { + checkTogglePrefCheckbox(wrapper, pref); + } + }); +}); diff --git a/devtools/client/accessibility/test/node/components/accessibility-row-value.test.js b/devtools/client/accessibility/test/node/components/accessibility-row-value.test.js new file mode 100644 index 0000000000..5e73f0f18f --- /dev/null +++ b/devtools/client/accessibility/test/node/components/accessibility-row-value.test.js @@ -0,0 +1,56 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); +const { + mockAccessible, + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const Badges = require("resource://devtools/client/accessibility/components/Badges.js"); +const { + REPS: { Rep }, +} = require("resource://devtools/client/shared/components/reps/index.js"); +const AuditController = require("resource://devtools/client/accessibility/components/AuditController.js"); + +const AccessibilityRowValueClass = require("resource://devtools/client/accessibility/components/AccessibilityRowValue.js"); +const AccessibilityRowValue = createFactory(AccessibilityRowValueClass); + +describe("AccessibilityRowValue component:", () => { + it("basic render", () => { + const store = setupStore({ + preloadedState: { ui: { supports: {} } }, + }); + const wrapper = mount( + Provider( + { store }, + AccessibilityRowValue({ + member: { object: mockAccessible() }, + }) + ) + ); + + expect(wrapper.html()).toMatchSnapshot(); + const rowValue = wrapper.find(AccessibilityRowValueClass); + expect(rowValue.children().length).toBe(1); + const container = rowValue.childAt(0); + expect(container.type()).toBe("span"); + expect(container.prop("role")).toBe("presentation"); + expect(container.children().length).toBe(2); + expect(container.childAt(0).type()).toBe(Rep); + const controller = container.childAt(1); + expect(controller.type()).toBe(AuditController); + expect(controller.children().length).toBe(1); + expect(controller.childAt(0).type()).toBe(Badges); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/accessibility-tree-filter.test.js b/devtools/client/accessibility/test/node/components/accessibility-tree-filter.test.js new file mode 100644 index 0000000000..af37a8318d --- /dev/null +++ b/devtools/client/accessibility/test/node/components/accessibility-tree-filter.test.js @@ -0,0 +1,437 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); + +const MenuButton = require("resource://devtools/client/shared/components/menu/MenuButton.js"); +const ConnectedAccessibilityTreeFilterClass = require("resource://devtools/client/accessibility/components/AccessibilityTreeFilter.js"); +const AccessibilityTreeFilterClass = + ConnectedAccessibilityTreeFilterClass.WrappedComponent; +const AccessibilityTreeFilter = createFactory( + ConnectedAccessibilityTreeFilterClass +); +const { + checkMenuItem, + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const { + AUDIT, + AUDITING, + FILTERS, + FILTER_TOGGLE, +} = require("resource://devtools/client/accessibility/constants.js"); + +function checkToggleFilterCheckbox(wrapper, filter) { + const filterInstance = wrapper.find(AccessibilityTreeFilterClass).instance(); + filterInstance.toggleFilter = jest.fn(); + filter.click(); + expect(filterInstance.toggleFilter.mock.calls.length).toBe(1); +} + +function getMenuItems(wrapper, selector) { + const menuButton = wrapper.find(MenuButton); + // Focusing on the menu button will trigger rendering of the HTMLTooltip with + // the menu list. + menuButton.childAt(0).getDOMNode().focus(); + + return menuButton + .instance() + .tooltip.panel.querySelectorAll(`.menuitem ${selector}`); +} + +function checkFiltersState(wrapper, expected) { + const filters = getMenuItems(wrapper, ".filter"); + for (let i = 0; i < filters.length; i++) { + checkMenuItem(filters[i], { + checked: expected.filters[i].active, + label: expected.filters[i].text, + disabled: expected.filters[i].disabled, + }); + } +} + +describe("AccessibilityTreeFilter component:", () => { + it("audit filter not filtered", () => { + const store = setupStore(); + const wrapper = mount( + Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document })) + ); + const accTreeFilter = wrapper.find(AccessibilityTreeFilterClass); + const toolbar = accTreeFilter.childAt(0); + + expect(wrapper.html()).toMatchSnapshot(); + expect(accTreeFilter.children().length).toBe(1); + expect(toolbar.is("div")).toBe(true); + expect(toolbar.prop("role")).toBe("group"); + + checkFiltersState(wrapper, { + filters: [ + { active: true, disabled: false, text: "None" }, + { active: false, disabled: false, text: "All Issues" }, + { + active: false, + disabled: false, + text: "Contrast", + }, + { + active: false, + disabled: false, + text: "Keyboard", + }, + { + active: false, + disabled: false, + text: "Text Labels", + }, + ], + }); + }); + + it("audit filters filtered", () => { + const store = setupStore({ + preloadedState: { + audit: { + filters: { + [FILTERS.ALL]: true, + [FILTERS.CONTRAST]: true, + [FILTERS.KEYBOARD]: true, + [FILTERS.TEXT_LABEL]: true, + }, + auditing: [], + }, + }, + }); + const wrapper = mount( + Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document })) + ); + expect(wrapper.html()).toMatchSnapshot(); + checkFiltersState(wrapper, { + filters: [ + { active: false, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + ], + }); + }); + + it("audit all filter not filtered auditing", () => { + const store = setupStore({ + preloadedState: { + audit: { + filters: { + [FILTERS.ALL]: false, + }, + auditing: [FILTERS.ALL], + }, + }, + }); + const wrapper = mount( + Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document })) + ); + expect(wrapper.html()).toMatchSnapshot(); + checkFiltersState(wrapper, { + filters: [ + { active: true, disabled: false, text: "None" }, + { active: false, disabled: true, text: "All Issues" }, + ], + }); + }); + + it("audit other filter not filtered auditing", () => { + const store = setupStore({ + preloadedState: { + audit: { + filters: { + [FILTERS.ALL]: false, + [FILTERS.CONTRAST]: false, + [FILTERS.KEYBOARD]: false, + [FILTERS.TEXT_LABEL]: false, + }, + auditing: [FILTERS.CONTRAST], + }, + }, + }); + const wrapper = mount( + Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document })) + ); + expect(wrapper.html()).toMatchSnapshot(); + checkFiltersState(wrapper, { + filters: [ + { active: true, disabled: true }, + { active: false, disabled: false }, + { active: false, disabled: true }, + { active: false, disabled: false }, + { active: false, disabled: false }, + ], + }); + }); + + it("audit all filter filtered auditing", () => { + const store = setupStore({ + preloadedState: { + audit: { + filters: { + [FILTERS.ALL]: true, + }, + auditing: [FILTERS.ALL], + }, + }, + }); + const wrapper = mount( + Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document })) + ); + const filters = getMenuItems(wrapper, ".filter"); + expect(wrapper.html()).toMatchSnapshot(); + checkMenuItem(filters[1], { checked: true, disabled: true }); + }); + + it("audit other filter filtered auditing", () => { + const store = setupStore({ + preloadedState: { + audit: { + filters: { + [FILTERS.ALL]: false, + [FILTERS.CONTRAST]: true, + [FILTERS.KEYBOARD]: false, + [FILTERS.TEXT_LABEL]: false, + }, + auditing: [FILTERS.CONTRAST], + }, + }, + }); + const wrapper = mount( + Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document })) + ); + expect(wrapper.html()).toMatchSnapshot(); + checkFiltersState(wrapper, { + filters: [ + { active: false, disabled: true }, + { active: false, disabled: false }, + { active: true, disabled: true }, + { active: false, disabled: false }, + { active: false, disabled: false }, + ], + }); + }); + + it("toggle filter", () => { + const store = setupStore(); + const wrapper = mount( + Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document })) + ); + const filters = getMenuItems(wrapper, ".filter"); + + expect(wrapper.html()).toMatchSnapshot(); + for (const filter of filters) { + checkToggleFilterCheckbox(wrapper, filter); + } + }); + + it("render filters after state changes", () => { + const store = setupStore(); + const wrapper = mount( + Provider({ store }, AccessibilityTreeFilter({ toolboxDoc: document })) + ); + const tests = [ + { + expected: { + filters: [ + { active: true, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + ], + }, + }, + { + action: { + type: AUDITING, + auditing: Object.values(FILTERS), + }, + expected: { + filters: [ + { active: true, disabled: true }, + { active: false, disabled: true }, + { active: false, disabled: true }, + { active: false, disabled: true }, + { active: false, disabled: true }, + ], + }, + }, + { + action: { + type: AUDIT, + response: [], + }, + expected: { + filters: [ + { active: true, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + ], + }, + }, + { + action: { + type: FILTER_TOGGLE, + filter: FILTERS.ALL, + }, + expected: { + filters: [ + { active: false, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + ], + }, + }, + { + action: { + type: FILTER_TOGGLE, + filter: FILTERS.CONTRAST, + }, + expected: { + filters: [ + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + ], + }, + }, + { + action: { + type: AUDITING, + auditing: [FILTERS.CONTRAST], + }, + expected: { + filters: [ + { active: false, disabled: true }, + { active: false, disabled: false }, + { active: false, disabled: true }, + { active: true, disabled: false }, + { active: true, disabled: false }, + ], + }, + }, + { + action: { + type: AUDIT, + response: [], + }, + expected: { + filters: [ + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + ], + }, + }, + { + action: { + type: FILTER_TOGGLE, + filter: FILTERS.CONTRAST, + }, + expected: { + filters: [ + { active: false, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + { active: true, disabled: false }, + ], + }, + }, + { + action: { + type: FILTER_TOGGLE, + filter: FILTERS.NONE, + }, + expected: { + filters: [ + { active: true, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + ], + }, + }, + { + action: { + type: AUDITING, + auditing: [FILTERS.TEXT_LABEL], + }, + expected: { + filters: [ + { active: true, disabled: true }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: true }, + ], + }, + }, + { + action: { + type: AUDIT, + response: [], + }, + expected: { + filters: [ + { active: true, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + ], + }, + }, + { + action: { + type: FILTER_TOGGLE, + filter: FILTERS.TEXT_LABEL, + }, + expected: { + filters: [ + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: false, disabled: false }, + { active: true, disabled: false }, + ], + }, + }, + ]; + + for (const test of tests) { + const { action, expected } = test; + if (action) { + store.dispatch(action); + wrapper.update(); + } + + expect(wrapper.html()).toMatchSnapshot(); + checkFiltersState(wrapper, expected); + } + }); +}); diff --git a/devtools/client/accessibility/test/node/components/audit-controller.test.js b/devtools/client/accessibility/test/node/components/audit-controller.test.js new file mode 100644 index 0000000000..ad8ba3ee2b --- /dev/null +++ b/devtools/client/accessibility/test/node/components/audit-controller.test.js @@ -0,0 +1,91 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + span, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); + +const AuditController = createFactory( + require("resource://devtools/client/accessibility/components/AuditController.js") +); +const { + mockAccessible, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +describe("AuditController component:", () => { + it("dead accessible actor", () => { + const accessibleFront = mockAccessible(); + const wrapper = mount( + AuditController( + { + accessibleFront, + }, + span() + ) + ); + + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.find("span").length).toBe(1); + expect(wrapper.find("span").first().props()).toMatchObject({ + checks: undefined, + }); + + const instance = wrapper.instance(); + expect(accessibleFront.on.mock.calls.length).toBe(1); + expect(accessibleFront.off.mock.calls.length).toBe(1); + expect(accessibleFront.on.mock.calls[0]).toEqual([ + "audited", + instance.onAudited, + ]); + expect(accessibleFront.off.mock.calls[0]).toEqual([ + "audited", + instance.onAudited, + ]); + }); + + it("accessible without checks", () => { + const accessibleFront = mockAccessible({ + actorID: "1", + }); + const wrapper = mount( + AuditController( + { + accessibleFront, + }, + span() + ) + ); + + expect(wrapper.html()).toMatchSnapshot(); + expect(accessibleFront.audit.mock.calls.length).toBe(1); + expect(accessibleFront.on.mock.calls.length).toBe(1); + expect(accessibleFront.off.mock.calls.length).toBe(0); + }); + + it("accessible with checks", () => { + const checks = { foo: "bar" }; + const accessibleFront = mockAccessible({ + actorID: "1", + checks, + }); + const wrapper = mount( + AuditController( + { + accessibleFront, + }, + span({ className: "child" }) + ) + ); + + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.state("checks")).toMatchObject(checks); + expect(wrapper.find(".child").prop("checks")).toMatchObject(checks); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/audit-filter.test.js b/devtools/client/accessibility/test/node/components/audit-filter.test.js new file mode 100644 index 0000000000..a38efa12ae --- /dev/null +++ b/devtools/client/accessibility/test/node/components/audit-filter.test.js @@ -0,0 +1,153 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const { + span, +} = require("resource://devtools/client/shared/vendor/react-dom-factories.js"); +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); + +const ConnectedAuditFilterClass = require("resource://devtools/client/accessibility/components/AuditFilter.js"); +const AuditFilterClass = ConnectedAuditFilterClass.WrappedComponent; +const AuditFilter = createFactory(ConnectedAuditFilterClass); +const { + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); +const { + FILTERS, +} = require("resource://devtools/client/accessibility/constants.js"); + +const { + accessibility: { SCORES }, +} = require("resource://devtools/shared/constants.js"); + +describe("AuditController component:", () => { + it("audit filter not filtered", () => { + const store = setupStore(); + + const wrapper = mount(Provider({ store }, AuditFilter({}, span()))); + expect(wrapper.html()).toMatchSnapshot(); + + const filter = wrapper.find(AuditFilterClass); + expect(filter.children().length).toBe(1); + expect(filter.childAt(0).is("span")).toBe(true); + }); + + it("audit filter filtered no checks", () => { + const store = setupStore({ + preloadedState: { audit: { filters: { [FILTERS.CONTRAST]: true } } }, + }); + + const wrapper = mount(Provider({ store }, AuditFilter({}, span()))); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("audit filter filtered unknown checks", () => { + const store = setupStore({ + preloadedState: { audit: { filters: { tbd: true } } }, + }); + + const wrapper = mount(Provider({ store }, AuditFilter({}, span()))); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("audit filter filtered contrast checks success", () => { + const store = setupStore({ + preloadedState: { audit: { filters: { [FILTERS.CONTRAST]: true } } }, + }); + + const wrapper = mount( + Provider( + { store }, + AuditFilter( + { + checks: { + CONTRAST: { + value: 5.11, + color: [255, 0, 0, 1], + backgroundColor: [255, 255, 255, 1], + isLargeText: false, + score: SCORES.AA, + }, + }, + }, + span() + ) + ) + ); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("audit filter filtered contrast checks fail", () => { + const store = setupStore({ + preloadedState: { audit: { filters: { [FILTERS.CONTRAST]: true } } }, + }); + + const CONTRAST = { + value: 3.1, + color: [255, 0, 0, 1], + backgroundColor: [255, 255, 255, 1], + isLargeText: false, + score: SCORES.FAIL, + }; + + const wrapper = mount( + Provider( + { store }, + AuditFilter( + { + checks: { CONTRAST }, + }, + span() + ) + ) + ); + expect(wrapper.html()).toMatchSnapshot(); + const filter = wrapper.find(AuditFilterClass); + expect(filter.children().length).toBe(1); + expect(filter.childAt(0).is("span")).toBe(true); + }); + + it("audit filter filtered contrast checks fail range", () => { + const store = setupStore({ + preloadedState: { audit: { filters: { [FILTERS.CONTRAST]: true } } }, + }); + + const CONTRAST = { + min: 1.19, + max: 1.39, + color: [128, 128, 128, 1], + backgroundColorMin: [219, 106, 116, 1], + backgroundColorMax: [156, 145, 211, 1], + isLargeText: false, + score: SCORES.FAIL, + }; + + const wrapper = mount( + Provider( + { store }, + AuditFilter( + { + checks: { CONTRAST }, + }, + span() + ) + ) + ); + expect(wrapper.html()).toMatchSnapshot(); + const filter = wrapper.find(AuditFilterClass); + expect(filter.children().length).toBe(1); + expect(filter.childAt(0).is("span")).toBe(true); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/audit-progress-overlay.test.js b/devtools/client/accessibility/test/node/components/audit-progress-overlay.test.js new file mode 100644 index 0000000000..797bbce1a1 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/audit-progress-overlay.test.js @@ -0,0 +1,126 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); +const { + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const { + accessibility: { AUDIT_TYPE }, +} = require("resource://devtools/shared/constants.js"); +const { + AUDIT_PROGRESS, +} = require("resource://devtools/client/accessibility/constants.js"); + +const ConnectedAuditProgressOverlayClass = require("resource://devtools/client/accessibility/components/AuditProgressOverlay.js"); +const AuditProgressOverlayClass = + ConnectedAuditProgressOverlayClass.WrappedComponent; +const AuditProgressOverlay = createFactory(ConnectedAuditProgressOverlayClass); + +function testTextProgressBar(store, expectedText) { + const wrapper = mount(Provider({ store }, AuditProgressOverlay())); + expect(wrapper.html()).toMatchSnapshot(); + + const overlay = wrapper.find(AuditProgressOverlayClass); + expect(overlay.children().length).toBe(1); + + const overlayText = overlay.childAt(0); + expect(overlayText.type()).toBe("span"); + expect(overlayText.prop("id")).toBe("audit-progress-container"); + expect(overlayText.prop("role")).toBe("progressbar"); + expect(overlayText.prop("aria-valuetext")).toBe(expectedText); + expect(overlayText.text()).toBe(expectedText); +} + +function testProgress(wrapper, percentage) { + const progress = wrapper.find("progress"); + expect(progress.prop("max")).toBe(100); + expect(progress.prop("value")).toBe(percentage); + expect(progress.hasClass("audit-progress-progressbar")).toBe(true); + expect(progress.prop("aria-labelledby")).toBe("audit-progress-container"); +} + +describe("AuditProgressOverlay component:", () => { + it("render not auditing", () => { + const store = setupStore(); + const wrapper = mount(Provider({ store }, AuditProgressOverlay())); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("render auditing initializing", () => { + const store = setupStore({ + preloadedState: { audit: { auditing: [AUDIT_TYPE.CONTRAST] } }, + }); + + testTextProgressBar(store, "Initializing…"); + }); + + it("render auditing progress", () => { + const store = setupStore({ + preloadedState: { + audit: { + auditing: [AUDIT_TYPE.CONTRAST], + progress: { total: 5, percentage: 0 }, + }, + }, + }); + + const wrapper = mount(Provider({ store }, AuditProgressOverlay())); + expect(wrapper.html()).toMatchSnapshot(); + + const overlay = wrapper.find(AuditProgressOverlayClass); + expect(overlay.children().length).toBe(1); + + const overlayContainer = overlay.childAt(0); + expect(overlayContainer.type()).toBe("span"); + expect(overlayContainer.prop("id")).toBe("audit-progress-container"); + expect(overlayContainer.children().length).toBe(1); + + expect(overlayContainer.text()).toBe("Checking 5 nodes"); + expect(overlayContainer.childAt(0).type()).toBe("progress"); + + testProgress(wrapper, 0); + + store.dispatch({ + type: AUDIT_PROGRESS, + progress: { total: 5, percentage: 50 }, + }); + wrapper.update(); + + expect(wrapper.html()).toMatchSnapshot(); + testProgress(wrapper, 50); + + store.dispatch({ + type: AUDIT_PROGRESS, + progress: { total: 5, percentage: 75 }, + }); + wrapper.update(); + + expect(wrapper.html()).toMatchSnapshot(); + testProgress(wrapper, 75); + }); + + it("render auditing finishing up", () => { + const store = setupStore({ + preloadedState: { + audit: { + auditing: [AUDIT_TYPE.CONTRAST], + progress: { total: 5, percentage: 100 }, + }, + }, + }); + + testTextProgressBar(store, "Finishing up…"); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/badge.test.js b/devtools/client/accessibility/test/node/components/badge.test.js new file mode 100644 index 0000000000..4285d1adb5 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/badge.test.js @@ -0,0 +1,42 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); +const { + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const BadgeClass = require("resource://devtools/client/accessibility/components/Badge.js"); +const Badge = createFactory(BadgeClass); + +describe("Badge component:", () => { + const label = "Contrast"; + const tooltip = "Does not meet WCAG standards for accessible text."; + const props = { label, tooltip }; + + it("basic render", () => { + const store = setupStore(); + const wrapper = mount(Provider({ store }, Badge(props))); + expect(wrapper.html()).toMatchSnapshot(); + + const badge = wrapper.find(BadgeClass); + expect(badge.children().length).toBe(1); + expect( + badge.find(`span[aria-label="${label}"][title="${tooltip}"]`) + ).toHaveLength(1); + + const badgeText = badge.childAt(0); + expect(badgeText.hasClass("audit-badge")).toBe(true); + expect(badgeText.hasClass("badge")).toBe(true); + expect(badgeText.text()).toBe(label); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/badges.test.js b/devtools/client/accessibility/test/node/components/badges.test.js new file mode 100644 index 0000000000..c98e4602ac --- /dev/null +++ b/devtools/client/accessibility/test/node/components/badges.test.js @@ -0,0 +1,114 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); +const { + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const Badge = require("resource://devtools/client/accessibility/components/Badge.js"); +const Badges = createFactory( + require("resource://devtools/client/accessibility/components/Badges.js") +); +const ContrastBadge = require("resource://devtools/client/accessibility/components/ContrastBadge.js"); + +const { + accessibility: { SCORES }, +} = require("resource://devtools/shared/constants.js"); + +describe("Badges component:", () => { + const store = setupStore(); + + it("no props render", () => { + const wrapper = mount(Provider({ store }, Badges())); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("null checks render", () => { + const wrapper = mount(Provider({ store }, Badges({ checks: null }))); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("empty checks render", () => { + const wrapper = mount(Provider({ store }, Badges({ checks: {} }))); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("unsupported checks render", () => { + const wrapper = mount(Provider({ store }, Badges({ checks: { tbd: {} } }))); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("contrast ratio success render", () => { + const wrapper = mount( + Provider( + { store }, + Badges({ + checks: { + CONTRAST: { + value: 5.11, + color: [255, 0, 0, 1], + backgroundColor: [255, 255, 255, 1], + isLargeText: false, + score: SCORES.AA, + }, + }, + }) + ) + ); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("contrast ratio fail render", () => { + const CONTRAST = { + value: 3.1, + color: [255, 0, 0, 1], + backgroundColor: [255, 255, 255, 1], + isLargeText: false, + score: SCORES.FAIL, + }; + const wrapper = mount( + Provider({ store }, Badges({ checks: { CONTRAST } })) + ); + + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.find(Badge).length).toBe(1); + expect(wrapper.find(ContrastBadge).length).toBe(1); + expect(wrapper.find(ContrastBadge).first().props()).toMatchObject(CONTRAST); + }); + + it("contrast ratio fail range render", () => { + const CONTRAST = { + min: 1.19, + max: 1.39, + color: [128, 128, 128, 1], + backgroundColorMin: [219, 106, 116, 1], + backgroundColorMax: [156, 145, 211, 1], + isLargeText: false, + score: SCORES.FAIL, + }; + const wrapper = mount( + Provider({ store }, Badges({ checks: { CONTRAST } })) + ); + + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.find(Badge).length).toBe(1); + expect(wrapper.find(ContrastBadge).length).toBe(1); + expect(wrapper.find(ContrastBadge).first().props()).toMatchObject(CONTRAST); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/check.test.js b/devtools/client/accessibility/test/node/components/check.test.js new file mode 100644 index 0000000000..ef024ea0ab --- /dev/null +++ b/devtools/client/accessibility/test/node/components/check.test.js @@ -0,0 +1,50 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +"use strict"; + +const { mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const CheckClass = require("resource://devtools/client/accessibility/components/Check.js"); +const Check = createFactory(CheckClass); + +const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js"); +const LocalizationProvider = createFactory(FluentReact.LocalizationProvider); + +const { + accessibility: { + AUDIT_TYPE: { TEXT_LABEL }, + ISSUE_TYPE: { + [TEXT_LABEL]: { AREA_NO_NAME_FROM_ALT }, + }, + SCORES: { FAIL }, + }, +} = require("resource://devtools/shared/constants.js"); + +const { + testCheck, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +describe("Check component:", () => { + const props = { + id: "accessibility-text-label-header", + issue: AREA_NO_NAME_FROM_ALT, + score: FAIL, + getAnnotation: jest.fn(), + }; + + it("basic render", () => { + const wrapper = mount(LocalizationProvider({ bundles: [] }, Check(props))); + expect(wrapper.html()).toMatchSnapshot(); + + testCheck(wrapper.childAt(0), { + issue: AREA_NO_NAME_FROM_ALT, + score: FAIL, + }); + expect(props.getAnnotation.mock.calls.length).toBe(1); + expect(props.getAnnotation.mock.calls[0]).toEqual([AREA_NO_NAME_FROM_ALT]); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/contrast-badge.test.js b/devtools/client/accessibility/test/node/components/contrast-badge.test.js new file mode 100644 index 0000000000..c96134b834 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/contrast-badge.test.js @@ -0,0 +1,96 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { shallow, mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); + +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); +const { + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const Badge = require("resource://devtools/client/accessibility/components/Badge.js"); +const ContrastBadgeClass = require("resource://devtools/client/accessibility/components/ContrastBadge.js"); +const ContrastBadge = createFactory(ContrastBadgeClass); + +const { + accessibility: { SCORES }, +} = require("resource://devtools/shared/constants.js"); + +describe("ContrastBadge component:", () => { + const store = setupStore(); + + it("error render", () => { + const wrapper = shallow(ContrastBadge({ error: true })); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("success render", () => { + const wrapper = shallow( + ContrastBadge({ + value: 5.11, + isLargeText: false, + score: SCORES.AA, + }) + ); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("success range render", () => { + const wrapper = shallow( + ContrastBadge({ + min: 5.11, + max: 6.25, + isLargeText: false, + score: SCORES.AA, + }) + ); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("success large text render", () => { + const wrapper = shallow( + ContrastBadge({ + value: 3.77, + isLargeText: true, + score: SCORES.AA, + }) + ); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("fail render", () => { + const wrapper = mount( + Provider( + { store }, + ContrastBadge({ + value: 3.77, + isLargeText: false, + score: SCORES.FAIL, + }) + ) + ); + + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.children().length).toBe(1); + const contrastBadge = wrapper.find(ContrastBadgeClass); + const badge = contrastBadge.childAt(0); + expect(badge.type()).toBe(Badge); + expect(badge.props()).toMatchObject({ + label: "contrast", + tooltip: "Does not meet WCAG standards for accessible text.", + }); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/display-tabbing-order.test.js b/devtools/client/accessibility/test/node/components/display-tabbing-order.test.js new file mode 100644 index 0000000000..65952a10e5 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/display-tabbing-order.test.js @@ -0,0 +1,91 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); +const { + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); +const { + UPDATE_DISPLAY_TABBING_ORDER, +} = require("resource://devtools/client/accessibility/constants.js"); + +const ConnectedDisplayTabbingOrderClass = require("resource://devtools/client/accessibility/components/DisplayTabbingOrder.js"); +const DisplayTabbingOrderClass = + ConnectedDisplayTabbingOrderClass.WrappedComponent; +const DisplayTabbingOrder = createFactory(ConnectedDisplayTabbingOrderClass); + +function testCheckbox(wrapper, expected) { + expect(wrapper.html()).toMatchSnapshot(); + const displayTabbingOrder = wrapper.find(DisplayTabbingOrderClass); + expect(displayTabbingOrder.children().length).toBe(1); + + // Label checks + const label = displayTabbingOrder.childAt(0); + expect(label.hasClass("accessibility-tabbing-order")).toBe(true); + expect(label.hasClass("devtools-checkbox-label")).toBe(true); + expect(label.prop("title")).toBe( + "Show tabbing order of elements and their tabbing index." + ); + expect(label.text()).toBe("Show Tabbing Order"); + expect(label.children().length).toBe(1); + + // Checkbox checks + const checkbox = label.childAt(0); + expect(checkbox.prop("checked")).toBe(expected.checked); + expect(checkbox.prop("disabled")).toBe(!!expected.disabled); +} + +describe("DisplayTabbingOrder component:", () => { + it("default render", () => { + const store = setupStore(); + const wrapper = mount(Provider({ store }, DisplayTabbingOrder())); + + testCheckbox(wrapper, { checked: false }); + }); + + it("toggle tabbing order overlay", () => { + const store = setupStore(); + const wrapper = mount(Provider({ store }, DisplayTabbingOrder())); + + expect(wrapper.html()).toMatchSnapshot(); + const displayTabbingOrderInstance = wrapper + .find(DisplayTabbingOrderClass) + .instance(); + displayTabbingOrderInstance.onChange = jest.fn(); + displayTabbingOrderInstance.forceUpdate(); + const checkbox = wrapper.find("input"); + checkbox.simulate("change"); + expect(displayTabbingOrderInstance.onChange.mock.calls.length).toBe(1); + }); + + it("displaying tabbing order render/update", () => { + const store = setupStore({ + preloadedState: { + ui: { + tabbingOrderDisplayed: true, + }, + }, + }); + const wrapper = mount(Provider({ store }, DisplayTabbingOrder())); + + testCheckbox(wrapper, { checked: true }); + + store.dispatch({ + type: UPDATE_DISPLAY_TABBING_ORDER, + tabbingOrderDisplayed: false, + }); + wrapper.update(); + + testCheckbox(wrapper, { checked: false }); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/keyboard-badge.test.js b/devtools/client/accessibility/test/node/components/keyboard-badge.test.js new file mode 100644 index 0000000000..ae462dd29e --- /dev/null +++ b/devtools/client/accessibility/test/node/components/keyboard-badge.test.js @@ -0,0 +1,73 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { shallow, mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); + +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); +const { + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const Badge = require("resource://devtools/client/accessibility/components/Badge.js"); +const KeyboardBadgeClass = require("resource://devtools/client/accessibility/components/KeyboardBadge.js"); +const KeyboardBadge = createFactory(KeyboardBadgeClass); +const { + accessibility: { SCORES }, +} = require("resource://devtools/shared/constants.js"); + +function testBadge(wrapper) { + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.children().length).toBe(1); + const keyboardBadge = wrapper.find(KeyboardBadgeClass); + const badge = keyboardBadge.childAt(0); + expect(badge.type()).toBe(Badge); + expect(badge.props()).toMatchObject({ + label: "keyboard", + tooltip: "Does not meet WCAG standards for keyboard accessibility.", + }); +} + +describe("KeyboardBadge component:", () => { + const store = setupStore(); + + it("error render", () => { + const wrapper = shallow(KeyboardBadge({ error: true })); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("fail render", () => { + const wrapper = mount( + Provider( + { store }, + KeyboardBadge({ + score: SCORES.FAIL, + }) + ) + ); + + testBadge(wrapper); + }); + + it("warning render", () => { + const wrapper = mount( + Provider( + { store }, + KeyboardBadge({ + score: SCORES.WARNING, + }) + ) + ); + + testBadge(wrapper); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/keyboard-check.test.js b/devtools/client/accessibility/test/node/components/keyboard-check.test.js new file mode 100644 index 0000000000..d0f16d0bb8 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/keyboard-check.test.js @@ -0,0 +1,47 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { mount } = require("enzyme"); +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const KeyboardCheckClass = require("resource://devtools/client/accessibility/components/KeyboardCheck.js"); +const KeyboardCheck = createFactory(KeyboardCheckClass); + +const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js"); +const LocalizationProvider = createFactory(FluentReact.LocalizationProvider); + +const { + testCustomCheck, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const { + accessibility: { + AUDIT_TYPE: { KEYBOARD }, + ISSUE_TYPE: { + [KEYBOARD]: { INTERACTIVE_NO_ACTION, FOCUSABLE_NO_SEMANTICS }, + }, + SCORES: { FAIL, WARNING }, + }, +} = require("resource://devtools/shared/constants.js"); + +describe("KeyboardCheck component:", () => { + const testProps = [ + { score: FAIL, issue: INTERACTIVE_NO_ACTION }, + { score: WARNING, issue: FOCUSABLE_NO_SEMANTICS }, + ]; + + for (const props of testProps) { + it(`${props.score} render`, () => { + const wrapper = mount( + LocalizationProvider({ bundles: [] }, KeyboardCheck(props)) + ); + + const keyboardCheck = wrapper.find(KeyboardCheckClass); + testCustomCheck(keyboardCheck, props); + }); + } +}); diff --git a/devtools/client/accessibility/test/node/components/text-label-badge.test.js b/devtools/client/accessibility/test/node/components/text-label-badge.test.js new file mode 100644 index 0000000000..39510c0e92 --- /dev/null +++ b/devtools/client/accessibility/test/node/components/text-label-badge.test.js @@ -0,0 +1,86 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { shallow, mount } = require("enzyme"); + +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); + +const Provider = createFactory( + require("resource://devtools/client/shared/vendor/react-redux.js").Provider +); +const { + setupStore, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const Badge = require("resource://devtools/client/accessibility/components/Badge.js"); +const TextLabelBadgeClass = require("resource://devtools/client/accessibility/components/TextLabelBadge.js"); +const TextLabelBadge = createFactory(TextLabelBadgeClass); +const { + accessibility: { SCORES }, +} = require("resource://devtools/shared/constants.js"); + +function testBadge(wrapper) { + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.children().length).toBe(1); + const textLabelBadge = wrapper.find(TextLabelBadgeClass); + const badge = textLabelBadge.childAt(0); + expect(badge.type()).toBe(Badge); + expect(badge.props()).toMatchObject({ + label: "text label", + tooltip: "Does not meet WCAG standards for text alternative.", + }); +} + +describe("TextLabelBadge component:", () => { + const store = setupStore(); + + it("error render", () => { + const wrapper = shallow(TextLabelBadge({ error: true })); + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.isEmptyRender()).toBe(true); + }); + + it("fail render", () => { + const wrapper = mount( + Provider( + { store }, + TextLabelBadge({ + score: SCORES.FAIL, + }) + ) + ); + + testBadge(wrapper); + }); + + it("warning render", () => { + const wrapper = mount( + Provider( + { store }, + TextLabelBadge({ + score: SCORES.WARNING, + }) + ) + ); + + testBadge(wrapper); + }); + + it("best practices render", () => { + const wrapper = mount( + Provider( + { store }, + TextLabelBadge({ + score: SCORES.BEST_PRACTICES, + }) + ) + ); + + testBadge(wrapper); + }); +}); diff --git a/devtools/client/accessibility/test/node/components/text-label-check.test.js b/devtools/client/accessibility/test/node/components/text-label-check.test.js new file mode 100644 index 0000000000..38a56ba3ce --- /dev/null +++ b/devtools/client/accessibility/test/node/components/text-label-check.test.js @@ -0,0 +1,52 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { mount } = require("enzyme"); +const { + createFactory, +} = require("resource://devtools/client/shared/vendor/react.js"); +const TextLabelCheckClass = require("resource://devtools/client/accessibility/components/TextLabelCheck.js"); +const TextLabelCheck = createFactory(TextLabelCheckClass); + +const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js"); +const LocalizationProvider = createFactory(FluentReact.LocalizationProvider); + +const { + testCustomCheck, +} = require("resource://devtools/client/accessibility/test/node/helpers.js"); + +const { + accessibility: { + AUDIT_TYPE: { TEXT_LABEL }, + ISSUE_TYPE: { + [TEXT_LABEL]: { + AREA_NO_NAME_FROM_ALT, + DIALOG_NO_NAME, + FORM_NO_VISIBLE_NAME, + }, + }, + SCORES: { BEST_PRACTICES, FAIL, WARNING }, + }, +} = require("resource://devtools/shared/constants.js"); + +describe("TextLabelCheck component:", () => { + const testProps = [ + { issue: AREA_NO_NAME_FROM_ALT, score: FAIL }, + { issue: FORM_NO_VISIBLE_NAME, score: WARNING }, + { issue: DIALOG_NO_NAME, score: BEST_PRACTICES }, + ]; + + for (const props of testProps) { + it(`${props.score} render`, () => { + const wrapper = mount( + LocalizationProvider({ bundles: [] }, TextLabelCheck(props)) + ); + + const textLabelCheck = wrapper.find(TextLabelCheckClass); + testCustomCheck(textLabelCheck, props); + }); + } +}); diff --git a/devtools/client/accessibility/test/node/helpers.js b/devtools/client/accessibility/test/node/helpers.js new file mode 100644 index 0000000000..bfb14c258c --- /dev/null +++ b/devtools/client/accessibility/test/node/helpers.js @@ -0,0 +1,134 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const { + reducers, +} = require("resource://devtools/client/accessibility/reducers/index.js"); +const CheckClass = require("resource://devtools/client/accessibility/components/Check.js"); +const FluentReact = require("resource://devtools/client/shared/vendor/fluent-react.js"); + +const { + createStore, + combineReducers, +} = require("resource://devtools/client/shared/vendor/redux.js"); + +/** + * Prepare the store for use in testing. + */ +function setupStore({ preloadedState } = {}) { + const store = createStore(combineReducers(reducers), preloadedState); + return store; +} + +/** + * Build a mock accessible object. + * @param {Object} form + * Data similar to what accessible actor passes to accessible front. + */ +function mockAccessible(form) { + return { + on: jest.fn(), + off: jest.fn(), + isDestroyed: () => !form?.actorID, + audit: jest.fn().mockReturnValue(Promise.resolve()), + ...form, + }; +} + +/** + * + * @param {DOMNode} + * DOMNode that corresponds to a menu item in a menu list + * @param {Object} + * Expected properties: + * - role: optional ARIA role for the menu item + * - checked: optional checked state for the menu item + * - disabled: optional disabled state for the menu item + * - label: optional text label for the menu item + */ +function checkMenuItem(menuItem, expected) { + expect(menuItem.tagName).toBe("BUTTON"); + if (expected.role) { + expect(menuItem.getAttribute("role")).toBe(expected.role); + } else if (typeof expected.checked !== "undefined") { + expect(menuItem.getAttribute("role")).toBe("menuitemcheckbox"); + } else { + expect(menuItem.getAttribute("role")).toBe("menuitem"); + } + + if (typeof expected.checked !== "undefined") { + expect(menuItem.hasAttribute("aria-checked")).toBe(expected.checked); + } + + if (expected.checked) { + expect(menuItem.getAttribute("aria-checked")).toBe("true"); + } + + if (expected.disabled) { + expect(menuItem.hasAttribute("disabled")).toBe(true); + } + + if (expected.label) { + expect(menuItem.textContent).toBe(expected.label); + } +} + +/** + * + * @param {ReactWrapper} + * React wrapper for the top level check component. + * @param {Object} + * Expected audit properties: + * - score: audit score + * - issue: audit issue type + */ +function testCustomCheck(wrapper, props) { + expect(wrapper.html()).toMatchSnapshot(); + expect(wrapper.children().length).toBe(1); + const check = wrapper.childAt(0); + expect(wrapper.find(CheckClass)).toStrictEqual(check); + testCheck(check, props); +} + +/** + * + * @param {ReactWrapper} + * React wrapper for the check component. + * @param {Object} + * Expected audit properties: + * - score: audit score + * - issue: audit issue type + */ +function testCheck(wrapper, props) { + expect(wrapper.html()).toMatchSnapshot(); + const container = wrapper.childAt(0); + expect(container.hasClass("accessibility-check")).toBe(true); + expect(container.prop("role")).toBe("presentation"); + expect(container.prop("tabIndex")).toBe("-1"); + expect(wrapper.props()).toMatchObject(props); + + const localized = wrapper.find(FluentReact.Localized); + expect(localized.length).toBe(3); + + const heading = localized.at(0).childAt(0); + expect(heading.type()).toBe("h3"); + expect(heading.hasClass("accessibility-check-header")).toBe(true); + + const icon = localized.at(1).childAt(0); + expect(icon.type()).toBe("img"); + expect(icon.prop("data-score")).toEqual(props.score); + + const annotation = localized.at(2).childAt(0); + expect(annotation.type()).toBe("p"); + expect(annotation.hasClass("accessibility-check-annotation")).toBe(true); +} + +module.exports = { + checkMenuItem, + mockAccessible, + setupStore, + testCheck, + testCustomCheck, +}; diff --git a/devtools/client/accessibility/test/node/jest.config.js b/devtools/client/accessibility/test/node/jest.config.js new file mode 100644 index 0000000000..c561ec66f4 --- /dev/null +++ b/devtools/client/accessibility/test/node/jest.config.js @@ -0,0 +1,19 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +/* global __dirname */ +const sharedJestConfig = require(`${__dirname}/../../../shared/test-helpers/shared-jest.config`); + +module.exports = { + ...sharedJestConfig, + moduleNameMapper: { + // This needs to be set before the other rules + "^resource://devtools/shared/event-emitter": `${__dirname}/node_modules/devtools-modules/src/utils/event-emitter`, + ...sharedJestConfig.moduleNameMapper, + }, + setupFiles: ["<rootDir>setup.js"], + snapshotSerializers: ["enzyme-to-json/serializer"], +}; diff --git a/devtools/client/accessibility/test/node/package.json b/devtools/client/accessibility/test/node/package.json new file mode 100644 index 0000000000..787a47df36 --- /dev/null +++ b/devtools/client/accessibility/test/node/package.json @@ -0,0 +1,27 @@ +{ + "name": "devtools-client-framework-tests", + "license": "MPL-2.0", + "version": "0.0.1", + "engines": { + "node": ">=8.9.4" + }, + "scripts": { + "test": "jest", + "test-ci": "jest --json" + }, + "dependencies": { + "@babel/plugin-proposal-async-generator-functions": "^7.2.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-proposal-optional-chaining": "^7.8.3", + "@babel/plugin-proposal-class-properties": "7.10.4", + "babel-plugin-transform-amd-to-commonjs": "1.4.0", + "devtools-modules": "1.1.5", + "enzyme": "^3.9.0", + "enzyme-adapter-react-16": "^1.13.2", + "enzyme-to-json": "^3.3.5", + "jest": "^24.6.0", + "react": "16.4.1", + "react-dom": "16.4.1", + "react-test-renderer": "16.4.1" + } +} diff --git a/devtools/client/accessibility/test/node/setup.js b/devtools/client/accessibility/test/node/setup.js new file mode 100644 index 0000000000..570e4462ae --- /dev/null +++ b/devtools/client/accessibility/test/node/setup.js @@ -0,0 +1,15 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ + +"use strict"; + +// Configure enzyme with React 16 adapter. +const Enzyme = require("enzyme"); +const Adapter = require("enzyme-adapter-react-16"); +Enzyme.configure({ adapter: new Adapter() }); + +const { + setMocksInGlobal, +} = require("resource://devtools/client/shared/test-helpers/shared-node-helpers.js"); +setMocksInGlobal(); diff --git a/devtools/client/accessibility/test/node/yarn.lock b/devtools/client/accessibility/test/node/yarn.lock new file mode 100644 index 0000000000..b5f7cd09b0 --- /dev/null +++ b/devtools/client/accessibility/test/node/yarn.lock @@ -0,0 +1,4316 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/code-frame@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" + integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== + dependencies: + "@babel/highlight" "^7.10.4" + +"@babel/core@^7.1.0": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.5.tgz#081f97e8ffca65a9b4b0fdc7e274e703f000c06a" + integrity sha512-OvjIh6aqXtlsA8ujtGKfC7LYWksYSX8yQcM8Ay3LuvVeQ63lcOKgoZWVqcpFwkd29aYU9rVx7jxhfhiEDV9MZA== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helpers" "^7.4.4" + "@babel/parser" "^7.4.5" + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.4.5" + "@babel/types" "^7.4.4" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.11" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.11.5": + version "7.11.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.11.6.tgz#b868900f81b163b4d464ea24545c61cbac4dc620" + integrity sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA== + dependencies: + "@babel/types" "^7.11.5" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@babel/generator@^7.4.0", "@babel/generator@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" + integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ== + dependencies: + "@babel/types" "^7.4.4" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-annotate-as-pure@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" + integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-create-class-features-plugin@^7.10.4": + version "7.10.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz#9f61446ba80e8240b0a5c85c6fdac8459d6f259d" + integrity sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A== + dependencies: + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-member-expression-to-functions" "^7.10.5" + "@babel/helper-optimise-call-expression" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-replace-supers" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.10.4" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-function-name@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a" + integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ== + dependencies: + "@babel/helper-get-function-arity" "^7.10.4" + "@babel/template" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" + integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A== + dependencies: + "@babel/types" "^7.10.4" + +"@babel/helper-member-expression-to-functions@^7.10.4", "@babel/helper-member-expression-to-functions@^7.10.5": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz#ae69c83d84ee82f4b42f96e2a09410935a8f26df" + integrity sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q== + dependencies: + "@babel/types" "^7.11.0" + +"@babel/helper-optimise-call-expression@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz#50dc96413d594f995a77905905b05893cd779673" + integrity sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg== + dependencies: + "@babel/types" "^7.10.4" + +"@babel/helper-plugin-utils@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" + integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== + +"@babel/helper-plugin-utils@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" + integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== + +"@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670" + integrity sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ== + +"@babel/helper-remap-async-to-generator@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" + integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-wrap-function" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-replace-supers@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz#d585cd9388ea06e6031e4cd44b6713cbead9e6cf" + integrity sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.10.4" + "@babel/helper-optimise-call-expression" "^7.10.4" + "@babel/traverse" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/helper-split-export-declaration@^7.10.4", "@babel/helper-split-export-declaration@^7.11.0": + version "7.11.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f" + integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg== + dependencies: + "@babel/types" "^7.11.0" + +"@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== + dependencies: + "@babel/types" "^7.4.4" + +"@babel/helper-validator-identifier@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" + integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== + +"@babel/helper-wrap-function@^7.1.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" + integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.2.0" + +"@babel/helpers@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5" + integrity sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A== + dependencies: + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@babel/highlight@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" + integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.5.tgz#04af8d5d5a2b044a2a1bffacc1e5e6673544e872" + integrity sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew== + +"@babel/parser@^7.10.4", "@babel/parser@^7.11.5": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.5.tgz#c7ff6303df71080ec7a4f5b8c003c58f1cf51037" + integrity sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q== + +"@babel/plugin-proposal-async-generator-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" + integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.1.0" + "@babel/plugin-syntax-async-generators" "^7.2.0" + +"@babel/plugin-proposal-class-properties@7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.10.4.tgz#a33bf632da390a59c7a8c570045d1115cd778807" + integrity sha512-vhwkEROxzcHGNu2mzUC0OFFNXdZ4M23ib8aRRcJSsW8BZK9pQMD7QB7csl97NBbgGZO7ZyHUyKDnxzOaP4IrCg== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-proposal-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz#e4572253fdeed65cddeecfdab3f928afeb2fd5d2" + integrity sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" + +"@babel/plugin-proposal-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.8.3.tgz#ae10b3214cb25f7adb1f3bc87ba42ca10b7e2543" + integrity sha512-QIoIR9abkVn+seDE3OjA08jWcs3eZ9+wJCKSRgo3WdEU2csFYgdScb+8qHB3+WXsGJD55u+5hWCISI7ejXS+kg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.0" + +"@babel/plugin-syntax-async-generators@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" + integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-object-rest-spread@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" + integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.0": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" + integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/template@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" + integrity sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/parser" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.5.tgz#4e92d1728fd2f1897dafdd321efbff92156c3216" + integrity sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.4.5" + "@babel/types" "^7.4.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + +"@babel/traverse@^7.10.4": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.11.5.tgz#be777b93b518eb6d76ee2e1ea1d143daa11e61c3" + integrity sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.11.5" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.11.0" + "@babel/parser" "^7.11.5" + "@babel/types" "^7.11.5" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + +"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" + integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ== + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + +"@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.11.5": + version "7.11.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.11.5.tgz#d9de577d01252d77c6800cee039ee64faf75662d" + integrity sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + +"@cnakazawa/watch@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" + integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@jest/console@^24.7.1": + version "24.7.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" + integrity sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg== + dependencies: + "@jest/source-map" "^24.3.0" + chalk "^2.0.1" + slash "^2.0.0" + +"@jest/core@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b" + integrity sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A== + dependencies: + "@jest/console" "^24.7.1" + "@jest/reporters" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-changed-files "^24.8.0" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve-dependencies "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + jest-watcher "^24.8.0" + micromatch "^3.1.10" + p-each-series "^1.0.0" + pirates "^4.0.1" + realpath-native "^1.1.0" + rimraf "^2.5.4" + strip-ansi "^5.0.0" + +"@jest/environment@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac" + integrity sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw== + dependencies: + "@jest/fake-timers" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + +"@jest/fake-timers@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1" + integrity sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw== + dependencies: + "@jest/types" "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + +"@jest/reporters@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729" + integrity sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + istanbul-lib-coverage "^2.0.2" + istanbul-lib-instrument "^3.0.1" + istanbul-lib-report "^2.0.4" + istanbul-lib-source-maps "^3.0.1" + istanbul-reports "^2.1.1" + jest-haste-map "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + node-notifier "^5.2.1" + slash "^2.0.0" + source-map "^0.6.0" + string-length "^2.0.0" + +"@jest/source-map@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28" + integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.1.15" + source-map "^0.6.0" + +"@jest/test-result@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3" + integrity sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng== + dependencies: + "@jest/console" "^24.7.1" + "@jest/types" "^24.8.0" + "@types/istanbul-lib-coverage" "^2.0.0" + +"@jest/test-sequencer@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b" + integrity sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg== + dependencies: + "@jest/test-result" "^24.8.0" + jest-haste-map "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + +"@jest/transform@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5" + integrity sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^24.8.0" + babel-plugin-istanbul "^5.1.0" + chalk "^2.0.1" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.15" + jest-haste-map "^24.8.0" + jest-regex-util "^24.3.0" + jest-util "^24.8.0" + micromatch "^3.1.10" + realpath-native "^1.1.0" + slash "^2.0.0" + source-map "^0.6.1" + write-file-atomic "2.4.1" + +"@jest/types@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad" + integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^12.0.9" + +"@types/babel__core@^7.1.0": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" + integrity sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" + integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" + integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f" + integrity sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw== + dependencies: + "@babel/types" "^7.3.0" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" + integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== + +"@types/istanbul-lib-report@*": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c" + integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" + integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA== + dependencies: + "@types/istanbul-lib-coverage" "*" + "@types/istanbul-lib-report" "*" + +"@types/node@*": + version "11.13.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.2.tgz#dc85dde46aa8740bb4aed54b8104250f8f849503" + integrity sha512-HOtU5KqROKT7qX/itKHuTtt5fV0iXbheQvrgbLNXFJQBY/eh+VS5vmmTAVlo3qIGMsypm0G4N1t2AXjy1ZicaQ== + +"@types/stack-utils@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" + integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== + +"@types/yargs@^12.0.2", "@types/yargs@^12.0.9": + version "12.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" + integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== + +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +acorn-globals@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.0.tgz#e3b6f8da3c1552a95ae627571f7dd6923bb54103" + integrity sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw== + dependencies: + acorn "^6.0.1" + acorn-walk "^6.0.1" + +acorn-walk@^6.0.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" + integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== + +acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + +acorn@^6.0.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + +airbnb-prop-types@^2.13.2: + version "2.13.2" + resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.13.2.tgz#43147a5062dd2a4a5600e748a47b64004cc5f7fc" + integrity sha512-2FN6DlHr6JCSxPPi25EnqGaXC4OC3/B3k1lCd6MMYrZ51/Gf/1qDfaR+JElzWa+Tl7cY2aYOlsYJGFeQyVHIeQ== + dependencies: + array.prototype.find "^2.0.4" + function.prototype.name "^1.1.0" + has "^1.0.3" + is-regex "^1.0.4" + object-is "^1.0.1" + object.assign "^4.1.0" + object.entries "^1.1.0" + prop-types "^15.7.2" + prop-types-exact "^1.2.0" + react-is "^16.8.6" + +ajv@^6.5.5: + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.0.0, ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= + +array-filter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" + integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +array.prototype.find@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.0.4.tgz#556a5c5362c08648323ddaeb9de9d14bc1864c90" + integrity sha1-VWpcU2LAhkgyPdrrnenRS8GGTJA= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" + +array.prototype.flat@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#812db8f02cad24d3fab65dd67eabe3b8903494a4" + integrity sha512-rVqIs330nLJvfC7JqYvEWwqVr5QjYF1ib02i3YJtR/fICO6527Tjpc/e4Mvmxh3GIePPreRXMdaGyC99YphWEw== + dependencies: + define-properties "^1.1.2" + es-abstract "^1.10.0" + function-bind "^1.1.1" + +asap@~2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + +babel-jest@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589" + integrity sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw== + dependencies: + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/babel__core" "^7.1.0" + babel-plugin-istanbul "^5.1.0" + babel-preset-jest "^24.6.0" + chalk "^2.4.2" + slash "^2.0.0" + +babel-plugin-istanbul@^5.1.0: + version "5.1.4" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" + integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ== + dependencies: + find-up "^3.0.0" + istanbul-lib-instrument "^3.3.0" + test-exclude "^5.2.3" + +babel-plugin-jest-hoist@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz#f7f7f7ad150ee96d7a5e8e2c5da8319579e78019" + integrity sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w== + dependencies: + "@types/babel__traverse" "^7.0.6" + +babel-plugin-transform-amd-to-commonjs@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-amd-to-commonjs/-/babel-plugin-transform-amd-to-commonjs-1.4.0.tgz#d9bc5003eaa26dbdd4e854e453f84903852af2ca" + integrity sha512-Xx0kYPn0LPyms+8n2KLn9yd2R5XMb2P1sNe4qn64/UQY5F2KFYlhhhyYUNm/BThfODAzl7rbaOsEfpU2M8iDKQ== + +babel-preset-jest@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984" + integrity sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw== + dependencies: + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + babel-plugin-jest-hoist "^24.6.0" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +boolbase@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +browser-process-hrtime@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== + +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== + dependencies: + resolve "1.1.7" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== + dependencies: + rsvp "^4.8.4" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +cheerio@^1.0.0-rc.2: + version "1.0.0-rc.3" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6" + integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA== + dependencies: + css-select "~1.2.0" + dom-serializer "~0.1.1" + entities "~1.1.1" + htmlparser2 "^3.9.1" + lodash "^4.15.0" + parse5 "^3.0.1" + +chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + dependencies: + delayed-stream "~1.0.0" + +commander@^2.19.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + +commander@~2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== + +component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + +convert-source-map@^1.1.0, convert-source-map@^1.4.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^1.0.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" + integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY= + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +css-select@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" + integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= + dependencies: + boolbase "~1.0.0" + css-what "2.1" + domutils "1.5.1" + nth-check "~1.0.1" + +css-what@2.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" + integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.6" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" + integrity sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A== + +cssstyle@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.2.tgz#427ea4d585b18624f6fdbf9de7a2a1a3ba713077" + integrity sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow== + dependencies: + cssom "0.3.x" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +data-urls@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" + +debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +define-properties@^1.1.2, define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= + +devtools-modules@1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/devtools-modules/-/devtools-modules-1.1.5.tgz#55e71233692b4095f0277a00e6bfe3ff374d37f1" + integrity sha512-JVdZeQNKhABOeED5tDF6dlQck9SIyR9mq78X13sF3rj1pM87UqP81gfY+ALUqwD3lME0aUpKb3BVIzpIwHuyjQ== + dependencies: + devtools-services "0.0.1" + punycode "^2.1.0" + +devtools-services@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/devtools-services/-/devtools-services-0.0.1.tgz#9042600c11d1f4d45cc6ca299588a86fac1fbdd5" + integrity sha512-1hq7u0743b5OADkSPc5j0qK6zLKilJdn6YYIt2yN/OvrTbSxeD6+CNquAoeP8q1j5oP8Psi79cTFW8SyIi0VBw== + +diff-sequences@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" + integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== + +discontinuous-range@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" + integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo= + +dom-serializer@0, dom-serializer@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" + integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== + dependencies: + domelementtype "^1.3.0" + entities "^1.1.1" + +domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== + +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== + dependencies: + webidl-conversions "^4.0.2" + +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== + dependencies: + domelementtype "1" + +domutils@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= + dependencies: + dom-serializer "0" + domelementtype "1" + +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== + dependencies: + dom-serializer "0" + domelementtype "1" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +encoding@^0.1.11: + version "0.1.12" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= + dependencies: + iconv-lite "~0.4.13" + +end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + dependencies: + once "^1.4.0" + +entities@^1.1.1, entities@~1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" + integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== + +enzyme-adapter-react-16@^1.13.2: + version "1.14.0" + resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.14.0.tgz#204722b769172bcf096cb250d33e6795c1f1858f" + integrity sha512-7PcOF7pb4hJUvjY7oAuPGpq3BmlCig3kxXGi2kFx0YzJHppqX1K8IIV9skT1IirxXlu8W7bneKi+oQ10QRnhcA== + dependencies: + enzyme-adapter-utils "^1.12.0" + has "^1.0.3" + object.assign "^4.1.0" + object.values "^1.1.0" + prop-types "^15.7.2" + react-is "^16.8.6" + react-test-renderer "^16.0.0-0" + semver "^5.7.0" + +enzyme-adapter-utils@^1.12.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.12.0.tgz#96e3730d76b872f593e54ce1c51fa3a451422d93" + integrity sha512-wkZvE0VxcFx/8ZsBw0iAbk3gR1d9hK447ebnSYBf95+r32ezBq+XDSAvRErkc4LZosgH8J7et7H7/7CtUuQfBA== + dependencies: + airbnb-prop-types "^2.13.2" + function.prototype.name "^1.1.0" + object.assign "^4.1.0" + object.fromentries "^2.0.0" + prop-types "^15.7.2" + semver "^5.6.0" + +enzyme-to-json@^3.3.5: + version "3.3.5" + resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.3.5.tgz#f8eb82bd3d5941c9d8bc6fd9140030777d17d0af" + integrity sha512-DmH1wJ68HyPqKSYXdQqB33ZotwfUhwQZW3IGXaNXgR69Iodaoj8TF/D9RjLdz4pEhGq2Tx2zwNUIjBuqoZeTgA== + dependencies: + lodash "^4.17.4" + +enzyme@^3.9.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.10.0.tgz#7218e347c4a7746e133f8e964aada4a3523452f6" + integrity sha512-p2yy9Y7t/PFbPoTvrWde7JIYB2ZyGC+NgTNbVEGvZ5/EyoYSr9aG/2rSbVvyNvMHEhw9/dmGUJHWtfQIEiX9pg== + dependencies: + array.prototype.flat "^1.2.1" + cheerio "^1.0.0-rc.2" + function.prototype.name "^1.1.0" + has "^1.0.3" + html-element-map "^1.0.0" + is-boolean-object "^1.0.0" + is-callable "^1.1.4" + is-number-object "^1.0.3" + is-regex "^1.0.4" + is-string "^1.0.4" + is-subset "^0.1.1" + lodash.escape "^4.0.1" + lodash.isequal "^4.5.0" + object-inspect "^1.6.0" + object-is "^1.0.1" + object.assign "^4.1.0" + object.entries "^1.0.4" + object.values "^1.0.4" + raf "^3.4.0" + rst-selector-parser "^2.2.3" + string.prototype.trim "^1.1.2" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.5.0, es-abstract@^1.5.1, es-abstract@^1.7.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" + integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-keys "^1.0.12" + +es-to-primitive@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +escodegen@^1.9.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510" + integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw== + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= + +estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + +exec-sh@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" + integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expect@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d" + integrity sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA== + dependencies: + "@jest/types" "^24.8.0" + ansi-styles "^3.2.0" + jest-get-type "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-regex-util "^24.3.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= + dependencies: + bser "^2.0.0" + +fbjs@^0.8.16: + version "0.8.17" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" + integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.18" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== + dependencies: + minipass "^2.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.2.7: + version "1.2.9" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" + integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw== + dependencies: + nan "^2.12.1" + node-pre-gyp "^0.12.0" + +function-bind@^1.0.2, function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +function.prototype.name@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.0.tgz#8bd763cc0af860a859cc5d49384d74b932cd2327" + integrity sha512-Bs0VRrTz4ghD8pTmbJQD1mZ8A/mN0ur/jGz+A6FBxPDUPkm1tNfF6bhTYPA7i7aF4lZJVr+OXTNNrnnIl58Wfg== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + is-callable "^1.1.3" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= + +handlebars@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== + dependencies: + neo-async "^2.6.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.1, has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + +html-element-map@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/html-element-map/-/html-element-map-1.0.1.tgz#3c4fcb4874ebddfe4283b51c8994e7713782b592" + integrity sha512-BZSfdEm6n706/lBfXKWa4frZRZcT5k1cOusw95ijZsHlI+GdgY0v95h6IzO3iIDf2ROwq570YTwqNPqHcNMozw== + dependencies: + array-filter "^1.0.0" + +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== + dependencies: + whatwg-encoding "^1.0.1" + +htmlparser2@^3.9.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" + integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== + dependencies: + domelementtype "^1.3.1" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^3.1.1" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +iconv-lite@0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + dependencies: + minimatch "^3.0.4" + +import-local@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" + integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== + dependencies: + pkg-dir "^3.0.0" + resolve-cwd "^2.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-boolean-object@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93" + integrity sha1-mPiygDBoQhmpXzdc+9iM40Bd/5M= + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-callable@^1.1.3, is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + +is-number-object@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.3.tgz#f265ab89a9f445034ef6aff15a8f00b00f551799" + integrity sha1-8mWrian0RQNO9q/xWo8AsA9VF5k= + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= + dependencies: + has "^1.0.1" + +is-stream@^1.0.1, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-string@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64" + integrity sha1-zDqbaYV9Yh6WNyWiTK7shzuCbmQ= + +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY= + +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +isomorphic-fetch@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" + integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== + +istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" + integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== + dependencies: + "@babel/generator" "^7.4.0" + "@babel/parser" "^7.4.3" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" + istanbul-lib-coverage "^2.0.5" + semver "^6.0.0" + +istanbul-lib-report@^2.0.4: + version "2.0.8" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" + integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== + dependencies: + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + supports-color "^6.1.0" + +istanbul-lib-source-maps@^3.0.1: + version "3.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" + integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + rimraf "^2.6.3" + source-map "^0.6.1" + +istanbul-reports@^2.1.1: + version "2.2.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" + integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== + dependencies: + handlebars "^4.1.2" + +jest-changed-files@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b" + integrity sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug== + dependencies: + "@jest/types" "^24.8.0" + execa "^1.0.0" + throat "^4.0.0" + +jest-cli@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989" + integrity sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA== + dependencies: + "@jest/core" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + exit "^0.1.2" + import-local "^2.0.0" + is-ci "^2.0.0" + jest-config "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + prompts "^2.0.1" + realpath-native "^1.1.0" + yargs "^12.0.2" + +jest-config@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f" + integrity sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw== + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^24.8.0" + "@jest/types" "^24.8.0" + babel-jest "^24.8.0" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^24.8.0" + jest-environment-node "^24.8.0" + jest-get-type "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + micromatch "^3.1.10" + pretty-format "^24.8.0" + realpath-native "^1.1.0" + +jest-diff@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172" + integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g== + dependencies: + chalk "^2.0.1" + diff-sequences "^24.3.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" + +jest-docblock@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" + integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg== + dependencies: + detect-newline "^2.1.0" + +jest-each@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775" + integrity sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA== + dependencies: + "@jest/types" "^24.8.0" + chalk "^2.0.1" + jest-get-type "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + +jest-environment-jsdom@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857" + integrity sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" + jsdom "^11.5.1" + +jest-environment-node@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231" + integrity sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" + +jest-get-type@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc" + integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ== + +jest-haste-map@^24.8.0: + version "24.8.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.1.tgz#f39cc1d2b1d907e014165b4bd5a957afcb992982" + integrity sha512-SwaxMGVdAZk3ernAx2Uv2sorA7jm3Kx+lR0grp6rMmnY06Kn/urtKx1LPN2mGTea4fCT38impYT28FfcLUhX0g== + dependencies: + "@jest/types" "^24.8.0" + anymatch "^2.0.0" + fb-watchman "^2.0.0" + graceful-fs "^4.1.15" + invariant "^2.2.4" + jest-serializer "^24.4.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + micromatch "^3.1.10" + sane "^4.0.3" + walker "^1.0.7" + optionalDependencies: + fsevents "^1.2.7" + +jest-jasmine2@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898" + integrity sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^24.8.0" + is-generator-fn "^2.0.0" + jest-each "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + throat "^4.0.0" + +jest-leak-detector@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980" + integrity sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g== + dependencies: + pretty-format "^24.8.0" + +jest-matcher-utils@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495" + integrity sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw== + dependencies: + chalk "^2.0.1" + jest-diff "^24.8.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" + +jest-message-util@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b" + integrity sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g== + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/stack-utils" "^1.0.1" + chalk "^2.0.1" + micromatch "^3.1.10" + slash "^2.0.0" + stack-utils "^1.0.1" + +jest-mock@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56" + integrity sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A== + dependencies: + "@jest/types" "^24.8.0" + +jest-pnp-resolver@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" + integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== + +jest-regex-util@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" + integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== + +jest-resolve-dependencies@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0" + integrity sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw== + dependencies: + "@jest/types" "^24.8.0" + jest-regex-util "^24.3.0" + jest-snapshot "^24.8.0" + +jest-resolve@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f" + integrity sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw== + dependencies: + "@jest/types" "^24.8.0" + browser-resolve "^1.11.3" + chalk "^2.0.1" + jest-pnp-resolver "^1.2.1" + realpath-native "^1.1.0" + +jest-runner@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb" + integrity sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow== + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.4.2" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-config "^24.8.0" + jest-docblock "^24.3.0" + jest-haste-map "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-leak-detector "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + source-map-support "^0.5.6" + throat "^4.0.0" + +jest-runtime@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620" + integrity sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA== + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/source-map" "^24.3.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/yargs" "^12.0.2" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.1.15" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + realpath-native "^1.1.0" + slash "^2.0.0" + strip-bom "^3.0.0" + yargs "^12.0.2" + +jest-serializer@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" + integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== + +jest-snapshot@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6" + integrity sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg== + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + expect "^24.8.0" + jest-diff "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^24.8.0" + semver "^5.5.0" + +jest-util@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1" + integrity sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA== + dependencies: + "@jest/console" "^24.7.1" + "@jest/fake-timers" "^24.8.0" + "@jest/source-map" "^24.3.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + callsites "^3.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.15" + is-ci "^2.0.0" + mkdirp "^0.5.1" + slash "^2.0.0" + source-map "^0.6.0" + +jest-validate@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849" + integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA== + dependencies: + "@jest/types" "^24.8.0" + camelcase "^5.0.0" + chalk "^2.0.1" + jest-get-type "^24.8.0" + leven "^2.1.0" + pretty-format "^24.8.0" + +jest-watcher@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4" + integrity sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw== + dependencies: + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/yargs" "^12.0.9" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + jest-util "^24.8.0" + string-length "^2.0.0" + +jest-worker@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3" + integrity sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ== + dependencies: + merge-stream "^1.0.1" + supports-color "^6.1.0" + +jest@^24.6.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.8.0.tgz#d5dff1984d0d1002196e9b7f12f75af1b2809081" + integrity sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg== + dependencies: + import-local "^2.0.0" + jest-cli "^24.8.0" + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsdom@^11.5.1: + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +json5@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== + dependencies: + minimist "^1.2.0" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +kleur@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== + dependencies: + invert-kv "^2.0.0" + +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +lodash.escape@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98" + integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg= + +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= + +lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.4: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +lodash@^4.17.19: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= + dependencies: + tmpl "1.0.x" + +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== + dependencies: + p-defer "^1.0.0" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" + +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= + dependencies: + readable-stream "^2.0.1" + +micromatch@^3.1.10, micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +mime-db@~1.38.0: + version "1.38.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad" + integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.22" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd" + integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog== + dependencies: + mime-db "~1.38.0" + +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.1.1, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +minipass@^2.2.1, minipass@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + dependencies: + minipass "^2.2.1" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +moo@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/moo/-/moo-0.4.3.tgz#3f847a26f31cf625a956a87f2b10fbc013bfd10e" + integrity sha512-gFD2xGCl8YFgGHsqJ9NKRVdwlioeW3mI1iqfLNYQOv0+6JRwG58Zk9DIGQgyIaffSYaO1xsKnMaYzzNr1KyIAw== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +nan@^2.12.1: + version "2.14.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" + integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +nearley@^2.7.10: + version "2.16.0" + resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.16.0.tgz#77c297d041941d268290ec84b739d0ee297e83a7" + integrity sha512-Tr9XD3Vt/EujXbZBv6UAHYoLUSMQAxSsTnm9K3koXzjzNWY195NqALeyrzLZBKzAkL3gl92BcSogqrHjD8QuUg== + dependencies: + commander "^2.19.0" + moo "^0.4.3" + railroad-diagrams "^1.0.0" + randexp "0.4.6" + semver "^5.4.1" + +needle@^2.2.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" + integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +neo-async@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835" + integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +node-fetch@^1.0.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= + +node-notifier@^5.2.1: + version "5.4.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a" + integrity sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ== + dependencies: + growly "^1.3.0" + is-wsl "^1.1.0" + semver "^5.5.0" + shellwords "^0.1.1" + which "^1.3.0" + +node-pre-gyp@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" + integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +npm-bundled@^1.0.1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" + integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== + +npm-packlist@^1.1.6: + version "1.4.1" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" + integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +nth-check@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" + integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== + dependencies: + boolbase "~1.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +nwsapi@^2.0.7: + version "2.1.3" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.3.tgz#25f3a5cec26c654f7376df6659cdf84b99df9558" + integrity sha512-RowAaJGEgYXEZfQ7tvvdtAQUKPyTR6T6wNu0fwlNsGQYr/h3yQc6oI8WnVZh3Y/Sylwc+dtAlvPqfFZjhTyk3A== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-inspect@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" + integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== + +object-is@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6" + integrity sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY= + +object-keys@^1.0.11, object-keys@^1.0.12: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.entries@^1.0.4, object.entries@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519" + integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + +object.fromentries@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" + integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA== + dependencies: + define-properties "^1.1.2" + es-abstract "^1.11.0" + function-bind "^1.1.1" + has "^1.0.1" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +object.values@^1.0.4, object.values@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9" + integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-locale@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== + dependencies: + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" + +os-tmpdir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= + +p-each-series@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= + dependencies: + p-reduce "^1.0.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== + +p-limit@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" + integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== + dependencies: + p-try "^2.0.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== + +parse5@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" + integrity sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA== + dependencies: + "@types/node" "*" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + +pirates@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" + integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== + dependencies: + node-modules-regexp "^1.0.0" + +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== + dependencies: + find-up "^3.0.0" + +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +pretty-format@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2" + integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw== + dependencies: + "@jest/types" "^24.8.0" + ansi-regex "^4.0.0" + ansi-styles "^3.2.0" + react-is "^16.8.4" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + +promise@^7.1.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== + dependencies: + asap "~2.0.3" + +prompts@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db" + integrity sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg== + dependencies: + kleur "^3.0.2" + sisteransi "^1.0.0" + +prop-types-exact@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869" + integrity sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA== + dependencies: + has "^1.0.3" + object.assign "^4.1.0" + reflect.ownkeys "^0.2.0" + +prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + +psl@^1.1.24, psl@^1.1.28: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +raf@^3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" + integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== + dependencies: + performance-now "^2.1.0" + +railroad-diagrams@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" + integrity sha1-635iZ1SN3t+4mcG5Dlc3RVnN234= + +randexp@0.4.6: + version "0.4.6" + resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" + integrity sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ== + dependencies: + discontinuous-range "1.0.0" + ret "~0.1.10" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +react-dom@16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.4.1.tgz#7f8b0223b3a5fbe205116c56deb85de32685dad6" + integrity sha512-1Gin+wghF/7gl4Cqcvr1DxFX2Osz7ugxSwl6gBqCMpdrxHjIFUS7GYxrFftZ9Ln44FHw0JxCFD9YtZsrbR5/4A== + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + +react-is@^16.4.1, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== + +react-test-renderer@16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.4.1.tgz#f2fb30c2c7b517db6e5b10ed20bb6b0a7ccd8d70" + integrity sha512-wyyiPxRZOTpKnNIgUBOB6xPLTpIzwcQMIURhZvzUqZzezvHjaGNsDPBhMac5fIY3Jf5NuKxoGvV64zDSOECPPQ== + dependencies: + fbjs "^0.8.16" + object-assign "^4.1.1" + prop-types "^15.6.0" + react-is "^16.4.1" + +react-test-renderer@^16.0.0-0: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.8.6.tgz#188d8029b8c39c786f998aa3efd3ffe7642d5ba1" + integrity sha512-H2srzU5IWYT6cZXof6AhUcx/wEyJddQ8l7cLM/F7gDXYyPr4oq+vCIxJYXVGhId1J706sqziAjuOEjyNkfgoEw== + dependencies: + object-assign "^4.1.1" + prop-types "^15.6.2" + react-is "^16.8.6" + scheduler "^0.13.6" + +react@16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32" + integrity sha512-3GEs0giKp6E0Oh/Y9ZC60CmYgUPnp7voH9fbjWsvXtYFb4EWtgQub0ADSq0sJR0BbHc4FThLLtzlcFaFXIorwg== + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + +read-pkg-up@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== + dependencies: + find-up "^3.0.0" + read-pkg "^3.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +readable-stream@^2.0.1, readable-stream@^2.0.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.1.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.3.0.tgz#cb8011aad002eb717bf040291feba8569c986fb9" + integrity sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +realpath-native@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" + integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== + dependencies: + util.promisify "^1.0.0" + +reflect.ownkeys@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460" + integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA= + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +request-promise-core@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" + integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag== + dependencies: + lodash "^4.17.11" + +request-promise-native@^1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" + integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w== + dependencies: + request-promise-core "1.1.2" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + +request@^2.87.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= + dependencies: + resolve-from "^3.0.0" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= + +resolve@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" + integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== + dependencies: + path-parse "^1.0.6" + +resolve@^1.3.2: + version "1.11.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232" + integrity sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw== + dependencies: + path-parse "^1.0.6" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +rst-selector-parser@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91" + integrity sha1-gbIw6i/MYGbInjRy3nlChdmwPZE= + dependencies: + lodash.flattendeep "^4.4.0" + nearley "^2.7.10" + +rsvp@^4.8.4: + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== + +safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +scheduler@^0.13.6: + version "0.13.6" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889" + integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0: + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + +semver@^6.0.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b" + integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ== + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +sisteransi@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" + integrity sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ== + +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.5.6: + version "0.5.12" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" + integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.0, source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz#75ecd1a88de8c184ef015eafb51b5b48bfd11bb1" + integrity sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +stack-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +stealthy-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= + +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string.prototype.trim@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" + integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.0" + function-bind "^1.0.2" + +string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= + +tar@^4: + version "4.4.8" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" + integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.3.4" + minizlib "^1.1.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +test-exclude@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" + integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== + dependencies: + glob "^7.1.3" + minimatch "^3.0.4" + read-pkg-up "^4.0.0" + require-main-filename "^2.0.0" + +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@^2.3.3, tough-cookie@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= + dependencies: + punycode "^2.1.0" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +ua-parser-js@^0.7.18: + version "0.7.19" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b" + integrity sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ== + +uglify-js@^3.1.4: + version "3.5.3" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.3.tgz#d490bb5347f23025f0c1bc0dee901d98e4d6b063" + integrity sha512-rIQPT2UMDnk4jRX+w4WO84/pebU2jiLsjgIyrCktYgSvx28enOE3iYQMr+BD1rHiitWnDmpu0cY/LfIEpKcjcw== + dependencies: + commander "~2.19.0" + source-map "~0.6.1" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= + dependencies: + browser-process-hrtime "^0.1.2" + +walker@^1.0.7, walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + dependencies: + makeerror "1.0.x" + +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== + dependencies: + iconv-lite "0.4.24" + +whatwg-fetch@>=0.10.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" + integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== + +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^1.2.9, which@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" + integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== + dependencies: + async-limiter "~1.0.0" + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== + +"y18n@^3.2.1 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + +yargs-parser@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@^12.0.2: + version "12.0.5" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== + dependencies: + cliui "^4.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^11.1.1" diff --git a/devtools/client/accessibility/utils/audit.js b/devtools/client/accessibility/utils/audit.js new file mode 100644 index 0000000000..6234e711f1 --- /dev/null +++ b/devtools/client/accessibility/utils/audit.js @@ -0,0 +1,45 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +/** + * A helper class that contains the state of the audit progress performed by + * the accessibility panel. Its onProgressForWalker function wraps around the + * onProgress function (see actions/audit.js) that updates the panel state. It + * combines the audits across multiple frames that happen asynchronously. It + * only starts dispatching/calling onProgress after we get an initial progress + * audit-event from all frames (and thus know the combined total). + */ +class CombinedProgress { + constructor({ onProgress, totalFrames }) { + this.onProgress = onProgress; + this.totalFrames = totalFrames; + this.combinedProgress = new Map(); + } + + onProgressForWalker(walker, progress) { + this.combinedProgress.set(walker, progress); + // We did not get all initial progress events from all frames, do not + // relay them to the client until we can calculate combined total below. + if (this.combinedProgress.size < this.totalFrames) { + return; + } + + let combinedTotal = 0; + let combinedCompleted = 0; + + for (const { completed, total } of this.combinedProgress.values()) { + combinedTotal += total; + combinedCompleted += completed; + } + this.onProgress({ + total: combinedTotal, + percentage: Math.round((combinedCompleted / combinedTotal) * 100), + }); + } +} + +exports.CombinedProgress = CombinedProgress; +exports.isFiltered = filters => Object.values(filters).some(active => active); diff --git a/devtools/client/accessibility/utils/l10n.js b/devtools/client/accessibility/utils/l10n.js new file mode 100644 index 0000000000..0b1052c4fc --- /dev/null +++ b/devtools/client/accessibility/utils/l10n.js @@ -0,0 +1,11 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +const { LocalizationHelper } = require("resource://devtools/shared/l10n.js"); + +const A11Y_STRINGS_URI = "devtools/client/locales/accessibility.properties"; + +exports.L10N = new LocalizationHelper(A11Y_STRINGS_URI); diff --git a/devtools/client/accessibility/utils/moz.build b/devtools/client/accessibility/utils/moz.build new file mode 100644 index 0000000000..8129eea8e5 --- /dev/null +++ b/devtools/client/accessibility/utils/moz.build @@ -0,0 +1,5 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +DevToolsModules("audit.js", "l10n.js") |