Repository navigation
Combine/color contrast plus lighter stacking order - #322
Merged
sunny-se merged 10 commits intoNov 30, 2026
Merged
Conversation
flattenColors looked up blendFunctions[blendMode] without a guard and the map had no entry for plus-lighter. Any text over a plus-lighter layer threw "blendFunctions[blendMode] is not a function", which the color-contrast check caught as a check error: the node became incomplete and the whole scan was reported as PARTIAL_SUCCESS. plus-lighter is a Porter-Duff compositing operator, not a blend function, so it is composited directly: co = min(1, as * Cs + ab * Cb), ao = min(1, as + ab). Blend modes missing from the map (including inherited Object keys) now fall back to normal instead of throwing. Refs: AXE-4075 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mix-blend-mode that flattenColors cannot composite (e.g. Safari's plus-darker) fell back to normal and could produce a wrong pass/fail. getBackgroundColor now returns null for such a stacking context or page background, so the check reports incomplete with the default message instead of a verdict. The flattenColors fallback stays only as a no-throw safety net for the foreground path. Refs: AXE-4075 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Text inside a mix-blend-mode: plus-lighter layer is added to the backdrop behind that layer, so dark text renders as the backdrop colour. The foreground ignored the blend and could pass at ~11:1 where the rendered contrast is ~1.2:1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Translucent text first mixes with its own layer before plus-lighter adds it to the backdrop. That step is not modelled, so report the foreground as unknown (fgAlpha) instead of a possibly wrong pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Text shadows are compared (thin) or folded into the background (thick) as unblended colors, so inside a plus-lighter layer they could pass text that renders white on white. Report complexTextShadows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The foreground backdrop flattened earlier sibling layers as normal, so a plus-lighter sibling under the text was treated as opaque paint and could pass dark text that renders ~#bbb on #ccc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stackingContextToColor multiplied opacity into the cached leaf colour, so the foreground pass applied it a second time. It also applied the first descendant's blend mode to the aggregate, which for plus-lighter adds the whole stack to the parent (#808080 became white). Copy the leaf colour, and composite plus-lighter descendants in paint order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Positioned elements with z-index auto were sorted above non-positioned stacking contexts, and a real stacking context such as position fixed was treated as a pseudo stack when building the stacking order. A stacking context nested inside positioned containers could therefore be sorted below its own ancestors, and color-contrast measured the text against whatever was painted underneath. Track whether each stack is real or pseudo, cut the order at the first pseudo stack, and sort positioned elements and stacking contexts in the same layer, as CSS 2 paint order step 8 does. Backport of the upstream axe-core 4.13.0 fix, with its tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r' into combine/color-contrast-plus-lighter-stacking-order
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<< Describe the changes >>
Closes: