{"id":3439,"date":"2026-11-28T16:12:16","date_gmt":"2026-11-28T16:12:16","guid":{"rendered":"https:\/\/danieldavidreitberg.com\/?p=3439"},"modified":"2026-11-28T16:12:16","modified_gmt":"2026-11-28T16:12:16","slug":"dr-ai-7319e345bc32b8de8de7","status":"publish","type":"post","link":"https:\/\/danieldavidreitberg.com\/index.php\/2026\/11\/28\/dr-ai-7319e345bc32b8de8de7\/","title":{"rendered":"Measure the Rendered Box Before Calling an Overlay Safe"},"content":{"rendered":"<p>A design mockup puts a title inside safe margins over a cover image. In the published card, a different crop and line wrap push one word past the intended area. Test the actual on-page geometry and the clipped result rather than measuring a mockup that no reader sees.<\/p>\n<p>Reference: <a href=\"https:\/\/www.w3.org\/TR\/cssom-view\/\">W3C CSSOM View<\/a>. CSSOM View specifies APIs for obtaining geometry information for elements.<\/p>\n<h2>Measure rendered geometry<\/h2>\n<p>Compare the image or its intended overlay region with the label in the same coordinate space. The bounds from getBoundingClientRect can describe an element\u2019s viewport-relative bounding rectangle, including effects of transforms on those bounds. They are not a map of every visible pixel, and clipping by an ancestor or a different image crop needs separate inspection. Define the real safe region for the card\u2019s placement and compare the label with that, not just with the outer image element. Keep the visible proof as an editorial check as well as any measurement.<\/p>\n<h2>Test clipping behavior<\/h2>\n<p>In a fictional feature card, test a short label, a two-line label and an unusually long one. Inspect the narrow and wide views after resizing, scrolling and enlarging text. Check whether the measured bounds still agree with the visual safe region. A rotated graphic can have a bounding rectangle larger than its apparent shape; an ancestor may clip a label even when its coordinates seem reasonable. If the title cannot fit over the image, try a different layout or place it beside the image rather than shrinking it until it is hard to read.<\/p>\n<p>The review should say both where the text was measured and what was visible to a reader. A passed rectangle check alone should not authorize publication.<\/p>\n<p>Check the final placement with the actual headline and crop.<\/p>\n<p>Include a test where the relevant image changes to a different aspect ratio. The same width check does not establish that the safe region is still in the same location.<\/p>\n<p><!-- drai-run:7319e345bc32b8de8de7 --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A design-safe area check should measure the actual on-page location.<\/p>\n","protected":false},"author":4,"featured_media":3440,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/posts\/3439"}],"collection":[{"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/comments?post=3439"}],"version-history":[{"count":1,"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/posts\/3439\/revisions"}],"predecessor-version":[{"id":3441,"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/posts\/3439\/revisions\/3441"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/media\/3440"}],"wp:attachment":[{"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/media?parent=3439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/categories?post=3439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/danieldavidreitberg.com\/index.php\/wp-json\/wp\/v2\/tags?post=3439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}