Merge pull request #18664 from calixteman/bug1911994
[Editor] Make the focused stamp annotation more clear from a screen reader point of view (bug 1911994)
This commit is contained in:
commit
5d8d9ef6f9
@ -279,8 +279,7 @@ class AltText {
|
|||||||
this.#altTextTooltip = tooltip = document.createElement("span");
|
this.#altTextTooltip = tooltip = document.createElement("span");
|
||||||
tooltip.className = "tooltip";
|
tooltip.className = "tooltip";
|
||||||
tooltip.setAttribute("role", "tooltip");
|
tooltip.setAttribute("role", "tooltip");
|
||||||
const id = (tooltip.id = `alt-text-tooltip-${this.#editor.id}`);
|
tooltip.id = `alt-text-tooltip-${this.#editor.id}`;
|
||||||
button.setAttribute("aria-describedby", id);
|
|
||||||
|
|
||||||
const DELAY_TO_SHOW_TOOLTIP = 100;
|
const DELAY_TO_SHOW_TOOLTIP = 100;
|
||||||
const signal = this.#editor._uiManager._signal;
|
const signal = this.#editor._uiManager._signal;
|
||||||
|
|||||||
@ -993,6 +993,15 @@ class AnnotationEditor {
|
|||||||
this.#altText?.destroy();
|
this.#altText?.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addContainer(container) {
|
||||||
|
const editToolbarDiv = this._editToolbar?.div;
|
||||||
|
if (editToolbarDiv) {
|
||||||
|
editToolbarDiv.before(container);
|
||||||
|
} else {
|
||||||
|
this.div.append(container);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getClientDimensions() {
|
getClientDimensions() {
|
||||||
return this.div.getBoundingClientRect();
|
return this.div.getBoundingClientRect();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -373,6 +373,7 @@ class StampEditor extends AnnotationEditor {
|
|||||||
|
|
||||||
super.render();
|
super.render();
|
||||||
this.div.hidden = true;
|
this.div.hidden = true;
|
||||||
|
this.div.setAttribute("role", "figure");
|
||||||
|
|
||||||
this.addAltTextButton();
|
this.addAltTextButton();
|
||||||
|
|
||||||
@ -425,7 +426,9 @@ class StampEditor extends AnnotationEditor {
|
|||||||
|
|
||||||
this._uiManager.enableWaiting(false);
|
this._uiManager.enableWaiting(false);
|
||||||
const canvas = (this.#canvas = document.createElement("canvas"));
|
const canvas = (this.#canvas = document.createElement("canvas"));
|
||||||
div.append(canvas);
|
canvas.setAttribute("role", "img");
|
||||||
|
this.addContainer(canvas);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!this._uiManager.useNewAltTextWhenAddingImage ||
|
!this._uiManager.useNewAltTextWhenAddingImage ||
|
||||||
!this._uiManager.useNewAltTextFlow
|
!this._uiManager.useNewAltTextFlow
|
||||||
|
|||||||
@ -71,6 +71,10 @@ class EditorToolbar {
|
|||||||
return editToolbar;
|
return editToolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get div() {
|
||||||
|
return this.#toolbar;
|
||||||
|
}
|
||||||
|
|
||||||
static #pointerDown(e) {
|
static #pointerDown(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user