Stacking-order z-index: 0 bug causes color-contrast to misidentify background #4542
Labels
color contrast
Color contrast issues
fix
Bug fixes
rules
Issue or false result from an axe-core rule
Milestone
There's a bug in our getStackLevel code where we treat a declared
z-index: 0
as having a stacking context but not a z-index.For example, the correct stack order of the following code should be
[#parent, #child, body, html]
but instead it comes out to[#parent, body, html, #child]
Instead we need to allow
z-index: 0
to be treated as a validz-index
value and allow the stacking level to equal 0. However doing so creates another problem though as we made theROOT_LEVEL
z-index equal 0 and then remove root level elements when we encounter a real stack (a positioned stacking context that declares a non-auto z-index).We'll also need to update our
visuallySort
function as it treats the -1 z-index of a child context as being higher in the visual stack than the parent element, when in reality the parent should be on top.The text was updated successfully, but these errors were encountered: