Chrome 158 brings object-fit to embedded SVG documents

SVG files loaded with <object> or <embed> no longer have to stretch to fill their box. Here is what shipped, and what it means for SVG background art.

News3 min read
Glowing vector curves centered inside a dark frame with alignment guides
In short
  • Chrome 158 reached the stable channel on November 17, 2026. Edge 158 followed with release notes dated November 19.
  • object-fit and object-position now size and position SVG documents loaded with <object> and <embed>, the same way they work on <img>.
  • Before this, Chromium ignored both properties for embedded SVG and stretched the document viewport to fill the whole content box.
158Chrome and Edge version
7New media pseudo-classes in the same release
204Security fixes in Chrome 158

Google promoted Chrome 158 to the stable channel on November 17, 2026. Among its CSS changes is a small one with a direct effect on decorative SVG: object-fit and object-position now apply to SVG documents embedded with <object> and <embed>. The change is listed in the Chrome Platform Status release notes and in the Microsoft Edge 158 web platform notes.

If your site uses embedded SVG for hero art, dividers or pattern panels, this is worth a quick review after the update. Product teams that hire front end developers through partners such as YuSMP Group can fold a check like this into their regular browser-release pass, next to visual regression tests.

What changed in Chrome 158?

An SVG file loaded with <object> or <embed> is a separate document with its own viewport. Until now, Chromium ignored object-fit and object-position for that case. The SVG viewport was always stretched to cover the entire content box of the element.

From version 158, the SVG document is sized and positioned inside the element's content box by those two properties, exactly like the image inside an <img>. Microsoft documents the same behavior for Edge 158, which is built on Chromium.

Other CSS features in the same release

The release also ships other CSS features, reported by GIGAZINE and the vendor notes:

  • ::highlight(*), a universal selector for all custom highlights, with zero specificity.
  • Seven media pseudo-classes for <video> and <audio>: :playing, :paused, :seeking, :buffering, :stalled, :muted and :volume-locked.
  • flow-start and flow-end alignment keywords, as aliases of flex-start and flex-end.
  • A side attribute on SVG <textPath>.

Security fixes

On the security side, SecurityWeek counted 204 fixes in the release, six of them rated critical, in builds 158.0.8127.36 and .37.

Why does it matter for SVG background art?

Most SVG backgrounds go in through CSS background-image or a plain <img>. Both already had full sizing control. The <object> route is the odd one out, and people pick it for a reason: the SVG stays a live document. Its internal CSS animations run, it can use its own stylesheet, and scripts inside it can work.

That made it a good fit for animated hero art and wavy dividers, but a poor fit for responsive layouts. A wide 16:9 drawing in a tall mobile box either stretched or letterboxed, depending on the SVG's preserveAspectRatio, and CSS on the page could not change that. Now the page can decide.

How do you use object-fit on an embedded SVG hero?

Here is a full-bleed animated background, cropped like a photo and anchored near the top:

<div class="hero">
  <object class="hero-art" data="/art/waves.svg"
          type="image/svg+xml" aria-hidden="true" tabindex="-1"></object>
  <h1>Your headline</h1>
</div>

.hero { position: relative; min-height: 70vh; overflow: hidden; }
.hero-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;          /* crop instead of stretch */
  object-position: 50% 20%;   /* keep the top of the art in view */
  pointer-events: none;
}

Three details keep it clean:

  1. Mark decorative art with aria-hidden="true" so screen readers skip it.
  2. Keep a viewBox in the SVG file. It still defines the drawing's own coordinates.
  3. Check text contrast on every crop. A cover crop on a narrow screen can move a bright part of the art right behind the headline.

What about browsers without support?

The vendor notes cover Chromium-based browsers only. In a browser that has not shipped the change, the code above still renders: the viewport stretches to the box and the SVG's own preserveAspectRatio decides the fit. Set it to xMidYMin slice inside the file and you get a similar cover crop on both paths.

If the art does not need scripts or internal animation, you do not need <object> at all. A CSS background with background-size: cover or an <img> with object-fit works everywhere today. Our guides to SVG pattern backgrounds and responsive background images cover both. For a ready-made shape to test with, try the abstract blue background with wavy lines.

Questions about object-fit and embedded SVG

Does this change affect SVG used as a CSS background-image?

No. The change covers SVG documents loaded through the object and embed elements. SVG in background-image is sized with background-size and background-position, as before.

Do I need object-fit if my SVG already has a viewBox?

Often not. The viewBox and preserveAspectRatio still control how the drawing fits inside its viewport. object-fit controls the viewport itself inside the element box, which matters when the box and the SVG have different proportions.

Keep reading

Built for the web.
Free to download.