From 408e306ffc52a463fa258e135386a8ad86cffd5f Mon Sep 17 00:00:00 2001 From: Sean Lip Date: Thu, 28 Jul 2016 17:47:43 -0700 Subject: [PATCH] Update aria labels. In the process, refactor lists to comply with HTML5 spec to avoid ChromeVox getting confused about how many elements are in a list. --- accessible/app.component.js | 2 +- accessible/field.component.js | 47 +++++++++++--------------- accessible/messages.js | 1 + accessible/toolbox-tree.component.js | 46 +++++++++++-------------- accessible/tree.service.js | 13 +++---- accessible/utils.service.js | 9 ++--- accessible/workspace-tree.component.js | 30 +++++++++------- media/accessible.css | 5 ++- 8 files changed, 74 insertions(+), 79 deletions(-) diff --git a/accessible/app.component.js b/accessible/app.component.js index 9de1cc60a..b78b5977b 100644 --- a/accessible/app.component.js +++ b/accessible/app.component.js @@ -44,7 +44,7 @@ blocklyApp.AppView = ng.core - + diff --git a/accessible/field.component.js b/accessible/field.component.js index 5aa2a74ad..7b1719113 100644 --- a/accessible/field.component.js +++ b/accessible/field.component.js @@ -28,44 +28,37 @@ blocklyApp.FieldComponent = ng.core .Component({ selector: 'blockly-field', template: ` -
  • - -
  • -
  • - -
  • -
  • + + + + +
    1. + [attr.aria-labelledBy]="generateAriaLabelledByAttr(idMap[optionValue + 'Button'], 'blockly-button')">
    -
  • -
  • + + +
    // Checkboxes are not currently supported. -
  • -
  • - -
  • + + + `, - inputs: ['field', 'level', 'index', 'parentId', 'disabled'], + inputs: ['field', 'index', 'parentId', 'disabled'], pipes: [blocklyApp.TranslatePipe] }) .Class({ diff --git a/accessible/messages.js b/accessible/messages.js index e4ca99d5f..022de027b 100644 --- a/accessible/messages.js +++ b/accessible/messages.js @@ -58,6 +58,7 @@ Blockly.Msg.COPY_TO_MARKED_SPOT = 'copy to marked spot'; Blockly.Msg.TOOLBOX = 'Toolbox'; Blockly.Msg.WORKSPACE = 'Workspace'; Blockly.Msg.ANY = 'any'; +Blockly.Msg.FOR = 'for'; Blockly.Msg.STATEMENT = 'statement'; Blockly.Msg.VALUE = 'value'; Blockly.Msg.CUT_BLOCK_MSG = 'Cut block: '; diff --git a/accessible/toolbox-tree.component.js b/accessible/toolbox-tree.component.js index b0278a3c7..6bd889744 100644 --- a/accessible/toolbox-tree.component.js +++ b/accessible/toolbox-tree.component.js @@ -40,57 +40,51 @@ blocklyApp.ToolboxTreeComponent = ng.core [attr.aria-level]="level + 1">
      -
    1. -
    2. -
    3. -
    4. -
    5. -
    -
    - - + + -
    - + @@ -318,11 +325,10 @@ blocklyApp.WorkspaceTreeComponent = ng.core }); for (var i = 0; i < this.block.inputList.length; i++) { var inputBlock = this.block.inputList[i]; - if (inputBlock.connection && !inputBlock.connection.targetBlock()) { - that.idKeys.push( - 'inputList' + i, 'inputMenuLabel' + i, 'markSpot' + i, - 'markSpotButton' + i, 'paste' + i, 'pasteButton' + i); - } + that.idKeys.push( + 'inputList' + i, 'inputMenuLabel' + i, 'markSpot' + i, + 'markSpotButton' + i, 'paste' + i, 'pasteButton' + i, + 'listItem' + i); } }, ngDoCheck: function() { diff --git a/media/accessible.css b/media/accessible.css index 651c74328..5a68527ca 100644 --- a/media/accessible.css +++ b/media/accessible.css @@ -4,6 +4,9 @@ .blocklyTree .blocklyActiveDescendant > label, .blocklyTree .blocklyActiveDescendant > div > label, .blocklyActiveDescendant > button, -.blocklyActiveDescendant > input { +.blocklyActiveDescendant > input, +.blocklyActiveDescendant > blockly-field > label, +.blocklyActiveDescendant > blockly-field > input, +.blocklyActiveDescendant > blockly-field > div > label { outline: 2px dotted #00f; }