Skip to content

Combine/color contrast plus lighter stacking order - #322

Merged
sunny-se merged 10 commits into
mainfrom
combine/color-contrast-plus-lighter-stacking-order
Nov 30, 2026
Merged

sunny-se merged 10 commits into
mainfrom
combine/color-contrast-plus-lighter-stacking-order

Conversation

@Aaryan430

Copy link
Copy Markdown
Collaborator

<< Describe the changes >>

Closes:

Shresth-Jain and others added 10 commits November 9, 2026 02:46
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
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto (fallback from Default branch)
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited), Workspace UI (inherited); Enforced overrides: Organization
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: ad053689-e526-46d5-94ea-714407fb2800

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@sunny-se
sunny-se merged commit 80fdfa4 into main Nov 30, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants