-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(color-contrast): correctly calculate background color of text nod…
…es with different size than their container (#3703) * fix(color-contrast): correctly calculate background color of text nodes with different size than their container * undo file rename * fix test * remove export * test name * comment * undeprecate for this pr * tests * fix test * fix firefox test * fix bug * firefox... * firefox ci is annoying * fix test? * new lint * sigh... * :P * :P * works now? * Update lib/commons/color/get-background-color.js Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> * Update lib/commons/color/get-background-color.js Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> * Update lib/commons/math/get-intersection-rect.js Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> * Update lib/commons/math/get-intersection-rect.js Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> * Update lib/commons/math/get-intersection-rect.js Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> * changes * Update lib/commons/color/get-background-stack.js Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> * Update lib/commons/color/get-background-color.js Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> * Update lib/commons/dom/get-visible-text-rects.js Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> * changes * 🤖 Automated formatting fixes * suggestions * suggestions * rename Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> Co-authored-by: straker <straker@users.noreply.github.com>
- Loading branch information
1 parent
08e2d20
commit 123b83c
Showing
16 changed files
with
605 additions
and
187 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import memoize from '../../core/utils/memoize'; | ||
|
||
/** | ||
* Get all ancestor nodes (including the passed in node) that have overflow:hidden | ||
* @method getOverflowHiddenAncestors | ||
* @memberof axe.commons.dom | ||
* @param {VirtualNode} vNode | ||
* @returns {VirtualNode[]} | ||
*/ | ||
const getOverflowHiddenAncestors = memoize( | ||
function getOverflowHiddenAncestorsMemoized(vNode) { | ||
const ancestors = []; | ||
|
||
if (!vNode) { | ||
return ancestors; | ||
} | ||
|
||
const overflow = vNode.getComputedStylePropertyValue('overflow'); | ||
|
||
if (overflow === 'hidden') { | ||
ancestors.push(vNode); | ||
} | ||
|
||
return ancestors.concat(getOverflowHiddenAncestors(vNode.parent)); | ||
} | ||
); | ||
|
||
export default getOverflowHiddenAncestors; |
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
Oops, something went wrong.