-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4277 from dequelabs/release-4.8.3
chore(release): 4.8.3
- Loading branch information
Showing
10 changed files
with
134 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "axe-core", | ||
"version": "4.8.2", | ||
"version": "4.8.3", | ||
"deprecated": true, | ||
"contributors": [ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Spelled incorrectly intentionally (backwards compatibility). | ||
export function pollyfillElementsFromPoint() { | ||
if (document.elementsFromPoint) return document.elementsFromPoint; | ||
if (document.msElementsFromPoint) return document.msElementsFromPoint; | ||
|
||
var usePointer = (function () { | ||
var element = document.createElement('x'); | ||
element.style.cssText = 'pointer-events:auto'; | ||
return element.style.pointerEvents === 'auto'; | ||
})(); | ||
|
||
var cssProp = usePointer ? 'pointer-events' : 'visibility'; | ||
var cssDisableVal = usePointer ? 'none' : 'hidden'; | ||
|
||
var style = document.createElement('style'); | ||
style.innerHTML = usePointer | ||
? '* { pointer-events: all }' | ||
: '* { visibility: visible }'; | ||
|
||
return function (x, y) { | ||
var current, i, d; | ||
var elements = []; | ||
var previousPointerEvents = []; | ||
|
||
// startup | ||
document.head.appendChild(style); | ||
|
||
while ( | ||
(current = document.elementFromPoint(x, y)) && | ||
elements.indexOf(current) === -1 | ||
) { | ||
// push the element and its current style | ||
elements.push(current); | ||
|
||
previousPointerEvents.push({ | ||
value: current.style.getPropertyValue(cssProp), | ||
priority: current.style.getPropertyPriority(cssProp) | ||
}); | ||
|
||
// add "pointer-events: none", to get to the underlying element | ||
current.style.setProperty(cssProp, cssDisableVal, 'important'); | ||
} | ||
|
||
// Due to negative index, documentElement could actually not be the last, | ||
// so we'll simply move it to the end | ||
if (elements.indexOf(document.documentElement) < elements.length - 1) { | ||
elements.splice(elements.indexOf(document.documentElement), 1); | ||
elements.push(document.documentElement); | ||
} | ||
|
||
// restore the previous pointer-events values | ||
for ( | ||
i = previousPointerEvents.length; | ||
!!(d = previousPointerEvents[--i]); | ||
|
||
) { | ||
elements[i].style.setProperty( | ||
cssProp, | ||
d.value ? d.value : '', | ||
d.priority | ||
); | ||
} | ||
|
||
// teardown; | ||
document.head.removeChild(style); | ||
|
||
return elements; | ||
}; | ||
} | ||
|
||
if (typeof window.addEventListener === 'function') { | ||
document.elementsFromPoint = pollyfillElementsFromPoint(); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters