@@ -342,8 +342,37 @@ <h2 id=resolution-units><span class=secno>3. </span> Resolution Units: the
342342 < dd > dots per ‘< code class =css > px</ code > ’ unit
343343 </ dl >
344344
345- < p class =note > The default resolution of raster images in CSS is
346- ‘< code class =css > 1dppx</ code > ’.</ p >
345+ < p > The <resolution> unit represents the size of a single "dot" of an
346+ image. For raster images, a dot is an image pixel. For vector images, a
347+ dot is a pixel in the outermost coordinate space of the image. A
348+ <resolution> defines how many of these dots fit in a CSS ‘< code
349+ class =property > in</ code > ’, ‘< code
350+ class =property > cm</ code > ’, or ‘< code
351+ class =property > px</ code > ’ so that images can be sized accordingly.
352+ < span class =note > The default resolution of raster images in CSS is
353+ ‘< code class =css > 1dppx</ code > ’, which is equivalent to
354+ ‘< code class =css > 96dpi</ code > ’.</ span >
355+
356+ < div class =example >
357+ < p > Printers tend to have substantially higher resolution than computer
358+ monitors; due to this, an image that looks fine on the screen may look
359+ pixellated when printed out. A <resolution> may be used in the
360+ ‘< a href ="#image-resolution0 "> < code
361+ class =property > image-resolution</ code > </ a > ’ property to embed a
362+ high-resolution image into the document that maintains an appropriate
363+ size, ensuring attractive display both on screen and on paper:</ p >
364+
365+ < pre class =css > < code >
366+ img.high-res {
367+ image-resolution: 300dpi;
368+ }</ code > </ pre >
369+
370+ < p > With this set, an image meant to be 5 inches wide that was saved at
371+ 300dpi will actually display as 5 inches wide; without this set, the
372+ image would display as approximately 15.6 inches wide since the image is
373+ 15000 image pixels across, and by default there are 96 image pixels per
374+ inch.</ p >
375+ </ div >
347376 <!-- ====================================================================== -->
348377
349378 < h2 id =image > < span class =secno > 4. </ span > Image Values: the <image>
@@ -463,7 +492,7 @@ <h3 id=image-notation><span class=secno>4.2. </span> Image Annotations and
463492 < p > If a directional keyword (‘< code class =css > ltr</ code > ’ or
464493 ‘< code class =css > rtl</ code > ’) is given, the image itself gains
465494 that directionality. If the image is used in a property on an element with
466- opposite directionality, it must be mirrored in the inline dimension when
495+ opposite directionality, is must be mirrored in the inline dimension when
467496 rendered.
468497
469498 < p > Multiple arguments can be given separated by commas, in which case the
@@ -514,8 +543,8 @@ <h3 id=element-reference><span class=secno>4.3. </span> Using Elements as
514543 slide in a slideshow. The syntax for ‘< code
515544 class =css > element()</ code > ’ is defined as:
516545
517- < pre class = prod > < dfn id = ltelement-reference > <element-reference > </ dfn > =
518- element( [<id-selector> | <identifier> ] )</ pre >
546+ < pre
547+ class = prod > < dfn id = ltelement-reference > <element-reference > </ dfn > = element( [<id-selector> | <identifier> ] )</ pre >
519548
520549 < p > where <id-selector> is an ID selector < a href ="#SELECT "
521550 rel =biblioentry > [SELECT]<!--{{!SELECT}}--> </ a > , and <identifier> is an
@@ -540,14 +569,14 @@ <h3 id=element-reference><span class=secno>4.3. </span> Using Elements as
540569
541570 < p > If the ‘< code class =css > element()</ code > ’ function refers to
542571 an element, then it represents an image with width and height equal to the
543- width and height of the bounding box of the border boxes of the referenced
544- element. The image must be constructed by rendering the referenced element
545- and its descendants at the same size that the element would be in its
546- document, over an infinite transparent black background, positioned so
547- that the edges of the margin box of the element is flush with the edges of
548- the image. < span class =note > If the element has decorations or descendants
549- that extend outside the margin box, these will be clipped to the margin
550- box in the generated image by default. ‘< code
572+ width and height of the margin box of the referenced element. The image
573+ must be constructed by rendering the referenced element and its
574+ descendants at the same size that the element would be in its document,
575+ over an infinite transparent black background, positioned so that the
576+ edges of the margin box of the element is flush with the edges of the
577+ image. < span class =note > If the element has decorations or descendants that
578+ extend outside the margin box, these will be clipped to the margin box in
579+ the generated image by default. ‘< code
551580 class =css > background-repeat:extend</ code > ’ may allow the author to
552581 override this behavior so that decorations and descendants outside the
553582 margin box are still painted.</ span > If the referenced element or an
@@ -566,22 +595,7 @@ <h3 id=element-reference><span class=secno>4.3. </span> Using Elements as
566595 regeneration process. That is, the image must look identical to the
567596 referenced element, modulo rasterization quality.
568597
569- < p class =note > While the decision is up to the host language, it is intended
570- that element() can validly refer to some types of elements that are
571- associated with the document but not descendants of the root element. For
572- example, in HTML the <img> , <video> , and <canvas> elements all
573- have a reasonable notion of what it means to "be rendered" without being
574- part of a document, and so they can be created with Javascript, associated
575- with a < a href ="#css-element-reference-identifier "> < i > CSS Element
576- Reference Identifier</ i > </ a > , and used in element() without being appended
577- to the document.
578-
579598 < div class =example > TODO: copy an example from the MozHacks article</ div >
580-
581- < p class =issue > Moz's implementation allows directly referencing SVG paint
582- servers. This doesn't come for free - do we want to spec it out? I want to
583- be able to use SVG paint servers *somehow*. I'm not sure if this is quite
584- the place to do it, though.</ p >
585599 <!-- ====================================================================== -->
586600
587601 < h4 class ="no-num no-toc " id =element-cycles > Detecting and Resolving
0 commit comments