From d7485cf10bdcbafe405ed08396121f2eb6d9a395 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Tue, 3 Nov 2015 15:49:27 +0000 Subject: [PATCH] WP oEmbed: Improve the Sharing dialog accessibility. Improves ARIA attributes, focus handling, and constrains tabbing within the modal dialog. Fixes #34484. Built from https://develop.svn.wordpress.org/trunk@35492 git-svn-id: http://core.svn.wordpress.org/trunk@35456 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/embed-functions.php | 2 +- wp-includes/embed-template.php | 25 ++++++++++++------------ wp-includes/js/wp-embed-template.js | 26 +++++++++++++++++++------ wp-includes/js/wp-embed-template.min.js | 2 +- wp-includes/version.php | 2 +- 5 files changed, 35 insertions(+), 22 deletions(-) diff --git a/wp-includes/embed-functions.php b/wp-includes/embed-functions.php index eccec922a8..cfc8693c07 100644 --- a/wp-includes/embed-functions.php +++ b/wp-includes/embed-functions.php @@ -938,7 +938,7 @@ function print_embed_scripts() { * and edit wp-embed-template.js directly. */ ?> - !function(a,b){"use strict";function c(b,c){a.parent.postMessage({message:b,value:c,secret:g},"*")}function d(){function d(){k.className=k.className.replace("hidden",""),n[0].select()}function e(){k.className+=" hidden",b.querySelector(".wp-embed-share-dialog-open").focus()}function f(a){var c=b.querySelector('.wp-embed-share-tab-button [aria-selected="true"]');c.setAttribute("aria-selected","false"),b.querySelector("#"+c.getAttribute("aria-controls")).setAttribute("aria-hidden","true"),a.target.setAttribute("aria-selected","true"),b.querySelector("#"+a.target.getAttribute("aria-controls")).setAttribute("aria-hidden","false")}function g(a){var c,d,e=a.target,f=e.parentElement.previousElementSibling,g=e.parentElement.nextElementSibling;if(37===a.keyCode)c=f;else{if(39!==a.keyCode)return!1;c=g}"rtl"===b.documentElement.getAttribute("dir")&&(c=c===f?g:f),c&&(d=c.firstElementChild,e.setAttribute("tabindex","-1"),e.setAttribute("aria-selected",!1),b.querySelector("#"+e.getAttribute("aria-controls")).setAttribute("aria-hidden","true"),d.setAttribute("tabindex","0"),d.setAttribute("aria-selected","true"),d.focus(),b.querySelector("#"+d.getAttribute("aria-controls")).setAttribute("aria-hidden","false"))}function h(a){var b,d=a.target;b=d.hasAttribute("href")?d.getAttribute("href"):d.parentElement.getAttribute("href"),c("link",b),a.preventDefault()}if(!i){i=!0;var j,k=b.querySelector(".wp-embed-share-dialog"),l=b.querySelector(".wp-embed-share-dialog-open"),m=b.querySelector(".wp-embed-share-dialog-close"),n=b.querySelectorAll(".wp-embed-share-input"),o=b.querySelectorAll(".wp-embed-share-tab-button button"),p=b.getElementsByTagName("a");if(n)for(j=0;j diff --git a/wp-includes/embed-template.php b/wp-includes/embed-template.php index 5af9cb6e30..ce33832b36 100644 --- a/wp-includes/embed-template.php +++ b/wp-includes/embed-template.php @@ -158,35 +158,34 @@ if ( have_posts() ) :
-
-