Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: options.js

Issue 29332808: Issue 2408 - Improved accessibility of checkboxes in options page (Closed)
Left Patch Set: Created Jan. 19, 2016, 3:10 p.m.
Right Patch Set: Reverted styles for Advanced tab Created Jan. 25, 2016, 6:02 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « options.html ('k') | skin/options.css » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 var table = E(this.details[i].id); 103 var table = E(this.details[i].id);
104 var element = table.childNodes[index]; 104 var element = table.childNodes[index];
105 105
106 // Element gets removed so make sure to handle focus appropriately 106 // Element gets removed so make sure to handle focus appropriately
107 var control = element.querySelector(".control"); 107 var control = element.querySelector(".control");
108 if (control && control == document.activeElement) 108 if (control && control == document.activeElement)
109 { 109 {
110 if (!focusNextElement(element.parentElement, control)) 110 if (!focusNextElement(element.parentElement, control))
111 { 111 {
112 // Fall back to next focusable element within same tab or dialog 112 // Fall back to next focusable element within same tab or dialog
113 var tab = element.parentElement; 113 var focusableElement = element.parentElement;
saroyanm 2016/01/25 14:45:43 Detail: This is not only tab already, so maybe mak
Thomas Greiner 2016/01/25 18:04:21 Done.
114 while (tab) 114 while (focusableElement)
saroyanm 2016/01/25 14:45:43 What if the dialog where the collection is impleme
Thomas Greiner 2016/01/25 18:04:21 The main challenge with focus management is that y
saroyanm 2016/01/26 18:40:12 Fare enough.
115 { 115 {
116 if (tab.classList.contains("tab-content") 116 if (focusableElement.classList.contains("tab-content")
117 || tab.classList.contains("dialog-content")) 117 || focusableElement.classList.contains("dialog-content"))
saroyanm 2016/01/25 14:45:43 I think we need to make it obvious whether it's so
Thomas Greiner 2016/01/25 18:04:21 We could put this into a separate function that's
118 break; 118 break;
119 119
120 tab = tab.parentElement; 120 focusableElement = focusableElement.parentElement;
121 } 121 }
122 focusNextElement(tab || document, control); 122 focusNextElement(focusableElement || document, control);
123 } 123 }
124 } 124 }
125 125
126 element.parentElement.removeChild(element); 126 element.parentElement.removeChild(element);
127 if (this.items.length == 0) 127 if (this.items.length == 0)
128 this._setEmpty(table, this.details[i].emptyText); 128 this._setEmpty(table, this.details[i].emptyText);
129 } 129 }
130 }; 130 };
131 131
132 Collection.prototype.updateItem = function(item) 132 Collection.prototype.updateItem = function(item)
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 filter: ["added", "loaded", "removed"] 867 filter: ["added", "loaded", "removed"]
868 }); 868 });
869 ext.backgroundPage.sendMessage( 869 ext.backgroundPage.sendMessage(
870 { 870 {
871 type: "subscriptions.listen", 871 type: "subscriptions.listen",
872 filter: ["added", "disabled", "homepage", "removed", "title"] 872 filter: ["added", "disabled", "homepage", "removed", "title"]
873 }); 873 });
874 874
875 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 875 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
876 })(); 876 })();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld