<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[46363] trunk/src: Accessibility: Media: Use the ARIA tabs pattern for the media modal menus.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/46363">46363</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/46363","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>afercia</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-09-30 19:36:42 +0000 (Mon, 30 Sep 2019)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Accessibility: Media: Use the ARIA tabs pattern for the media modal menus.
The ARIA tabs pattern improves interaction for keyboard and assistive technologies users.
It gives the menu items proper roles, and `aria-selected` allows users of assistive technologies to know which tab is currently selected.
Props audrasjb, afercia, joedolson, karmatosed, melchoyce.
See <a href="https://core.trac.wordpress.org/ticket/47149">#47149</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcjsmediaviewsfocusmanagerjs">trunk/src/js/media/views/focus-manager.js</a></li>
<li><a href="#trunksrcjsmediaviewsframepostjs">trunk/src/js/media/views/frame/post.js</a></li>
<li><a href="#trunksrcjsmediaviewsmediaframejs">trunk/src/js/media/views/media-frame.js</a></li>
<li><a href="#trunksrcjsmediaviewsmenuitemjs">trunk/src/js/media/views/menu-item.js</a></li>
<li><a href="#trunksrcjsmediaviewsmenujs">trunk/src/js/media/views/menu.js</a></li>
<li><a href="#trunksrcjsmediaviewsrouterjs">trunk/src/js/media/views/router.js</a></li>
<li><a href="#trunksrcwpincludescssmediaviewscss">trunk/src/wp-includes/css/media-views.css</a></li>
<li><a href="#trunksrcwpincludesmediatemplatephp">trunk/src/wp-includes/media-template.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcjsmediaviewsfocusmanagerjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/media/views/focus-manager.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/media/views/focus-manager.js 2019-09-30 19:19:06 UTC (rev 46362)
+++ trunk/src/js/media/views/focus-manager.js 2019-09-30 19:36:42 UTC (rev 46363)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,3 +1,5 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+var $ = jQuery;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * wp.media.view.FocusManager
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,10 +13,43 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.prototype */{
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> events: {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'keydown': 'constrainTabbing'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'keydown': 'focusManagementMode'
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Initializes the Focus Manager.
+ *
+ * @param {object} options The Focus Manager options.
+ *
+ * @since 5.3.0
+ *
+ * @return {void}
+ */
+ initialize: function( options ) {
+ this.mode = options.mode || 'constrainTabbing';
+ this.tabsAutomaticActivation = options.tabsAutomaticActivation || false;
+ },
+
+ /**
+ * Determines which focus management mode to use.
+ *
+ * @since 5.3.0
+ *
+ * @param {object} event jQuery event object.
+ *
+ * @returns {void}
+ */
+ focusManagementMode: function( event ) {
+ if ( this.mode === 'constrainTabbing' ) {
+ this.constrainTabbing( event );
+ }
+
+ if ( this.mode === 'tabsNavigation' ) {
+ this.tabsNavigation( event );
+ }
+ },
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Gets all the tabbable elements.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.3.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,9 +102,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Hides from assistive technologies all the body children except the
- * provided element and other elements that should not be hidden.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Hides from assistive technologies all the body children.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Sets an `aria-hidden="true"` attribute on all the body children except
+ * the provided element and other elements that should not be hidden.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * The reason why we use `aria-hidden` is that `aria-modal="true"` is buggy
</span><span class="cx" style="display: block; padding: 0 10px"> * in Safari 11.1 and support is spotty in other browsers. Also, `aria-modal="true"`
</span><span class="cx" style="display: block; padding: 0 10px"> * prevents the `wp.a11y.speak()` ARIA live regions to work as they're outside
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,7 +148,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Makes visible again to assistive technologies all body children
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Unhides from assistive technologies all the body children.
+ *
+ * Makes visible again to assistive technologies all the body children
</ins><span class="cx" style="display: block; padding: 0 10px"> * previously hidden and stored in this.ariaHiddenElements.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.2.3
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -165,7 +204,158 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.2.3
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ariaHiddenElements: []
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ariaHiddenElements: [],
+
+ /**
+ * Holds the jQuery collection of ARIA tabs.
+ *
+ * @since 5.3.0
+ */
+ tabs: $(),
+
+ /**
+ * Sets up tabs in an ARIA tabbed interface.
+ *
+ * @since 5.3.0
+ *
+ * @param {object} event jQuery event object.
+ *
+ * @returns {void}
+ */
+ setupAriaTabs: function() {
+ this.tabs = this.$( '[role="tab"]' );
+
+ // Set up initial attributes.
+ this.tabs.attr( {
+ 'aria-selected': 'false',
+ tabIndex: '-1'
+ } );
+
+ // Set up attributes on the initially active tab.
+ this.tabs.filter( '.active' )
+ .removeAttr( 'tabindex' )
+ .attr( 'aria-selected', 'true' );
+ },
+
+ /**
+ * Enables arrows navigation within the ARIA tabbed interface.
+ *
+ * @since 5.3.0
+ *
+ * @param {object} event jQuery event object.
+ *
+ * @returns {void}
+ */
+ tabsNavigation: function( event ) {
+ var orientation = 'horizontal',
+ keys = [ 32, 35, 36, 37, 38, 39, 40 ];
+
+ // Return if not Spacebar, End, Home, or Arrow keys.
+ if ( keys.indexOf( event.which ) === -1 ) {
+ return;
+ }
+
+ // Determine navigation direction.
+ if ( this.$el.attr( 'aria-orientation' ) === 'vertical' ) {
+ orientation = 'vertical';
+ }
+
+ // Make Up and Down arrow keys do nothing with horizontal tabs.
+ if ( orientation === 'horizontal' && [ 38, 40 ].indexOf( event.which ) !== -1 ) {
+ return;
+ }
+
+ // Make Left and Right arrow keys do nothing with vertical tabs.
+ if ( orientation === 'vertical' && [ 37, 39 ].indexOf( event.which ) !== -1 ) {
+ return;
+ }
+
+ this.switchTabs( event, this.tabs );
+ },
+
+ /**
+ * Switches tabs in the ARIA tabbed interface.
+ *
+ * @since 5.3.0
+ *
+ * @param {object} event jQuery event object.
+ *
+ * @returns {void}
+ */
+ switchTabs: function( event ) {
+ var key = event.which,
+ index = this.tabs.index( $( event.target ) ),
+ newIndex;
+
+ switch ( key ) {
+ // Space bar: Activate current targeted tab.
+ case 32: {
+ this.activateTab( this.tabs[ index ] );
+ break;
+ }
+ // End key: Activate last tab.
+ case 35: {
+ event.preventDefault();
+ this.activateTab( this.tabs[ this.tabs.length - 1 ] );
+ break;
+ }
+ // Home key: Activate first tab.
+ case 36: {
+ event.preventDefault();
+ this.activateTab( this.tabs[ 0 ] );
+ break;
+ }
+ // Left and up keys: Activate previous tab.
+ case 37:
+ case 38: {
+ event.preventDefault();
+ newIndex = ( index - 1 ) < 0 ? this.tabs.length - 1 : index - 1;
+ this.activateTab( this.tabs[ newIndex ] );
+ break;
+ }
+ // Right and down keys: Activate next tab.
+ case 39:
+ case 40: {
+ event.preventDefault();
+ newIndex = ( index + 1 ) === this.tabs.length ? 0 : index + 1;
+ this.activateTab( this.tabs[ newIndex ] );
+ break;
+ }
+ }
+ },
+
+ /**
+ * Sets a single tab to be focusable and semantically selected.
+ *
+ * @since 5.3.0
+ *
+ * @param {object} tab The tab DOM element.
+ *
+ * @returns {void}
+ */
+ activateTab: function( tab ) {
+ if ( ! tab ) {
+ return;
+ }
+
+ // The tab is a DOM element: no need for jQuery methods.
+ tab.focus();
+
+ // Handle automatic activation.
+ if ( this.tabsAutomaticActivation ) {
+ tab.removeAttribute( 'tabindex' );
+ tab.setAttribute( 'aria-selected', 'true' );
+ tab.click();
+
+ return;
+ }
+
+ // Handle manual activation.
+ $( tab ).on( 'click', function() {
+ tab.removeAttribute( 'tabindex' );
+ tab.setAttribute( 'aria-selected', 'true' );
+ } );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> module.exports = FocusManager;
</span></span></pre></div>
<a id="trunksrcjsmediaviewsframepostjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/media/views/frame/post.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/media/views/frame/post.js 2019-09-30 19:19:06 UTC (rev 46362)
+++ trunk/src/js/media/views/frame/post.js 2019-09-30 19:36:42 UTC (rev 46363)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -257,8 +257,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> mainMenu: function( view ) {
</span><span class="cx" style="display: block; padding: 0 10px"> view.set({
</span><span class="cx" style="display: block; padding: 0 10px"> 'library-separator': new wp.media.View({
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- className: 'separator',
- priority: 100
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ className: 'separator',
+ priority: 100,
+ attributes: {
+ role: 'presentation'
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> })
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span></span></pre></div>
<a id="trunksrcjsmediaviewsmediaframejs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/media/views/media-frame.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/media/views/media-frame.js 2019-09-30 19:19:06 UTC (rev 46362)
+++ trunk/src/js/media/views/media-frame.js 2019-09-30 19:36:42 UTC (rev 46363)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,7 +23,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> regions: ['menu','title','content','toolbar','router'],
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> events: {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'click div.media-frame-title h1': 'toggleMenu'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'click .media-frame-menu-toggle': 'toggleMenu'
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -75,14 +75,79 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.on( 'title:create:default', this.createTitle, this );
</span><span class="cx" style="display: block; padding: 0 10px"> this.title.mode('default');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.on( 'title:render', function( view ) {
- view.$el.append( '<span class="dashicons dashicons-arrow-down"></span>' );
- });
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Bind default menu.
</span><span class="cx" style="display: block; padding: 0 10px"> this.on( 'menu:create:default', this.createMenu, this );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Set the menu ARIA tab panel attributes when the modal opens.
+ this.on( 'open', this.setMenuTabPanelAriaAttributes, this );
+ // Set the router ARIA tab panel attributes when the modal opens.
+ this.on( 'open', this.setRouterTabPanelAriaAttributes, this );
+
+ // Update the menu ARIA tab panel attributes when the content updates.
+ this.on( 'content:render', this.setMenuTabPanelAriaAttributes, this );
+ // Update the router ARIA tab panel attributes when the content updates.
+ this.on( 'content:render', this.setRouterTabPanelAriaAttributes, this );
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Sets the attributes to be used on the menu ARIA tab panel.
+ *
+ * @since 5.3.0
+ *
+ * @returns {void}
+ */
+ setMenuTabPanelAriaAttributes: function() {
+ var stateId = this.state().get( 'id' ),
+ tabPanelEl = this.$el.find( '.media-frame-tab-panel' ),
+ ariaLabelledby;
+
+ tabPanelEl.removeAttr( 'role aria-labelledby tabindex' );
+
+ if ( this.menuView && this.menuView.isVisible ) {
+ ariaLabelledby = 'menu-item-' + stateId;
+
+ // Set the tab panel attributes only if the tabs are visible.
+ tabPanelEl
+ .attr( {
+ role: 'tabpanel',
+ 'aria-labelledby': ariaLabelledby,
+ tabIndex: '0'
+ } );
+ }
+ },
+
+ /**
+ * Sets the attributes to be used on the router ARIA tab panel.
+ *
+ * @since 5.3.0
+ *
+ * @returns {void}
+ */
+ setRouterTabPanelAriaAttributes: function() {
+ var tabPanelEl = this.$el.find( '.media-frame-content' ),
+ ariaLabelledby;
+
+ tabPanelEl.removeAttr( 'role aria-labelledby tabindex' );
+
+ // On the Embed view the router menu is hidden.
+ if ( 'embed' === this.content._mode ) {
+ return;
+ }
+
+ // Set the tab panel attributes only if the tabs are visible.
+ if ( this.routerView && this.routerView.isVisible && this.content._mode ) {
+ ariaLabelledby = 'menu-item-' + this.content._mode;
+
+ tabPanelEl
+ .attr( {
+ role: 'tabpanel',
+ 'aria-labelledby': ariaLabelledby,
+ tabIndex: '0'
+ } );
+ }
+ },
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * @returns {wp.media.view.MediaFrame} Returns itself to allow chaining
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> render: function() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,12 +176,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> createMenu: function( menu ) {
</span><span class="cx" style="display: block; padding: 0 10px"> menu.view = new wp.media.view.Menu({
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- controller: this
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ controller: this,
+
+ attributes: {
+ role: 'tablist',
+ 'aria-orientation': 'vertical'
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ this.menuView = menu.view;
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- toggleMenu: function() {
- this.$el.find( '.media-menu' ).toggleClass( 'visible' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ toggleMenu: function( event ) {
+ var menu = this.$el.find( '.media-menu' );
+
+ menu.toggleClass( 'visible' );
+ $( event.target ).attr( 'aria-expanded', menu.hasClass( 'visible' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,8 +209,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> createRouter: function( router ) {
</span><span class="cx" style="display: block; padding: 0 10px"> router.view = new wp.media.view.Router({
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- controller: this
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ controller: this,
+
+ attributes: {
+ role: 'tablist',
+ 'aria-orientation': 'horizontal'
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ this.routerView = router.view;
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} options
</span></span></pre></div>
<a id="trunksrcjsmediaviewsmenuitemjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/media/views/menu-item.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/media/views/menu-item.js 2019-09-30 19:19:06 UTC (rev 46362)
+++ trunk/src/js/media/views/menu-item.js 2019-09-30 19:36:42 UTC (rev 46363)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,26 +11,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @augments Backbone.View
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> MenuItem = wp.media.View.extend(/** @lends wp.media.view.MenuItem.prototype */{
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- tagName: 'a',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ tagName: 'button',
</ins><span class="cx" style="display: block; padding: 0 10px"> className: 'media-menu-item',
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> attributes: {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- href: '#'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ type: 'button',
+ role: 'tab'
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> events: {
</span><span class="cx" style="display: block; padding: 0 10px"> 'click': '_click'
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param {Object} event
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Allows to override the click event.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _click: function( event ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _click: function() {
</ins><span class="cx" style="display: block; padding: 0 10px"> var clickOverride = this.options.click;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( event ) {
- event.preventDefault();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> if ( clickOverride ) {
</span><span class="cx" style="display: block; padding: 0 10px"> clickOverride.call( this );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,14 +41,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( state ) {
</span><span class="cx" style="display: block; padding: 0 10px"> this.controller.setState( state );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Toggle the menu visibility in the responsive view.
</ins><span class="cx" style="display: block; padding: 0 10px"> this.views.parent.$el.removeClass( 'visible' ); // TODO: or hide on any click, see below
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {wp.media.view.MenuItem} returns itself to allow chaining
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> render: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var options = this.options;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var options = this.options,
+ menuProperty = options.state || options.contentMode;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( options.text ) {
</span><span class="cx" style="display: block; padding: 0 10px"> this.$el.text( options.text );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -58,6 +59,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.$el.html( options.html );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Set the menu item ID based on the frame state associated to the menu item.
+ this.$el.attr( 'id', 'menu-item-' + menuProperty );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return this;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span></span></pre></div>
<a id="trunksrcjsmediaviewsmenujs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/media/views/menu.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/media/views/menu.js 2019-09-30 19:19:06 UTC (rev 46362)
+++ trunk/src/js/media/views/menu.js 2019-09-30 19:36:42 UTC (rev 46363)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,15 +20,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ItemView: MenuItem,
</span><span class="cx" style="display: block; padding: 0 10px"> region: 'menu',
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* TODO: alternatively hide on any click anywhere
- events: {
- 'click': 'click'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ attributes: {
+ role: 'tablist',
+ 'aria-orientation': 'horizontal'
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- click: function() {
- this.$el.removeClass( 'visible' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ initialize: function() {
+ this._views = {};
+
+ this.set( _.extend( {}, this._views, this.options.views ), { silent: true });
+ delete this.options.views;
+
+ if ( ! this.options.silent ) {
+ this.render();
+ }
+
+ // Initialize the Focus Manager.
+ this.focusManager = new wp.media.view.FocusManager( {
+ el: this.el,
+ mode: 'tabsNavigation'
+ } );
+
+ // The menu is always rendered and can be visible or hidden on some frames.
+ this.isVisible = true;
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- */
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @param {Object} options
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -47,6 +62,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> PriorityList.prototype.ready.apply( this, arguments );
</span><span class="cx" style="display: block; padding: 0 10px"> this.visibility();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Set up aria tabs initial attributes.
+ this.focusManager.setupAriaTabs();
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> set: function() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,6 +90,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> hide = ! views || views.length < 2;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( this === view ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Flag this menu as hidden or visible.
+ this.isVisible = ! hide;
+ // Set or remove a CSS class to hide the menu.
</ins><span class="cx" style="display: block; padding: 0 10px"> this.controller.$el.toggleClass( 'hide-' + region, hide );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,6 +108,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.deselect();
</span><span class="cx" style="display: block; padding: 0 10px"> view.$el.addClass('active');
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Set up again the aria tabs initial attributes after the menu updates.
+ this.focusManager.setupAriaTabs();
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> deselect: function() {
</span></span></pre></div>
<a id="trunksrcjsmediaviewsrouterjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/media/views/router.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/media/views/router.js 2019-09-30 19:19:06 UTC (rev 46362)
+++ trunk/src/js/media/views/router.js 2019-09-30 19:36:42 UTC (rev 46363)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,6 +20,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ItemView: wp.media.view.RouterItem,
</span><span class="cx" style="display: block; padding: 0 10px"> region: 'router',
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ attributes: {
+ role: 'tablist',
+ 'aria-orientation': 'horizontal'
+ },
+
</ins><span class="cx" style="display: block; padding: 0 10px"> initialize: function() {
</span><span class="cx" style="display: block; padding: 0 10px"> this.controller.on( 'content:render', this.update, this );
</span><span class="cx" style="display: block; padding: 0 10px"> // Call 'initialize' directly on the parent class.
</span></span></pre></div>
<a id="trunksrcwpincludescssmediaviewscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/css/media-views.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/css/media-views.css 2019-09-30 19:19:06 UTC (rev 46362)
+++ trunk/src/wp-includes/css/media-views.css 2019-09-30 19:36:42 UTC (rev 46363)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -580,23 +580,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> user-select: none;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.media-menu > a {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-menu .media-menu-item {
</ins><span class="cx" style="display: block; padding: 0 10px"> display: block;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ box-sizing: border-box;
+ width: 100%;
</ins><span class="cx" style="display: block; padding: 0 10px"> position: relative;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border: 0;
+ margin: 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 8px 20px;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- margin: 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ font-size: 14px;
</ins><span class="cx" style="display: block; padding: 0 10px"> line-height: 1.28571428;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- font-size: 14px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background: transparent;
</ins><span class="cx" style="display: block; padding: 0 10px"> color: #0073aa;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ text-align: left;
</ins><span class="cx" style="display: block; padding: 0 10px"> text-decoration: none;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ cursor: pointer;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.media-menu > a:hover {
- color: #0073aa;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-menu .media-menu-item:hover {
</ins><span class="cx" style="display: block; padding: 0 10px"> background: rgba(0, 0, 0, 0.04);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.media-menu > a:active {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-menu .media-menu-item:active {
+ color: #0073aa;
</ins><span class="cx" style="display: block; padding: 0 10px"> outline: none;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -606,6 +612,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> font-weight: 600;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-menu .media-menu-item:focus {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+ color: #124964;
+ /* Only visible in Windows High Contrast mode */
+ outline: 1px solid transparent;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .media-menu .separator {
</span><span class="cx" style="display: block; padding: 0 10px"> height: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 12px 20px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -621,42 +636,48 @@
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0 6px;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> clear: both;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.media-router a {
- transition: none;
-}
-
-.media-router > a {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-router .media-menu-item {
</ins><span class="cx" style="display: block; padding: 0 10px"> position: relative;
</span><span class="cx" style="display: block; padding: 0 10px"> float: left;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border: 0;
+ margin: 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 8px 10px 9px;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- margin: 0;
</del><span class="cx" style="display: block; padding: 0 10px"> height: 18px;
</span><span class="cx" style="display: block; padding: 0 10px"> line-height: 1.28571428;
</span><span class="cx" style="display: block; padding: 0 10px"> font-size: 14px;
</span><span class="cx" style="display: block; padding: 0 10px"> text-decoration: none;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background: transparent;
+ cursor: pointer;
+ transition: none;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.media-router > a:last-child {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-router .media-menu-item:last-child {
</ins><span class="cx" style="display: block; padding: 0 10px"> border-right: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.media-router > a:active {
- outline: none;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-router .media-menu-item:hover,
+.media-router .media-menu-item:active {
+ color: #0073aa;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .media-router .active,
</span><span class="cx" style="display: block; padding: 0 10px"> .media-router .active:hover {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: #32373c;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: #23282d;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-router .media-menu-item:focus {
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, 0.8);
+ color: #124964;
+ /* Only visible in Windows High Contrast mode */
+ outline: 1px solid transparent;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .media-router .active,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.media-router > a.active:last-child {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.media-router .media-menu-item.active:last-child {
</ins><span class="cx" style="display: block; padding: 0 10px"> margin: -1px -1px 0;
</span><span class="cx" style="display: block; padding: 0 10px"> background: #fff;
</span><span class="cx" style="display: block; padding: 0 10px"> border: 1px solid #ddd;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -752,15 +773,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> display: none;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.media-frame.hide-router .media-frame-title {
- border-bottom: 1px solid #ddd;
- box-shadow: 0 4px 4px -4px rgba(0, 0, 0, 0.1);
-}
-
-.media-frame-title .dashicons {
- display: none;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> .media-frame-title h1 {
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0 16px;
</span><span class="cx" style="display: block; padding: 0 10px"> font-size: 22px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -768,6 +780,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.wp-core-ui .button.media-frame-menu-toggle {
+ display: none;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .media-frame-title .suggested-dimensions {
</span><span class="cx" style="display: block; padding: 0 10px"> font-size: 14px;
</span><span class="cx" style="display: block; padding: 0 10px"> float: right;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2251,9 +2267,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Responsive layout
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> @media only screen and (max-width: 900px) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .media-modal .media-frame-title {
+ height: 40px;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .media-modal .media-frame-title h1 {
+ line-height: 2.22222222;
+ font-size: 18px;
+ }
+
+ .media-modal-close {
+ width: 42px;
+ height: 42px;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Drop-down menu */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .media-frame:not(.hide-menu) .media-frame-title,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .media-frame .media-frame-title {
+ position: static;
+ padding: 0 44px;
+ text-align: center;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .media-frame:not(.hide-menu) .media-frame-router,
</span><span class="cx" style="display: block; padding: 0 10px"> .media-frame:not(.hide-menu) .media-frame-content,
</span><span class="cx" style="display: block; padding: 0 10px"> .media-frame:not(.hide-menu) .media-frame-toolbar {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2260,6 +2294,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> left: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .media-frame:not(.hide-menu) .media-frame-router {
+ /* 40 title + (40 - 6) menu toggle button + 6 spacing */
+ top: 80px;
+ }
+
+ .media-frame:not(.hide-menu) .media-frame-content {
+ /* 80 + room for the tabs */
+ top: 114px;
+ }
+
+ .media-frame.hide-router .media-frame-content {
+ top: 80px;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .media-frame:not(.hide-menu) .media-frame-menu {
</span><span class="cx" style="display: block; padding: 0 10px"> position: static;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2266,12 +2314,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .media-frame:not(.hide-menu) .media-menu {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ display: none;
</ins><span class="cx" style="display: block; padding: 0 10px"> width: auto;
</span><span class="cx" style="display: block; padding: 0 10px"> max-width: 80%;
</span><span class="cx" style="display: block; padding: 0 10px"> overflow: auto;
</span><span class="cx" style="display: block; padding: 0 10px"> z-index: 2000;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- top: 50px;
- left: -300px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ top: 75px;
+ left: 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> right: auto;
</span><span class="cx" style="display: block; padding: 0 10px"> bottom: auto;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 5px 0;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2279,7 +2328,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .media-frame:not(.hide-menu) .media-menu.visible {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- left: 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ display: block;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .media-frame:not(.hide-menu) .media-menu > a {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2287,29 +2336,32 @@
</span><span class="cx" style="display: block; padding: 0 10px"> font-size: 16px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .media-frame:not(.hide-menu) .media-menu > a.active {
- display: none;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> .media-frame:not(.hide-menu) .media-menu .separator {
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 5px 10px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .media-frame:not(.hide-menu) .media-frame-title {
- left: 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .wp-core-ui .media-frame:not(.hide-menu) .button.media-frame-menu-toggle {
+ display: inline-flex;
+ align-items: center;
+ vertical-align: top;
+ min-height: 40px;
+ margin: -6px 6px 0;
+ padding: 0 2px 0 12px;
+ font-size: 0.875rem;
+ font-weight: 600;
+ text-decoration: none;
+ background: transparent;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .media-frame:not(.hide-menu) .media-frame-title .dashicons {
- display: inline-block;
- line-height: 2.5;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .wp-core-ui .button.media-frame-menu-toggle:hover,
+ .wp-core-ui .button.media-frame-menu-toggle:active {
+ background: transparent;
+ transform: none;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .media-frame:not(.hide-menu) .media-frame-title h1 {
- color: #0073aa;
- line-height: 3;
- font-size: 18px;
- float: left;
- cursor: pointer;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .wp-core-ui .button.media-frame-menu-toggle:focus {
+ /* Only visible in Windows High Contrast mode */
+ outline: 1px solid transparent;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> /* End drop-down menu */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2561,31 +2613,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/* Landscape specific header override */
-@media screen and (max-height: 400px) {
- .media-menu,
- .media-frame:not(.hide-menu) .media-menu {
- top: 44px;
- }
-
- .media-frame-router {
- top: 44px;
- }
-
- .media-frame-content {
- top: 78px;
- }
-
- .attachments-browser .attachments {
- top: 40px;
- }
-
- /* Prevent unnecessary scrolling on title input */
- .embed-link-settings {
- overflow: visible;
- }
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> @media only screen and (min-width: 901px) and (max-height: 400px) {
</span><span class="cx" style="display: block; padding: 0 10px"> .media-menu,
</span><span class="cx" style="display: block; padding: 0 10px"> .media-frame:not(.hide-menu) .media-menu {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2595,38 +2622,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> @media only screen and (max-width: 480px) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .media-modal-close {
- top: -5px;
- }
-
- .media-modal .media-frame-title {
- height: 40px;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> .wp-core-ui.wp-customizer .media-button {
</span><span class="cx" style="display: block; padding: 0 10px"> margin-top: 13px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .media-modal .media-frame-title h1,
- .media-frame:not(.hide-menu) .media-frame-title h1 {
- font-size: 18px;
- line-height: 2.22222222;
- }
-
- .media-frame:not(.hide-menu) .media-frame-title .dashicons {
- line-height: 2;
- }
-
- .media-frame-router,
- .media-frame:not(.hide-menu) .media-menu {
- top: 40px;
- padding-top: 0;
- }
-
- .media-frame-content {
- top: 74px;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> .media-frame.hide-router .media-frame-content {
</span><span class="cx" style="display: block; padding: 0 10px"> top: 40px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesmediatemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/media-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/media-template.php 2019-09-30 19:19:06 UTC (rev 46362)
+++ trunk/src/wp-includes/media-template.php 2019-09-30 19:36:42 UTC (rev 46363)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -178,9 +178,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php // Template for the media frame: used both in the media grid and in the media modal. ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <script type="text/html" id="tmpl-media-frame">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="media-frame-title" id="media-frame-title"></div>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <button type="button" class="button button-link media-frame-menu-toggle" aria-expanded="false">
+ <?php _e( 'Media Types' ); ?>
+ <span class="dashicons dashicons-arrow-down" aria-hidden="true"></span>
+ </button>
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="media-frame-menu"></div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="media-frame-router"></div>
- <div class="media-frame-content"></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="media-frame-tab-panel">
+ <div class="media-frame-router"></div>
+ <div class="media-frame-content"></div>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="media-frame-toolbar"></div>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="media-frame-uploader"></div>
</span><span class="cx" style="display: block; padding: 0 10px"> </script>
</span></span></pre>
</div>
</div>
</body>
</html>