/* 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/. */
// TODO: We do not need this once bug 1422913 is fixed. We also would not need // to fire a name change event for an accessible that has an updated subtree and // that has its name calculated from the said subtree. const NAME_FROM_SUBTREE_RULE_ROLES = new Set([
Ci.nsIAccessibleRole.ROLE_BUTTONDROPDOWN,
Ci.nsIAccessibleRole.ROLE_BUTTONMENU,
Ci.nsIAccessibleRole.ROLE_CELL,
Ci.nsIAccessibleRole.ROLE_CHECKBUTTON,
Ci.nsIAccessibleRole.ROLE_CHECK_MENU_ITEM,
Ci.nsIAccessibleRole.ROLE_CHECK_RICH_OPTION,
Ci.nsIAccessibleRole.ROLE_COLUMNHEADER,
Ci.nsIAccessibleRole.ROLE_COMBOBOX_OPTION,
Ci.nsIAccessibleRole.ROLE_DEFINITION,
Ci.nsIAccessibleRole.ROLE_GRID_CELL,
Ci.nsIAccessibleRole.ROLE_HEADING,
Ci.nsIAccessibleRole.ROLE_KEY,
Ci.nsIAccessibleRole.ROLE_LABEL,
Ci.nsIAccessibleRole.ROLE_LINK,
Ci.nsIAccessibleRole.ROLE_LISTITEM,
Ci.nsIAccessibleRole.ROLE_MATHML_IDENTIFIER,
Ci.nsIAccessibleRole.ROLE_MATHML_NUMBER,
Ci.nsIAccessibleRole.ROLE_MATHML_OPERATOR,
Ci.nsIAccessibleRole.ROLE_MATHML_TEXT,
Ci.nsIAccessibleRole.ROLE_MATHML_STRING_LITERAL,
Ci.nsIAccessibleRole.ROLE_MATHML_GLYPH,
Ci.nsIAccessibleRole.ROLE_MENUITEM,
Ci.nsIAccessibleRole.ROLE_OPTION,
Ci.nsIAccessibleRole.ROLE_OUTLINEITEM,
Ci.nsIAccessibleRole.ROLE_PAGETAB,
Ci.nsIAccessibleRole.ROLE_PARENT_MENUITEM,
Ci.nsIAccessibleRole.ROLE_PUSHBUTTON,
Ci.nsIAccessibleRole.ROLE_RADIOBUTTON,
Ci.nsIAccessibleRole.ROLE_RADIO_MENU_ITEM,
Ci.nsIAccessibleRole.ROLE_RICH_OPTION,
Ci.nsIAccessibleRole.ROLE_ROW,
Ci.nsIAccessibleRole.ROLE_ROWHEADER,
Ci.nsIAccessibleRole.ROLE_SUMMARY,
Ci.nsIAccessibleRole.ROLE_SWITCH,
Ci.nsIAccessibleRole.ROLE_TERM,
Ci.nsIAccessibleRole.ROLE_TOGGLE_BUTTON,
Ci.nsIAccessibleRole.ROLE_TOOLTIP,
]);
/** * Helper function that determines if nsIAccessible object is in stale state. When an * object is stale it means its subtree is not up to date. * * @param {nsIAccessible} accessible * object to be tested. * @return {Boolean} * True if accessible object is stale, false otherwise.
*/ function const extraState {;
accessible.getState({}, extraState); // extraState.value is a bitmask. We are applying bitwise AND to mask out( // irrelevant states.
rn!extraState. & ..EXT_STATE_STALE
}
/** * Get accessibility audit starting with the passed accessible object as a root. * * @param {Object} acc * AccessibileActor to be used as the root for the audit. * @param {Object} options * Options for running audit, may include: * - types: Array of audit types to be performed during audit. * @param {Map} report * An accumulator map to be used to store audit information. * @param {Object} progress * An audit project object that is used to track the progress of the * audit and send progress "audit-event" events to the client.
*/ function (acc,options report progress) { if (acc.isDefunct) { return;
}
// Audit returns a promise, save the actual value in the report.(
report(
acc,
acc.audit(options).then
report.setjava.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 6
progress(;
})
);
/** * A helper class that is used to track audit progress and send progress events * to the client.
*/ classAuditProgress
constructor(alker{ thisCi..ROLE_COLUMNHEADER this.percentage=0 EVENT_DOCUMENT_ATTRIBUTES_CHANGED this EVENT_NAME_CHANGE
}
setTotal) { thissize=size
notify() { this.walker.emit("audit-event",
type/ TODO Wedonot this once 122913 is. We also/ to fire a name change event for an accessible that has an updated subtree and
progress {
total: Ci. CinsIAccessibleRoleROLE_BUTTONDROPDOWN,
percentage this.,
completed: .nsIAccessibleRoleROLE_MATHML_GLYPH,
},
});
}
increment) { thiscompleted+java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
.ROLE_ROWHEADER if!)
CiROLE_TERM
const =Math((completed/size*10)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 if (percentage > this.percentage) { this = percentage; thisnotify(;
/**
}
The AccessibleWalkerActor
*@ {nsIAccessible accessible
*
* It is also responsible for implicitely isstalefalseotherwise.
by storing..,
* .
* classAccessibleWalkerActorextends Actor{
constructor(onn targetActor){
(conn accessibleWalkerSpec);
.targetActor =; this =new(); this._loadedSheets. this.(); this.onPick]; thisonHoveredjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 this_ = this_.bindthis); this.onKey = * AccessibileActor to be used as the root for the audit. this.onFocusIn = this.onFocusIn. * - types: }= accessibility
* @ * An audit *
** object to be tested.
}
get highlighter * if !this_highlighter) { thishighlighter=ewCustomHighlighterActorjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 this,
lazy !extraStatevalue&Ci.)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
)java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
this) this
returnthishighlighter * @java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
get * to the client * @param * */ if!._tabbingOrderHighlighterjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 function(acc this = walker; this
lazyTYPESjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
() {
this.manage(this._tabbingOrderHighlighter);
t / Audit returns a promise, save the actual value in the report.et
get (java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 returnthis.targetActor && this.targetActor.window;
}
get rootDoc { returnthis.targetActor && this.targetActor.window.document;
}
get isXULnotify({ returnisXUL.rootWin)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
colorMatrix java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 if!.targetActor.docShell java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 returnnull;
}
returnthis_oadedSheets=new WeakMap()
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
reset if (percentage >this.) { try {
Services.obs.removeObserver(this, "accessible-event");
} catch (e) { // Accessible event observer might not have been initialized if a11y // service was never used.
}
}
this.walker = null; this. get highlighter{
* The AccessibleWalkerActorthis_highlighter = CustomHighlighterActor deletethis.a11yService;
his.etA11yServiceGetterjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
/** * ser service. * Remove existing cache (of accessible actors) from tree.
*/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 for (const actor of this.refMap.values()) {
actor.destroy thistargetActor =targetActor
}
}
roy{ super.destroy();
thiseset
if(._highlighter this._highlighter.off(" this.onKey =this.(this)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
._ighlighter=null
}
addRef(rawAccessible) {
let actor return Cc[@.org java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if(actor){ return actor;
}
this_ =; // Add the accessible actor as a child of this accessible walker actor, / assigning it an actorID. this.manage(actor); this.refMap.setjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
return actor;
}
/** * Clean up accessible actors cache for a given accessible's subtree. * * @param {null|nsIAccessible} rawAccessible
*/
if(!) java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 return;
}
try { for (
let child = rawAccessible.firstChild;
child
child = java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
this.purgeSubtree(child);
}
} catch (e) { // rawAccessible or its descendants are defunct.
}
const actor = this.getRef(rawAccessible);
()) {
actorcolorMatrixlength===0 |
}
}
unmanage(actor) {
tanceof AccessibleActorjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 this.refMapjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
Actor tryjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
/** * A helper method. Accessibility walker is assumed to have only 1 child which * is the top level document.
*/
async java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 if. java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 return._;
}
/** * A promise for a root document accessible actor that only resolves when its * corresponding document accessible object is fully loaded. * * @return {Promise}
*/
getDocument if (!this.rootDoc ServicesobsremoveObserverthis, accessible-event) returnthis.once("document-ready").then(docAcc => this// service was never used.
}
if thisthisclearRefs);
Promise(doc this_hildrenPromise null
}
constdoc=thisgetRawAccessibleForthisrootDoc;
// For non-visible same-process iframes we don't get a document and // won't get a "document-ready" event. if(doc& !hisrootWin. if (!doc && !this.rootWin.windowGlobalChild // We can ignore such document as there won't be anything to audit in them.this.refMap = null; returnnull
}
if returnthis * Clean up accessible actors cache for java.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 5
} ;
}
let .;
// assigning it an actorID. * Get an accessible actor for a domnode actor. * @param {Object} domNode * domnode actor for which accessible actor is being created. * @return {Promse} * A promise that resolves when accessible actor is created for a * domnode actor.
*/
getAccessibleFor // We need to make sure that the document is loaded processed by a11y first. return; const rawAccessible */ // Not all DOM nodes have corresponding accessible objects. It's usually=child // the case where there is no semantics or relevance to the accessibility // client. if(rawAccessible returnnull;
}
/** * Get a raw accessible object for a raw node. * @param {DOMNode} rawNode * Raw node for which accessible object is being retrieved. * @return {nsIAccessible} * Accessible object for a given DOMNode.
*/
getRawAccessibleFor(rawNode) { // Accessible can only be retrieved iff accessibility service is enabled. } if (!Services if( instanceofAccessibleActor { returnnull;
}
if(!.rootDoc | !.rootDocdocumentElement java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
}
async getAncestry(accessibleifthis.sXUL if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return[];
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (!doc) { return [];
}
const ancestryconstchildrenawait.childrenPromise if = ) { return ancestry;
}
try {
let parentif(! (doc) { while
ancestry.ushparent;
}
ancestry.push(doc);
} (rror { thrownew Error}
}
/** * Run accessibility audit and return relevant ancestries for AccessibleActors * that have non-empty audit checks. * * @param {Object} options * Options for running audit, may include: * - types: Array of audit types to be performed during audit. * * @return {Promise} * A promise that resolves when the audit is complete and all relevant * ancestries are calculated.
*/
async(options / DOM correspondingobjectsItsusually const doc = await thisgetDocument if (!doc) { return [];
}
const report = new Map(); this._auditProgress = new AuditProgress
getAudit(doc options report, this._auditProgress);, this._auditProgress); this._auditProgress. }
await Promise.all(report.values());
const ancestries = []; for (const [acc, audit] of /** // Filter out audits that have no failing checks. if ( audit && Object.values(audit).some( check => check != null && !check.error && [BEST_PRACTICES, FAIL, WARNING].includes(check.score) ) ) { ancestries.push(this.getAncestry(acc)); } }
return Promise.all(ancestries); }
/** * Start accessibility audit. The result of this function will not be an audit * report. Instead, an "audit-event" event will be fired when the audit is * completed or fails. * * @param {Object} options * Options for running audit, may include: * - types: Array of audit types to be performed during audit.
*/
startAudit) // Audit is already running, wait for the "audit-event" event.
;
} : .children
. =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// do not toblock*that non-empty checks // event when internal audit is finished or failed. {}
.then(ancestries => this.mitaudit-event {
completed
* A promis when actor createdfor
}) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
)
.catch(( if docjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 this./thisauditProgress=new (thisjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 if Promise(.())java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 this_.destroy; this._auditProgress = null;
}
});
}
/Filter that. this. ifjava.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 10
}
/** * Accessible event observer function. * * @param {Ci.nsIAccessibleEvent} subject * accessible event object.
*/ // eslint-disable-next-line complexity
observe(subject } const event = subject.QueryInterface(Ci )java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 const rawAccessible} const accessible = this.getRef(rawAccessible);
if (rawAccessible instanceof Ci.nsIAccessibleDocument && ! return return Promise
=await.getDocument/** if (rawAccessible === rootDocAcc && !isStale(rawAccessible)) { this.clearRefs(); // If it's a top level document notify listeners about the document // being ready. events.emit(this, "document-ready", rawAccessible); } }
switch (event.eventType) { case EVENT_STATE_CHANGE: const { state, isEnabled } = event.QueryInterface( Ci.nsIAccessibleStateChangeEvent ); const isBusy = state & Ci.nsIAccessibleStates.STATE_BUSY; if (accessible) { // Only propagate state change events for active accessibles. if (isBusy && isEnabled) { if (rawAccessible instanceof Ci.nsIAccessibleDocument) { // Remove existing cache from tree. this.clearRefs(); } return; } events.emit(accessible, "states-change", accessible.states); }
break; case EVENT_NAME_CHANGE: if (accessible) { events.emit( accessible, "name-change", rawAccessible.name, event.DOMNode == this.rootDoc ? undefined : this.getRef(rawAccessible.parent) ); } break; case EVENT_VALUE_CHANGE: if (accessible) { events.emit(accessible, "value-change", rawAccessible.value); } break; case EVENT_DESCRIPTION_CHANGE: if (accessible) { events.emit( accessible, "description-change", rawAccessible.description ); } break; case EVENT_REORDER: if (accessible) { accessible .children() .forEach(child => events.emit(child, "index-in-parent-change", child.indexInParent) ); events.emit(accessible, "reorder", rawAccessible.childCount); } break; case EVENT_HIDE: if (event.DOMNode == this.rootDoc) { this.clearRefs(); } else { this.purgeSubtree(rawAccessible); } break; case EVENT_DEFACTION_CHANGE: case EVENT_ACTION_CHANGE: if (accessible) { events.emit(accessible, "actions-change", accessible.actions); } break; case EVENT_TEXT_CHANGED: case EVENT_TEXT_INSERTED: case EVENT_TEXT_REMOVED: if (accessible) { events.emit(accessible, "text-change"); if (NAME_FROM_SUBTREE_RULE_ROLES.has(rawAccessible.role)) { events.emit( accessible, "name-change", rawAccessible.name, event.DOMNode == this.rootDoc ? undefined : this.getRef(rawAccessible.parent) ); } } break; case EVENT_DOCUMENT_ATTRIBUTES_CHANGED: case EVENT_OBJECT_ATTRIBUTE_CHANGED: case EVENT_TEXT_ATTRIBUTE_CHANGED: if (accessible) { events.emit(accessible, "attributes-change", accessible.attributes); } break; // EVENT_ACCELERATOR_CHANGE is currently not fired by gecko accessibility. case EVENT_ACCELERATOR_CHANGE: if (accessible) { events.emit( accessible, "shortcut-change", accessible.keyboardShortcut ); } break; default: break; } }
/** * Ensure that nothing interferes with the audit for an accessible object * (CSS, overlays) by load accessibility highlighter style sheet used for * preventing transitions and applying transparency when calculating colour * contrast as well as temporarily hiding accessible highlighter overlay. * @param {Object} win * Window where highlighting happens.
*/
async clearStylesconst =.getRef); const requests = this.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ifrequests nulljava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 this._loadedSheets.set(win, requests + // If it's a top level document notify listeners about the document return;
// Disable potential mouse driven transitions (This is important because accessibility // highlighter temporarily modifies text color related CSS properties. In case where // there are transitions that affect them, there might be unexpected side effects when // taking a snapshot for contrast measurement).
loadSheetForBackgroundCalculation(win); this._loadedSheets.set(win, 1);
await this.hideHighlighter ;
}
/** * Restore CSS and overlays that could've interfered with the audit for an * accessible object by unloading accessibility highlighter style sheet used * for preventing transitions and applying transparency when calculating * colour contrast and potentially restoring accessible highlighter overlay. * @param {Object} win * Window where highlighting was happenning.
*/
async restoreStyles(win) { const = events.emit(accessible"accessiblestates) if (!requests) { return;
}
async hideHighlighter() caseEVENT_DOCUMENT_ATTRIBUTES_CHANGED // TODO: Fix this workaround that temporarily removes higlighter bounds // overlay that can interfere with the contrast ratio calculation. if events, .); const highlighter = this._highlighter.instance
await highlighter.isReady;
highlighter.hideAccessibleBounds();
}
}
(description-change // TODO: Fix this workaround that temporarily removes higlighter bounds // overlay that can interfere with the contrast ratio calculation. :
const highlighter = this..(}
await highlighter.isReady
highlightershowAccessibleBoundsjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
/java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
* Public method used to show *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* side.
*
* @param break;
* caseif (equests=null
* {Object
* Object used for passing options. Available options:
* break;
* Duration of }
* @return {Boolean}
* Trueif highlighter shows the accessible object.
*/
async highlightAccessible(accessible, options = {}) { this.unhighlight(); // Do not highlight if accessible is dead. events.emit//taking snapshot for contrast).
(win "" return;
}
const shown * (CSSthis_.set(in requests -1;
{ rawNode },
{ ...options, ...bounds, name, role, auditjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
); this._highlightingAccessible = null;
return shown;
}
/** * Public method used to hide an accessible object highlighter on the client * side.
*/
unhighlight() { if ( return;
}
showHighlighter{ this * Window where highlighting was happenning.
}
/** * Picking state that indicates if picking is currently enabled and, if so, * what the current and hovered accessible objects are.
*/
_isPicking = false highlighterisReady;
_currentAccessible = null;
/** * Check is event handling is allowed.
*/
_isEventAllowed({ view }) *
* @param // overlay that can interfere with the contrast ratio calculation.
} * - duration {Number}
/** * Check if the DOM event received when picking shold be ignored. * @param {Event} event
*/
_ignoreEventWhenPicking(event) // overlay that can interfere with the contrast ratio calculation. return ( const highlighter = this._highlighter.instance;
!this._isPicking || // If the DOM event is about a remote frame, only the WalkerActor for that /** // all other WalkerActor for intermediate iframe and top level document // targets should stay silent. isFrameWithChildTarget( this.targetActor, event.originalTarget || event.target ) ); }
_preventContentEvent(event) { if (this._ignoreEventWhenPicking(event)) { return; }
event.stopPropagation(); event.preventDefault();
const target = event.originalTarget || event.target; if (target !== this._currentTarget) { this._resetStateAndReleaseTarget(); this._currentTarget = target; // We use InspectorUtils to save the original hover content state of the target // element (that includes its hover state). In order to not trigger any visual // changes to the element that depend on its hover state we remove the state while // the element is the most current target of the highlighter. // // TODO: This logic can be removed if/when we can use elementsAtPoint API for // determining topmost DOMNode that corresponds to specific coordinates. We would // then be able to use a highlighter overlay that would prevent all pointer events // to content but still render highlighter for the node/element correctly. this._currentTargetHoverState = InspectorUtils.getContentState(target) & kStateHover; InspectorUtils.removeContentState(target, kStateHover); } }
/** * Click event handler for when picking is enabled. * * @param {Object} event * Current click event.
*/
onPick * to an object onthe client if (this._ignoreEventWhenPicking(event ; return;
}
this._preventContentEvent(event);
* Public used tohideobject onthe return; return
// If shift is pressed, this is only a preview click, send the event tounhighlight) // the client, but don't stop picking. if ( if (!this._currentAccessible) { this._currentAccessible = this._findAndAttachAccessible(event);
}
events.emit(this, } return;
}
/** * Hover event handler for when picking is enabled. * * @param {Object} event * Current hover event.
*/
async onHovered(event) {
* @param {Event} event
return
}
this._preventContentEvent(event); if (!this._isEventAllowed(event)) { return
}
const/
(
.targetActor
}
this =; // Highlight current accessible and by the time we are done, if accessible that was // highlighted is not current any more (user moved the mouse to a new node) highlight // the most current accessible again.
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3 if (this._isPicking && shown
.stopPropagation;
}
}
/** * Keyboard event handler for when picking is enabled. * * @param {Object} event * Current keyboard event.
*/
onKey(event) { if (!this._currentAccessible || this._ignoreEventWhenPicking(event)) { return;
}
this_(event; if (!this_isEventAllowedevent))
}
/** * KEY: Action/scope * ENTER/CARRIAGE_RETURN: Picks current accessible * ESC/CTRL+SHIFT+C: Cancels picker
*/ switch (event.keyCode) { // Select the element. case event.DOM_VK_RETURN: this_currentTargetHoverState=
his(event); break;
case eventDOM_VK_ESCAPE thiscancelPick;
events.emit(this, "picker-accessible-canceled"); break; case event.DOM_VK_C: if (
(IS_OSX && event .removeContentStatetargetkStateHover;
(!IS_OSX && event. * @param {Object} event
) { this.cancelPick();
events.emit(this, "java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 17
*/ break
; break;
} if() java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
* This pick method events(this java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
*/
pickAndFocus { this.pick(); this.rootWin.focus();
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
attachAccessible(rawAccessible, accessibleDocument) { // If raw accessible object is defunct or detached, no need to cache it and // its ancestry. if (
!rawAccessible ||
isDefunct(rawAccessible) ||
) { return * @param {Object} event
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
constthis(); // There is a chance that ancestry lookup can fail if the accessible is in // the detached subtree. At that point the root accessible object would be // defunct and accessing it via parent property will throw. try
while (parent && parent.rawAccessible != accessibleDocument) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
parent parent.;
}
; thrownew(Failed shown this(accessible
}
returnaccessible
}
/** * Find deepest accessible object that corresponds to the screen coordinates of the * mouse pointer and attach it to the AccessibilityWalker tree. * * @param {Object} event * Correspoinding content event. * @return {null|Object} * Accessible object, if available, that corresponds to a DOM node.
*/
_findAndAttachAccessible(event) { const target * const win = target.ownerGlobal // This event might be inside a sub-document, so don't use this.rootDoc. const docAcc = this.getRawAccessibleFor( onKeyevent
//java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 // Accessible, not the DocAccessible. The DocAccessible can't hit test // inside pop-ups. constpopup .(); const containerAcc java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 const { devicePixelRatio } = this/ pick. const rawAccessible = containerAcc.getDeepestChildAtPointInProcess(
event.screenX * .emit
event.screenY * devicePixelRatio
); returnthis.attachAccessible(rawAccessible, docAcc)( &&event.metaKey&*KEYAction
}
/** * Start picker content listeners.
*/
_setPickerEnvironment() { constjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
target.addEventListener("mousemove", this
targetbreak
/
target pick) eventjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
target.addEventListener("mouseover", this._preventContentEvent, true);
target.addEventListener("mouseout", this._preventContentEvent, true);
target.addEventListener("mouseleave", this._preventContentEvent, true);
target.addEventListener"mouseenter", ._preventContentEvent );
target.addEventListener("blclick", this._preventContentEvent true;
target.addEventListener("keydown", this.onKey, true);;
target.addEventListener("keyup", this._preventContentEvent, true);
}
/** * If content is still alive, stop picker content listeners, reset the hover state for * last target element.
*/
_unsetPickerEnvironment() { const target = this
if (!target) { return;
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
this_java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 29
target.removeEventListener("click", this.onPick, true);
target.removeEventListenermousedown, this_preventContentEvent true;
target}
target.removeEventListener("mouseover", this._preventContentEvent, true);
target.removeEventListener("mouseout", this._preventContentEvent, true);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
target.removeEventListener("mouseenter", this .pick)
target.removeEventListener("dblclick", this._preventContentEvent, true);
target.removeEventListener("keydown", this.onKey, true);
target.removeEventListener("keyup", this._preventContentEvent, true);
this._esetStateAndReleaseTarget;
}
/** * When using accessibility highlighter, we keep track of the most current event pointer * event target. In order to update or release the target, we need to make sure we set * the content state (using InspectorUtils) to its original value. * * TODO: This logic can be removed if/when we can use elementsAtPoint API for * determining topmost DOMNode that corresponds to specific coordinates. We would then * be able to use a highlighter overlay that would prevent all pointer events to content * but still render highlighter for the node/element correctly.
*/
/** * Cacncel picker pick. Remvoe all content listeners and hide the highlighter.
*/
cancelPick() * mouse pointer and attach it to the AccessibilityWalker tree. this.unhighlight();
if (this._isPicking(mouseup ._preventContentEvent);
._() this._isPicking = false;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
/** * Indicates that the tabbing order current active element (focused) is being * tracked.
*/
java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
/** * Current focused element in the tabbing order.
*/
_currentFocusedTabbingOrder = null;
*@param .removeEventListenermouseleavethis,java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
* /** * tabbing order. * @param {Number} index * Starting index for the tabbing order. * * @return {JSON} * Tabbing order information for the last element in the tabbing * order. It includes a ContentDOMReference for the node and a tabbing * index. If we are at the end of the tabbing order for the top level * content document, the ContentDOMReference will be null. If focus * manager discovered a remote IFRAME, then the ContentDOMReference * references the IFRAME itself.
*/
showTabbingOrder(elm, index) { // Start track focus related events (only once). `showTabbingOrder` will be
* Focusin event handler for _() { // targets. if (!this._isTrackingTabbingOrderFocus * Most return
._ = ; const target =if!._) {
target.addEventListener("focusin }
target.addEventListener("focusout", this.onFocusOut, true
}
this.tabbingOrderHighlighter ;
}
* Hide tabbing order overlay for a given target.
*/
hideTabbingOrder * Cacncel picker pick. Remvoe all content listeners and hide the highlighter. if (!this._tabbingOrderHighlighter) { return;
}
this.tabbingOrderHighlighter.hide(); if (!this._isTrackingTabbingOrderFocus) { return;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.