CSS Sub Grid and Container Queries crashing Chrome

Tested using version 129.0.6668.59 of Chrome for Windows. Chrome seems to crash every time I try to use subgrid and container queries together.

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.comparison-item {
  container-type: inline-size;
  display: grid;
  grid-template-rows: subgrid;
}

button {
  @container (min-width: 460px) {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
  }
}
<div class="comparison-grid">
  <div class="comparison-item ">
    <p>Item number 1</p>
    <button>test</button>
  </div>
  <div class="comparison-item">
    <p>Item number 2</p>
    <button>test</button>
  </div>
</div>

The Error Message

2

Based on below observations and workarounds, I’m guessing the bug is due to subgrid trying to control the layout within a inline-size/size container and the container is not letting it, which then crashes the rendering program. Interestingly if we just set the containment of the container to inline-size without making it a inline-size query container it won’t crash the page, so there must be something else going on causing this problem when making an element a query container. Hence, it might be better to report an issue with Chromium instead of hacking the CSS.


In older Chrome versions such as Chrome 128, though not crashing, the layout within the container simply won’t be affected by the subgrid.

Following this observation, in Chrome 129.0.6668.59 (64bit), you can see that if you add a layout containment via contain, it will behave like older versions that the subgrid won’t be laying out the child elements within it, and the program won’t crash anymore.

One interesting thing is that if you remove layout after the size is calculated via JS, both the reflowed result and the container will behave as expected while not crashing the page.

Note that this is not intended to be a solution but to demonstrate my observation. If you really need to acheive the same result you proably should consider other layout modules or combining some JS.

window.addEventListener("load", function() {
  var list = document.querySelectorAll(".comparison-item");
  for (let el of list) {
    el.style.setProperty('contain', 'inline-size');
  }
});
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}

.comparison-item {
  grid-row: span 3;
  container-type: inline-size;
  contain: inline-size layout;
  display: grid;
  grid-template-rows: subgrid;
  .span-two {
    grid-row: span 2;
  }
}

button {
  @container (max-width: 460px) {
    color:blue;
  }
}
<div class="comparison-grid">
  <div class="comparison-item ">
    <p class="span-two">Spanning 2 Rows</p>
    <button>Spanning 1 Row</button>
  </div>
  <div class="comparison-item">
    <p>Spanning 1 Row</p>
    <button class="span-two">Spanning 2 Rows</button>
  </div>
</div>

Ok, there seems to be some issue with chrome 129, with layouts and all. Can’t get much information but this layout might be heloful

https://support.google.com/chrome/thread/297477809/chrome-update-from-128-to-129-causing-application-to-break?hl=en

Though, this shows that subgrid is supported on Chrome 129, but just keep looking out for it.

https://caniuse.com/?search=subgrid

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật