<!DOCTYPE html>
<style>
div, span {
  content-visibility: auto;
  contain-intrinsic-width: auto 100vw;
}
div::first-line {
  color: blue;
}
</style>
<div>
  <span style="display: inline-block">foo</span>
</div>
