← Chrome 159 reference · All APIs

v159 · css · enabled by default

Background layer count independence

The computed values of coordinating background-* longhand properties (such as background-position, background-size, background-repeat, background-origin, background-clip, and background-attachment) now keep the exact number of comma-separated values specified by the author instead of repeating or truncating them to match the background-image layer count. Truncation and cyclic repetition apply strictly at used-value time during painting, aligning Chromium with CSS Values and Units Level 4 Appendix A, Firefox, and Safari Technology Preview.

Limited availability — computed-value layer-count independence is newly converging across engines (base background is Baseline Widely available)

  • Chrome · 159 (desktop, Android, WebView, iOS)
  • Edge · Chromium-based (inherits 159; no BCD subfeature yet)
  • Firefox · Already matches spec
  • Safari · Shipped in Safari Technology Preview 246 (stable version unconfirmed)

The umbrella background web-feature is Baseline Widely available since 2018-01-29 per webstatus.dev, but BCD css/properties/background-position.json and css/properties/background-size.json do not yet track computed-value list-length independence as a subfeature (checked 2026-11-24). Firefox already implemented the specified behavior, WebKit shipped it in Safari Technology Preview 246, and Chromium catches up in Chrome 159.

at a glance

Shipped inChrome 159 (desktop, Android, WebView, iOS), enabled by default — filed under “Enabled by default” in the milestone=159 listing and confirmed in the ChromeStatus API record
Origin trial / flagNo origin trial, no user-facing chrome://flags toggle. Enabled by default via Blink runtime flag CSSBackgroundLayerCountIndependence (status: "stable" in runtime_enabled_features.json5; noted for removal in M161)
SpecificationCSS Values and Units Module Level 4 Appendix A — Coordinating List-Valued Properties; CSS Backgrounds and Borders Module Level 3 §2.1 Layering Multiple Background Images
CSSWG issuesw3c/csswg-drafts#12791 (2026-03-11 resolution confirming spec behavior and updating WPT); w3c/csswg-drafts#7164 (linked list-valued properties)
Intentsblink-dev Intent to Prototype; blink-dev Intent to Ship
Tracking bugissues.chromium.org/40855581
Web platform testscss/css-backgrounds/parsing (background-computed.html), background-position-interpolation.html, background-size-interpolation.html, and css/css-masking/parsing
ChromeStatus5144333908049920 — Background layer count independence

why it exists

Prior to Chrome 159, Chromium coupled the computed values of background-* longhand properties to the length of background-image: if an element had one background-image (or the initial value none) and three comma-separated background-position values, getComputedStyle(el).backgroundPosition truncated the list to one item; conversely, if background-image had three layers and background-repeat had one item, Blink expanded the computed list. That diverged from CSS Values 4 Appendix A and Firefox, broke inherited or dynamically toggled background-image layers (where a parent sets multi-layer positions/sizes independently), and broke repeatable-list interpolation in animations. On 2026-03-11 the CSS Working Group resolved in w3c/csswg-drafts#12791 to keep the spec’s computed-value independence rule and align WPT; Chrome 159 ships that catch-up.

Source: ChromeStatus motivation & interop notes (5144333908049920); w3c/csswg-drafts#12791 CSSWG resolution.

Syntax and computed-vs-used value contract

No new CSS properties or value grammars are added. Every coordinating background-* longhand continues to accept a comma-separated list (# multiplier in CSS Backgrounds 3), while background-image remains the coordinating list base property for used-value painting:

/* Coordinating list base property (determines painted layer count) */
background-image: <bg-image>#;

/* Coordinating list longhands (computed list length is preserved independently) */
background-attachment: <attachment>#;
background-clip: <visual-box>#; /* plus text / border-area where supported */
background-origin: <visual-box>#;
background-position: <bg-position>#;
background-position-x: [ center | [ [ left | right | x-start | x-end ]? <length-percentage>? ]! ]#;
background-position-y: [ center | [ [ top | bottom | y-start | y-end ]? <length-percentage>? ]! ]#;
background-repeat: <repeat-style>#;
background-size: <bg-size>#;

/* Non-list background longhand (always a single color, painted behind all layers) */
background-color: <color>;

“If a coordinating list property has too many values specified, excess values at the end of its list are not used. If a coordinating list property has too few values specified, its value list is repeated to add more used values. The computed values of the coordinating list properties are not affected by such truncation or repetition.”

This contract has four developer-visible behaviors: computed-value list preservation across all coordinating background-* longhands, used-value layer coordination against background-image, background shorthand CSSOM serialization on mismatched list lengths, and repeatable-list animation interpolation.

Source: CSS Values and Units 4 Appendix A (normative quote fetched 2026-11-24); CSS Backgrounds 3 §2.1; WPT background-computed.html.

Computed-value list preservation across background-* longhands

Inputs. Any valid comma-separated list of 1, 2, 3, or N values declared on any coordinating background-* longhand, regardless of how many layers are declared on background-image (including when background-image is omitted and defaults to none, or has multiple none entries such as background-image: none, none, none).

Outputs. getComputedStyle(el) returns the exact number of list items specified on that longhand after normal per-item value computation (for example, converting 0.5em to pixels or keywords like center to 50%), with neither truncation nor cyclic repetition. background-color is not a list-valued property and always computes to a single resolved <color>; background-blend-mode (from CSS Compositing 1) already computes as specified.

Computed value of coordinating background-* longhands when background-image: none, none, none (3 layers) is set (from WPT background-computed.html)
Property & specified valueChrome < 159 (coupled)Chrome 159+ (independent)
background-attachment: local (1 item)Repeated to 3 items (local, local, local)local (1 item preserved)
background-clip: content-box, border-box (2 items)Repeated to 3 itemscontent-box, border-box (2 items preserved)
background-origin: content-box, border-box, padding-box, content-box (4 items)Truncated to 3 itemscontent-box, border-box, padding-box, content-box (4 items preserved)
background-position: 12px 13px, 50% 6px, 30px -10px, -7px 8px (4 items)Truncated to 3 itemsAll 4 pairs preserved verbatim
background-position-x: calc(10px - 0.5em), -20%, right, 15% (4 items, font-size: 40px)Truncated to 3 items-10px, -20%, 100%, 15% (4 items)
background-repeat: repeat-y, round no-repeat, repeat-x, repeat (4 items)Truncated to 3 itemsAll 4 items preserved
background-size: auto 1px, 2% 3%, contain, 7px 8px (4 items)Truncated to 3 itemsAll 4 items preserved
Source: WPT background-computed.html; CSS Values 4 Appendix A; WPT background-blend-mode-computed.html.

Used-value layer coordination during painting

Inputs & algorithm. Visual rendering is unchanged: CSS Backgrounds 3 §2.1 still determines the number of painted background layers solely from the number of comma-separated entries in background-image (where an entry of none still creates a layer slot). For each layer index k from 0 to L − 1 (where L is the length of background-image):

Outputs. Painted pixels are identical to pre-159 Chromium for any static combination of declarations; only computed-value inspection (getComputedStyle()), inheritance (via inherit), shorthand serialization, and list-length animation interpolation change.

Source: CSS Backgrounds 3 §2.1 Layering Multiple Background Images; CSS Values 4 Appendix A.

background shorthand CSSOM serialization

Inputs & outputs. Per CSS Values 4 Appendix A, the background shorthand represents each layer by combining corresponding items across all coordinating longhands. It can only serialize its longhands when every non-initial coordinating longhand has the same list length:

Note that WPT background-computed.html also tracks open issue w3c/csswg-drafts#418 regarding full computed-value serialization details for the background shorthand itself; reading individual longhands (such as getComputedStyle(el).backgroundSize) is deterministic and unaffected.

Source: CSS Values 4 Appendix A (shorthand serialization); WPT background-computed.html.

Repeatable-list interpolation in animations and transitions

Inputs & outputs. When CSS transitions or Web Animations interpolate background-position or background-size between two keyframes whose list lengths differ (for example, from with 2 items and to with 3 items), the engine repeats each endpoint list to the least common multiple of their lengths (LCM(2, 3) = 6 items) and interpolates item-by-item, regardless of how many layers background-image defines (even when background-image is none, i.e. 1 layer). Because Chrome 159 no longer truncates computed longhand lists to background-image’s length before interpolation, all 6 interpolated items are preserved in getComputedStyle() throughout the animation.

Lifecycle & dynamic updates. Because computed values are independent of background-image, dynamically adding or removing an image in background-image does not mutate the computed values of background-position, background-size, background-repeat, background-origin, background-clip, or background-attachment; only the used-value layer assembly recomputes during layout/paint. Children using background-position: inherit (or other longhand inherit) receive the parent’s full preserved list rather than a list truncated or repeated to the parent’s background-image count.

Source: WPT background-position-interpolation.html; WPT background-size-interpolation.html.

Errors, migration risks, and feature detection

CSS background longhands never throw JavaScript exceptions on mismatched layer counts, and invalid declarations are dropped at parse time per standard CSS error handling. However, existing scripts written against Chromium < 159 can break silently if they assumed getComputedStyle(el).backgroundPosition.split(",") always had the same length as background-image:

Source: ChromeStatus interop & compatibility notes (5144333908049920); CSS Values 4 Appendix A.

Context and exposure

Applies to all CSS stylesheets (document stylesheets, shadow DOM stylesheets, inline style attributes, CSS Typed OM, CSS transitions, and Web Animations) on any renderable element in any browsing context. Requires no secure context, no permission, no user activation, and no JavaScript API opt-in. Not applicable to Web Workers (no DOM styling).

Source: CSS Values 4 Appendix A; CSS Backgrounds 3 §2.1.

Examples

No interactive demo exists yet on the Chrome Platform Showcase for Chrome 159 (checked 2026-11-24).

Preserving computed longhand lists independently of background-image

<div id="card" class="layered"></div>

<style>
  .layered {
    /* 1 layer initially (or 3 layers once a class adds gradients) */
    background-image: none;
    background-position: 12px 13px, 50% 6px, 30px -10px;
    background-size: auto 1px, 2% 3%, contain, 7px 8px;
    background-repeat: no-repeat;
  }

  .layered.with-images {
    background-image:
      linear-gradient(90deg, #0b57d0, transparent),
      radial-gradient(circle, #e37400, transparent),
      linear-gradient(180deg, #137333, transparent);
  }
</style>

<script>
  const el = document.getElementById("card");
  const cs = getComputedStyle(el);

  // Chrome 159+, Firefox, Safari TP 246:
  // Preserves all 3 positions and all 4 sizes even while background-image is "none".
  console.log(cs.backgroundPosition); // "12px 13px, 50% 6px, 30px -10px"
  console.log(cs.backgroundSize);     // "auto 1px, 2% 3%, contain, 7px 8px"
  console.log(cs.backgroundRepeat);   // "no-repeat" (NOT repeated to 3 items)

  // Used-value painting when .with-images is added:
  // Layer 0 uses (12px 13px, auto 1px, no-repeat)
  // Layer 1 uses (50% 6px,   2% 3%,    no-repeat)
  // Layer 2 uses (30px -10px, contain, no-repeat)
  // The 4th background-size item (7px 8px) is unused at paint time but stays in computed style.
  el.classList.add("with-images");
</script>
Source: WPT background-computed.html; CSS Backgrounds 3 §2.1.

Shorthand empty-string serialization and feature detection

function supportsIndependentBackgroundLayerCount() {
  const probe = document.createElement("div");
  probe.style.backgroundImage = "none";
  probe.style.backgroundSize = "10px 10px, 20px 20px";
  document.body.append(probe);
  const independent = getComputedStyle(probe).backgroundSize.includes(",");
  probe.remove();
  return independent;
}

// Shorthand serialization when non-initial longhands have mismatched list lengths:
const box = document.createElement("div");
box.style.backgroundImage = "none, none";
box.style.backgroundPosition = "0px 0px, 10px 10px, 20px 20px";
// Per CSS Values 4 Appendix A, cannot serialize mismatched lengths into one shorthand list:
console.log(box.style.background); // ""
Source: CSS Values 4 Appendix A; WPT background-size-computed.html.

Mismatched-length background-position animation (LCM repetition)

const anim = document.getElementById("card").animate(
  [
    { backgroundPosition: "0px 0px, 80px 0px" },                 // 2 items
    { backgroundPosition: "40px 40px, 80px 80px, 0px 80px" }     // 3 items
  ],
  { duration: 1000, fill: "forwards" }
);

// Repeatable-list interpolation expands both lists to LCM(2, 3) = 6 items,
// even when background-image has only 1 layer ("none"):
// At 50%: "20px 20px, 80px 40px, 0px 40px, 60px 20px, 40px 40px, 40px 40px"
Source: WPT background-position-interpolation.html; WPT background-size-interpolation.html.

Browser compatibility

Support for computed-value layer-count independence across coordinating background-* longhands. BCD has no dedicated subfeature yet; status below comes from ChromeStatus, CSSWG #12791, WebKit bug 315771, Safari TP 246 notes, and BCD base property data (checked 2026-11-24).
BrowserLayer-count independenceEvidence / notesBase background-* (BCD)
Chrome (desktop, Android, WebView, iOS)159Enabled by default via CSSBackgroundLayerCountIndependence per ChromeStatus API record and runtime_enabled_features.json5Chrome 1 / Android 18
EdgeUnknown
(Chromium 159)
Chromium-based; inherits Chromium 159 behavior once Edge 159 ships (no separate BCD subfeature)12
FirefoxShippedAlready implemented per spec prior to Chrome 159; cited as the existing spec-compliant engine in w3c/csswg-drafts#12791 (exact first version unrecorded in BCD)1 (desktop) / 4 (Android)
SafariTP 246
(stable unknown)
Shipped in Safari Technology Preview 246 (WebKit bug 315771); stable Safari version not yet confirmed in BCD1 / iOS 1
Source: ChromeStatus API record (5144333908049920); BCD background-position.json; BCD background-size.json; webstatus.dev background.

Security and privacy

Preserving the author-declared list length on computed background-* longhands introduces no new storage, network fetch, permission, cross-origin disclosure, or user-fingerprinting surface: the exposed values are strictly the declarations already supplied by the document’s own stylesheets. ChromeStatus records no security risks and lists security/privacy reviews as Pending (checked 2026-11-24).

Source: ChromeStatus security_risks & review status (5144333908049920); CSS Values 4 Appendix A.

Specifications

see also