Skip to content

The design language that makes your AI harness better at design.

JavaScript
13.5 KB
Raw Blame
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Own-box surfaces, repainted ink and pixel reads: Should Flag vs Should Pass</title>
  <style>
    /* Fixture for low-contrast verdicts that scored a colour no pixel shows
       (corpus observations-35, section 5 branch 1: rows 2, 4, 11, 17, 18 and
       the contrast parts of row 15).

       Surfaces on the element's own box:
       - a gradient on a box paints over that box's own opaque fill, so the
         gradient is the surface and the fill is not;
       - an upper gradient layer is composited over the layers below it in
         the same box, not over the page behind the box.

       Ink that is not the computed `color`:
       - SVG text paints its `fill`. It is scored only where the markup says
         the fill is `currentColor`;
       - a `filter` that moves the ink or the surface (or one the engine
         cannot model) leaves no verdict; a filter at rest (`brightness(1)`)
         changes nothing;
       - a word of a scripted colour reveal is not at its resting colour,
         also where the run is a wrapping flex heading whose words set their
         own `display`.

       Pixels that replace a verdict (URL engine only):
       - text the element pass hands to the pixels is read there even inside
         an `aria-hidden="true"` box;
       - a `background-attachment: fixed` image is placed against the
         viewport, so the sampled pass does not map it onto the box and the
         pixel pass reads the text;
       - an image the sampled pass cannot place under a point ends its walk,
         so the text is not scored against the boxes beneath it;
       - where the sample points read two surfaces and the line passes on
         the one most of them read, the pixel pass reads the glyphs;
       - text over a pseudo-element scrim, which the sampled pass's stack
         never lists, is read from pixels.

       The static HTML engine measures no boxes and reads no pixels. It
       scores a box with a fill and a gradient against the fill, pools the
       stops of layered gradients, reads SVG text as `color`, models no
       filter and no reveal, and scores a caption over a photo against the
       fill behind the photo. So it misses the first should-flag row and
       reports six of the nine should-pass rows: the dark-gradient button, the dark
       initials, the filtered label, the reveal word, the SVG label with no
       fill and the date on the dark photo (and it reports neither fixed
       image nor the streak, which only pixels read). The URL behavior is
       pinned by crates/browser/tests/own_box_surface_and_ink.rs. Every case
       uses its own text colour so a finding names the case. */
    * { box-sizing: border-box; }
    body { font: 16px/1.5 system-ui, sans-serif; margin: 0; color: #111111; background: #ffffff; }
    h1 { font: 600 28px/1.2 system-ui, sans-serif; margin: 0; padding: 16px 20px 8px; color: #111111; }
    .grid { display: grid; grid-template-columns: 600px 600px; gap: 40px; padding: 0 20px; }
    .col { position: relative; width: 600px; }
    .col h2 { font: 600 15px/1.2 system-ui, sans-serif; margin: 0 0 8px; color: #111111; }
    .case { position: relative; width: 560px; margin: 0 0 16px; }

    /* A button with a fill and a gradient over it. */
    .cta { display: inline-block; width: 200px; height: 44px; padding: 0 16px; border-radius: 4px;
      font: 600 14px/44px system-ui, sans-serif; text-decoration: none; text-align: center; }
    .cta-pale-over-dark { color: #fffdf5; background: #1e3a8a linear-gradient(135deg, #fde68a 0%, #fef3c7 100%); }
    .cta-dark-over-pale { color: #fffffe; background: #c4b5fd linear-gradient(135deg, #5b21b6 0%, #6d28d9 100%); }

    /* An avatar: a translucent highlight over an opaque pastel wheel, on a
       dark section. */
    .night { width: 560px; padding: 16px 24px; background-color: #13162a; }
    .avatar { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%;
      background-image: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.3) 0%, rgba(0, 0, 0, 0) 45%),
        conic-gradient(#a3e635 0deg, #2dd4bf 85deg, #a78bfa 180deg, #f472b6 270deg, #a3e635 360deg); }
    .avatar span { font: 700 24px/32px system-ui, sans-serif; }
    .initials-pale { color: #f3e8ff; }
    .initials-dark { color: #0b1020; }

    /* Filters. */
    .filter-rest { margin: 0; font-size: 14px; line-height: 20px; color: #b8b8b9; filter: brightness(1); }
    .blue-bar { width: 560px; padding: 12px 24px; background-color: #066bed; }
    .filter-light { margin: 0; font-size: 14px; line-height: 20px; color: #363637; filter: grayscale(1) brightness(0) invert(1); }

    /* Coloured words. */
    .words { margin: 0; width: 560px; padding: 12px 24px; background-color: #eaeaea; font: 700 22px/30px system-ui, sans-serif; color: #000000; }
    .reveal { display: flex; flex-wrap: wrap; }

    /* SVG labels. */
    .plan { width: 420px; height: 72px; padding: 12px; background-color: #f3e9d7; color: #f2f4ef; }
    .plan svg { display: block; width: 396px; height: 48px; }
    .plan-current { color: #f2f4ee; }

    /* A photo behind a caption, inside a box hidden from assistive
       technology. */
    .slide { position: relative; width: 420px; height: 96px; background-color: #ededed; overflow: hidden; }
    .slide img { position: absolute; left: 0; top: 0; width: 420px; height: 96px; }
    .slide .meta { position: relative; padding: 36px 16px; }
    .slide time { font-size: 14px; line-height: 20px; }
    .date-on-pale-photo { color: #fefefe; }
    .date-on-dark-photo { color: #fdfdfd; }
    .fold-spacer { height: 700px; }

    /* A fixed image: placed against the viewport, dark everywhere but a
       pale patch at the viewport's top left, which the left column sits in
       and the right column never reaches. Mapped onto the band's own box,
       the patch would lie under either copy. */
    .fixed-band { width: 560px; height: 64px; padding: 20px 24px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2000' height='4000'%3E%3Crect width='2000' height='4000' fill='%230b2a33'/%3E%3Crect width='600' height='4000' fill='%23f3ead8'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-size: 2000px 4000px; background-position: 0 0; background-attachment: fixed; }
    .fixed-band p { margin: 0; font-size: 16px; line-height: 24px; }
    .copy-on-fixed-pale { color: #e9dfcb; }
    .copy-on-fixed-dark { color: #fcfcfc; }

    /* A dark photo band with one bright streak at its left edge, under the
       first of the three points the sampled pass reads on a single line. */
    .streak-band { width: 560px; height: 60px; padding: 20px 24px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='60' preserveAspectRatio='none'%3E%3Crect width='560' height='60' fill='%2314532d'/%3E%3Crect width='37' height='60' fill='%23f7fee7'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-size: 560px 60px; background-position: 0 0; }
    .streak-band p { margin: 0; font: 700 16px/20px system-ui, sans-serif; color: #fbfbfb; }

    /* A pale photo under a teal scrim drawn as the band's own ::before,
       which no hit-test stack lists. */
    .scrim-band { position: relative; z-index: 1; width: 560px; height: 64px; padding: 20px 24px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23e7efe9'/%3E%3C/svg%3E");
      background-size: cover; background-repeat: no-repeat; }
    .scrim-band::before { content: ""; position: absolute; left: 0; top: 0; width: 560px; height: 64px; background-color: rgb(0, 83, 94); opacity: 0.9; }
    .scrim-band p { position: relative; margin: 0; font-size: 16px; line-height: 24px; color: #fafafa; }
  </style>
</head>
<body>
  <h1>Own-box surfaces, repainted ink and pixel reads</h1>
  <div class="grid">
    <div class="col">
      <h2>Should flag</h2>

      <!-- The pale gradient is the surface, not the navy fill under it. -->
      <div class="case">
        <a class="cta cta-pale-over-dark" id="flag-label-on-pale-gradient-over-dark-fill" href="#start">Get started</a>
      </div>

      <!-- Pale initials on the pastel wheel. -->
      <div class="case">
        <div class="night"><span class="avatar"><span class="initials-pale" id="flag-pale-initials-on-pastel-layers">AB</span></span></div>
      </div>

      <!-- A filter at rest changes nothing. -->
      <div class="case">
        <p class="filter-rest" id="flag-copy-under-resting-filter">Pale copy under a filter at its resting value</p>
      </div>

      <!-- Words an editor coloured: no transition, so the colour rests. -->
      <div class="case">
        <p class="words"><span id="flag-coloured-word-at-rest" style="color: rgb(199, 201, 217);">Coloured</span> <span style="color: rgb(199, 201, 217);">words</span> <span style="color: rgb(199, 201, 217);">at</span> <span style="color: rgb(199, 201, 217);">rest</span></p>
      </div>

      <!-- SVG text that says its fill is its colour. -->
      <div class="case">
        <div class="plan plan-current">
          <svg viewBox="0 0 396 48"><text id="flag-svg-label-filled-with-current-colour" x="8" y="32" font-size="20" fill="currentColor">Second floor plan</text></svg>
        </div>
      </div>

      <!-- Pale copy over the pale patch of the fixed image. -->
      <div class="case">
        <div class="fixed-band"><p class="copy-on-fixed-pale" id="flag-copy-on-fixed-pale-patch">Resources for investors</p></div>
      </div>

      <div class="fold-spacer"></div>

      <!-- Below the fold, where no hit test answers and the element pass
           hands its verdict over: a pale date over a pale photo, read from
           pixels. -->
      <div class="case">
        <div aria-hidden="true">
          <div class="slide">
            <img alt="" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23e8e2d6'/%3E%3C/svg%3E">
            <div class="meta"><time class="date-on-pale-photo" id="flag-date-on-pale-photo-in-aria-hidden">19 June 2024</time></div>
          </div>
        </div>
      </div>
    </div>

    <div class="col">
      <h2>Should pass</h2>

      <!-- The dark gradient is the surface, not the lavender fill under it. -->
      <div class="case">
        <a class="cta cta-dark-over-pale" id="pass-label-on-dark-gradient-over-pale-fill" href="#start">Get started</a>
      </div>

      <!-- Dark initials on the pastel wheel: the highlight's clear stop
           shows the wheel, not the dark section behind the avatar. -->
      <div class="case">
        <div class="night"><span class="avatar"><span class="initials-dark" id="pass-dark-initials-on-pastel-layers">MK</span></span></div>
      </div>

      <!-- The filter paints the charcoal ink white. -->
      <div class="case">
        <div class="blue-bar"><p class="filter-light" id="pass-label-repainted-by-filter">Mail</p></div>
      </div>

      <!-- A scripted colour reveal in a wrapping flex heading. -->
      <div class="case">
        <h3 class="words reveal"><span id="pass-reveal-word" style="display: inline-block; color: rgb(172, 176, 207); will-change: color; transition: color 0.3s;">creating</span><span style="display: inline-block; width: 0.3em;"></span><span style="display: inline-block; color: rgb(172, 176, 207); will-change: color; transition: color 0.3s;">the</span><span style="display: inline-block; width: 0.3em;"></span><span style="display: inline-block; color: rgb(172, 176, 207); will-change: color; transition: color 0.3s;">most</span><span style="display: inline-block; width: 0.3em;"></span><span style="display: inline-block; color: rgb(172, 176, 207); will-change: color; transition: color 0.3s;">capable</span></h3>
      </div>

      <!-- SVG text with no fill paints black, whatever `color` it inherits. -->
      <div class="case">
        <div class="plan">
          <svg viewBox="0 0 396 48"><text id="pass-svg-label-without-fill" x="8" y="32" font-size="20">First floor plan</text></svg>
        </div>
      </div>

      <!-- White copy over the dark part of the fixed image. -->
      <div class="case">
        <div class="fixed-band"><p class="copy-on-fixed-dark" id="pass-copy-on-fixed-dark-photo">Financial statements</p></div>
      </div>

      <!-- Bold white copy on a dark photo with one bright streak. -->
      <div class="case">
        <div class="streak-band"><p id="pass-copy-on-photo-with-bright-streak">We know fresh matters to our customers</p></div>
      </div>

      <!-- White copy on a pseudo-element scrim over a pale photo. -->
      <div class="case">
        <div class="scrim-band"><p id="pass-copy-on-pseudo-scrim-over-pale-photo">The company was founded by royal decree</p></div>
      </div>

      <div class="fold-spacer"></div>

      <!-- Below the fold: a white date over a dark photo, read from
           pixels, which drop the verdict the element pass handed over. -->
      <div class="case">
        <div aria-hidden="true">
          <div class="slide">
            <img alt="" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='8' height='8' fill='%230f172a'/%3E%3C/svg%3E">
            <div class="meta"><time class="date-on-dark-photo" id="pass-date-on-dark-photo-in-aria-hidden">29 September 2026</time></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
</html>