<!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>[41329] trunk/src: Accessibility: Improve the color picker UI accessibility, interaction, and generated markup.</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 { 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/41329">41329</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/41329","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>2017-09-03 16:01:18 +0000 (Sun, 03 Sep 2017)</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: Improve the color picker UI accessibility, interaction, and generated markup.
- Refactors the UI controls around the Iris color picker to output valid and semantic markup
- Simplifies the way elements visibility gets toggled
- Properly associates the visually hidden label with the color input field
- Makes the toggle button a real button
- Adds `aria-expanded` to the toggle button
- Keeps focus on the toggle button instead of moving it to the color input field
- Adds `aria-label` attributes to give better context to some controls
- Removes a redundant title attribute
- Keeps the toggle button text to "Select Color" instead of changing it to "Current Color" when a color is selected
- Slightly improves the responsive view
- CSS clean-up
Fixes <a href="https://core.trac.wordpress.org/ticket/39662">#39662</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmincsscolorpickercss">trunk/src/wp-admin/css/color-picker.css</a></li>
<li><a href="#trunksrcwpadmincsscommoncss">trunk/src/wp-admin/css/common.css</a></li>
<li><a href="#trunksrcwpadmincsscustomizecontrolscss">trunk/src/wp-admin/css/customize-controls.css</a></li>
<li><a href="#trunksrcwpadminjscolorpickerjs">trunk/src/wp-admin/js/color-picker.js</a></li>
<li><a href="#trunksrcwpincludescustomizeclasswpcustomizecolorcontrolphp">trunk/src/wp-includes/customize/class-wp-customize-color-control.php</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmincsscolorpickercss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/color-picker.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/color-picker.css 2017-09-01 12:27:49 UTC (rev 41328)
+++ trunk/src/wp-admin/css/color-picker.css 2017-09-03 16:01:18 UTC (rev 41329)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,40 +6,23 @@
</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">-.wp-color-result {
- background-color: #f7f7f7;
- border: 1px solid #ccc;
- border-radius: 3px;
- cursor: pointer;
- display: inline-block;
- height: 22px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* Needs higher specificiity. */
+.wp-picker-container .wp-color-result.button {
+ height: 24px;
</ins><span class="cx" style="display: block; padding: 0 10px"> margin: 0 6px 6px 0px;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- position: relative;
- top: 1px;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- vertical-align: bottom;
- display: inline-block;
- padding-left: 30px;
- box-shadow: 0 1px 0 #ccc;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ padding: 0 0 0 30px;
+ font-size: 11px;
</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">-.wp-color-result:after {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.wp-color-result-text {
</ins><span class="cx" style="display: block; padding: 0 10px"> background: #f7f7f7;
</span><span class="cx" style="display: block; padding: 0 10px"> border-radius: 0 2px 2px 0;
</span><span class="cx" style="display: block; padding: 0 10px"> border-left: 1px solid #ccc;
</span><span class="cx" style="display: block; padding: 0 10px"> color: #555;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- content: attr( title );
</del><span class="cx" style="display: block; padding: 0 10px"> display: block;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- font-size: 11px;
</del><span class="cx" style="display: block; padding: 0 10px"> line-height: 22px;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0 6px;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- position: relative;
- right: 0;
</del><span class="cx" style="display: block; padding: 0 10px"> text-align: center;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- top: 0;
</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"> .wp-color-result:hover,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,17 +39,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> border-left: 1px solid #999;
</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">-.wp-color-result {
- top: 0;
-}
-
-.wp-color-result.wp-picker-open:after {
- content: attr( data-current );
-}
-
-.wp-picker-container, .wp-picker-container:active {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.wp-picker-containers {
</ins><span class="cx" style="display: block; padding: 0 10px"> display: inline-block;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- outline: 0;
</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"> .wp-color-result:focus {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,15 +48,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> box-shadow: 0 0 3px rgba( 0, 115, 170, .8 );
</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-color-result:active {
+ /* See Trac ticket #39662 */
+ transform: none !important;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .wp-picker-open + .wp-picker-input-wrap {
</span><span class="cx" style="display: block; padding: 0 10px"> display: inline-block;
</span><span class="cx" style="display: block; padding: 0 10px"> vertical-align: top;
</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">-.wp-picker-container .button {
- margin-left: 6px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.wp-picker-input-wrap label {
+ display: inline-block;
+ vertical-align: top;
</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">+/* For the old `custom-background` page, to override the inline-block and margins from `.form-table td fieldset label`. */
+.form-table .wp-picker-input-wrap label {
+ margin: 0 !important;
+}
+
+.wp-picker-input-wrap .button,
+.wp-customizer .wp-picker-input-wrap .button {
+ margin-left: 6px;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .wp-picker-container .iris-square-slider .ui-slider-handle:focus {
</span><span class="cx" style="display: block; padding: 0 10px"> background-color: #555
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,6 +89,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> font-family: monospace;
</span><span class="cx" style="display: block; padding: 0 10px"> line-height: 16px;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ vertical-align: top;
</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"> .wp-color-picker::-webkit-input-placeholder {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -127,9 +118,55 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 0 0 2px 1px rgba(30, 140, 190, .8);
</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">+.iris-picker .iris-palette:focus {
+ box-shadow:
+ inset 0 0 5px rgba(0,0,0,.4),
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, .8);
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> @media screen and ( max-width: 782px ) {
</span><span class="cx" style="display: block; padding: 0 10px"> .wp-picker-container input[type="text"].wp-color-picker {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- margin-right: 6px;
- padding: 3px 5px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ width: 80px;
+ padding: 6px 5px 5px;
+ font-size: 16px;
+ line-height: 18px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ .wp-customizer .wp-picker-container input[type="text"].wp-color-picker {
+ padding: 5px 5px 4px;
+ }
+
+ .wp-picker-container .wp-color-result.button {
+ height: auto;
+ padding: 0 0 0 40px;
+ font-size: 14px;
+ line-height: 29px;
+ }
+
+ .wp-customizer .wp-picker-container .wp-color-result.button {
+ font-size: 13px;
+ line-height: 26px;
+ }
+
+ .wp-picker-container .wp-color-result-text {
+ padding: 0 14px;
+ font-size: inherit;
+ line-height: inherit;
+ }
+
+ .wp-customizer .wp-picker-container .wp-color-result-text {
+ 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">+
+@media screen and ( max-width: 640px ) {
+ .wp-customizer .wp-picker-container .wp-color-result.button {
+ font-size: 14px;
+ line-height: 29px;
+ }
+
+ .wp-customizer .wp-picker-container input[type="text"].wp-color-picker {
+ padding: 6px 5px;
+ }
+}
</ins></span></pre></div>
<a id="trunksrcwpadmincsscommoncss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/common.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/common.css 2017-09-01 12:27:49 UTC (rev 41328)
+++ trunk/src/wp-admin/css/common.css 2017-09-03 16:01:18 UTC (rev 41329)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3578,17 +3578,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> white-space: nowrap;
</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">- .wp-color-result {
- height: auto;
- padding-left: 45px;
- }
-
- .wp-color-result:after {
- font-size: 14px;
- height: auto;
- padding: 6px 14px;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> /* Feedback Messages */
</span><span class="cx" style="display: block; padding: 0 10px"> .notice,
</span><span class="cx" style="display: block; padding: 0 10px"> .wrap div.updated,
</span></span></pre></div>
<a id="trunksrcwpadmincsscustomizecontrolscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/css/customize-controls.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/css/customize-controls.css 2017-09-01 12:27:49 UTC (rev 41328)
+++ trunk/src/wp-admin/css/customize-controls.css 2017-09-03 16:01:18 UTC (rev 41329)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -858,15 +858,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> max-width: 112px;
</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">-/* Color Picker */
-.customize-control-color .color-picker-hex {
- display: none;
-}
-
-.customize-control-color.open .color-picker-hex {
- display: block;
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> .customize-control-color .dropdown {
</span><span class="cx" style="display: block; padding: 0 10px"> margin-right: 5px;
</span><span class="cx" style="display: block; padding: 0 10px"> margin-bottom: 5px;
</span></span></pre></div>
<a id="trunksrcwpadminjscolorpickerjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/color-picker.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/color-picker.js 2017-09-01 12:27:49 UTC (rev 41328)
+++ trunk/src/wp-admin/js/color-picker.js 2017-09-03 16:01:18 UTC (rev 41329)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,11 +1,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* global wpColorPickerL10n */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-( function( $, undef ){
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+( function( $, undef ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> var ColorPicker,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _before = '<a tabindex="0" class="wp-color-result" />',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',
</ins><span class="cx" style="display: block; padding: 0 10px"> _after = '<div class="wp-picker-holder" />',
</span><span class="cx" style="display: block; padding: 0 10px"> _wrap = '<div class="wp-picker-container" />',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _button = '<input type="button" class="button button-small hidden" />';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _button = '<input type="button" class="button button-small" />',
+ _wrappingLabel = '<label></label>',
+ _wrappingLabelText = '<span class="screen-reader-text"></span>';
</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"> * @summary Creates a jQuery UI color picker.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -101,21 +103,68 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> self.initialValue = el.val();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Set up HTML structure and hide the color picker.
- el.addClass( 'wp-color-picker' ).hide().wrap( _wrap );
- self.wrap = el.parent();
- self.toggler = $( _before ).insertBefore( el ).css( { backgroundColor: self.initialValue } ).attr( 'title', wpColorPickerL10n.pick ).attr( 'data-current', wpColorPickerL10n.current );
- self.pickerContainer = $( _after ).insertAfter( el );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Add a CSS class to the input field.
+ el.addClass( 'wp-color-picker' );
+
+ /*
+ * Check if there's already a wrapping label, e.g. in the Customizer.
+ * If there's no label, add a default one to match the Customizer template.
+ */
+ if ( ! el.parent( 'label' ).length ) {
+ // Wrap the input field in the default label.
+ el.wrap( _wrappingLabel );
+ // Insert the default label text.
+ self.wrappingLabelText = $( _wrappingLabelText )
+ .insertBefore( el )
+ .text( wpColorPickerL10n.defaultLabel );
+ }
+
+ /*
+ * At this point, either it's the standalone version or the Customizer
+ * one, we have a wrapping label to use as hook in the DOM, let's store it.
+ */
+ self.wrappingLabel = el.parent();
+
+ // Wrap the label in the main wrapper.
+ self.wrappingLabel.wrap( _wrap );
+ // Store a reference to the main wrapper.
+ self.wrap = self.wrappingLabel.parent();
+ // Set up the toggle button and insert it before the wrapping label.
+ self.toggler = $( _before )
+ .insertBefore( self.wrappingLabel )
+ .css( { backgroundColor: self.initialValue } );
+ // Set the toggle button span element text.
+ self.toggler.find( '.wp-color-result-text' ).text( wpColorPickerL10n.pick );
+ // Set up the Iris container and insert it after the wrapping label.
+ self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
+ // Store a reference to the Clear/Default button.
</ins><span class="cx" style="display: block; padding: 0 10px"> self.button = $( _button );
</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 up the Clear/Default button.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( self.options.defaultColor ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.button
+ .addClass( 'wp-picker-default' )
+ .val( wpColorPickerL10n.defaultString )
+ .attr( 'aria-label', wpColorPickerL10n.defaultAriaLabel );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.button
+ .addClass( 'wp-picker-clear' )
+ .val( wpColorPickerL10n.clear )
+ .attr( 'aria-label', wpColorPickerL10n.clearAriaLabel );
</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">- el.wrap( '<span class="wp-picker-input-wrap" />' ).after( self.button );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Wrap the wrapping label in its wrapper and append the Clear/Default button.
+ self.wrappingLabel
+ .wrap( '<span class="wp-picker-input-wrap hidden" />' )
+ .after( self.button );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
+ * The input wrapper now contains the label+input+Clear/Default button.
+ * Store a reference to the input wrapper: we'll use this to toggle
+ * the controls visibility.
+ */
+ self.inputWrapper = el.closest( '.wp-picker-input-wrap' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> el.iris( {
</span><span class="cx" style="display: block; padding: 0 10px"> target: self.pickerContainer,
</span><span class="cx" style="display: block; padding: 0 10px"> hide: self.options.hide,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -216,25 +265,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">- * @summary Enables the user to open the color picker with their keyboard.
- *
- * Enables the user to open the color picker with their keyboard.
- * This is possible by using the space or enter key.
- *
- * @since 3.5.0
- *
- * @param {Event} event The event that's being called.
- *
- * @returns {void}
- */
- self.toggler.on( 'keyup', function( event ) {
- if ( event.keyCode === 13 || event.keyCode === 32 ) {
- event.preventDefault();
- self.toggler.trigger( 'click' ).next().focus();
- }
- });
-
- /**
</del><span class="cx" style="display: block; padding: 0 10px"> * @summary Enables the user to clear or revert the color in the color picker.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Enables the user to either clear the color in the color picker or revert back to the default color.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -266,10 +296,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {void}
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> open: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.element.show().iris( 'toggle' ).focus();
- this.button.removeClass( 'hidden' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.element.iris( 'toggle' );
+ this.inputWrapper.removeClass( 'hidden' );
</ins><span class="cx" style="display: block; padding: 0 10px"> this.wrap.addClass( 'wp-picker-active' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.toggler.addClass( 'wp-picker-open' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.toggler
+ .addClass( 'wp-picker-open' )
+ .attr( 'aria-expanded', 'true' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $( 'body' ).trigger( 'click.wpcolorpicker' ).on( 'click.wpcolorpicker', this.close );
</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">@@ -280,10 +312,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @returns {void}
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> close: function() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.element.hide().iris( 'toggle' );
- this.button.addClass( 'hidden' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.element.iris( 'toggle' );
+ this.inputWrapper.addClass( 'hidden' );
</ins><span class="cx" style="display: block; padding: 0 10px"> this.wrap.removeClass( 'wp-picker-active' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.toggler.removeClass( 'wp-picker-open' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.toggler
+ .removeClass( 'wp-picker-open' )
+ .attr( 'aria-expanded', 'false' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $( 'body' ).off( 'click.wpcolorpicker', this.close );
</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="trunksrcwpincludescustomizeclasswpcustomizecolorcontrolphp"></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/customize/class-wp-customize-color-control.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/customize/class-wp-customize-color-control.php 2017-09-01 12:27:49 UTC (rev 41328)
+++ trunk/src/wp-includes/customize/class-wp-customize-color-control.php 2017-09-03 16:01:18 UTC (rev 41329)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -99,21 +99,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> defaultValueAttr = ' data-default-color=' + defaultValue; // Quotes added automatically.
</span><span class="cx" style="display: block; padding: 0 10px"> } #>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <label>
- <# if ( data.label ) { #>
- <span class="customize-control-title">{{{ data.label }}}</span>
- <# } #>
- <# if ( data.description ) { #>
- <span class="description customize-control-description">{{{ data.description }}}</span>
- <# } #>
- <div class="customize-control-content">
- <# if ( isHueSlider ) { #>
- <input class="color-picker-hue" type="text" data-type="hue" />
- <# } else { #>
- <input class="color-picker-hex" type="text" maxlength="7" placeholder="{{ defaultValue }}" {{ defaultValueAttr }} />
- <# } #>
- </div>
- </label>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <# if ( data.label ) { #>
+ <span class="customize-control-title">{{{ data.label }}}</span>
+ <# } #>
+ <# if ( data.description ) { #>
+ <span class="description customize-control-description">{{{ data.description }}}</span>
+ <# } #>
+ <div class="customize-control-content">
+ <label><span class="screen-reader-text">{{{ data.label }}}</span>
+ <# if ( isHueSlider ) { #>
+ <input class="color-picker-hue" type="text" data-type="hue" />
+ <# } else { #>
+ <input class="color-picker-hex" type="text" maxlength="7" placeholder="{{ defaultValue }}" {{ defaultValueAttr }} />
+ <# } #>
+ </label>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php
</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="trunksrcwpincludesscriptloaderphp"></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/script-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/script-loader.php 2017-09-01 12:27:49 UTC (rev 41328)
+++ trunk/src/wp-includes/script-loader.php 2017-09-03 16:01:18 UTC (rev 41329)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -796,10 +796,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $scripts->add( 'iris', '/wp-admin/js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), '1.0.7', 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $scripts->add( 'wp-color-picker', "/wp-admin/js/color-picker$suffix.js", array( 'iris' ), false, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> did_action( 'init' ) && $scripts->localize( 'wp-color-picker', 'wpColorPickerL10n', array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'clear' => __( 'Clear' ),
- 'defaultString' => __( 'Default' ),
- 'pick' => __( 'Select Color' ),
- 'current' => __( 'Current Color' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'clear' => __( 'Clear' ),
+ 'clearAriaLabel' => __( 'Clear color' ),
+ 'defaultString' => __( 'Default' ),
+ 'defaultAriaLabel' => __( 'Select default color' ),
+ 'pick' => __( 'Select Color' ),
+ 'defaultLabel' => __( 'Color value' ),
</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"> $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox', 'wp-util', 'wp-a11y' ), false, 1 );
</span></span></pre>
</div>
</div>
</body>
</html>