diff --git a/CHANGES.md b/CHANGES.md index c378ea08f9d..c12470665f6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ CKEditor 4 Changelog Fixed Issues: +* [#14539](https://dev.ckeditor.com/ticket/14539): Fixed: JAWS reads "selected Blank" instead of "selected " when selecting widget. * [#14667](http://dev.ckeditor.com/ticket/14667): [IE] Fixed: Removing background color from selected text removes background color from the whole paragraph. * [#14252](http://dev.ckeditor.com/ticket/14252): Fixed: Styles dropdown doesn't always reflect the current style of the text line in Internet Explorer. * [#13929](http://dev.ckeditor.com/ticket/13929): Fixed: Errors in console on IE11 with compatibility mode in manual test for [#13867](http://dev.ckeditor.com/ticket/13867). diff --git a/core/selection.js b/core/selection.js index 573b890e18d..9574c5ccd74 100644 --- a/core/selection.js +++ b/core/selection.js @@ -234,10 +234,11 @@ } // Creates cke_hidden_sel container and puts real selection there. - function hideSelection( editor ) { - var style = CKEDITOR.env.ie ? 'display:none' : 'position:fixed;top:0;left:-1000px', + function hideSelection( editor, ariaLabel ) { + var content = ariaLabel || ' ', + style = CKEDITOR.env.ie ? 'display:none' : 'position:fixed;top:0;left:-1000px', hiddenEl = CKEDITOR.dom.element.createFromHtml( - '
 
', + '
' + content + '
', editor.document ); editor.fire( 'lockSnapshot' ); @@ -1954,14 +1955,20 @@ * displayed to the user. * * @param {CKEDITOR.dom.element} element The element to be "selected". + * @param {String} [ariaLabel] String to be used for screen reader to describe the selection. */ - fake: function( element ) { + fake: function( element, ariaLabel ) { var editor = this.root.editor; + // Attempt to retreive aria-label if possible (#14539). + if ( ariaLabel === undefined && element.hasAttribute( 'aria-label' ) ) { + ariaLabel = element.getAttribute( 'aria-label' ); + } + // Cleanup after previous selection - e.g. remove hidden sel container. this.reset(); - hideSelection( editor ); + hideSelection( editor, ariaLabel ); // Set this value after executing hiseSelection, because it may // cause reset() which overwrites cache. diff --git a/plugins/widget/lang/af.js b/plugins/widget/lang/af.js index ed9b0b07821..52fece0da41 100644 --- a/plugins/widget/lang/af.js +++ b/plugins/widget/lang/af.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'af', { - 'move': 'Klik en trek on te beweeg' + 'move': 'Klik en trek on te beweeg', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/ar.js b/plugins/widget/lang/ar.js index 9058e478f05..b1c7a0f96b7 100644 --- a/plugins/widget/lang/ar.js +++ b/plugins/widget/lang/ar.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'ar', { - 'move': 'إضغط و إسحب للتحريك' + 'move': 'إضغط و إسحب للتحريك', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/bg.js b/plugins/widget/lang/bg.js index a1105befb9a..2d7fc93e4e9 100644 --- a/plugins/widget/lang/bg.js +++ b/plugins/widget/lang/bg.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'bg', { - 'move': 'Кликни и влачи, за да преместиш' + 'move': 'Кликни и влачи, за да преместиш', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/ca.js b/plugins/widget/lang/ca.js index 1ab68f2301e..abd606f2738 100644 --- a/plugins/widget/lang/ca.js +++ b/plugins/widget/lang/ca.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'ca', { - 'move': 'Clicar i arrossegar per moure' + 'move': 'Clicar i arrossegar per moure', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/cs.js b/plugins/widget/lang/cs.js index cba0a0bacc7..2a671868957 100644 --- a/plugins/widget/lang/cs.js +++ b/plugins/widget/lang/cs.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'cs', { - 'move': 'Klepněte a táhněte pro přesunutí' + 'move': 'Klepněte a táhněte pro přesunutí', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/cy.js b/plugins/widget/lang/cy.js index ba53bf22024..e39e3c53b99 100644 --- a/plugins/widget/lang/cy.js +++ b/plugins/widget/lang/cy.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'cy', { - 'move': 'Clcio a llusgo i symud' + 'move': 'Clcio a llusgo i symud', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/da.js b/plugins/widget/lang/da.js index c74247b28bd..72e9e438cc4 100644 --- a/plugins/widget/lang/da.js +++ b/plugins/widget/lang/da.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'da', { - 'move': 'Klik og træk for at flytte' + 'move': 'Klik og træk for at flytte', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/de-ch.js b/plugins/widget/lang/de-ch.js index 1b1c08df7b4..52c20ad7e52 100644 --- a/plugins/widget/lang/de-ch.js +++ b/plugins/widget/lang/de-ch.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'de-ch', { - 'move': 'Zum Verschieben anwählen und ziehen' + 'move': 'Zum Verschieben anwählen und ziehen', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/de.js b/plugins/widget/lang/de.js index fcbbbe9ba29..aef2559af4d 100644 --- a/plugins/widget/lang/de.js +++ b/plugins/widget/lang/de.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'de', { - 'move': 'Zum Verschieben anwählen und ziehen' + 'move': 'Zum Verschieben anwählen und ziehen', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/el.js b/plugins/widget/lang/el.js index b92f34ec7c6..f375d841143 100644 --- a/plugins/widget/lang/el.js +++ b/plugins/widget/lang/el.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'el', { - 'move': 'Κάνετε κλικ και σύρετε το ποντίκι για να μετακινήστε' + 'move': 'Κάνετε κλικ και σύρετε το ποντίκι για να μετακινήστε', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/en-gb.js b/plugins/widget/lang/en-gb.js index dd43ea52500..7e767d4bb08 100644 --- a/plugins/widget/lang/en-gb.js +++ b/plugins/widget/lang/en-gb.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'en-gb', { - 'move': 'Click and drag to move' + 'move': 'Click and drag to move', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/en.js b/plugins/widget/lang/en.js index 7bf60a9cfd8..54f59b4fe02 100644 --- a/plugins/widget/lang/en.js +++ b/plugins/widget/lang/en.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'en', { - 'move': 'Click and drag to move' + 'move': 'Click and drag to move', + 'label': '%1 widget' } ); diff --git a/plugins/widget/lang/eo.js b/plugins/widget/lang/eo.js index 10535775c76..b34187220ef 100644 --- a/plugins/widget/lang/eo.js +++ b/plugins/widget/lang/eo.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'eo', { - 'move': 'klaki kaj treni por movi' + 'move': 'klaki kaj treni por movi', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/es.js b/plugins/widget/lang/es.js index c01877b72d4..3eaa3b96bfe 100644 --- a/plugins/widget/lang/es.js +++ b/plugins/widget/lang/es.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'es', { - 'move': 'Dar clic y arrastrar para mover' + 'move': 'Dar clic y arrastrar para mover', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/eu.js b/plugins/widget/lang/eu.js index 3ee63986390..d42cea527c0 100644 --- a/plugins/widget/lang/eu.js +++ b/plugins/widget/lang/eu.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'eu', { - 'move': 'Klikatu eta arrastatu lekuz aldatzeko' + 'move': 'Klikatu eta arrastatu lekuz aldatzeko', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/fa.js b/plugins/widget/lang/fa.js index 3bba61a5659..2b796c6efbd 100644 --- a/plugins/widget/lang/fa.js +++ b/plugins/widget/lang/fa.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'fa', { - 'move': 'کلیک و کشیدن برای جابجایی' + 'move': 'کلیک و کشیدن برای جابجایی', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/fi.js b/plugins/widget/lang/fi.js index 488fbf32afe..81104030830 100644 --- a/plugins/widget/lang/fi.js +++ b/plugins/widget/lang/fi.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'fi', { - 'move': 'Siirrä klikkaamalla ja raahaamalla' + 'move': 'Siirrä klikkaamalla ja raahaamalla', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/fr.js b/plugins/widget/lang/fr.js index 7f7956d2e68..93d7959d141 100644 --- a/plugins/widget/lang/fr.js +++ b/plugins/widget/lang/fr.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'fr', { - 'move': 'Cliquer et glisser pour déplacer' + 'move': 'Cliquer et glisser pour déplacer', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/gl.js b/plugins/widget/lang/gl.js index 6246af308f3..9a07ecb811a 100644 --- a/plugins/widget/lang/gl.js +++ b/plugins/widget/lang/gl.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'gl', { - 'move': 'Prema e arrastre para mover' + 'move': 'Prema e arrastre para mover', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/he.js b/plugins/widget/lang/he.js index 840e708b96e..1fe2169fc7c 100644 --- a/plugins/widget/lang/he.js +++ b/plugins/widget/lang/he.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'he', { - 'move': 'לחץ וגרור להזזה' + 'move': 'לחץ וגרור להזזה', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/hr.js b/plugins/widget/lang/hr.js index d2fe0b5081a..d607ad6ca5b 100644 --- a/plugins/widget/lang/hr.js +++ b/plugins/widget/lang/hr.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'hr', { - 'move': 'Klikni i povuci da pomakneš' + 'move': 'Klikni i povuci da pomakneš', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/hu.js b/plugins/widget/lang/hu.js index 0753d9b1a8d..90c73d10baa 100644 --- a/plugins/widget/lang/hu.js +++ b/plugins/widget/lang/hu.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'hu', { - 'move': 'Kattints és húzd a mozgatáshoz' + 'move': 'Kattints és húzd a mozgatáshoz', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/id.js b/plugins/widget/lang/id.js index aeede0fce57..4c26921b047 100644 --- a/plugins/widget/lang/id.js +++ b/plugins/widget/lang/id.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'id', { - 'move': 'Tekan dan geser untuk memindahkan' + 'move': 'Tekan dan geser untuk memindahkan', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/it.js b/plugins/widget/lang/it.js index 614dd4676dd..2cecf87a6f6 100644 --- a/plugins/widget/lang/it.js +++ b/plugins/widget/lang/it.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'it', { - 'move': 'Fare clic e trascinare per spostare' + 'move': 'Fare clic e trascinare per spostare', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/ja.js b/plugins/widget/lang/ja.js index 2419ea99cba..a5ec869cf3f 100644 --- a/plugins/widget/lang/ja.js +++ b/plugins/widget/lang/ja.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'ja', { - 'move': 'ドラッグして移動' + 'move': 'ドラッグして移動', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/km.js b/plugins/widget/lang/km.js index d0789093c52..9092bb4cd42 100644 --- a/plugins/widget/lang/km.js +++ b/plugins/widget/lang/km.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'km', { - 'move': 'ចុច​ហើយ​ទាញ​ដើម្បី​ផ្លាស់​ទី' + 'move': 'ចុច​ហើយ​ទាញ​ដើម្បី​ផ្លាស់​ទី', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/ko.js b/plugins/widget/lang/ko.js index 41b6739db5d..e63723cad58 100644 --- a/plugins/widget/lang/ko.js +++ b/plugins/widget/lang/ko.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'ko', { - 'move': '움직이려면 클릭 후 드래그 하세요' + 'move': '움직이려면 클릭 후 드래그 하세요', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/ku.js b/plugins/widget/lang/ku.js index b46bbd7da7c..2cbd4d9fbfd 100644 --- a/plugins/widget/lang/ku.js +++ b/plugins/widget/lang/ku.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'ku', { - 'move': 'کرتەبکە و ڕایبکێشە بۆ جوڵاندن' + 'move': 'کرتەبکە و ڕایبکێشە بۆ جوڵاندن', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/lv.js b/plugins/widget/lang/lv.js index fce45a75c2c..f50363eccab 100644 --- a/plugins/widget/lang/lv.js +++ b/plugins/widget/lang/lv.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'lv', { - 'move': 'Klikšķina un velc, lai pārvietotu' + 'move': 'Klikšķina un velc, lai pārvietotu', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/nb.js b/plugins/widget/lang/nb.js index d8a5900c67e..dc743ac5dbe 100644 --- a/plugins/widget/lang/nb.js +++ b/plugins/widget/lang/nb.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'nb', { - 'move': 'Klikk og dra for å flytte' + 'move': 'Klikk og dra for å flytte', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/nl.js b/plugins/widget/lang/nl.js index a43ab648bfe..4dedaacdbbc 100644 --- a/plugins/widget/lang/nl.js +++ b/plugins/widget/lang/nl.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'nl', { - 'move': 'Klik en sleep om te verplaatsen' + 'move': 'Klik en sleep om te verplaatsen', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/no.js b/plugins/widget/lang/no.js index a862c0d5f6b..9671dda1fa4 100644 --- a/plugins/widget/lang/no.js +++ b/plugins/widget/lang/no.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'no', { - 'move': 'Klikk og dra for å flytte' + 'move': 'Klikk og dra for å flytte', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/pl.js b/plugins/widget/lang/pl.js index c863dd6a6c1..066fbe1aa68 100644 --- a/plugins/widget/lang/pl.js +++ b/plugins/widget/lang/pl.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'pl', { - 'move': 'Kliknij i przeciągnij, by przenieść.' + 'move': 'Kliknij i przeciągnij, by przenieść.', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/pt-br.js b/plugins/widget/lang/pt-br.js index 57324a67966..2d9547990f1 100644 --- a/plugins/widget/lang/pt-br.js +++ b/plugins/widget/lang/pt-br.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'pt-br', { - 'move': 'Click e arraste para mover' + 'move': 'Click e arraste para mover', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/pt.js b/plugins/widget/lang/pt.js index 2e4e2df2d95..814c39ec723 100644 --- a/plugins/widget/lang/pt.js +++ b/plugins/widget/lang/pt.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'pt', { - 'move': 'Clique e arraste para mover' + 'move': 'Clique e arraste para mover', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/ru.js b/plugins/widget/lang/ru.js index a1241cec58e..acd58f8fe38 100644 --- a/plugins/widget/lang/ru.js +++ b/plugins/widget/lang/ru.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'ru', { - 'move': 'Нажмите и перетащите' + 'move': 'Нажмите и перетащите', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/sk.js b/plugins/widget/lang/sk.js index 56f61375f56..02b025586d6 100644 --- a/plugins/widget/lang/sk.js +++ b/plugins/widget/lang/sk.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'sk', { - 'move': 'Kliknite a potiahnite pre presunutie' + 'move': 'Kliknite a potiahnite pre presunutie', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/sl.js b/plugins/widget/lang/sl.js index 304d8ef9fff..d35743da75c 100644 --- a/plugins/widget/lang/sl.js +++ b/plugins/widget/lang/sl.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'sl', { - 'move': 'Kliknite in povlecite, da premaknete' + 'move': 'Kliknite in povlecite, da premaknete', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/sq.js b/plugins/widget/lang/sq.js index d5d76b366b3..89084ccc0b6 100644 --- a/plugins/widget/lang/sq.js +++ b/plugins/widget/lang/sq.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'sq', { - 'move': 'Kliko dhe tërhiqe për ta lëvizur' + 'move': 'Kliko dhe tërhiqe për ta lëvizur', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/sv.js b/plugins/widget/lang/sv.js index 5fcd21f4b96..c8f3e938af2 100644 --- a/plugins/widget/lang/sv.js +++ b/plugins/widget/lang/sv.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'sv', { - 'move': 'Klicka och drag för att flytta' + 'move': 'Klicka och drag för att flytta', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/tr.js b/plugins/widget/lang/tr.js index 8848a2ac30f..04c2540e401 100644 --- a/plugins/widget/lang/tr.js +++ b/plugins/widget/lang/tr.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'tr', { - 'move': 'Taşımak için, tıklayın ve sürükleyin' + 'move': 'Taşımak için, tıklayın ve sürükleyin', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/tt.js b/plugins/widget/lang/tt.js index 04a02964464..5eb53089b06 100644 --- a/plugins/widget/lang/tt.js +++ b/plugins/widget/lang/tt.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'tt', { - 'move': 'Күчереп куер өчен басып шудырыгыз' + 'move': 'Күчереп куер өчен басып шудырыгыз', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/ug.js b/plugins/widget/lang/ug.js index 9fefbb8af55..445a3d2c6b9 100644 --- a/plugins/widget/lang/ug.js +++ b/plugins/widget/lang/ug.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'ug', { - 'move': 'يۆتكەشتە چېكىپ سۆرەڭ' + 'move': 'يۆتكەشتە چېكىپ سۆرەڭ', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/uk.js b/plugins/widget/lang/uk.js index bdaa125a5d6..0955a326904 100644 --- a/plugins/widget/lang/uk.js +++ b/plugins/widget/lang/uk.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'uk', { - 'move': 'Клікніть і потягніть для переміщення' + 'move': 'Клікніть і потягніть для переміщення', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/vi.js b/plugins/widget/lang/vi.js index c5ab748c5bf..1904d6124cd 100644 --- a/plugins/widget/lang/vi.js +++ b/plugins/widget/lang/vi.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'vi', { - 'move': 'Nhấp chuột và kéo để di chuyển' + 'move': 'Nhấp chuột và kéo để di chuyển', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/zh-cn.js b/plugins/widget/lang/zh-cn.js index 45be1a7a444..334a5efa1c6 100644 --- a/plugins/widget/lang/zh-cn.js +++ b/plugins/widget/lang/zh-cn.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'zh-cn', { - 'move': '点击并拖拽以移动' + 'move': '点击并拖拽以移动', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/lang/zh.js b/plugins/widget/lang/zh.js index ab84e6dbe93..a511366ee4d 100644 --- a/plugins/widget/lang/zh.js +++ b/plugins/widget/lang/zh.js @@ -3,5 +3,6 @@ * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'widget', 'zh', { - 'move': '拖曳以移動' + 'move': '拖曳以移動', + 'label': '%1 widget' // MISSING } ); diff --git a/plugins/widget/plugin.js b/plugins/widget/plugin.js index a96fb0e3d39..8bc6ade7a29 100644 --- a/plugins/widget/plugin.js +++ b/plugins/widget/plugin.js @@ -3112,6 +3112,29 @@ } ); } + // Add a listener to data event that will set/change widget's label (#14539). + function setupA11yListener( widget ) { + // Note, the function gets executed in a context of widget instance. + function getLabelDefault() { + return this.editor.lang.widget.label.replace( /%1/, this.pathName || this.element.getName() ); + } + + // Setting a listener on data is enough, there's no need to perform it on widget initialization, as + // setupWidgetData fires this event anyway. + widget.on( 'data', function() { + // In some cases widget might get destroyed in an earlier data listener. For instance, image2 plugin, does + // so when changing its internal state. + if ( !widget.wrapper ) { + return; + } + + var label = this.getLabel ? this.getLabel() : getLabelDefault.call( this ); + + widget.wrapper.setAttribute( 'role', 'region' ); + widget.wrapper.setAttribute( 'aria-label', label ); + }, null, null, 9999 ); + } + function setupDragHandler( widget ) { if ( !widget.draggable ) return; @@ -3139,7 +3162,8 @@ src: CKEDITOR.tools.transparentImageData, width: DRAG_HANDLER_SIZE, title: editor.lang.widget.move, - height: DRAG_HANDLER_SIZE + height: DRAG_HANDLER_SIZE, + role: 'presentation' } ); widget.inline && img.setAttribute( 'draggable', 'true' ); @@ -3331,6 +3355,7 @@ setupMask( widget ); setupDragHandler( widget ); setupDataClassesListener( widget ); + setupA11yListener( widget ); // #11145: [IE8] Non-editable content of widget is draggable. if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) { @@ -3828,6 +3853,16 @@ * @property editables */ +/** + * The function used to obtain accessibility label for the widget. It might be used to make + * widgets label as precise as possible, since it has access to a widget instance. + * + * If not specified, the default implementation will use {@link #pathName} or main {@link #element} + * tag name. + * + * @property {Function} getLabel + */ + /** * Widget name displayed in elements path. * diff --git a/tests/plugins/widget/_helpers/tools.js b/tests/plugins/widget/_helpers/tools.js index e27de89c78e..72a6304db2e 100644 --- a/tests/plugins/widget/_helpers/tools.js +++ b/tests/plugins/widget/_helpers/tools.js @@ -373,6 +373,7 @@ var widgetTestsTools = ( function() { assertWidget: assertWidget, widgetInitedWrapperAttributes: + 'aria-label="[a-z]+ widget" ' + 'class="cke_widget_wrapper cke_widget_(?:inline|block)" ' + 'contenteditable="false" ' + '(?:data-cke-display-name="[a-z0-9]+" )?' + @@ -380,6 +381,7 @@ var widgetTestsTools = ( function() { 'data-cke-filter="off" ' + 'data-cke-widget-id="[0-9]+" ' + 'data-cke-widget-wrapper="1" ' + + 'role="region" ' + 'tabindex="-1"', widgetWrapperAttributes: 'class="cke_widget_wrapper cke_widget_new cke_widget_(?:inline|block)" ' + @@ -396,6 +398,7 @@ var widgetTestsTools = ( function() { 'data-cke-widget-drag-handler="1" ' + '(?:draggable="true" )?' + 'height="\\d+" ' + + 'role="presentation" ' + 'src="[^"]+" ' + 'title="[^"]+" ' + 'width="\\d+" ' + diff --git a/tests/plugins/widget/manual/arialabel.html b/tests/plugins/widget/manual/arialabel.html new file mode 100644 index 00000000000..7630dd36684 --- /dev/null +++ b/tests/plugins/widget/manual/arialabel.html @@ -0,0 +1,51 @@ + +
+

Element without classes: This is inner text

+

Element with 2 classes: This is inner text

+

This widget doesn't implement path: foo

+
+ + diff --git a/tests/plugins/widget/manual/arialabel.md b/tests/plugins/widget/manual/arialabel.md new file mode 100644 index 00000000000..6f87a93d2a1 --- /dev/null +++ b/tests/plugins/widget/manual/arialabel.md @@ -0,0 +1,32 @@ +@bender-tags: 4.5.10, tc, 14539, widget, accessibility +@bender-ui: collapsed +@bender-ckeditor-plugins: widget, wysiwygarea, toolbar, sourcearea, floatingspace, elementspath + +## Aria label for widgets + +You need to enable screen reader for this test. + +### Custom label (fake selection) + +1. Put the selection in the first line, like so: `Element without classes:^ This is inner text`. +1. Press `right arrow` key twice, so that widget becomes focused. + +**Expected:** Screen reader reads "selected: fancy widget". + +### Default label (fake selection) + +1. Put the selection in the last line, like so: `This widget doesn't implement path:^ foo`. +1. Press `right arrow` key twice, so that widget becomes focused. + +**Expected:** Screen reader reads "selected: em widget". + +### Label in standard selection + +1. Put the selection in the first line, like so: `^Element without classes: This is inner text`. +1. Press `up arrow` key, so that screen reader will read whole line. + + **Expected:** Screen reader reads "Element without classes: Fancy widget region". **However for JAWS**, due it's broken implementation it reads: "Element without classes: Group box Fancy widget, This is inner text". + + The reason for this is: + * Treads region role as a group box. + * Adds inner text at the end, so it's: "This is inner text". \ No newline at end of file