|
13 | 13 | * See the License for the specific language governing permissions and |
14 | 14 | * limitations under the License. |
15 | 15 | * |
16 | | - * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/tree/55f83ba7d34402f43150e16d19c69b131894d2ae |
| 16 | + * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/tree/9da0231fc2c264712547d66438874c66269c98fa |
17 | 17 | * |
18 | 18 | * See project README for build steps. |
19 | 19 | */ |
@@ -620,16 +620,25 @@ axs.color.multiplyMatrixVector = function(a, b) { |
620 | 620 | axs.color.toYCbCr = function(a) { |
621 | 621 | var b = a.red / 255, c = a.green / 255; |
622 | 622 | a = a.blue / 255; |
623 | | - return new axs.color.YCbCr(axs.color.multiplyMatrixVector(axs.color.YCC_MATRIX, [.03928 >= b ? b / 12.92 : Math.pow((b + .055) / 1.055, 2.4), .03928 >= c ? c / 12.92 : Math.pow((c + .055) / 1.055, 2.4), .03928 >= a ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4)])); |
| 623 | + b = .03928 >= b ? b / 12.92 : Math.pow((b + .055) / 1.055, 2.4); |
| 624 | + c = .03928 >= c ? c / 12.92 : Math.pow((c + .055) / 1.055, 2.4); |
| 625 | + a = .03928 >= a ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4); |
| 626 | + return new axs.color.YCbCr(axs.color.multiplyMatrixVector(axs.color.YCC_MATRIX, [b, c, a])); |
624 | 627 | }; |
625 | 628 | axs.color.fromYCbCr = function(a) { |
626 | 629 | return axs.color.fromYCbCrArray([a.luma, a.Cb, a.Cr]); |
627 | 630 | }; |
628 | 631 | axs.color.fromYCbCrArray = function(a) { |
629 | | - var b = axs.color.multiplyMatrixVector(axs.color.INVERTED_YCC_MATRIX, a); |
630 | | - a = b[0]; |
631 | | - var c = b[1], b = b[2]; |
632 | | - return new axs.color.Color(Math.min(Math.max(Math.round(255 * (.00303949 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - .055)), 0), 255), Math.min(Math.max(Math.round(255 * (.00303949 >= c ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - .055)), 0), 255), Math.min(Math.max(Math.round(255 * (.00303949 >= b ? 12.92 * b : 1.055 * Math.pow(b, 1 / 2.4) - .055)), 0), 255), 1); |
| 632 | + var b = axs.color.multiplyMatrixVector(axs.color.INVERTED_YCC_MATRIX, a), c = b[0]; |
| 633 | + a = b[1]; |
| 634 | + b = b[2]; |
| 635 | + c = .00303949 >= c ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - .055; |
| 636 | + a = .00303949 >= a ? 12.92 * a : 1.055 * Math.pow(a, 1 / 2.4) - .055; |
| 637 | + b = .00303949 >= b ? 12.92 * b : 1.055 * Math.pow(b, 1 / 2.4) - .055; |
| 638 | + c = Math.min(Math.max(Math.round(255 * c), 0), 255); |
| 639 | + a = Math.min(Math.max(Math.round(255 * a), 0), 255); |
| 640 | + b = Math.min(Math.max(Math.round(255 * b), 0), 255); |
| 641 | + return new axs.color.Color(c, a, b, 1); |
633 | 642 | }; |
634 | 643 | axs.color.RGBToYCbCrMatrix = function(a, b) { |
635 | 644 | return [[a, 1 - a - b, b], [-a / (2 - 2 * b), (a + b - 1) / (2 - 2 * b), (1 - b) / (2 - 2 * b)], [(1 - a) / (2 - 2 * a), (a + b - 1) / (2 - 2 * a), -b / (2 - 2 * a)]]; |
@@ -2018,7 +2027,7 @@ axs.AuditRules.addRule({name:"imagesWithoutAltText", heading:"Images should have |
2018 | 2027 | return 0 == Object.keys(b).length ? !0 : !1; |
2019 | 2028 | }, code:"AX_TEXT_02"}); |
2020 | 2029 | axs.AuditRules.addRule({name:"linkWithUnclearPurpose", heading:"The purpose of each link should be clear from the link text", url:"https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_text_04", severity:axs.constants.Severity.WARNING, relevantElementMatcher:function(a) { |
2021 | | - return axs.browserUtils.matchSelector(a, "a") && !axs.utils.isElementOrAncestorHidden(a); |
| 2030 | + return axs.browserUtils.matchSelector(a, "a[href]") && !axs.utils.isElementOrAncestorHidden(a); |
2022 | 2031 | }, test:function(a, b) { |
2023 | 2032 | for (var c = b || {}, d = c.blacklistPhrases || [], e = /\s+/, f = 0;f < d.length;f++) { |
2024 | 2033 | var g = "^\\s*" + d[f].trim().replace(e, "\\s*") + "s*[^a-z]$"; |
|
0 commit comments