Ticket #7745: 7745_2.patch

File 7745_2.patch, 4.1 KB (added by Garry Yao, 12 years ago)

path compensate description with aria live region

  • _source/plugins/wysiwygarea/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    476476                        var fixForBody = ( editor.config.enterMode != CKEDITOR.ENTER_BR && editor.config.autoParagraph !== false )
    477477                                ? editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' : false;
    478478
    479                         var frameLabel = editor.lang.editorTitle.replace( '%1', editor.name );
     479                        // ARIA related markups.
     480                        var ariaLabel = editor.lang.editor,
     481                                ariaDesc = editor.lang.editorTitle.replace( '%1', editor.name ),
     482                                labelId = CKEDITOR.tools.getNextId();
    480483
     484                        var voiceRegionHtml = '<div role="region" ' +
     485                                                         'id="' + labelId + '" ' +
     486                                                         'style="width:0;height:0;"" ' +
     487                                                         'aria-relevant="text" ' +
     488                                                         'aria-live="assertive"></div>';
     489
     490                        // Speak out the specified text through the live region.
     491                        function updateVoiceRegion( text )
     492                        {
     493                                var labelEl = CKEDITOR.document.getById( labelId );
     494                                setTimeout( function() { labelEl.setText( text ); }, 0 );
     495                        }
     496
    481497                        var win = CKEDITOR.document.getWindow();
    482498                        var contentDomReadyHandler;
    483499                        editor.on( 'editingBlockReady', function()
     
    523539                                                iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' +
    524540                                                        ' style="width:100%;height:100%"' +
    525541                                                        ' frameBorder="0"' +
    526                                                         ' title="' + frameLabel + '"' +
     542                                                        ' aria-label="'+ ariaLabel +'"' +
     543                                                        ' role="textbox"' +
    527544                                                        ' src="' + src + '"' +
    528545                                                        ' tabIndex="' + ( CKEDITOR.env.webkit? -1 : editor.tabIndex ) + '"' +
    529546                                                        ' allowTransparency="true"' +
     
    549566                                                if ( document.location.protocol == 'chrome:' )
    550567                                                        CKEDITOR.event.useCapture = false;
    551568
     569                                                mainElement.append( CKEDITOR.dom.element.createFromHtml( voiceRegionHtml ) );
    552570                                                mainElement.append( iframe );
    553571
    554572                                                // Webkit: iframe size doesn't auto fit well. (#7360)
     
    733751                                                                }
    734752
    735753                                                                editor.focusManager.focus();
     754
     755                                                                // IE doesn't accept any more description on iframe,
     756                                                                // we cheat it by sending via live region right
     757                                                                // after focus is received, so it should be spoken
     758                                                                // right after the presentation has completed.
     759                                                                updateVoiceRegion( ariaDesc );
    736760                                                        });
    737761
    738762                                                var keystrokeHandler = editor.keystrokeHandler;
     
    10071031                                                                                '<html dir="' + config.contentsLangDirection + '"' +
    10081032                                                                                        ' lang="' + ( config.contentsLanguage || editor.langCode ) + '">' +
    10091033                                                                                '<head>' +
    1010                                                                                         '<title>' + frameLabel + '</title>' +
     1034                                                                                        '<title></title>' +
    10111035                                                                                        baseTag +
    10121036                                                                                        headExtra +
    10131037                                                                                '</head>' +
     
    11421166                                        }, null, null, 1 );
    11431167                                });
    11441168
    1145                         var titleBackup;
    1146                         // Setting voice label as window title, backup the original one
    1147                         // and restore it before running into use.
    1148                         editor.on( 'contentDom', function()
     1169                        // [IE] JAWS will not recognize the aria label we used on the iframe
     1170                        // unless the frame window title string is used as the voice label,
     1171                        // backup the original one and restore it on output.
     1172                        CKEDITOR.env.ie && editor.on( 'contentDom', function()
    11491173                                {
    11501174                                        var title = editor.document.getElementsByTag( 'title' ).getItem( 0 );
    11511175                                        title.data( 'cke-title', editor.document.$.title );
    1152                                         editor.document.$.title = frameLabel;
     1176                                        editor.document.$.title = ariaLabel;
    11531177                                });
    11541178
    11551179                        editor.on( 'readOnly', function()
  • _source/lang/en.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    3131         * Screenreader titles. Please note that screenreaders are not always capable
    3232         * of reading non-English words. So be careful while translating it.
    3333         */
    34         editorTitle : 'Rich text editor, %1, press ALT 0 for help.',
     34        editorTitle : '%1, press ALT 0 for help.',
    3535
    3636        // ARIA descriptions.
    3737        toolbars        : 'Editor toolbars',
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy