Index: wp-content/themes/twentythirteen/js/functions.js
===================================================================
--- wp-content/themes/twentythirteen/js/functions.js	(revision 31769)
+++ wp-content/themes/twentythirteen/js/functions.js	(working copy)
@@ -6,8 +6,14 @@
 
 ( function( $ ) {
 	var body    = $( 'body' ),
-	    _window = $( window );
+	    _window = $( window ),
+		nav, button, menu, tertiary;
 
+	nav = $( '#site-navigation' );
+	button = nav.find( '.menu-toggle' );
+	menu = nav.find( '.nav-menu' );
+	tertiary = $( '#tertiary' );
+
 	/**
 	 * Adds a top margin to the footer if the sidebar widget area is higher
 	 * than the rest of the page, to help the footer always visually clear
@@ -29,18 +35,11 @@
 	 * Enables menu toggle for small screens.
 	 */
 	( function() {
-		var nav = $( '#site-navigation' ), button, menu;
-		if ( ! nav ) {
+		if ( ! nav || ! button ) {
 			return;
 		}
 
-		button = nav.find( '.menu-toggle' );
-		if ( ! button ) {
-			return;
-		}
-
 		// Hide button if menu is missing or empty.
-		menu = nav.find( '.nav-menu' );
 		if ( ! menu || ! menu.children().length ) {
 			button.hide();
 			return;
@@ -69,6 +68,25 @@
 		} );
 	} )();
 
+	// Add or remove ARIA attributes.
+	function onResizeARIA() {
+		if ( 643 > _window.width() ) {
+			button.attr( 'aria-expanded', 'false' );
+			tertiary.attr( 'aria-expanded', 'false' );
+			button.attr( 'aria-controls', 'secondary' );
+		} else {
+			button.removeAttr( 'aria-expanded' );
+			tertiary.removeAttr( 'aria-expanded' );
+			button.removeAttr( 'aria-controls' );
+		}
+	}
+
+	_window
+		.on( 'load.twentythirteen', onResizeARIA )
+		.on( 'resize.twentythirteen', function() {
+			onResizeARIA();
+	} );
+
 	/**
 	 * Makes "skip to content" link work correctly in IE9 and Chrome for better
 	 * accessibility.
