Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6542)

Unified Diff: chrome/common/extensions/docs/examples/apps/calculator/app/view.js

Issue 11189028: Improve accessibility of Calculator default app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/docs/examples/apps/calculator/app/style.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/examples/apps/calculator/app/view.js
diff --git a/chrome/common/extensions/docs/examples/apps/calculator/app/view.js b/chrome/common/extensions/docs/examples/apps/calculator/app/view.js
index 375854efff9dc68ec598525f07954bd2c472da3d..a45169f4602f5dc2e0726f36a497f58691fc0917 100644
--- a/chrome/common/extensions/docs/examples/apps/calculator/app/view.js
+++ b/chrome/common/extensions/docs/examples/apps/calculator/app/view.js
@@ -88,9 +88,13 @@ View.prototype.updateDisplay_ = function(display, values, event) {
View.prototype.addEquation_ = function(display, values) {
// The order of the equation children below makes them stack correctly.
var equation = this.createDiv_(display, 'equation');
- equation.appendChild(this.createDiv_(display, 'operand'));
- equation.appendChild(this.createDiv_(display, 'operator'));
- equation.appendChild(this.createDiv_(display, 'accumulator'));
+ var operation = this.createDiv_(display, 'operation');
+ operation.appendChild(this.createSpan_(display, 'operator'));
+ operation.appendChild(this.createSpan_(display, 'operand'));
+ equation.appendChild(operation);
+ var accumulator = this.createDiv_(display, 'accumulator');
+ accumulator.setAttribute('aria-hidden', 'true');
+ equation.appendChild(accumulator);
this.updateEquation_(equation, values);
display.appendChild(equation).scrollIntoView();
}
@@ -125,3 +129,10 @@ View.prototype.createDiv_ = function(display, classes) {
div.setAttribute('class', classes);
return div;
}
+
+/** @private */
+View.prototype.createSpan_ = function(display, classes) {
+ var span = display.ownerDocument.createElement('span');
+ span.setAttribute('class', classes);
+ return span;
+}
« no previous file with comments | « chrome/common/extensions/docs/examples/apps/calculator/app/style.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698