Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wordpress/dom

Package Overview
Dependencies
Maintainers
15
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/dom - npm Package Compare versions

Comparing version 2.12.0 to 2.13.0

15

build-module/focusable.js

@@ -33,2 +33,15 @@ /**

/**
* Returns true if the specified element should be skipped from focusable elements.
* For now it rather specific for `iframes` and if tabindex attribute is set to -1.
*
* @param {Element} element DOM element to test.
*
* @return {boolean} Whether element should be skipped from focusable elements.
*/
function skipFocus(element) {
return element.nodeName.toLowerCase() === 'iframe' && element.getAttribute('tabindex') === '-1';
}
/**
* Returns true if the specified area element is a valid focusable element, or

@@ -66,3 +79,3 @@ * false otherwise. Area is only focusable if within a map where a named map

return Array.from(elements).filter(function (element) {
if (!isVisible(element)) {
if (!isVisible(element) || skipFocus(element)) {
return false;

@@ -69,0 +82,0 @@ }

@@ -40,2 +40,15 @@ "use strict";

/**
* Returns true if the specified element should be skipped from focusable elements.
* For now it rather specific for `iframes` and if tabindex attribute is set to -1.
*
* @param {Element} element DOM element to test.
*
* @return {boolean} Whether element should be skipped from focusable elements.
*/
function skipFocus(element) {
return element.nodeName.toLowerCase() === 'iframe' && element.getAttribute('tabindex') === '-1';
}
/**
* Returns true if the specified area element is a valid focusable element, or

@@ -73,3 +86,3 @@ * false otherwise. Area is only focusable if within a map where a named map

return Array.from(elements).filter(function (element) {
if (!isVisible(element)) {
if (!isVisible(element) || skipFocus(element)) {
return false;

@@ -76,0 +89,0 @@ }

4

package.json
{
"name": "@wordpress/dom",
"version": "2.12.0",
"version": "2.13.0",
"description": "DOM utilities module for WordPress.",

@@ -33,3 +33,3 @@ "author": "The WordPress Contributors",

},
"gitHead": "8e06f0d212f89adba9099106497117819adefc5a"
"gitHead": "381a42b62e157d0e7fd6366cc51b0f5725990044"
}

@@ -51,2 +51,17 @@ /**

/**
* Returns true if the specified element should be skipped from focusable elements.
* For now it rather specific for `iframes` and if tabindex attribute is set to -1.
*
* @param {Element} element DOM element to test.
*
* @return {boolean} Whether element should be skipped from focusable elements.
*/
function skipFocus( element ) {
return (
element.nodeName.toLowerCase() === 'iframe' &&
element.getAttribute( 'tabindex' ) === '-1'
);
}
/**
* Returns true if the specified area element is a valid focusable element, or

@@ -81,3 +96,3 @@ * false otherwise. Area is only focusable if within a map where a named map

return Array.from( elements ).filter( ( element ) => {
if ( ! isVisible( element ) ) {
if ( ! isVisible( element ) || skipFocus( element ) ) {
return false;

@@ -84,0 +99,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc