CINXE.COM
CSS Transforms Module Level 1
<!doctype html><html lang="en"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> <title>CSS Transforms Module Level 1</title> <meta content="ED" name="w3c-status"> <link href="https://www.w3.org/StyleSheets/TR/2021/W3C-ED" rel="stylesheet"> <meta content="Bikeshed version 60c422380, updated Thu Feb 20 19:11:22 2025 -0800" name="generator"> <link href="https://www.w3.org/TR/css-transforms-1/" rel="canonical"> <link href="https://drafts.csswg.org/csslogo.ico" rel="icon"> <meta content="00a4565adc80e6981e7fdefb92480d41c0f5ffea" name="revision"> <meta content="dark light" name="color-scheme"> <link href="https://www.w3.org/StyleSheets/TR/2021/dark.css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css"> <style type="text/css"> .example { clear:both } th { text-align:left } .pseudo-code { font-family:monospace } .pseudo-code > ol { list-style-type:decimal } .pseudo-code > ol > li > ol { list-style-type:lower-latin } .pseudo-code > ol > li > ol > li > ol { list-style-type:lower-roman } .pseudo-code ul { list-style-type:disc } dd > p:nth-child(1) { margin-top:0 } </style> <style>/* Boilerplate: style-autolinks */ .css.css, .property.property, .descriptor.descriptor { color: var(--a-normal-text); font-size: inherit; font-family: inherit; } .css::before, .property::before, .descriptor::before { content: "‘"; } .css::after, .property::after, .descriptor::after { content: "’"; } .property, .descriptor { /* Don't wrap property and descriptor names */ white-space: nowrap; } .type { /* CSS value <type> */ font-style: italic; } pre .property::before, pre .property::after { content: ""; } [data-link-type="property"]::before, [data-link-type="propdesc"]::before, [data-link-type="descriptor"]::before, [data-link-type="value"]::before, [data-link-type="function"]::before, [data-link-type="at-rule"]::before, [data-link-type="selector"]::before, [data-link-type="maybe"]::before { content: "‘"; } [data-link-type="property"]::after, [data-link-type="propdesc"]::after, [data-link-type="descriptor"]::after, [data-link-type="value"]::after, [data-link-type="function"]::after, [data-link-type="at-rule"]::after, [data-link-type="selector"]::after, [data-link-type="maybe"]::after { content: "’"; } [data-link-type].production::before, [data-link-type].production::after, .prod [data-link-type]::before, .prod [data-link-type]::after { content: ""; } [data-link-type=element], [data-link-type=element-attr] { font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: .9em; } [data-link-type=element]::before { content: "<" } [data-link-type=element]::after { content: ">" } [data-link-type=biblio] { white-space: pre; } @media (prefers-color-scheme: dark) { :root { --selflink-text: black; --selflink-bg: silver; --selflink-hover-text: white; } } </style> <style>/* Boilerplate: style-colors */ /* Any --*-text not paired with a --*-bg is assumed to have a transparent bg */ :root { color-scheme: light dark; --text: black; --bg: white; --unofficial-watermark: url(https://www.w3.org/StyleSheets/TR/2016/logos/UD-watermark); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #707070; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #f8f8f8; --tocnav-active-text: #c00; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #f7f8f9; --tocsidebar-shadow: rgba(0,0,0,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #3980b5; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #005a9c; --hr-text: var(--text); --algo-border: #def; --del-text: red; --del-bg: transparent; --ins-text: #080; --ins-bg: transparent; --a-normal-text: #034575; --a-normal-underline: #bbb; --a-visited-text: var(--a-normal-text); --a-visited-underline: #707070; --a-hover-bg: rgba(75%, 75%, 75%, .25); --a-active-text: #c00; --a-active-underline: #c00; --blockquote-border: silver; --blockquote-bg: transparent; --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: #fbe9e9; --issue-text: var(--text); --issueheading-text: #831616; --example-border: #e0cb52; --example-bg: #fcfaee; --example-text: var(--text); --exampleheading-text: #574b0f; --note-border: #52e052; --note-bg: #e9fbe9; --note-text: var(--text); --noteheading-text: hsl(120, 70%, 30%); --notesummary-underline: silver; --assertion-border: #aaa; --assertion-bg: #eee; --assertion-text: black; --advisement-border: orange; --advisement-bg: #fec; --advisement-text: var(--text); --advisementheading-text: #b35f00; --warning-border: red; --warning-bg: hsla(40,100%,50%,0.95); --warning-text: var(--text); --amendment-border: #330099; --amendment-bg: #F5F0FF; --amendment-text: var(--text); --amendmentheading-text: #220066; --def-border: #8ccbf2; --def-bg: #def; --def-text: var(--text); --defrow-border: #bbd7e9; --datacell-border: silver; --indexinfo-text: #707070; --indextable-hover-text: black; --indextable-hover-bg: #f7f8f9; --outdatedspec-bg: rgba(0, 0, 0, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; } @media (prefers-color-scheme: dark) { :root { --text: #ddd; --bg: black; --unofficial-watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cg fill='%23100808' transform='translate(200 200) rotate(-45) translate(-200 -200)' stroke='%23100808' stroke-width='3'%3E%3Ctext x='50%25' y='220' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EUNOFFICIAL%3C/text%3E%3Ctext x='50%25' y='305' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EDRAFT%3C/text%3E%3C/g%3E%3C/svg%3E"); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #999; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #080808; --tocnav-active-text: #f44; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #080808; --tocsidebar-shadow: rgba(255,255,255,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #6af; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #8af; --hr-text: var(--text); --algo-border: #456; --del-text: #f44; --del-bg: transparent; --ins-text: #4a4; --ins-bg: transparent; --a-normal-text: #6af; --a-normal-underline: #555; --a-visited-text: var(--a-normal-text); --a-visited-underline: var(--a-normal-underline); --a-hover-bg: rgba(25%, 25%, 25%, .2); --a-active-text: #f44; --a-active-underline: var(--a-active-text); --borderedblock-bg: rgba(255, 255, 255, .05); --blockquote-border: silver; --blockquote-bg: var(--borderedblock-bg); --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: var(--borderedblock-bg); --issue-text: var(--text); --issueheading-text: hsl(0deg, 70%, 70%); --example-border: hsl(50deg, 90%, 60%); --example-bg: var(--borderedblock-bg); --example-text: var(--text); --exampleheading-text: hsl(50deg, 70%, 70%); --note-border: hsl(120deg, 100%, 35%); --note-bg: var(--borderedblock-bg); --note-text: var(--text); --noteheading-text: hsl(120, 70%, 70%); --notesummary-underline: silver; --assertion-border: #444; --assertion-bg: var(--borderedblock-bg); --assertion-text: var(--text); --advisement-border: orange; --advisement-bg: #222218; --advisement-text: var(--text); --advisementheading-text: #f84; --warning-border: red; --warning-bg: hsla(40,100%,20%,0.95); --warning-text: var(--text); --amendment-border: #330099; --amendment-bg: #080010; --amendment-text: var(--text); --amendmentheading-text: #cc00ff; --def-border: #8ccbf2; --def-bg: #080818; --def-text: var(--text); --defrow-border: #136; --datacell-border: silver; --indexinfo-text: #aaa; --indextable-hover-text: var(--text); --indextable-hover-bg: #181818; --outdatedspec-bg: rgba(255, 255, 255, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; } /* In case a transparent-bg image doesn't expect to be on a dark bg, which is quite common in practice... */ img { background: white; } } </style> <style>/* Boilerplate: style-counters */ body { counter-reset: example figure issue; } .issue { counter-increment: issue; } .issue:not(.no-marker)::before { content: "Issue " counter(issue); } .example { counter-increment: example; } .example:not(.no-marker)::before { content: "Example " counter(example); } .invalid.example:not(.no-marker)::before, .illegal.example:not(.no-marker)::before { content: "Invalid Example" counter(example); } figcaption { counter-increment: figure; } figcaption:not(.no-marker)::before { content: "Figure " counter(figure) " "; } </style> <style>/* Boilerplate: style-dfn-panel */ :root { --dfnpanel-bg: #ddd; --dfnpanel-text: var(--text); --dfnpanel-target-bg: #ffc; --dfnpanel-target-outline: orange; } @media (prefers-color-scheme: dark) { :root { --dfnpanel-bg: #222; --dfnpanel-text: var(--text); --dfnpanel-target-bg: #333; --dfnpanel-target-outline: silver; } } .dfn-panel { position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.75em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--dfnpanel-bg); color: var(--dfnpanel-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .dfn-panel:not(.on) { display: none; } .dfn-panel * { margin: 0; padding: 0; text-indent: 0; } .dfn-panel > b { display: block; } .dfn-panel a { color: var(--dfnpanel-text); } .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; } .dfn-panel a:focus { outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color; } .dfn-panel > b + b { margin-top: 0.25em; } .dfn-panel ul { padding: 0 0 0 1em; list-style: none; } .dfn-panel li a { max-width: calc(300px - 1.5em - 1em); overflow: hidden; text-overflow: ellipsis; } .dfn-panel.activated { display: inline-block; position: fixed; left: 8px; bottom: 2em; margin: 0 auto; max-width: calc(100vw - 1.5em - .4em - .5em); max-height: 30vh; transition: left 1s ease-out, bottom 1s ease-out; } .dfn-panel .link-item:hover { text-decoration: underline; } .dfn-panel .link-item .copy-icon { opacity: 0; } .dfn-panel .link-item:hover .copy-icon, .dfn-panel .link-item .copy-icon:focus { opacity: 1; } .dfn-panel .copy-icon { display: inline-block; margin-right: 0.5em; width: 0.85em; height: 1em; border-radius: 3px; background-color: #ccc; cursor: pointer; } .dfn-panel .copy-icon .icon { width: 100%; height: 100%; background-color: #fff; display: flex; justify-content: center; align-items: center; position: relative; } .dfn-panel .copy-icon .icon::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 1px solid black; background-color: #ccc; opacity: 0.25; transform: translate(3px, -3px); } .dfn-panel .copy-icon:active .icon::before { opacity: 1; } .dfn-paneled[role="button"] { cursor: help; } .highlighted { animation: target-fade 3s; } @keyframes target-fade { from { background-color: var(--dfnpanel-target-bg); outline: 5px solid var(--dfnpanel-target-outline); } to { color: var(--a-normal-text); background-color: transparent; outline: transparent; } } </style> <style>/* Boilerplate: style-issues */ a[href].issue-return { float: right; float: inline-end; color: var(--issueheading-text); font-weight: bold; text-decoration: none; } </style> <style>/* Boilerplate: style-md-lists */ /* This is a weird hack for me not yet following the commonmark spec regarding paragraph and lists. */ [data-md] > :first-child { margin-top: 0; } [data-md] > :last-child { margin-bottom: 0; } </style> <style>/* Boilerplate: style-mdn-anno */ :root { --mdn-bg: #EEE; --mdn-shadow: #999; --mdn-nosupport-text: #ccc; --mdn-pass: green; --mdn-fail: red; } @media (prefers-color-scheme: dark) { :root { --mdn-bg: #222; --mdn-shadow: #444; --mdn-nosupport-text: #666; --mdn-pass: #690; --mdn-fail: #d22; } } .mdn-anno { background: var(--mdn-bg, #EEE); border-radius: .25em; box-shadow: 0 0 3px var(--mdn-shadow, #999); color: var(--text, black); font: 1em sans-serif; hyphens: none; max-width: min-content; overflow: hidden; padding: 0.2em; position: absolute; right: 0.3em; top: auto; white-space: nowrap; word-wrap: normal; z-index: 8; } .mdn-anno.unpositioned { display: none; } .mdn-anno.overlapping-main { opacity: .2; transition: opacity .1s; } .mdn-anno[open] { opacity: 1; z-index: 9; min-width: 9em; } .mdn-anno:hover { opacity: 1; outline: var(--text, black) 1px solid; } .mdn-anno > summary { font-weight: normal; text-align: right; cursor: pointer; display: block; } .mdn-anno > summary > .less-than-two-engines-flag { color: var(--mdn-fail); padding-right: 2px; } .mdn-anno > summary > .all-engines-flag { color: var(--mdn-pass); padding-right: 2px; } .mdn-anno > summary > span { color: #fff; background-color: #000; font-weight: normal; font-family: zillaslab, Palatino, "Palatino Linotype", serif; padding: 2px 3px 0px 3px; line-height: 1.3em; vertical-align: top; } .mdn-anno > .feature { margin-top: 20px; } .mdn-anno > .feature:not(:first-of-type) { border-top: 1px solid #999; margin-top: 6px; padding-top: 2px; } .mdn-anno > .feature > .less-than-two-engines-text { color: var(--mdn-fail); } .mdn-anno > .feature > .all-engines-text { color: var(--mdn-pass); } .mdn-anno > .feature > p { font-size: .75em; margin-top: 6px; margin-bottom: 0; } .mdn-anno > .feature > p + p { margin-top: 3px; } .mdn-anno > .feature > .support { display: block; font-size: 0.6em; margin: 0; padding: 0; margin-top: 2px; } .mdn-anno > .feature > .support + div { padding-top: 0.5em; } .mdn-anno > .feature > .support > hr { display: block; border: none; border-top: 1px dotted #999; padding: 3px 0px 0px 0px; margin: 2px 3px 0px 3px; } .mdn-anno > .feature > .support > hr::before { content: ""; } .mdn-anno > .feature > .support > span { padding: 0.2em 0; display: block; display: table; } .mdn-anno > .feature > .support > span.no { color: var(--mdn-nosupport-text); filter: grayscale(100%); } .mdn-anno > .feature > .support > span.no::before { opacity: 0.5; } .mdn-anno > .feature > .support > span:first-of-type { padding-top: 0.5em; } .mdn-anno > .feature > .support > span > span { padding: 0 0.5em; display: table-cell; } .mdn-anno > .feature > .support > span > span:first-child { width: 100%; } .mdn-anno > .feature > .support > span > span:last-child { width: 100%; white-space: pre; padding: 0; } .mdn-anno > .feature > .support > span::before { content: ' '; display: table-cell; min-width: 1.5em; height: 1.5em; background: no-repeat center center; background-size: contain; text-align: right; font-size: 0.75em; font-weight: bold; } .mdn-anno > .feature > .support > .chrome_android::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .mdn-anno > .feature > .support > .firefox_android::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .mdn-anno > .feature > .support > .chrome::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .mdn-anno > .feature > .support > .edge_blink::before { background-image: url(https://resources.whatwg.org/browser-logos/edge.svg); } .mdn-anno > .feature > .support > .edge::before { background-image: url(https://resources.whatwg.org/browser-logos/edge_legacy.svg); } .mdn-anno > .feature > .support > .firefox::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .mdn-anno > .feature > .support > .ie::before { background-image: url(https://resources.whatwg.org/browser-logos/ie.png); } .mdn-anno > .feature > .support > .safari_ios::before { background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg); } .mdn-anno > .feature > .support > .nodejs::before { background-image: url(https://nodejs.org/favicon.ico); } .mdn-anno > .feature > .support > .opera_android::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .mdn-anno > .feature > .support > .opera::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .mdn-anno > .feature > .support > .safari::before { background-image: url(https://resources.whatwg.org/browser-logos/safari.png); } .mdn-anno > .feature > .support > .samsunginternet_android::before { background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg); } .mdn-anno > .feature > .support > .webview_android::before { background-image: url(https://resources.whatwg.org/browser-logos/android-webview.png); } .name-slug-mismatch { color: red; } .caniuse-status:hover { z-index: 9; } /* dt, li, .issue, .note, and .example are "position: relative", so to put annotation at right margin, must move to right of containing block */; .h-entry:not(.status-LS) dt > .mdn-anno, .h-entry:not(.status-LS) li > .mdn-anno, .h-entry:not(.status-LS) .issue > .mdn-anno, .h-entry:not(.status-LS) .note > .mdn-anno, .h-entry:not(.status-LS) .example > .mdn-anno { right: -6.7em; } .h-entry p + .mdn-anno { margin-top: 0; } h2 + .mdn-anno.after { margin: -48px 0 0 0; } h3 + .mdn-anno.after { margin: -46px 0 0 0; } h4 + .mdn-anno.after { margin: -42px 0 0 0; } h5 + .mdn-anno.after { margin: -40px 0 0 0; } h6 + .mdn-anno.after { margin: -40px 0 0 0; } </style> <style>/* Boilerplate: style-railroad */ :root { --railroad-bg: hsl(30, 20%, 95%); --railroad-stroke: black; --railroad-fill: hsl(120,100%,90%); } svg.railroad-diagram { background-color: var(--railroad-bg); } svg.railroad-diagram path { stroke-width:3px; stroke: var(--railroad-stroke); fill:transparent; } svg.railroad-diagram text { font: bold 14px monospace; fill: var(--text, currentcolor); text-anchor:middle; } svg.railroad-diagram text.label { text-anchor:start; } svg.railroad-diagram text.comment { font:italic 12px monospace; } svg.railroad-diagram rect { stroke-width:3px; stroke: var(--railroad-stroke); fill: var(--railroad-fill); } @media (prefers-color-scheme: dark) { :root { --railroad-bg: rgba(255, 255, 255, .05); --railroad-stroke: #bbb; --railroad-fill: hsla(240deg, 20%, 15%); } } </style> <style>/* Boilerplate: style-ref-hints */ :root { --ref-hint-bg: #ddd; --ref-hint-text: var(--text); } @media (prefers-color-scheme: dark) { :root { --ref-hint-bg: #222; --ref-hint-text: var(--text); } } .ref-hint { display: inline-block; position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.5em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--ref-hint-bg); color: var(--ref-hint-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .ref-hint * { margin: 0; padding: 0; text-indent: 0; } .ref-hint ul { padding: 0 0 0 1em; list-style: none; } </style> <style>/* Boilerplate: style-selflinks */ :root { --selflink-text: white; --selflink-bg: gray; --selflink-hover-text: black; } .heading, .issue, .note, .example, li, dt { position: relative; } a.self-link { position: absolute; top: 0; left: calc(-1 * (3.5rem - 26px)); width: calc(3.5rem - 26px); height: 2em; text-align: center; border: none; transition: opacity .2s; opacity: .5; } a.self-link:hover { opacity: 1; } .heading > a.self-link { font-size: 83%; } .example > a.self-link, .note > a.self-link, .issue > a.self-link { /* These blocks are overflow:auto, so positioning outside doesn't work. */ left: auto; right: 0; } li > a.self-link { left: calc(-1 * (3.5rem - 26px) - 2em); } dfn > a.self-link { top: auto; left: auto; opacity: 0; width: 1.5em; height: 1.5em; background: var(--selflink-bg); color: var(--selflink-text); font-style: normal; transition: opacity .2s, background-color .2s, color .2s; } dfn:hover > a.self-link { opacity: 1; } dfn > a.self-link:hover { color: var(--selflink-hover-text); } a.self-link::before { content: "¶"; } .heading > a.self-link::before { content: "§"; } dfn > a.self-link::before { content: "#"; } </style> <style>/* Boilerplate: style-syntax-highlighting */ code.highlight { padding: .1em; border-radius: .3em; } pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; } .highlight:not(.idl) { background: rgba(0, 0, 0, .03); } c-[a] { color: #990055 } /* Keyword.Declaration */ c-[b] { color: #990055 } /* Keyword.Type */ c-[c] { color: #708090 } /* Comment */ c-[d] { color: #708090 } /* Comment.Multiline */ c-[e] { color: #0077aa } /* Name.Attribute */ c-[f] { color: #669900 } /* Name.Tag */ c-[g] { color: #222222 } /* Name.Variable */ c-[k] { color: #990055 } /* Keyword */ c-[l] { color: #000000 } /* Literal */ c-[m] { color: #000000 } /* Literal.Number */ c-[n] { color: #0077aa } /* Name */ c-[o] { color: #999999 } /* Operator */ c-[p] { color: #999999 } /* Punctuation */ c-[s] { color: #a67f59 } /* Literal.String */ c-[t] { color: #a67f59 } /* Literal.String.Single */ c-[u] { color: #a67f59 } /* Literal.String.Double */ c-[cp] { color: #708090 } /* Comment.Preproc */ c-[c1] { color: #708090 } /* Comment.Single */ c-[cs] { color: #708090 } /* Comment.Special */ c-[kc] { color: #990055 } /* Keyword.Constant */ c-[kn] { color: #990055 } /* Keyword.Namespace */ c-[kp] { color: #990055 } /* Keyword.Pseudo */ c-[kr] { color: #990055 } /* Keyword.Reserved */ c-[ld] { color: #000000 } /* Literal.Date */ c-[nc] { color: #0077aa } /* Name.Class */ c-[no] { color: #0077aa } /* Name.Constant */ c-[nd] { color: #0077aa } /* Name.Decorator */ c-[ni] { color: #0077aa } /* Name.Entity */ c-[ne] { color: #0077aa } /* Name.Exception */ c-[nf] { color: #0077aa } /* Name.Function */ c-[nl] { color: #0077aa } /* Name.Label */ c-[nn] { color: #0077aa } /* Name.Namespace */ c-[py] { color: #0077aa } /* Name.Property */ c-[ow] { color: #999999 } /* Operator.Word */ c-[mb] { color: #000000 } /* Literal.Number.Bin */ c-[mf] { color: #000000 } /* Literal.Number.Float */ c-[mh] { color: #000000 } /* Literal.Number.Hex */ c-[mi] { color: #000000 } /* Literal.Number.Integer */ c-[mo] { color: #000000 } /* Literal.Number.Oct */ c-[sb] { color: #a67f59 } /* Literal.String.Backtick */ c-[sc] { color: #a67f59 } /* Literal.String.Char */ c-[sd] { color: #a67f59 } /* Literal.String.Doc */ c-[se] { color: #a67f59 } /* Literal.String.Escape */ c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */ c-[si] { color: #a67f59 } /* Literal.String.Interpol */ c-[sx] { color: #a67f59 } /* Literal.String.Other */ c-[sr] { color: #a67f59 } /* Literal.String.Regex */ c-[ss] { color: #a67f59 } /* Literal.String.Symbol */ c-[vc] { color: #0077aa } /* Name.Variable.Class */ c-[vg] { color: #0077aa } /* Name.Variable.Global */ c-[vi] { color: #0077aa } /* Name.Variable.Instance */ c-[il] { color: #000000 } /* Literal.Number.Integer.Long */ @media (prefers-color-scheme: dark) { .highlight:not(.idl) { background: rgba(255, 255, 255, .05); } c-[a] { color: #d33682 } /* Keyword.Declaration */ c-[b] { color: #d33682 } /* Keyword.Type */ c-[c] { color: #2aa198 } /* Comment */ c-[d] { color: #2aa198 } /* Comment.Multiline */ c-[e] { color: #268bd2 } /* Name.Attribute */ c-[f] { color: #b58900 } /* Name.Tag */ c-[g] { color: #cb4b16 } /* Name.Variable */ c-[k] { color: #d33682 } /* Keyword */ c-[l] { color: #657b83 } /* Literal */ c-[m] { color: #657b83 } /* Literal.Number */ c-[n] { color: #268bd2 } /* Name */ c-[o] { color: #657b83 } /* Operator */ c-[p] { color: #657b83 } /* Punctuation */ c-[s] { color: #6c71c4 } /* Literal.String */ c-[t] { color: #6c71c4 } /* Literal.String.Single */ c-[u] { color: #6c71c4 } /* Literal.String.Double */ c-[ch] { color: #2aa198 } /* Comment.Hashbang */ c-[cp] { color: #2aa198 } /* Comment.Preproc */ c-[cpf] { color: #2aa198 } /* Comment.PreprocFile */ c-[c1] { color: #2aa198 } /* Comment.Single */ c-[cs] { color: #2aa198 } /* Comment.Special */ c-[kc] { color: #d33682 } /* Keyword.Constant */ c-[kn] { color: #d33682 } /* Keyword.Namespace */ c-[kp] { color: #d33682 } /* Keyword.Pseudo */ c-[kr] { color: #d33682 } /* Keyword.Reserved */ c-[ld] { color: #657b83 } /* Literal.Date */ c-[nc] { color: #268bd2 } /* Name.Class */ c-[no] { color: #268bd2 } /* Name.Constant */ c-[nd] { color: #268bd2 } /* Name.Decorator */ c-[ni] { color: #268bd2 } /* Name.Entity */ c-[ne] { color: #268bd2 } /* Name.Exception */ c-[nf] { color: #268bd2 } /* Name.Function */ c-[nl] { color: #268bd2 } /* Name.Label */ c-[nn] { color: #268bd2 } /* Name.Namespace */ c-[py] { color: #268bd2 } /* Name.Property */ c-[ow] { color: #657b83 } /* Operator.Word */ c-[mb] { color: #657b83 } /* Literal.Number.Bin */ c-[mf] { color: #657b83 } /* Literal.Number.Float */ c-[mh] { color: #657b83 } /* Literal.Number.Hex */ c-[mi] { color: #657b83 } /* Literal.Number.Integer */ c-[mo] { color: #657b83 } /* Literal.Number.Oct */ c-[sa] { color: #6c71c4 } /* Literal.String.Affix */ c-[sb] { color: #6c71c4 } /* Literal.String.Backtick */ c-[sc] { color: #6c71c4 } /* Literal.String.Char */ c-[dl] { color: #6c71c4 } /* Literal.String.Delimiter */ c-[sd] { color: #6c71c4 } /* Literal.String.Doc */ c-[se] { color: #6c71c4 } /* Literal.String.Escape */ c-[sh] { color: #6c71c4 } /* Literal.String.Heredoc */ c-[si] { color: #6c71c4 } /* Literal.String.Interpol */ c-[sx] { color: #6c71c4 } /* Literal.String.Other */ c-[sr] { color: #6c71c4 } /* Literal.String.Regex */ c-[ss] { color: #6c71c4 } /* Literal.String.Symbol */ c-[fm] { color: #268bd2 } /* Name.Function.Magic */ c-[vc] { color: #cb4b16 } /* Name.Variable.Class */ c-[vg] { color: #cb4b16 } /* Name.Variable.Global */ c-[vi] { color: #cb4b16 } /* Name.Variable.Instance */ c-[vm] { color: #cb4b16 } /* Name.Variable.Magic */ c-[il] { color: #657b83 } /* Literal.Number.Integer.Long */ } </style> <style>/* Boilerplate: style-wpt */ :root { --wpt-border: hsl(0, 0%, 60%); --wpt-bg: hsl(0, 0%, 95%); --wpt-text: var(--text); --wptheading-text: hsl(0, 0%, 30%); } @media (prefers-color-scheme: dark) { :root { --wpt-border: hsl(0, 0%, 30%); --wpt-bg: var(--borderedblock-bg); --wpt-text: var(--text); --wptheading-text: hsl(0, 0%, 60%); } } .wpt-tests-block { list-style: none; border-left: .5em solid var(--wpt-border); background: var(--wpt-bg); color: var(--wpt-text); margin: 1em auto; padding: .5em; } .wpt-tests-block summary { color: var(--wptheading-text); font-weight: normal; text-transform: uppercase; } .wpt-tests-block summary::marker{ color: var(--wpt-border); } .wpt-tests-block summary:hover::marker{ color: var(--wpt-text); } /* The only content of a wpt test block in its closed state is the <summary>, which contains the word TESTS, and that is absolutely positioned. In that closed state, wpt test blocks are styled to have a top margin whose height is exactly equal to the height of the absolutely positioned <summary>, and no other background/padding/margin/border. The wpt test block elements will therefore allow the maring of the previous/next block elements to collapse through them; if this combined margin would be larger than its own top margin, it stays as is, and therefore the pre-existing vertical rhythm of the document is undisturbed. If that combined margin would be smaller, it is grown to that size. This means that the wpt test block ensures that there's always enough vertical space to insert the summary, without adding more than is needed. */ .wpt-tests-block:not([open]){ padding: 0; border: none; background: none; font-size: 0.75em; line-height: 1; position: relative; margin: 1em 0 0; } .wpt-tests-block:not([open]) summary { position: absolute; right: 0; bottom: 0; } /* It is possible that both the last child of a block element and the block element itself would be annotated with a <wpt> block each. If the block element has a padding or a border, that's fine, but otherwise the bottom margin of the block and of its last child would collapse and both <wpt> elements would overlap, being both placed there. To avoid that, add 1px of padding to the <wpt> element annotating the last child to prevent the bottom margin of the block and of its last child from collapsing (and as much negative margin, as wel only want to prevent margin collapsing, but are not trying to actually take more space). */ .wpt-tests-block:not([open]):last-child { padding-bottom: 1px; margin-bottom: -1px; } /* Exception to the previous rule: don't do that in non-last list items, because it's not necessary, and would therefore consume more space than strictly needed. Lists must have list items as children, not <wpt> elements, so a <wpt> element cannot be a sibling of a list item, and the collision that the previous rule avoids cannot happen. */ li:not(:last-child) > .wpt-tests-block:not([open]):last-child, dd:not(:last-child) > .wpt-tests-block:not([open]):last-child { padding-bottom: 0; margin-bottom: 0; } .wpt-tests-block:not([open]):not(:hover){ opacity: 0.5; } .wpt-tests-list { list-style: none; display: grid; margin: 0; padding: 0; grid-template-columns: 1fr max-content auto auto; grid-column-gap: .5em; } .wpt-tests-block hr:last-child { display: none; } .wpt-test { display: contents; } .wpt-test > a { text-decoration: underline; border: none; } .wpt-test > .wpt-name { grid-column: 1; } .wpt-test > .wpt-results { grid-column: 2; } .wpt-test > .wpt-live { grid-column: 3; } .wpt-test > .wpt-source { grid-column: 4; } .wpt-test > .wpt-results { display: flex; gap: .1em; } .wpt-test .wpt-result { display: inline-block; height: 1em; width: 1em; border-radius: 50%; position: relative; } </style> <body class="h-entry"> <div class="head"> <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2021/logos/W3C" width="72"> </a> </p> <h1 class="p-name no-ref" id="title">CSS Transforms Module Level 1</h1> <p id="w3c-state"><a href="https://www.w3.org/standards/types/#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2025-01-29">29 January 2025</time></p> <details open> <summary>More details about this document</summary> <div data-fill-with="spec-metadata"> <dl> <dt>This version: <dd><a class="u-url" href="https://drafts.csswg.org/css-transforms/">https://drafts.csswg.org/css-transforms/</a> <dt>Latest published version: <dd><a href="https://www.w3.org/TR/css-transforms-1/">https://www.w3.org/TR/css-transforms-1/</a> <dt>Previous Versions: <dd><a href="https://www.w3.org/TR/2019/CR-css-transforms-1-20190214/" rel="prev">https://www.w3.org/TR/2019/CR-css-transforms-1-20190214/</a> <dd><a href="https://www.w3.org/TR/2018/WD-css-transforms-1-20181130/" rel="prev">https://www.w3.org/TR/2018/WD-css-transforms-1-20181130/</a> <dd><a href="https://www.w3.org/TR/2017/WD-css-transforms-1-20171130/" rel="prev">https://www.w3.org/TR/2017/WD-css-transforms-1-20171130/</a> <dd><a href="https://www.w3.org/TR/2013/WD-css-transforms-1-20131126/" rel="prev">https://www.w3.org/TR/2013/WD-css-transforms-1-20131126/</a> <dd><a href="https://www.w3.org/TR/2012/WD-css3-transforms-20120911/" rel="prev">https://www.w3.org/TR/2012/WD-css3-transforms-20120911/</a> <dd><a href="https://www.w3.org/TR/2012/WD-css3-transforms-20120403/" rel="prev">https://www.w3.org/TR/2012/WD-css3-transforms-20120403/</a> <dt>Feedback: <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-transforms-1">CSSWG Issues Repository</a> <dt class="editor">Editors: <dd class="editor p-author h-card vcard" data-editor-id="15393"><a class="p-name fn u-url url" href="https://dbaron.org/">L. David Baron</a> (<a class="p-org org" href="https://www.google.com">Google</a>) <dd class="editor p-author h-card vcard" data-editor-id="44066"><a class="p-name fn u-email email" href="mailto:simon.fraser@apple.com">Simon Fraser</a> (<a class="p-org org" href="http://www.apple.com/">Apple Inc</a>) <dd class="editor p-author h-card vcard" data-editor-id="42080"><a class="p-name fn u-email email" href="mailto:dino@apple.com">Dean Jackson</a> (<a class="p-org org" href="http://www.apple.com/">Apple Inc</a>) <dd class="editor p-author h-card vcard" data-editor-id="40614"><a class="p-name fn u-email email" href="mailto:eoconnor@apple.com">Theresa O'Connor</a> (<a class="p-org org" href="http://www.apple.com/">Apple Inc</a>) <dd class="editor p-author h-card vcard" data-editor-id="51803"><a class="p-name fn u-email email" href="mailto:dschulze@adobe.com">Dirk Schulze</a> (<a class="p-org org" href="http://www.adobe.com/">Adobe Inc</a>) <dt class="editor">Former Editors: <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:hyatt@apple.com">David Hyatt</a> (<a class="p-org org" href="http://www.apple.com/">Apple Inc</a>) <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:cmarrin@apple.com">Chris Marrin</a> (<a class="p-org org" href="http://www.apple.com/">Apple Inc</a>) <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:ayg@aryeh.name">Aryeh Gregor</a> (<a class="p-org org" href="http://www.mozilla.org/">Mozilla</a>) <dt>Suggest an Edit for this Spec: <dd><a href="https://github.com/w3c/csswg-drafts/blob/main/css-transforms-1/Overview.bs">GitHub Editor</a> </dl> </div> </details> <div data-fill-with="warning"></div> <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/policies/#copyright">Copyright</a> © 2025 <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/policies/#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/policies/#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/copyright/software-license/" rel="license" title="W3C Software and Document License">permissive document license</a> rules apply. </p> <hr title="Separator for header"> </div> <div class="p-summary" data-fill-with="abstract"> <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2> <p>CSS transforms allows elements styled with CSS to be transformed in two-dimensional space. This specification is the convergence of the <a href="https://www.w3.org/TR/2009/WD-css3-2d-transforms-20090320/">CSS 2D Transforms</a> and <a href="https://www.w3.org/TR/2009/WD-SVG-Transforms-20090320/">SVG transforms</a> specifications.</p> <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, etc. <script> const githubPrefix = "https://w3c.github.io/csswg-drafts/"; if(location.href.slice(0, githubPrefix.length) == githubPrefix) { const suffix = location.href.slice(githubPrefix.length); const draftUrl = "https://drafts.csswg.org/" + suffix; window.location.replace(draftUrl); } </script> </div> <h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content">Status of this document</span></h2> <div data-fill-with="status"> <p> This is a public copy of the editors’ draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don’t cite this document other than as work in progress. </p> <p>Please send feedback by <a href="https://github.com/w3c/csswg-drafts/issues">filing issues in GitHub</a> (preferred), including the spec code “css-transforms” in the title, like this: “[css-transforms] <i>…summary of comment…</i>”. All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>. Alternately, feedback can be sent to the (<a href="https://lists.w3.org/Archives/Public/www-style/">archived</a>) public mailing list <a href="mailto:www-style@w3.org?Subject=%5Bcss-transforms%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>. </p> <p>This document is governed by the <a href="https://www.w3.org/policies/process/20231103/" id="w3c_process_revision">03 November 2023 W3C Process Document</a>. </p> </div> <div data-fill-with="at-risk"></div> <nav data-fill-with="table-of-contents" id="toc"> <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2> <ol class="toc" role="directory"> <li> <a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a> <ol class="toc"> <li><a href="#module-interactions"><span class="secno">1.1</span> <span class="content">Module Interactions</span></a> <li><a href="#css-values"><span class="secno">1.2</span> <span class="content">CSS Values</span></a> </ol> <li><a href="#transform-rendering"><span class="secno">2</span> <span class="content">The Transform Rendering Model</span></a> <li> <a href="#transform-property"><span class="secno">3</span> <span class="content">The <span class="property">transform</span> Property</span></a> <ol class="toc"> <li><a href="#serialization-of-transform-functions"><span class="secno">3.1</span> <span class="content">Serialization of <span class="production"><transform-function></span>s</span></a> <li><a href="#serialization-of-the-computed-value"><span class="secno">3.2</span> <span class="content">Resolved value of <span class="property">transform</span></span></a> </ol> <li><a href="#transform-origin-property"><span class="secno">4</span> <span class="content">The <span class="property">transform-origin</span> Property</span></a> <li><a href="#transform-box"><span class="secno">5</span> <span class="content">Transform reference box: the <span class="property">transform-box</span> property</span></a> <li> <a href="#svg-transform"><span class="secno">6</span> <span class="content">The SVG <span>transform</span> Attribute</span></a> <ol class="toc"> <li><a href="#transform-attribute-specificity"><span class="secno">6.1</span> <span class="content">SVG presentation attributes</span></a> <li><a href="#svg-syntax"><span class="secno">6.2</span> <span class="content">Syntax of the SVG <span>transform</span> attribute</span></a> <li><a href="#svg-transform-functions"><span class="secno">6.3</span> <span class="content">SVG transform functions</span></a> <li><a href="#svg-user-coordinate-space"><span class="secno">6.4</span> <span class="content">User coordinate space</span></a> <li><a href="#transform-attribute-dom"><span class="secno">6.5</span> <span class="content">SVG DOM interface for the <span>transform</span> attribute</span></a> </ol> <li> <a href="#transform-functions"><span class="secno">7</span> <span class="content">The Transform Functions</span></a> <ol class="toc"> <li><a href="#two-d-transform-functions"><span class="secno">7.1</span> <span class="content">2D Transform Functions</span></a> <li><a href="#transform-primitives"><span class="secno">7.2</span> <span class="content">Transform function primitives and derivatives</span></a> </ol> <li><a href="#transform-function-lists"><span class="secno">8</span> <span class="content">The Transform Function Lists</span></a> <li><a href="#interpolation-of-transforms"><span class="secno">9</span> <span class="content">Interpolation of Transforms</span></a> <li><a href="#interpolation-of-transform-functions"><span class="secno">10</span> <span class="content">Interpolation of primitives and derived transform functions</span></a> <li> <a href="#matrix-interpolation"><span class="secno">11</span> <span class="content">Interpolation of Matrices</span></a> <ol class="toc"> <li><a href="#supporting-functions"><span class="secno">11.1</span> <span class="content">Supporting functions</span></a> <li> <a href="#interpolation-of-2d-matrices"><span class="secno">11.2</span> <span class="content">Interpolation of 2D matrices</span></a> <ol class="toc"> <li><a href="#decomposing-a-2d-matrix"><span class="secno">11.2.1</span> <span class="content">Decomposing a 2D matrix</span></a> <li><a href="#interpolation-of-decomposed-2d-matrix-values"><span class="secno">11.2.2</span> <span class="content"> Interpolation of decomposed 2D matrix values </span></a> <li><a href="#recomposing-to-a-2d-matrix"><span class="secno">11.2.3</span> <span class="content">Recomposing to a 2D matrix</span></a> </ol> </ol> <li><a href="#mathematical-description"><span class="secno">12</span> <span class="content">Mathematical Description of Transform Functions</span></a> <li><a href="#priv-sec"><span class="secno">13</span> <span class="content">Privacy and Security Considerations</span></a> <li> <a href="#changes"><span class="secno"></span> <span class="content">Changes</span></a> <ol class="toc"> <li><a href="#CR20190214"><span class="secno"></span> <span class="content">Since the <span>14 February 2019 Candidate Recommendation</span></span></a> <li><a href="#WD20181130"><span class="secno"></span> <span class="content">Since the <span>30 November 2018 Working Draft</span></span></a> <li><a href="#WD20171130"><span class="secno"></span> <span class="content">Since the <span>30 November 2017 Working Draft</span> </span></a> </ol> <li><a href="#acknowledgments"><span class="secno"></span> <span class="content">Acknowledgments</span></a> <li> <a href="#w3c-conformance"><span class="secno"></span> <span class="content"> Conformance</span></a> <ol class="toc"> <li><a href="#w3c-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a> <li><a href="#w3c-conformance-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a> <li> <a href="#w3c-partial"><span class="secno"></span> <span class="content"> Partial implementations</span></a> <ol class="toc"> <li><a href="#w3c-conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a> </ol> <li><a href="#w3c-testing"><span class="secno"></span> <span class="content"> Non-experimental implementations</span></a> </ol> <li> <a href="#index"><span class="secno"></span> <span class="content">Index</span></a> <ol class="toc"> <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a> <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a> </ol> <li> <a href="#references"><span class="secno"></span> <span class="content">References</span></a> <ol class="toc"> <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a> <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a> </ol> <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a> </ol> </nav> <main> <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2> <p><em>This section is not normative.</em></p> <p>The CSS <a href="https://www.w3.org/TR/CSS2/visuren.html">visual formatting model</a> describes a coordinate system within each element is positioned. Positions and sizes in this coordinate space can be thought of as being expressed in pixels, starting in the origin of point with positive values proceeding to the right and down.</p> <p>This coordinate space can be modified with the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform">transform</a> property. Using transform, elements can be translated, rotated and scaled.</p> <h3 class="heading settled" data-level="1.1" id="module-interactions"><span class="secno">1.1. </span><span class="content">Module Interactions</span><a class="self-link" href="#module-interactions"></a></h3> <p>This module defines a set of CSS properties that affect the visual rendering of elements to which those properties are applied; these effects are applied after elements have been sized and positioned according to the <a href="https://www.w3.org/TR/CSS2/visuren.html">visual formatting model</a> from <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>. Some values of these properties result in the creation of a <a href="https://www.w3.org/TR/CSS2/visuren.html#containing-block">containing block</a>, and/or the creation of a <a data-link-type="dfn" href="https://www.w3.org/TR/CSS2/visuren.html#x43" id="ref-for-x43">stacking context</a>.</p> <p>Transforms affect the rendering of backgrounds on elements with a value of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-backgrounds-3/#valdef-background-attachment-fixed" id="ref-for-valdef-background-attachment-fixed">fixed</a> for the <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-backgrounds-3/#propdef-background-attachment" id="ref-for-propdef-background-attachment">background-attachment</a> property, which is specified in <a data-link-type="biblio" href="#biblio-css3bg" title="CSS Backgrounds and Borders Module Level 3">[CSS3BG]</a>.</p> <p>Transforms affect the client rectangles returned by the Element Interface Extensions <a href="https://www.w3.org/TR/cssom-view/#dom-element-getclientrects">getClientRects()</a> and <a href="https://www.w3.org/TR/cssom-view/#dom-element-getboundingclientrect">getBoundingClientRect()</a>, which are specified in <a data-link-type="biblio" href="#biblio-cssom-view" title="CSSOM View Module">[CSSOM-VIEW]</a>.</p> <p>Transforms affect the computation of the <a href="https://www.w3.org/TR/css-overflow-3/#scrollable-overflow-region">scrollable overflow region</a> as described by <a data-link-type="biblio" href="#biblio-css-overflow-3" title="CSS Overflow Module Level 3">[CSS-OVERFLOW-3]</a>.</p> <h3 class="heading settled" data-level="1.2" id="css-values"><span class="secno">1.2. </span><span class="content">CSS Values</span><a class="self-link" href="#css-values"></a></h3> <p>This specification follows the <a href="https://www.w3.org/TR/CSS2/about.html#property-defs">CSS property definition conventions</a> from <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a> using the <a href="https://www.w3.org/TR/css-values-3/#value-defs">value definition syntax</a> from <a data-link-type="biblio" href="#biblio-css-values-3" title="CSS Values and Units Module Level 3">[CSS-VALUES-3]</a>. Value types not defined in this specification are defined in CSS Values & Units <span title="CSS Values and Units Module Level 3">[CSS-VALUES-3]</span>. Combination with other CSS modules may expand the definitions of these value types.</p> <p>In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#css-wide-keywords" id="ref-for-css-wide-keywords">CSS-wide keywords</a> as their property value. For readability they have not been repeated explicitly. Terminology {#terminology}</p> ========================== <p>When used in this specification, terms have the meanings assigned in this section.</p> <div> <dl> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="transformable-element">transformable element</dfn> <dd data-md> <p>A transformable element is an element in one of these categories:</p> <ul> <li data-md> <p>all elements whose layout is governed by the CSS box model except for non-replaced inline boxes, table-column boxes, and table-column-group boxes <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>,</p> <li data-md> <p>all SVG <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/painting.html#TermPaintServerElement" id="ref-for-TermPaintServerElement">paint server elements</a>, the <a data-link-type="element" href="https://drafts.fxtf.org/css-masking-1/#elementdef-clippath" id="ref-for-elementdef-clippath">clipPath</a> element and SVG <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/render.html#TermRenderableElement" id="ref-for-TermRenderableElement">renderable elements</a> with the exception of any descendant element of <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/text.html#TermTextContentElement" id="ref-for-TermTextContentElement">text content elements</a> <a data-link-type="biblio" href="#biblio-svg2" title="Scalable Vector Graphics (SVG) 2">[SVG2]</a>.</p> </ul> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="transformed-element">transformed element</dfn> <dd data-md> <p>An element with a computed value other than <span class="css">none</span> for the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①">transform</a> property.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="user-coordinate-system">user coordinate system</dfn> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="local-coordinate-system">local coordinate system</dfn> <dd data-md> <p>In general, a coordinate system defines locations and distances on the current canvas. The current local coordinate system (also user coordinate system) is the coordinate system that is currently active and which is used to define how coordinates and lengths are located and computed, respectively, on the current canvas. The current user coordinate system has its origin at the top-left of a <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box">reference box</a> specified by the <a class="property css" data-link-type="property" href="#propdef-transform-box" id="ref-for-propdef-transform-box">transform-box</a> property. Percentage values are relative to the dimension of this reference box. One unit equals one CSS pixel.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="transformation-matrix">transformation matrix</dfn> <dd data-md> <p>A matrix that defines the mathematical mapping from one coordinate system into another. It is computed from the values of the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform②">transform</a> and <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin">transform-origin</a> properties as described <a href="#transformation-matrix-computation">below</a>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="current-transformation-matrix">current transformation matrix</dfn> (CTM) <dd data-md> <p>A matrix that defines the mapping from the <a data-link-type="dfn" href="#local-coordinate-system" id="ref-for-local-coordinate-system">local coordinate system</a> into the <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/coords.html#TermViewportCoordinateSystem" id="ref-for-TermViewportCoordinateSystem">viewport coordinate system</a>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="2d-matrix">2D matrix</dfn> <dd data-md> <p>A 3x2 transformation matrix, or a 4x4 matrix where the items m<sub>31</sub>, m<sub>32</sub>, m<sub>13</sub>, m<sub>23</sub>, m<sub>43</sub>, m<sub>14</sub>, m<sub>24</sub>, m<sub>34</sub> are equal to <span class="css">0</span> and m<sub>33</sub>, m<sub>44</sub> are equal to <span class="css">1</span>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="identity-transform-function">identity transform function</dfn> <dd data-md> <p>A <a href="#transform-functions">transform function</a> that is equivalent to a identity 4x4 matrix (see <a href="#mathematical-description">Mathematical Description of Transform Functions</a>). Examples for identity transform functions are <span class="css">translate(0)</span>, <span class="css">translateX(0)</span>, <span class="css">translateY(0)</span>, <span class="css">scale(1)</span>, <span class="css">scaleX(1)</span>, <span class="css">scaleY(1)</span>, <span class="css">rotate(0)</span>, <span class="css">skew(0, 0)</span>, <span class="css">skewX(0)</span>, <span class="css">skewY(0)</span> and <span class="css">matrix(1, 0, 0, 1, 0, 0)</span>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="post-multiply">post-multiply</dfn> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="post-multiplied">post-multiplied</dfn> <dd data-md> <p>Term <var>A</var> post-multiplied by term <var>B</var> is equal to <var>A</var> · <var>B</var>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="pre-multiply">pre-multiply</dfn> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="pre-multiplied">pre-multiplied</dfn> <dd data-md> <p>Term <var>A</var> pre-multiplied by term <var>B</var> is equal to <var>B</var> · <var>A</var>.</p> <dt data-md><dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="multiply">multiply</dfn> <dd data-md> <p>Multiply term <var>A</var> by term <var>B</var> is equal to <var>A</var> · <var>B</var>.</p> </dl> </div> <h2 class="heading settled" data-level="2" id="transform-rendering"><span class="secno">2. </span><span class="content">The Transform Rendering Model</span><a class="self-link" href="#transform-rendering"></a></h2> <p><em>This section is normative.</em></p> <p>Specifying a value other than <span class="css">none</span> for the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform③">transform</a> property establishes a new <a data-link-type="dfn" href="#local-coordinate-system" id="ref-for-local-coordinate-system①">local coordinate system</a> at the element that it is applied to. The mapping from where the element would have rendered into that local coordinate system is given by the element’s <a data-link-type="dfn" href="#transformation-matrix" id="ref-for-transformation-matrix">transformation matrix</a>.</p> <p id="transformation-matrix-computation"> The <a data-link-type="dfn" href="#transformation-matrix" id="ref-for-transformation-matrix①">transformation matrix</a> is computed from the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform④">transform</a> and <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin①">transform-origin</a> properties as follows: </p> <ol> <li data-md> <p>Start with the identity matrix.</p> <li data-md> <p>Translate by the computed X and Y of <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin②">transform-origin</a></p> <li data-md> <p>Multiply by each of the transform functions in <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform⑤">transform</a> property from left to right</p> <li data-md> <p>Translate by the negated computed X and Y values of <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin③">transform-origin</a></p> </ol> <div class="example" id="example-de7edca6"> <a class="self-link" href="#example-de7edca6"></a> <p>An element has a <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform⑥">transform</a> property that is not <span class="css">none</span>.</p> <pre><code class="highlight">div <c- p>{</c-> <c- k>transform-origin</c-><c- p>:</c-> <c- m>0</c-> <c- m>0</c-><c- p>;</c-> <c- k>transform</c-><c- p>:</c-> <c- nf>translate</c-><c- p>(</c-><c- m>-10</c-><c- k>px</c-><c- p>,</c-> <c- m>-20</c-><c- k>px</c-><c- p>)</c-> <c- nf>scale</c-><c- p>(</c-><c- m>2</c-><c- p>)</c-> <c- nf>rotate</c-><c- p>(</c-><c- m>45</c-><c- k>deg</c-><c- p>);</c-> <c- p>}</c-> </code></pre> <p>The <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin④">transform-origin</a> property is set to <span class="css">0 0</span> and can be omitted. The <a data-link-type="dfn" href="#transformation-matrix" id="ref-for-transformation-matrix②">transformation matrix</a> <i>TM</i> gets computed by post-multiplying the <a class="production css" data-link-type="function" href="#funcdef-transform-translate" id="ref-for-funcdef-transform-translate"><translate()></a>, <a class="production css" data-link-type="function" href="#funcdef-transform-scale" id="ref-for-funcdef-transform-scale"><scale()></a> and <a class="production css" data-link-type="function" href="#funcdef-transform-rotate" id="ref-for-funcdef-transform-rotate"><rotate()></a> <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function"><transform-function></a>s.</p> <p><img alt="TM = \begin{bmatrix} 1 & 0 & 0 & -10 \\ 0 & 1 & 0 & -20 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \cdot \begin{bmatrix} 2 & 0 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \cdot \begin{bmatrix} cos(45) & -sin(45) & 0 & 0 \\ sin(45) & cos(45) & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}" src="images/tm.png" width="627"></p> </div> <p>Transforms apply to <a data-link-type="dfn" href="#transformable-element" id="ref-for-transformable-element">transformable elements</a>.</p> <p>The coordinate space is a coordinate system with two axes: the X axis increases horizontally to the right; the Y axis increases vertically downwards.</p> <p>Transformations are cumulative. That is, elements establish their local coordinate system within the coordinate system of their parent.</p> <p>To map a point <i>p<sub>local</sub></i> with the coordinate pair <i>x<sub>local</sub></i> and <i>y<sub>local</sub></i> from the <a data-link-type="dfn" href="#local-coordinate-system" id="ref-for-local-coordinate-system②">local coordinate system</a> of an element into the parent’s coordinate system, post-multiply the <a data-link-type="dfn" href="#transformation-matrix" id="ref-for-transformation-matrix③">transformation matrix</a> <i>TM</i> of the element by <i>p<sub>local</sub></i>. The result is the mapped point <i>p<sub>parent</sub></i> with the coordinate pair <i>x<sub>parent</sub></i> and <i>y<sub>parent</sub></i> in the parent’s <span id="ref-for-local-coordinate-system③">local coordinate system</span>.</p> <p><img alt="\begin{bmatrix} x_{parent} \\ y_{parent} \\ 0 \\ 1 \end{bmatrix} = TM \cdot \begin{bmatrix} x_{local} \\ y_{local} \\ 0 \\ 1 \end{bmatrix}" src="images/tm-map.png" width="276"></p> <p>From the perspective of the user, an element effectively accumulates all the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform⑦">transform</a> properties of its ancestors as well as any local transform applied to it. The accumulation of these transforms defines a <a data-link-type="dfn" href="#current-transformation-matrix" id="ref-for-current-transformation-matrix">current transformation matrix</a> (CTM) for the element.</p> <p id="current-transformation-matrix-computation"> The <a data-link-type="dfn" href="#current-transformation-matrix" id="ref-for-current-transformation-matrix①">current transformation matrix</a> is computed by post-multiplying all transformation matrices starting from the <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/coords.html#TermViewportCoordinateSystem" id="ref-for-TermViewportCoordinateSystem①">viewport coordinate system</a> and ending with the <a data-link-type="dfn" href="#transformation-matrix" id="ref-for-transformation-matrix④">transformation matrix</a> of an element. </p> <div class="example" id="example-63675dc3"> <a class="self-link" href="#example-63675dc3"></a> This example has multiple, nested elements in an SVG document. Some elements get transformed by a <a data-link-type="dfn" href="#transformation-matrix" id="ref-for-transformation-matrix⑤">transformation matrix</a>. <pre><code class="highlight"><c- p><</c-><c- f>svg</c-> <c- e>xmlns</c-><c- o>=</c-><c- s>"http://www.w3.org/2000/svg"</c-><c- p>></c-> <c- p><</c-><c- f>g</c-> <c- e>transform</c-><c- o>=</c-><c- s>"translate(-10, 20)"</c-><c- p>></c-> <c- p><</c-><c- f>g</c-> <c- e>transform</c-><c- o>=</c-><c- s>"scale(2)"</c-><c- p>></c-> <c- p><</c-><c- f>rect</c-> <c- e>width</c-><c- o>=</c-><c- s>"200"</c-> <c- e>height</c-><c- o>=</c-><c- s>"200"</c-> <c- e>transform</c-><c- o>=</c-><c- s>"rotate(45)"</c-><c- p>/></c-> <c- p></</c-><c- f>g</c-><c- p>></c-> <c- p></</c-><c- f>g</c-><c- p>></c-> <c- p></</c-><c- f>svg</c-><c- p>></c-> </code></pre> <ul> <li data-md> <p><span class="css">translate(-10, 20)</span> computes to the transformation matrix <i>T1</i></p> <li data-md> <p><span class="css">scale(2)</span> computes to the transformation matrix <i>T2</i></p> <li data-md> <p><span class="css">rotate(45)</span> computes to the transformation matrix <i>T3</i></p> </ul> <p>The CTM for the SVG <a data-link-type="element" href="https://svgwg.org/svg2-draft/shapes.html#elementdef-rect" id="ref-for-elementdef-rect">rect</a> element is the result of multiplying <i>T1</i>, <i>T2</i> and <i>T3</i> in order.</p> <p><img alt="CTM = \begin{bmatrix} 1 & 0 & 0 & -10 \\ 0 & 1 & 0 & -20 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \cdot \begin{bmatrix} 2 & 0 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \cdot \begin{bmatrix} cos(45) & -sin(45) & 0 & 0 \\ sin(45) & cos(45) & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}" src="images/ctm.png" width="627"></p> <p>To map a point <i>p<sub>local</sub></i> with the coordinate pair <i>x<sub>local</sub></i> and <i>y<sub>local</sub></i> from the <a data-link-type="dfn" href="#local-coordinate-system" id="ref-for-local-coordinate-system④">local coordinate system</a> of the SVG <a data-link-type="element" href="https://svgwg.org/svg2-draft/shapes.html#elementdef-rect" id="ref-for-elementdef-rect①">rect</a> element into the <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/coords.html#TermViewportCoordinateSystem" id="ref-for-TermViewportCoordinateSystem②">viewport coordinate system</a>, post-multiply the <a data-link-type="dfn" href="#current-transformation-matrix" id="ref-for-current-transformation-matrix②">current transformation matrix</a> <i>CTM</i> of the element by <i>p<sub>local</sub></i>. The result is the mapped point <i>p<sub>viewport</sub></i> with the coordinate pair <i>x<sub>viewport</sub></i> and <i>y<sub>viewport</sub></i> in the <span id="ref-for-TermViewportCoordinateSystem③">viewport coordinate system</span>.</p> <p><img alt="\begin{bmatrix} x_{viewport} \\ y_{viewport} \\ 0 \\ 1 \end{bmatrix} = CTM \cdot \begin{bmatrix} x_{local} \\ y_{local} \\ 0 \\ 1 \end{bmatrix}" src="images/ctm-map.png" width="276"></p> </div> <p class="note" role="note"><span class="marker">Note:</span> Transformations do affect the visual rendering, but have no effect on the CSS layout other than affecting overflow. Transforms are also taken into account when computing client rectangles exposed via the Element Interface Extensions, namely <a href="https://www.w3.org/TR/cssom-view/#dom-element-getclientrects">getClientRects()</a> and <a href="https://www.w3.org/TR/cssom-view/#dom-element-getboundingclientrect">getBoundingClientRect()</a>, which are specified in <a data-link-type="biblio" href="#biblio-cssom-view" title="CSSOM View Module">[CSSOM-VIEW]</a>.</p> <div class="example" id="example-76e5e4e0"> <a class="self-link" href="#example-76e5e4e0"></a> <pre><code class="highlight">div <c- p>{</c-> <c- k>transform</c-><c- p>:</c-> <c- nf>translate</c-><c- p>(</c-><c- m>100</c-><c- k>px</c-><c- p>,</c-> <c- m>100</c-><c- k>px</c-><c- p>);</c-> <c- p>}</c-> </code></pre> <p>This transform moves the element by 100 pixels in both the X and Y directions.</p> <div class="figure"> <img alt="The 100px translation in X and Y" height="250" src="examples/translate1.svg" width="470"> </div> </div> <div class="example" id="example-f319ce51"> <a class="self-link" href="#example-f319ce51"></a> <pre><code class="highlight">div <c- p>{</c-> <c- k>height</c-><c- p>:</c-> <c- m>100</c-><c- k>px</c-><c- p>;</c-> <c- k>width</c-><c- p>:</c-> <c- m>100</c-><c- k>px</c-><c- p>;</c-> <c- k>transform-origin</c-><c- p>:</c-> <c- m>50</c-><c- k>px</c-> <c- m>50</c-><c- k>px</c-><c- p>;</c-> <c- k>transform</c-><c- p>:</c-> <c- nf>rotate</c-><c- p>(</c-><c- m>45</c-><c- k>deg</c-><c- p>);</c-> <c- p>}</c-> </code></pre> <p>The <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin⑤">transform-origin</a> property moves the point of origin by 50 pixels in both the X and Y directions. The transform rotates the element clockwise by 45° about the point of origin. After all transform functions were applied, the translation of the origin gets translated back by -50 pixels in both the X and Y directions.</p> <div class="figure"> <img alt="The point of origin gets translated temporary" height="250" src="examples/origin1.svg" width="735"> </div> </div> <div class="example" id="example-d0510fef"> <a class="self-link" href="#example-d0510fef"></a> <pre><code class="highlight">div <c- p>{</c-> <c- k>height</c-><c- p>:</c-> <c- m>100</c-><c- k>px</c-><c- p>;</c-> <c- k>width</c-><c- p>:</c-> <c- m>100</c-><c- k>px</c-><c- p>;</c-> <c- k>transform</c-><c- p>:</c-> <c- nf>translate</c-><c- p>(</c-><c- m>80</c-><c- k>px</c-><c- p>,</c-> <c- m>80</c-><c- k>px</c-><c- p>)</c-> <c- nf>scale</c-><c- p>(</c-><c- m>1.5</c-><c- p>,</c-> <c- m>1.5</c-><c- p>)</c-> <c- nf>rotate</c-><c- p>(</c-><c- m>45</c-><c- k>deg</c-><c- p>);</c-> <c- p>}</c-> </code></pre> <p>The visual appearance is as if the <a data-link-type="element" href="https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element" id="ref-for-the-div-element">div</a> element gets translated by 80px to the bottom left direction, then scaled up by 150% and finally rotated by 45°.</p> <p>Each <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function①"><transform-function></a> can get represented by a corresponding 4x4 matrix. To map a point from the coordinate space of the <a data-link-type="element" href="https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element" id="ref-for-the-div-element①">div</a> box to the coordinate space of the parent element, these transforms get multiplied in the reverse order:</p> <ol> <li data-md> <p>The rotation matrix gets <a data-link-type="dfn" href="#post-multiplied" id="ref-for-post-multiplied">post-multiplied</a> by the scale matrix.</p> <li data-md> <p>The result of the previous multiplication is then <a data-link-type="dfn" href="#post-multiplied" id="ref-for-post-multiplied①">post-multiplied</a> by the translation matrix to create the accumulated transformation matrix.</p> <li data-md> <p>Finally, the point to map gets <a data-link-type="dfn" href="#pre-multiplied" id="ref-for-pre-multiplied">pre-multiplied</a> with the accumulated transformation matrix.</p> </ol> <p>For more details see <a href="#transform-function-lists">The Transform Function Lists</a>.</p> <div class="figure"> <img alt="The transform specified above" height="270" src="examples/compound_transform.svg" width="270"> </div> <p class="note" role="note"><span class="marker">Note:</span> The identical rendering can be obtained by nesting elements with the equivalent transforms:</p> <pre><code class="highlight"><c- p><</c-><c- f>div</c-> <c- e>style</c-><c- o>=</c-><c- s>"transform: translate(80px, 80px)"</c-><c- p>></c-> <c- p><</c-><c- f>div</c-> <c- e>style</c-><c- o>=</c-><c- s>"transform: scale(1.5, 1.5)"</c-><c- p>></c-> <c- p><</c-><c- f>div</c-> <c- e>style</c-><c- o>=</c-><c- s>"transform: rotate(45deg)"</c-><c- p>></</c-><c- f>div</c-><c- p>></c-> <c- p></</c-><c- f>div</c-><c- p>></c-> <c- p></</c-><c- f>div</c-><c- p>></c-> </code></pre> </div> <p>For elements whose layout is governed by the CSS box model, the transform property does not affect the flow of the content surrounding the transformed element. However, the extent of the overflow area takes into account transformed elements. This behavior is similar to what happens when elements are offset via relative positioning. Therefore, if the value of the <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow">overflow</a> property is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-scroll" id="ref-for-valdef-overflow-scroll">scroll</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-overflow-auto" id="ref-for-valdef-overflow-auto">auto</a>, scrollbars will appear as needed to see content that is transformed outside the visible area. Specifically, transforms can extend (but do not shrink) the size of the overflow area, which is computed as the union of the bounds of the elements before and after the application of transforms.</p> <p>For elements whose layout is governed by the CSS box model, any value other than <span class="css">none</span> for the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform⑧">transform</a> property results in the creation of a stacking context. Implementations must paint the layer it creates, within its parent stacking context, at the same stacking order that would be used if it were a positioned element with <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css2/#propdef-z-index" id="ref-for-propdef-z-index">z-index: 0</a>. If an element with a transform is positioned, the <span class="property" id="ref-for-propdef-z-index①">z-index</span> property applies as described in <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>, except that <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/#valdef-z-index-auto" id="ref-for-valdef-z-index-auto">auto</a> is treated as <span class="css">0</span> since a new stacking context is always created.</p> <p>For elements whose layout is governed by the CSS box model, any value other than <span class="css">none</span> for the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform⑨">transform</a> property also causes the element to establish a <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="containing-block-for-all-descendants">containing block for all descendants</dfn>. Its padding box will be used to layout for all of its absolute-position descendants, fixed-position descendants, and descendant fixed background attachments.</p> <div class="example" id="example-544151e4"> <a class="self-link" href="#example-544151e4"></a> To demonstrate the effect of <a data-link-type="dfn" href="#containing-block-for-all-descendants" id="ref-for-containing-block-for-all-descendants">containing block for all descendants</a> on fixed-position descendants, the following code snippets should behave identically: <pre><code class="highlight"><c- p><</c-><c- f>style</c-><c- p>></c-> <c- p>#</c-><c- nn>container</c-> <c- p>{</c-> <c- k>width</c-><c- p>:</c-> <c- mi>300</c-><c- b>px</c-><c- p>;</c-> <c- k>height</c-><c- p>:</c-> <c- mi>200</c-><c- b>px</c-><c- p>;</c-> <c- k>border</c-><c- p>:</c-> <c- mi>5</c-><c- b>px</c-> <c- kc>dashed</c-> <c- kc>black</c-><c- p>;</c-> <c- k>padding</c-><c- p>:</c-> <c- mi>5</c-><c- b>px</c-><c- p>;</c-> <c- k>overflow</c-><c- p>:</c-> <c- kc>scroll</c-><c- p>;</c-> <c- p>}</c-> <c- p>#</c-><c- nn>bloat</c-> <c- p>{</c-> <c- k>height</c-><c- p>:</c-> <c- mi>1000</c-><c- b>px</c-><c- p>;</c-> <c- p>}</c-> <c- p>#</c-><c- nn>child</c-> <c- p>{</c-> <c- k>right</c-><c- p>:</c-> <c- mi>0</c-><c- p>;</c-> <c- k>bottom</c-><c- p>:</c-> <c- mi>0</c-><c- p>;</c-> <c- k>width</c-><c- p>:</c-> <c- mi>10</c-><c- b>%</c-><c- p>;</c-> <c- k>height</c-><c- p>:</c-> <c- mi>10</c-><c- b>%</c-><c- p>;</c-> <c- k>background</c-><c- p>:</c-> <c- kc>green</c-><c- p>;</c-> <c- p>}</c-> <c- p></</c-><c- f>style</c-><c- p>></c-> <c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"container"</c-> <c- e>style</c-><c- o>=</c-><c- s>"transform:translateX(5px);"</c-><c- p>></c-> <c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"bloat"</c-><c- p>></</c-><c- f>div</c-><c- p>></c-> <c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"child"</c-> <c- e>style</c-><c- o>=</c-><c- s>"position:fixed;"</c-><c- p>></</c-><c- f>div</c-><c- p>></c-> <c- p></</c-><c- f>div</c-><c- p>></c-> </code></pre> <p>versus</p> <pre><code class="highlight"><c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"container"</c-> <c- e>style</c-><c- o>=</c-><c- s>"position:relative; z-index:0; left:5px;"</c-><c- p>></c-> <c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"bloat"</c-><c- p>></</c-><c- f>div</c-><c- p>></c-> <c- p><</c-><c- f>div</c-> <c- e>id</c-><c- o>=</c-><c- s>"child"</c-> <c- e>style</c-><c- o>=</c-><c- s>"position:absolute;"</c-><c- p>></</c-><c- f>div</c-><c- p>></c-> <c- p></</c-><c- f>div</c-><c- p>></c-> </code></pre> </div> <p>When the background of an element is propagated to the canvas (see <a href="https://drafts.csswg.org/css-backgrounds-3/#root-background"><cite>CSS Backgrounds 3</cite> § 2.11.1 The Canvas Background and the Root Element</a> and <a href="https://drafts.csswg.org/css-backgrounds-3/#body-background"><cite>CSS Backgrounds 3</cite> § 2.11.2 The Canvas Background and the HTML <body> Element</a>), that background is not affected by any transform specified for that element or for the root element.</p> <p>For elements that are effected by a transform (i.e. have a transform applied to them, or to any of their ancestor elements) and do not have their background propagated to the canvas, a value of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-backgrounds-3/#valdef-background-attachment-fixed" id="ref-for-valdef-background-attachment-fixed①">fixed</a> for the <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-backgrounds-3/#propdef-background-attachment" id="ref-for-propdef-background-attachment①">background-attachment</a> property is treated as if it had a value of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-backgrounds-3/#valdef-background-attachment-scroll" id="ref-for-valdef-background-attachment-scroll">scroll</a>. The computed value of <span class="property" id="ref-for-propdef-background-attachment②">background-attachment</span> is not affected.</p> <h2 class="heading settled" data-level="3" id="transform-property"><span class="secno">3. </span><span class="content">The <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①⓪">transform</a> Property</span><a class="self-link" href="#transform-property"></a></h2> <p>A transformation is applied to the coordinate system an element renders into through the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①①">transform</a> property. This property contains a list of <a href="#transform-functions">transform functions</a>. The final transformation value for a coordinate system is obtained by converting each function in the list to its corresponding matrix like defined in <a href="#mathematical-description">Mathematical Description of Transform Functions</a>, then multiplying the matrices.</p> <table class="def propdef" data-link-for-hint="transform"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-transform">transform</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> <a class="production css" data-link-type="type" href="#typedef-transform-list" id="ref-for-typedef-transform-list"><transform-list></a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>none <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td><a data-link-type="dfn" href="#transformable-element" id="ref-for-transformable-element①">transformable elements</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>refer to the size of <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box①">reference box</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>as specified, but with lengths made absolute <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>transform list, see <a href="#interpolation-of-transforms">interpolation rules</a> </table> <p>Any computed value other than <span class="css">none</span> for the transform affects containing block and stacking context, as described in <a href="#transform-rendering">§ 2 The Transform Rendering Model</a>.</p> <pre class="prod"><dfn class="dfn-paneled" data-dfn-type="type" data-export id="typedef-transform-list"><transform-list></dfn> = <a class="production" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function②"><transform-function></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-one-plus" id="ref-for-mult-one-plus">+</a></pre> <h3 class="heading settled" data-level="3.1" id="serialization-of-transform-functions"><span class="secno">3.1. </span><span class="content">Serialization of <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function③"><transform-function></a>s</span><a class="self-link" href="#serialization-of-transform-functions"></a></h3> <p>To serialize the <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function④"><transform-function></a>s, serialize as per their individual grammars, in the order the grammars are written in, avoiding <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-values-4/#funcdef-calc" id="ref-for-funcdef-calc"><calc()></a> expressions where possible, avoiding <span class="production" id="ref-for-funcdef-calc①"><calc()></span> transformations, omitting components when possible without changing the meaning, joining space-separated tokens with a single space, and following each serialized comma with a single space.</p> <h3 class="heading settled" data-level="3.2" id="serialization-of-the-computed-value"><span class="secno">3.2. </span><span class="content">Resolved value of <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①②">transform</a></span><a class="self-link" href="#serialization-of-the-computed-value"></a></h3> <p>The <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①③">transform</a> property is a <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-1/#resolved-value-special-case-property" id="ref-for-resolved-value-special-case-property">resolved value special case property</a>. <a data-link-type="biblio" href="#biblio-cssom" title="CSS Object Model (CSSOM)">[CSSOM]</a></p> <p>When the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value">computed value</a> is a <a class="production css" data-link-type="type" href="#typedef-transform-list" id="ref-for-typedef-transform-list①"><transform-list></a>, the <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-1/#resolved-value" id="ref-for-resolved-value">resolved value</a> is one <a class="production css" data-link-type="function" href="#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix"><matrix()></a> function computed by the following algorithm:</p> <ol class="algorithm"> <li data-md> <p>Let <var>transform</var> be a 4x4 matrix initialized to the identity matrix. The elements <var>m11</var>, <var>m22</var>, <var>m33</var> and <var>m44</var> of <var>transform</var> must be set to <span class="css">1</span>; all other elements of <var>transform</var> must be set to <span class="css">0</span>.</p> <li data-md> <p>Post-multiply all <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function⑤"><transform-function></a>s in <a class="production css" data-link-type="type" href="#typedef-transform-list" id="ref-for-typedef-transform-list②"><transform-list></a> to <var>transform</var>.</p> <li data-md> <p>Serialize <var>transform</var> to a <a class="production css" data-link-type="function" href="#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix①"><matrix()></a> function.</p> </ol> <p>For other computed values, the <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-1/#resolved-value" id="ref-for-resolved-value①">resolved value</a> is the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value①">computed value</a>.</p> <h2 class="heading settled" data-level="4" id="transform-origin-property"><span class="secno">4. </span><span class="content">The <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin⑥">transform-origin</a> Property</span><a class="self-link" href="#transform-origin-property"></a></h2> <table class="def propdef" data-link-for-hint="transform-origin"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-transform-origin">transform-origin</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod"> [ left <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①">|</a> center <span id="ref-for-comb-one②">|</span> right <span id="ref-for-comb-one③">|</span> top <span id="ref-for-comb-one④">|</span> bottom <span id="ref-for-comb-one⑤">|</span> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage"><length-percentage></a> ]<br> <span id="ref-for-comb-one⑥">|</span> <br> [ left <span id="ref-for-comb-one⑦">|</span> center <span id="ref-for-comb-one⑧">|</span> right <span id="ref-for-comb-one⑨">|</span> <span class="production" id="ref-for-typedef-length-percentage①"><length-percentage></span> ]<br> [ top <span id="ref-for-comb-one①⓪">|</span> center <span id="ref-for-comb-one①①">|</span> bottom <span id="ref-for-comb-one①②">|</span> <span class="production" id="ref-for-typedef-length-percentage②"><length-percentage></span> ] <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value"><length></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt">?</a><br> <span id="ref-for-comb-one①③">|</span><br> [ [ center <span id="ref-for-comb-one①④">|</span> left <span id="ref-for-comb-one①⑤">|</span> right ] <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-all" id="ref-for-comb-all">&&</a> [ center <span id="ref-for-comb-one①⑥">|</span> top <span id="ref-for-comb-one①⑦">|</span> bottom ] ] <span class="production" id="ref-for-length-value①"><length></span><span id="ref-for-mult-opt①">?</span> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>50% 50% <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td><a data-link-type="dfn" href="#transformable-element" id="ref-for-transformable-element②">transformable elements</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>refer to the size of <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box②">reference box</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>see <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-backgrounds-3/#propdef-background-position" id="ref-for-propdef-background-position">background-position</a> <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>by computed value </table> <p>The values of the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①④">transform</a> and <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin⑦">transform-origin</a> properties are used to compute the <a data-link-type="dfn" href="#transformation-matrix" id="ref-for-transformation-matrix⑥">transformation matrix</a>, as described above.</p> <p>If only one value is specified, the second value is assumed to be <a class="css" data-link-type="value" href="#valdef-transform-origin-center" id="ref-for-valdef-transform-origin-center">center</a>. If one or two values are specified, the third value is assumed to be <span class="css">0px</span>.</p> <p>If two or more values are defined and either no value is a keyword, or the only used keyword is <a class="css" data-link-type="value" href="#valdef-transform-origin-center" id="ref-for-valdef-transform-origin-center①">center</a>, then the first value represents the horizontal position (or offset) and the second represents the vertical position (or offset). A third value always represents the Z position (or offset) and must be of type <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value②"><length></a>.</p> <dl> <dt data-md><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage③"><length-percentage></a> <dd data-md> <p>A percentage for the horizontal offset is relative to the width of the <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box③">reference box</a>. A percentage for the vertical offset is relative to the height of the <span id="ref-for-reference-box④">reference box</span>. The value for the horizontal and vertical offset represent an offset from the top left corner of the <span id="ref-for-reference-box⑤">reference box</span>.</p> <dt data-md><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value③"><length></a> <dd data-md> <p>A length value gives a fixed length as the offset. The value for the horizontal and vertical offset represent an offset from the top left corner of the <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box⑥">reference box</a>.</p> <dt data-md><dfn class="dfn-paneled css" data-dfn-for="transform-origin" data-dfn-type="value" data-export id="valdef-transform-origin-top">top</dfn> <dd data-md> <p>Computes to <span class="css">0%</span> for the vertical position.</p> <dt data-md><dfn class="dfn-paneled css" data-dfn-for="transform-origin" data-dfn-type="value" data-export id="valdef-transform-origin-right">right</dfn> <dd data-md> <p>Computes to <span class="css">100%</span> for the horizontal position.</p> <dt data-md><dfn class="dfn-paneled css" data-dfn-for="transform-origin" data-dfn-type="value" data-export id="valdef-transform-origin-bottom">bottom</dfn> <dd data-md> <p>Computes to <span class="css">100%</span> for the vertical position.</p> <dt data-md><dfn class="dfn-paneled css" data-dfn-for="transform-origin" data-dfn-type="value" data-export id="valdef-transform-origin-left">left</dfn> <dd data-md> <p>Computes to <span class="css">0%</span> for the horizontal position.</p> <dt data-md><dfn class="dfn-paneled css" data-dfn-for="transform-origin" data-dfn-type="value" data-export id="valdef-transform-origin-center">center</dfn> <dd data-md> <p>Computes to <span class="css">50%</span> (<span class="css">left 50%</span>) for the horizontal position if the horizontal position is not otherwise specified, or <span class="css">50%</span> (<span class="css">top 50%</span>) for the vertical position if it is.</p> </dl> <p>For SVG elements without associated CSS layout box the initial <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#used-value" id="ref-for-used-value">used value</a> is <span class="css">0 0</span> as if the user agent style sheet contained:</p> <pre><code class="highlight">*<c- nf>:not</c-><c- p>(</c->svg<c- p>),</c-> *<c- nf>:not</c-><c- p>(</c->foreignObject<c- p>)</c-> > svg <c- p>{</c-> <c- k>transform-origin</c-><c- p>:</c-> <c- m>0</c-> <c- m>0</c-><c- p>;</c-> <c- p>}</c-> </code></pre> <p>The <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin⑧">transform-origin</a> property is a <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-1/#resolved-value-special-case-property" id="ref-for-resolved-value-special-case-property①">resolved value special case property</a> like <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-sizing-3/#propdef-height" id="ref-for-propdef-height">height</a>. <a data-link-type="biblio" href="#biblio-cssom" title="CSS Object Model (CSSOM)">[CSSOM]</a></p> <h2 class="heading settled" data-level="5" id="transform-box"><span class="secno">5. </span><span class="content">Transform reference box: the <a class="property css" data-link-type="property" href="#propdef-transform-box" id="ref-for-propdef-transform-box①">transform-box</a> property</span><a class="self-link" href="#transform-box"></a></h2> <table class="def propdef" data-link-for-hint="transform-box"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-transform-box">transform-box</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">content-box <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑧">|</a> border-box <span id="ref-for-comb-one①⑨">|</span> fill-box <span id="ref-for-comb-one②⓪">|</span> stroke-box <span id="ref-for-comb-one②①">|</span> view-box <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>view-box <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td><a data-link-type="dfn" href="#transformable-element" id="ref-for-transformable-element③">transformable elements</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>N/A <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>specified keyword <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>discrete </table> <p>All transformations defined by the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①⑤">transform</a> and <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin⑨">transform-origin</a> property are relative to the position and dimensions of the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="reference-box">reference box</dfn> of the element. The <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box⑦">reference box</a> is specified by one of the following:</p> <dl> <dt data-md><dfn class="dfn-paneled css" data-dfn-for="transform-box" data-dfn-type="value" data-export id="valdef-transform-box-content-box">content-box</dfn> <dd data-md> <p>Uses the content box as reference box. The reference box of a table is the border box of its <a href="https://www.w3.org/TR/CSS21/tables.html#model">table wrapper box</a>, not its table box.</p> <dt data-md><dfn class="dfn-paneled css" data-dfn-for="transform-box" data-dfn-type="value" data-export id="valdef-transform-box-border-box">border-box</dfn> <dd data-md> <p>Uses the border box as reference box. The reference box of a table is the border box of its <a href="https://www.w3.org/TR/CSS21/tables.html#model">table wrapper box</a>, not its table box.</p> <dt data-md><dfn class="dfn-paneled css" data-dfn-for="transform-box" data-dfn-type="value" data-export id="valdef-transform-box-fill-box">fill-box</dfn> <dd data-md> <p>Uses the <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/coords.html#TermObjectBoundingBox" id="ref-for-TermObjectBoundingBox">object bounding box</a> as reference box.</p> <dt data-md><dfn class="dfn-paneled css" data-dfn-for="transform-box" data-dfn-type="value" data-export id="valdef-transform-box-stroke-box">stroke-box</dfn> <dd data-md> <p>Uses the <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/coords.html#TermStrokeBoundingBox" id="ref-for-TermStrokeBoundingBox">stroke bounding box</a> as reference box.</p> <dt data-md><dfn class="dfn-paneled css" data-dfn-for="transform-box" data-dfn-type="value" data-export id="valdef-transform-box-view-box">view-box</dfn> <dd data-md> <p>Uses the nearest <a href="https://www.w3.org/TR/SVG11/intro.html#TermSVGViewport">SVG viewport</a> as reference box.</p> <p>If a <code class="idl"><a data-link-type="idl" href="https://svgwg.org/svg2-draft/types.html#__svg__SVGFitToViewBox__viewBox" id="ref-for-__svg__SVGFitToViewBox__viewBox">viewBox</a></code> attribute is specified for the <a href="https://www.w3.org/TR/SVG11/intro.html#TermSVGViewport">SVG viewport</a> creating element:</p> <ul> <li data-md> <p>The reference box is positioned at the origin of the coordinate system established by the <code class="idl"><a data-link-type="idl" href="https://svgwg.org/svg2-draft/types.html#__svg__SVGFitToViewBox__viewBox" id="ref-for-__svg__SVGFitToViewBox__viewBox①">viewBox</a></code> attribute.</p> <li data-md> <p>The dimension of the reference box is set to the <em>width</em> and <em>height</em> values of the <code class="idl"><a data-link-type="idl" href="https://svgwg.org/svg2-draft/types.html#__svg__SVGFitToViewBox__viewBox" id="ref-for-__svg__SVGFitToViewBox__viewBox②">viewBox</a></code> attribute.</p> </ul> </dl> <p>For the SVG <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern" id="ref-for-elementdef-pattern">pattern</a></code> element, the reference box gets defined by the <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG/pservers.html#PatternElementPatternUnitsAttribute" id="ref-for-PatternElementPatternUnitsAttribute">patternUnits</a></code> attribute <a data-link-type="biblio" href="#biblio-svg2" title="Scalable Vector Graphics (SVG) 2">[SVG2]</a>.</p> <p>For the SVG <a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-linearGradient" id="ref-for-elementdef-linearGradient">linearGradient</a> and <a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-radialGradient" id="ref-for-elementdef-radialGradient">radialGradient</a> elements, the reference box gets defined by the <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG/pservers.html#LinearGradientElementGradientUnitsAttribute" id="ref-for-LinearGradientElementGradientUnitsAttribute">gradientUnits</a></code> attribute <a data-link-type="biblio" href="#biblio-svg2" title="Scalable Vector Graphics (SVG) 2">[SVG2]</a>.</p> <p>For the SVG <a data-link-type="element" href="https://drafts.fxtf.org/css-masking-1/#elementdef-clippath" id="ref-for-elementdef-clippath①">clipPath</a> element, the reference box gets defined by the <code><a data-link-type="element-sub" href="https://drafts.fxtf.org/css-masking-1/#element-attrdef-clippath-clippathunits" id="ref-for-element-attrdef-clippath-clippathunits">clipPathUnits</a></code> attribute <a data-link-type="biblio" href="#biblio-css-masking" title="CSS Masking Module Level 1">[CSS-MASKING]</a>.</p> <p>A reference box adds an additional offset to the origin specified by the <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin①⓪">transform-origin</a> property.</p> <p>For SVG elements without associated CSS layout box, the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#used-value" id="ref-for-used-value①">used value</a> for <a class="css" data-link-type="maybe" href="#valdef-transform-box-content-box" id="ref-for-valdef-transform-box-content-box">content-box</a> is <a class="css" data-link-type="maybe" href="#valdef-transform-box-fill-box" id="ref-for-valdef-transform-box-fill-box">fill-box</a> and for <a class="css" data-link-type="maybe" href="#valdef-transform-box-border-box" id="ref-for-valdef-transform-box-border-box">border-box</a> is <a class="css" data-link-type="maybe" href="#valdef-transform-box-stroke-box" id="ref-for-valdef-transform-box-stroke-box">stroke-box</a>.</p> <p>For elements with associated CSS layout box, the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#used-value" id="ref-for-used-value②">used value</a> for <a class="css" data-link-type="maybe" href="#valdef-transform-box-fill-box" id="ref-for-valdef-transform-box-fill-box①">fill-box</a> is <a class="css" data-link-type="maybe" href="#valdef-transform-box-content-box" id="ref-for-valdef-transform-box-content-box①">content-box</a> and for <a class="css" data-link-type="maybe" href="#valdef-transform-box-stroke-box" id="ref-for-valdef-transform-box-stroke-box①">stroke-box</a> and <a class="css" data-link-type="maybe" href="#valdef-transform-box-view-box" id="ref-for-valdef-transform-box-view-box">view-box</a> is <a class="css" data-link-type="maybe" href="#valdef-transform-box-border-box" id="ref-for-valdef-transform-box-border-box①">border-box</a>.</p> <h2 class="heading settled" data-level="6" id="svg-transform"><span class="secno">6. </span><span class="content">The SVG <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute">transform</a> Attribute</span><a class="self-link" href="#svg-transform"></a></h2> <h3 class="heading settled" data-level="6.1" id="transform-attribute-specificity"><span class="secno">6.1. </span><span class="content">SVG presentation attributes</span><a class="self-link" href="#transform-attribute-specificity"></a></h3> <p>The <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin①①">transform-origin</a> CSS property is also a <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/styling.html#TermPresentationAttribute" id="ref-for-TermPresentationAttribute">presentation attribute</a> and extends the list of existing <span id="ref-for-TermPresentationAttribute①">presentation attributes</span> <a data-link-type="biblio" href="#biblio-svg2" title="Scalable Vector Graphics (SVG) 2">[SVG2]</a>.</p> <p>SVG 2 defines the <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute①">transform</a>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute" id="ref-for-PatternElementPatternTransformAttribute">patternTransform</a></code>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute" id="ref-for-LinearGradientElementGradientTransformAttribute">gradientTransform</a></code> attributes as <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/styling.html#TermPresentationAttribute" id="ref-for-TermPresentationAttribute②">presentation attributes</a>, represented by the CSS <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①⑥">transform</a> property <a data-link-type="biblio" href="#biblio-svg2" title="Scalable Vector Graphics (SVG) 2">[SVG2]</a>.</p> <p>The participation in the CSS cascade is determined by the specificity of <a data-link-type="dfn" href="https://svgwg.org/svg2-draft/styling.html#TermPresentationAttribute" id="ref-for-TermPresentationAttribute③">presentation attributes</a> in the SVG specification. According to SVG, user agents conceptually insert a <a href="https://www.w3.org/TR/SVG/styling.html#PresentationAttributes">new author style sheet</a> for presentation attributes, which is the first in the author style sheet collection <a data-link-type="biblio" href="#biblio-svg2" title="Scalable Vector Graphics (SVG) 2">[SVG2]</a>.</p> <div class="example" id="example-ae528470"> <a class="self-link" href="#example-ae528470"></a> This example shows the combination of the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①⑦">transform</a> style property and the <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute②">transform</a> attribute. <pre><code class="highlight"><c- f><svg</c-> <c- e>xmlns=</c-><c- s>"http://www.w3.org/2000/svg"</c-><c- f>></c-> <c- f><style></c-> .container { transform: translate(100px, 100px); } <c- f></style></c-> <c- f><g</c-> <c- e>class=</c-><c- s>"container"</c-> <c- e>transform=</c-><c- s>"translate(200 200)"</c-><c- f>></c-> <c- f><rect</c-> <c- e>width=</c-><c- s>"100"</c-> <c- e>height=</c-><c- s>"100"</c-> <c- e>fill=</c-><c- s>"blue"</c-> <c- f>/></c-> <c- f></g></c-> <c- f></svg></c-> </code></pre> <div class="figure"> <img alt="Translated SVG container element." height="240" src="examples/svg-translate1.svg" width="470"> </div> <p>Because of the participation to the CSS cascade, the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①⑧">transform</a> style property overrides the <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute③">transform</a> attribute. Therefore the container gets translated by <span class="css">100px</span> in both the horizontal and the vertical directions, instead of <span class="css">200px</span>.</p> </div> <h3 class="heading settled" data-level="6.2" id="svg-syntax"><span class="secno">6.2. </span><span class="content">Syntax of the SVG <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute④">transform</a> attribute</span><a class="self-link" href="#svg-syntax"></a></h3> <p>For backwards compatibility reasons, the syntax of the <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute⑤">transform</a>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute" id="ref-for-PatternElementPatternTransformAttribute①">patternTransform</a></code>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute" id="ref-for-LinearGradientElementGradientTransformAttribute①">gradientTransform</a></code> attributes differ from the syntax of the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform①⑨">transform</a> CSS property. For the attributes, there is no support for additional <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function⑥"><transform-function></a>s defined for the CSS <span class="property" id="ref-for-propdef-transform②⓪">transform</span> property. Specifically, <a class="production css" data-link-type="function" href="#funcdef-transform-translatex" id="ref-for-funcdef-transform-translatex"><translateX()></a>, <a class="production css" data-link-type="function" href="#funcdef-transform-translatey" id="ref-for-funcdef-transform-translatey"><translateY()></a>, <a class="production css" data-link-type="function" href="#funcdef-transform-scalex" id="ref-for-funcdef-transform-scalex"><scaleX()></a>, <a class="production css" data-link-type="function" href="#funcdef-transform-scaley" id="ref-for-funcdef-transform-scaley"><scaleY()></a> and <a class="production css" data-link-type="function" href="#funcdef-transform-skew" id="ref-for-funcdef-transform-skew"><skew()></a> are not supported by the <span id="ref-for-TransformAttribute⑥">transform</span>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute" id="ref-for-PatternElementPatternTransformAttribute②">patternTransform</a></code>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute" id="ref-for-LinearGradientElementGradientTransformAttribute②">gradientTransform</a></code> attributes.</p> <p>The following list uses the Backus-Naur Form (BNF) to define values for the <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute⑦">transform</a>, <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute" id="ref-for-PatternElementPatternTransformAttribute③">patternTransform</a> and <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute" id="ref-for-LinearGradientElementGradientTransformAttribute③">gradientTransform</a> attributes followed by an informative rail road diagram. The following notation is used:</p> <ul> <li data-md> <p>*: 0 or more</p> <li data-md> <p>+: 1 or more</p> <li data-md> <p>?: 0 or 1</p> <li data-md> <p>(): grouping</p> <li data-md> <p>|: separates alternatives</p> <li data-md> <p>double quotes surround literals. Literals consists of <a data-link-type="dfn" href="https://drafts.csswg.org/css-syntax-3/#letter" id="ref-for-letter">letter</a>s <a data-link-type="biblio" href="#biblio-css-syntax-3" title="CSS Syntax Module Level 3">[CSS-SYNTAX-3]</a>, left parenthesis and right parenthesis.</p> <li data-md> <p><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-syntax-3/#typedef-number-token" id="ref-for-typedef-number-token"><number-token></a> defined by the CSS Syntax module <a data-link-type="biblio" href="#biblio-css-syntax-3" title="CSS Syntax Module Level 3">[CSS-SYNTAX-3]</a>.</p> </ul> <p class="note" role="note"><span class="marker">Note:</span> The syntax reflects implemented behavior in user agents and differs from the syntax defined by SVG 1.1.</p> <dl> <dt>left parenthesis ( <dd>U+0028 LEFT PARENTHESIS <dt>right parenthesis ) <dd>U+0029 RIGHT PARENTHESIS <dt id="svg-comma"><a class="self-link" href="#svg-comma"></a>comma <dd>U+002C COMMA. <dt id="svg-wsp"><a class="self-link" href="#svg-wsp"></a>wsp <dd>Either a U+000A LINE FEED, U+000D CARRIAGE RETURN, U+0009 CHARACTER TABULATION, or U+0020 SPACE. <dd> <div class="railroad"> <svg class="railroad-diagram" height="152" viewBox="0 0 182.5 152" width="182.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 31h0.0"></path> <path d="M142.5 31h0.0"></path> <path d="M40.0 31h20"></path> <g class="terminal "> <path d="M60.0 31h0.0"></path> <path d="M122.5 31h0.0"></path> <rect height="22" rx="10" ry="10" width="62.5" x="60" y="20"></rect> <text x="91.25" y="35">space</text> </g> <path d="M122.5 31h20"></path> <path d="M40.0 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M60.0 61h12.75"></path> <path d="M109.75 61h12.75"></path> <rect height="22" rx="10" ry="10" width="37" x="72.75" y="50"></rect> <text x="91.25" y="65">\t</text> </g> <path d="M122.5 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> <path d="M40.0 31a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M60.0 91h12.75"></path> <path d="M109.75 91h12.75"></path> <rect height="22" rx="10" ry="10" width="37" x="72.75" y="80"></rect> <text x="91.25" y="95">\r</text> </g> <path d="M122.5 91a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path> <path d="M40.0 31a10 10 0 0 1 10 10v70a10 10 0 0 0 10 10"></path> <g class="terminal "> <path d="M60.0 121h12.75"></path> <path d="M109.75 121h12.75"></path> <rect height="22" rx="10" ry="10" width="37" x="72.75" y="110"></rect> <text x="91.25" y="125">\f</text> </g> <path d="M122.5 121a10 10 0 0 0 10 -10v-70a10 10 0 0 1 10 -10"></path> </g> <path d="M 142.5 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="svg-comma-wsp"><a class="self-link" href="#svg-comma-wsp"></a>comma-wsp <dd> <pre>(wsp+ comma? wsp*) | (comma wsp*)</pre> <dd> <div class="railroad"> <svg class="railroad-diagram" height="128" viewBox="0 0 403.5 128" width="403.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 40h0.0"></path> <path d="M363.5 40h0.0"></path> <path d="M40.0 40h20"></path> <g> <path d="M60.0 40h0.0"></path> <path d="M343.5 40h0.0"></path> <g> <path d="M60.0 40h0.0"></path> <path d="M125.5 40h0.0"></path> <path d="M60.0 40h10"></path> <g class="non-terminal "> <path d="M70.0 40h0.0"></path> <path d="M115.5 40h0.0"></path> <rect height="22" width="45.5" x="70" y="29"></rect> <text x="92.75" y="44">wsp</text> </g> <path d="M115.5 40h10"></path> <path d="M70.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M70.0 60h45.5"></path> </g> <path d="M115.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M125.5 40h10"></path> <g> <path d="M135.5 40h0.0"></path> <path d="M238.0 40h0.0"></path> <path d="M135.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M155.5 20h62.5"></path> </g> <path d="M218.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M135.5 40h20"></path> <g class="non-terminal "> <path d="M155.5 40h0.0"></path> <path d="M218.0 40h0.0"></path> <rect height="22" width="62.5" x="155.5" y="29"></rect> <text x="186.75" y="44">comma</text> </g> <path d="M218.0 40h20"></path> </g> <g> <path d="M238.0 40h0.0"></path> <path d="M343.5 40h0.0"></path> <path d="M238.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M258.0 20h65.5"></path> </g> <path d="M323.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M238.0 40h20"></path> <g> <path d="M258.0 40h0.0"></path> <path d="M323.5 40h0.0"></path> <path d="M258.0 40h10"></path> <g class="non-terminal "> <path d="M268.0 40h0.0"></path> <path d="M313.5 40h0.0"></path> <rect height="22" width="45.5" x="268" y="29"></rect> <text x="290.75" y="44">wsp</text> </g> <path d="M313.5 40h10"></path> <path d="M268.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M268.0 60h45.5"></path> </g> <path d="M313.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M323.5 40h20"></path> </g> </g> <path d="M343.5 40h20"></path> <path d="M40.0 40a10 10 0 0 1 10 10v28a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 88h52.75"></path> <path d="M290.75 88h52.75"></path> <g class="non-terminal "> <path d="M112.75 88h0.0"></path> <path d="M175.25 88h0.0"></path> <rect height="22" width="62.5" x="112.75" y="77"></rect> <text x="144" y="92">comma</text> </g> <path d="M175.25 88h10"></path> <g> <path d="M185.25 88h0.0"></path> <path d="M290.75 88h0.0"></path> <path d="M185.25 88a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M205.25 68h65.5"></path> </g> <path d="M270.75 68a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M185.25 88h20"></path> <g> <path d="M205.25 88h0.0"></path> <path d="M270.75 88h0.0"></path> <path d="M205.25 88h10"></path> <g class="non-terminal "> <path d="M215.25 88h0.0"></path> <path d="M260.75 88h0.0"></path> <rect height="22" width="45.5" x="215.25" y="77"></rect> <text x="238" y="92">wsp</text> </g> <path d="M260.75 88h10"></path> <path d="M215.25 88a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M215.25 108h45.5"></path> </g> <path d="M260.75 108a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M270.75 88h20"></path> </g> </g> <path d="M343.5 88a10 10 0 0 0 10 -10v-28a10 10 0 0 1 10 -10"></path> </g> <path d="M 363.5 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="svg-translate"><a class="self-link" href="#svg-translate"></a>translate <dd> <pre>"translate" wsp* "(" wsp* number ( comma-wsp? number )? wsp* ")"</pre> <dd> <div class="railroad"> <svg class="railroad-diagram" height="192" viewBox="0 0 614.5 192" width="614.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g> <path d="M50 40h0.0"></path> <path d="M50.0 40h10"></path> <g> <path d="M60.0 40h64.25"></path> <path d="M490.25 40h64.25"></path> <g class="terminal "> <path d="M124.25 40h0.0"></path> <path d="M220.75 40h0.0"></path> <rect height="22" rx="10" ry="10" width="96.5" x="124.25" y="29"></rect> <text x="172.5" y="44">translate</text> </g> <path d="M220.75 40h10"></path> <g> <path d="M230.75 40h0.0"></path> <path d="M336.25 40h0.0"></path> <path d="M230.75 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M250.75 20h65.5"></path> </g> <path d="M316.25 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M230.75 40h20"></path> <g> <path d="M250.75 40h0.0"></path> <path d="M316.25 40h0.0"></path> <path d="M250.75 40h10"></path> <g class="non-terminal "> <path d="M260.75 40h0.0"></path> <path d="M306.25 40h0.0"></path> <rect height="22" width="45.5" x="260.75" y="29"></rect> <text x="283.5" y="44">wsp</text> </g> <path d="M306.25 40h10"></path> <path d="M260.75 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M260.75 60h45.5"></path> </g> <path d="M306.25 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M316.25 40h20"></path> </g> <path d="M336.25 40h10"></path> <g class="terminal "> <path d="M346.25 40h0.0"></path> <path d="M374.75 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="346.25" y="29"></rect> <text x="360.5" y="44">(</text> </g> <path d="M374.75 40h10"></path> <g> <path d="M384.75 40h0.0"></path> <path d="M490.25 40h0.0"></path> <path d="M384.75 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M404.75 20h65.5"></path> </g> <path d="M470.25 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M384.75 40h20"></path> <g> <path d="M404.75 40h0.0"></path> <path d="M470.25 40h0.0"></path> <path d="M404.75 40h10"></path> <g class="non-terminal "> <path d="M414.75 40h0.0"></path> <path d="M460.25 40h0.0"></path> <rect height="22" width="45.5" x="414.75" y="29"></rect> <text x="437.5" y="44">wsp</text> </g> <path d="M460.25 40h10"></path> <path d="M414.75 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M414.75 60h45.5"></path> </g> <path d="M460.25 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M470.25 40h20"></path> </g> </g> <path d="M554.5 40a10 10 0 0 1 10 10v8a10 10 0 0 1 -10 10h-494.5a10 10 0 0 0 -10 10v16a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 104h10.0"></path> <path d="M544.5 104h10.0"></path> <g class="non-terminal "> <path d="M70.0 104h0.0"></path> <path d="M209.0 104h0.0"></path> <rect height="22" width="139" x="70" y="93"></rect> <text x="139.5" y="108"><number-token></text> </g> <path d="M209.0 104h10"></path> <g> <path d="M219.0 104h0.0"></path> <path d="M544.5 104h0.0"></path> <path d="M219.0 104a10 10 0 0 0 10 -10v-8a10 10 0 0 1 10 -10"></path> <g> <path d="M239.0 76h285.5"></path> </g> <path d="M524.5 76a10 10 0 0 1 10 10v8a10 10 0 0 0 10 10"></path> <path d="M219.0 104h20"></path> <g> <path d="M239.0 104h0.0"></path> <path d="M524.5 104h0.0"></path> <g> <path d="M239.0 104h0.0"></path> <path d="M375.5 104h0.0"></path> <path d="M239.0 104a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M259.0 84h96.5"></path> </g> <path d="M355.5 84a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M239.0 104h20"></path> <g class="non-terminal "> <path d="M259.0 104h0.0"></path> <path d="M355.5 104h0.0"></path> <rect height="22" width="96.5" x="259" y="93"></rect> <text x="307.25" y="108">comma-wsp</text> </g> <path d="M355.5 104h20"></path> </g> <path d="M375.5 104h10"></path> <g class="non-terminal "> <path d="M385.5 104h0.0"></path> <path d="M524.5 104h0.0"></path> <rect height="22" width="139" x="385.5" y="93"></rect> <text x="455" y="108"><number-token></text> </g> </g> <path d="M524.5 104h20"></path> </g> </g> <path d="M554.5 104a10 10 0 0 1 10 10v0a10 10 0 0 1 -10 10h-494.5a10 10 0 0 0 -10 10v8a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 152h175.25"></path> <path d="M379.25 152h175.25"></path> <g> <path d="M235.25 152h0.0"></path> <path d="M340.75 152h0.0"></path> <path d="M235.25 152a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M255.25 132h65.5"></path> </g> <path d="M320.75 132a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M235.25 152h20"></path> <g> <path d="M255.25 152h0.0"></path> <path d="M320.75 152h0.0"></path> <path d="M255.25 152h10"></path> <g class="non-terminal "> <path d="M265.25 152h0.0"></path> <path d="M310.75 152h0.0"></path> <rect height="22" width="45.5" x="265.25" y="141"></rect> <text x="288" y="156">wsp</text> </g> <path d="M310.75 152h10"></path> <path d="M265.25 152a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M265.25 172h45.5"></path> </g> <path d="M310.75 172a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M320.75 152h20"></path> </g> <path d="M340.75 152h10"></path> <g class="terminal "> <path d="M350.75 152h0.0"></path> <path d="M379.25 152h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="350.75" y="141"></rect> <text x="365" y="156">)</text> </g> </g> <path d="M554.5 152h10"></path> <path d="M564.5 152h0.0"></path> </g> <path d="M564.5 152h10"></path> <path d="M 574.5 152 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="svg-scale"><a class="self-link" href="#svg-scale"></a>scale <dd> <pre>"scale" wsp* "(" wsp* number ( comma-wsp? number )? wsp* ")"</pre> <dd> <div class="railroad"> <svg class="railroad-diagram" height="192" viewBox="0 0 614.5 192" width="614.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g> <path d="M50 40h0.0"></path> <path d="M50.0 40h10"></path> <g> <path d="M60.0 40h81.25"></path> <path d="M473.25 40h81.25"></path> <g class="terminal "> <path d="M141.25 40h0.0"></path> <path d="M203.75 40h0.0"></path> <rect height="22" rx="10" ry="10" width="62.5" x="141.25" y="29"></rect> <text x="172.5" y="44">scale</text> </g> <path d="M203.75 40h10"></path> <g> <path d="M213.75 40h0.0"></path> <path d="M319.25 40h0.0"></path> <path d="M213.75 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M233.75 20h65.5"></path> </g> <path d="M299.25 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M213.75 40h20"></path> <g> <path d="M233.75 40h0.0"></path> <path d="M299.25 40h0.0"></path> <path d="M233.75 40h10"></path> <g class="non-terminal "> <path d="M243.75 40h0.0"></path> <path d="M289.25 40h0.0"></path> <rect height="22" width="45.5" x="243.75" y="29"></rect> <text x="266.5" y="44">wsp</text> </g> <path d="M289.25 40h10"></path> <path d="M243.75 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M243.75 60h45.5"></path> </g> <path d="M289.25 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M299.25 40h20"></path> </g> <path d="M319.25 40h10"></path> <g class="terminal "> <path d="M329.25 40h0.0"></path> <path d="M357.75 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="329.25" y="29"></rect> <text x="343.5" y="44">(</text> </g> <path d="M357.75 40h10"></path> <g> <path d="M367.75 40h0.0"></path> <path d="M473.25 40h0.0"></path> <path d="M367.75 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M387.75 20h65.5"></path> </g> <path d="M453.25 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M367.75 40h20"></path> <g> <path d="M387.75 40h0.0"></path> <path d="M453.25 40h0.0"></path> <path d="M387.75 40h10"></path> <g class="non-terminal "> <path d="M397.75 40h0.0"></path> <path d="M443.25 40h0.0"></path> <rect height="22" width="45.5" x="397.75" y="29"></rect> <text x="420.5" y="44">wsp</text> </g> <path d="M443.25 40h10"></path> <path d="M397.75 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M397.75 60h45.5"></path> </g> <path d="M443.25 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M453.25 40h20"></path> </g> </g> <path d="M554.5 40a10 10 0 0 1 10 10v8a10 10 0 0 1 -10 10h-494.5a10 10 0 0 0 -10 10v16a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 104h10.0"></path> <path d="M544.5 104h10.0"></path> <g class="non-terminal "> <path d="M70.0 104h0.0"></path> <path d="M209.0 104h0.0"></path> <rect height="22" width="139" x="70" y="93"></rect> <text x="139.5" y="108"><number-token></text> </g> <path d="M209.0 104h10"></path> <g> <path d="M219.0 104h0.0"></path> <path d="M544.5 104h0.0"></path> <path d="M219.0 104a10 10 0 0 0 10 -10v-8a10 10 0 0 1 10 -10"></path> <g> <path d="M239.0 76h285.5"></path> </g> <path d="M524.5 76a10 10 0 0 1 10 10v8a10 10 0 0 0 10 10"></path> <path d="M219.0 104h20"></path> <g> <path d="M239.0 104h0.0"></path> <path d="M524.5 104h0.0"></path> <g> <path d="M239.0 104h0.0"></path> <path d="M375.5 104h0.0"></path> <path d="M239.0 104a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M259.0 84h96.5"></path> </g> <path d="M355.5 84a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M239.0 104h20"></path> <g class="non-terminal "> <path d="M259.0 104h0.0"></path> <path d="M355.5 104h0.0"></path> <rect height="22" width="96.5" x="259" y="93"></rect> <text x="307.25" y="108">comma-wsp</text> </g> <path d="M355.5 104h20"></path> </g> <path d="M375.5 104h10"></path> <g class="non-terminal "> <path d="M385.5 104h0.0"></path> <path d="M524.5 104h0.0"></path> <rect height="22" width="139" x="385.5" y="93"></rect> <text x="455" y="108"><number-token></text> </g> </g> <path d="M524.5 104h20"></path> </g> </g> <path d="M554.5 104a10 10 0 0 1 10 10v0a10 10 0 0 1 -10 10h-494.5a10 10 0 0 0 -10 10v8a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 152h175.25"></path> <path d="M379.25 152h175.25"></path> <g> <path d="M235.25 152h0.0"></path> <path d="M340.75 152h0.0"></path> <path d="M235.25 152a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M255.25 132h65.5"></path> </g> <path d="M320.75 132a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M235.25 152h20"></path> <g> <path d="M255.25 152h0.0"></path> <path d="M320.75 152h0.0"></path> <path d="M255.25 152h10"></path> <g class="non-terminal "> <path d="M265.25 152h0.0"></path> <path d="M310.75 152h0.0"></path> <rect height="22" width="45.5" x="265.25" y="141"></rect> <text x="288" y="156">wsp</text> </g> <path d="M310.75 152h10"></path> <path d="M265.25 152a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M265.25 172h45.5"></path> </g> <path d="M310.75 172a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M320.75 152h20"></path> </g> <path d="M340.75 152h10"></path> <g class="terminal "> <path d="M350.75 152h0.0"></path> <path d="M379.25 152h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="350.75" y="141"></rect> <text x="365" y="156">)</text> </g> </g> <path d="M554.5 152h10"></path> <path d="M564.5 152h0.0"></path> </g> <path d="M564.5 152h10"></path> <path d="M 574.5 152 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="svg-rotate"><a class="self-link" href="#svg-rotate"></a>rotate <dd> <pre>"rotate" wsp* "(" wsp* number ( comma-wsp? number comma-wsp? number )? wsp* ")"</pre> <dd> <div class="railroad"> <svg class="railroad-diagram" height="215" viewBox="0 0 634.5 215" width="634.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g> <path d="M50 40h0.0"></path> <path d="M50.0 40h10"></path> <g> <path d="M60.0 40h87.0"></path> <path d="M487.5 40h87.0"></path> <g class="terminal "> <path d="M147.0 40h0.0"></path> <path d="M218.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="71" x="147" y="29"></rect> <text x="182.5" y="44">rotate</text> </g> <path d="M218.0 40h10"></path> <g> <path d="M228.0 40h0.0"></path> <path d="M333.5 40h0.0"></path> <path d="M228.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M248.0 20h65.5"></path> </g> <path d="M313.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M228.0 40h20"></path> <g> <path d="M248.0 40h0.0"></path> <path d="M313.5 40h0.0"></path> <path d="M248.0 40h10"></path> <g class="non-terminal "> <path d="M258.0 40h0.0"></path> <path d="M303.5 40h0.0"></path> <rect height="22" width="45.5" x="258" y="29"></rect> <text x="280.75" y="44">wsp</text> </g> <path d="M303.5 40h10"></path> <path d="M258.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M258.0 60h45.5"></path> </g> <path d="M303.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M313.5 40h20"></path> </g> <path d="M333.5 40h10"></path> <g class="terminal "> <path d="M343.5 40h0.0"></path> <path d="M372.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="343.5" y="29"></rect> <text x="357.75" y="44">(</text> </g> <path d="M372.0 40h10"></path> <g> <path d="M382.0 40h0.0"></path> <path d="M487.5 40h0.0"></path> <path d="M382.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M402.0 20h65.5"></path> </g> <path d="M467.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M382.0 40h20"></path> <g> <path d="M402.0 40h0.0"></path> <path d="M467.5 40h0.0"></path> <path d="M402.0 40h10"></path> <g class="non-terminal "> <path d="M412.0 40h0.0"></path> <path d="M457.5 40h0.0"></path> <rect height="22" width="45.5" x="412" y="29"></rect> <text x="434.75" y="44">wsp</text> </g> <path d="M457.5 40h10"></path> <path d="M412.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M412.0 60h45.5"></path> </g> <path d="M457.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M467.5 40h20"></path> </g> </g> <path d="M574.5 40a10 10 0 0 1 10 10v8a10 10 0 0 1 -10 10h-514.5a10 10 0 0 0 -10 10v16a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 104h10.0"></path> <path d="M564.5 104h10.0"></path> <g class="non-terminal "> <path d="M70.0 104h0.0"></path> <path d="M209.0 104h0.0"></path> <rect height="22" width="139" x="70" y="93"></rect> <text x="139.5" y="108"><number-token></text> </g> <path d="M209.0 104h10"></path> <g> <path d="M219.0 104h0.0"></path> <path d="M564.5 104h0.0"></path> <path d="M219.0 104a10 10 0 0 0 10 -10v-8a10 10 0 0 1 10 -10"></path> <g> <path d="M239.0 76h305.5"></path> </g> <path d="M544.5 76a10 10 0 0 1 10 10v8a10 10 0 0 0 10 10"></path> <path d="M219.0 104h20"></path> <g> <path d="M239.0 104h0.0"></path> <path d="M544.5 104h0.0"></path> <path d="M239.0 104h10"></path> <g> <path d="M249.0 104h0.0"></path> <path d="M534.5 104h0.0"></path> <g> <path d="M249.0 104h0.0"></path> <path d="M385.5 104h0.0"></path> <path d="M249.0 104a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M269.0 84h96.5"></path> </g> <path d="M365.5 84a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M249.0 104h20"></path> <g class="non-terminal "> <path d="M269.0 104h0.0"></path> <path d="M365.5 104h0.0"></path> <rect height="22" width="96.5" x="269" y="93"></rect> <text x="317.25" y="108">comma-wsp</text> </g> <path d="M365.5 104h20"></path> </g> <path d="M385.5 104h10"></path> <g class="non-terminal "> <path d="M395.5 104h0.0"></path> <path d="M534.5 104h0.0"></path> <rect height="22" width="139" x="395.5" y="93"></rect> <text x="465" y="108"><number-token></text> </g> </g> <path d="M534.5 104h10"></path> <path d="M249.0 104a10 10 0 0 0 -10 10v7a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M249.0 131h134.25"></path> <path d="M400.25 131h134.25"></path> <text class="comment" x="391.75" y="136">1</text> </g> <path d="M534.5 131a10 10 0 0 0 10 -10v-7a10 10 0 0 0 -10 -10"></path> </g> <path d="M544.5 104h20"></path> </g> </g> <path d="M574.5 104a10 10 0 0 1 10 10v23a10 10 0 0 1 -10 10h-514.5a10 10 0 0 0 -10 10v8a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 175h185.25"></path> <path d="M389.25 175h185.25"></path> <g> <path d="M245.25 175h0.0"></path> <path d="M350.75 175h0.0"></path> <path d="M245.25 175a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M265.25 155h65.5"></path> </g> <path d="M330.75 155a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M245.25 175h20"></path> <g> <path d="M265.25 175h0.0"></path> <path d="M330.75 175h0.0"></path> <path d="M265.25 175h10"></path> <g class="non-terminal "> <path d="M275.25 175h0.0"></path> <path d="M320.75 175h0.0"></path> <rect height="22" width="45.5" x="275.25" y="164"></rect> <text x="298" y="179">wsp</text> </g> <path d="M320.75 175h10"></path> <path d="M275.25 175a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M275.25 195h45.5"></path> </g> <path d="M320.75 195a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M330.75 175h20"></path> </g> <path d="M350.75 175h10"></path> <g class="terminal "> <path d="M360.75 175h0.0"></path> <path d="M389.25 175h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="360.75" y="164"></rect> <text x="375" y="179">)</text> </g> </g> <path d="M574.5 175h10"></path> <path d="M584.5 175h0.0"></path> </g> <path d="M584.5 175h10"></path> <path d="M 594.5 175 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="svg-skewX"><a class="self-link" href="#svg-skewX"></a>skewX <dd> <pre>"skewX" wsp* "(" wsp* number wsp* ")"</pre> <dd> <div class="railroad"> <svg class="railroad-diagram" height="176" viewBox="0 0 472.0 176" width="472.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g> <path d="M50 40h0.0"></path> <path d="M50.0 40h10"></path> <g> <path d="M60.0 40h10.0"></path> <path d="M402.0 40h10.0"></path> <g class="terminal "> <path d="M70.0 40h0.0"></path> <path d="M132.5 40h0.0"></path> <rect height="22" rx="10" ry="10" width="62.5" x="70" y="29"></rect> <text x="101.25" y="44">skewX</text> </g> <path d="M132.5 40h10"></path> <g> <path d="M142.5 40h0.0"></path> <path d="M248.0 40h0.0"></path> <path d="M142.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M162.5 20h65.5"></path> </g> <path d="M228.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M142.5 40h20"></path> <g> <path d="M162.5 40h0.0"></path> <path d="M228.0 40h0.0"></path> <path d="M162.5 40h10"></path> <g class="non-terminal "> <path d="M172.5 40h0.0"></path> <path d="M218.0 40h0.0"></path> <rect height="22" width="45.5" x="172.5" y="29"></rect> <text x="195.25" y="44">wsp</text> </g> <path d="M218.0 40h10"></path> <path d="M172.5 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M172.5 60h45.5"></path> </g> <path d="M218.0 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M228.0 40h20"></path> </g> <path d="M248.0 40h10"></path> <g class="terminal "> <path d="M258.0 40h0.0"></path> <path d="M286.5 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="258" y="29"></rect> <text x="272.25" y="44">(</text> </g> <path d="M286.5 40h10"></path> <g> <path d="M296.5 40h0.0"></path> <path d="M402.0 40h0.0"></path> <path d="M296.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M316.5 20h65.5"></path> </g> <path d="M382.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M296.5 40h20"></path> <g> <path d="M316.5 40h0.0"></path> <path d="M382.0 40h0.0"></path> <path d="M316.5 40h10"></path> <g class="non-terminal "> <path d="M326.5 40h0.0"></path> <path d="M372.0 40h0.0"></path> <rect height="22" width="45.5" x="326.5" y="29"></rect> <text x="349.25" y="44">wsp</text> </g> <path d="M372.0 40h10"></path> <path d="M326.5 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M326.5 60h45.5"></path> </g> <path d="M372.0 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M382.0 40h20"></path> </g> </g> <path d="M412.0 40a10 10 0 0 1 10 10v8a10 10 0 0 1 -10 10h-352.0a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 88h106.5"></path> <path d="M305.5 88h106.5"></path> <g class="non-terminal "> <path d="M166.5 88h0.0"></path> <path d="M305.5 88h0.0"></path> <rect height="22" width="139" x="166.5" y="77"></rect> <text x="236" y="92"><number-token></text> </g> </g> <path d="M412.0 88a10 10 0 0 1 10 10v0a10 10 0 0 1 -10 10h-352.0a10 10 0 0 0 -10 10v8a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 136h104.0"></path> <path d="M308.0 136h104.0"></path> <g> <path d="M164.0 136h0.0"></path> <path d="M269.5 136h0.0"></path> <path d="M164.0 136a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M184.0 116h65.5"></path> </g> <path d="M249.5 116a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M164.0 136h20"></path> <g> <path d="M184.0 136h0.0"></path> <path d="M249.5 136h0.0"></path> <path d="M184.0 136h10"></path> <g class="non-terminal "> <path d="M194.0 136h0.0"></path> <path d="M239.5 136h0.0"></path> <rect height="22" width="45.5" x="194" y="125"></rect> <text x="216.75" y="140">wsp</text> </g> <path d="M239.5 136h10"></path> <path d="M194.0 136a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M194.0 156h45.5"></path> </g> <path d="M239.5 156a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M249.5 136h20"></path> </g> <path d="M269.5 136h10"></path> <g class="terminal "> <path d="M279.5 136h0.0"></path> <path d="M308.0 136h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="279.5" y="125"></rect> <text x="293.75" y="140">)</text> </g> </g> <path d="M412.0 136h10"></path> <path d="M422.0 136h0.0"></path> </g> <path d="M422.0 136h10"></path> <path d="M 432.0 136 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="svg-skewY"><a class="self-link" href="#svg-skewY"></a>skewY <dd> <pre>"skewY" wsp* "(" wsp* number wsp* ")"</pre> <dd> <div class="railroad"> <svg class="railroad-diagram" height="176" viewBox="0 0 472.0 176" width="472.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g> <path d="M50 40h0.0"></path> <path d="M50.0 40h10"></path> <g> <path d="M60.0 40h10.0"></path> <path d="M402.0 40h10.0"></path> <g class="terminal "> <path d="M70.0 40h0.0"></path> <path d="M132.5 40h0.0"></path> <rect height="22" rx="10" ry="10" width="62.5" x="70" y="29"></rect> <text x="101.25" y="44">skewY</text> </g> <path d="M132.5 40h10"></path> <g> <path d="M142.5 40h0.0"></path> <path d="M248.0 40h0.0"></path> <path d="M142.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M162.5 20h65.5"></path> </g> <path d="M228.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M142.5 40h20"></path> <g> <path d="M162.5 40h0.0"></path> <path d="M228.0 40h0.0"></path> <path d="M162.5 40h10"></path> <g class="non-terminal "> <path d="M172.5 40h0.0"></path> <path d="M218.0 40h0.0"></path> <rect height="22" width="45.5" x="172.5" y="29"></rect> <text x="195.25" y="44">wsp</text> </g> <path d="M218.0 40h10"></path> <path d="M172.5 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M172.5 60h45.5"></path> </g> <path d="M218.0 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M228.0 40h20"></path> </g> <path d="M248.0 40h10"></path> <g class="terminal "> <path d="M258.0 40h0.0"></path> <path d="M286.5 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="258" y="29"></rect> <text x="272.25" y="44">(</text> </g> <path d="M286.5 40h10"></path> <g> <path d="M296.5 40h0.0"></path> <path d="M402.0 40h0.0"></path> <path d="M296.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M316.5 20h65.5"></path> </g> <path d="M382.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M296.5 40h20"></path> <g> <path d="M316.5 40h0.0"></path> <path d="M382.0 40h0.0"></path> <path d="M316.5 40h10"></path> <g class="non-terminal "> <path d="M326.5 40h0.0"></path> <path d="M372.0 40h0.0"></path> <rect height="22" width="45.5" x="326.5" y="29"></rect> <text x="349.25" y="44">wsp</text> </g> <path d="M372.0 40h10"></path> <path d="M326.5 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M326.5 60h45.5"></path> </g> <path d="M372.0 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M382.0 40h20"></path> </g> </g> <path d="M412.0 40a10 10 0 0 1 10 10v8a10 10 0 0 1 -10 10h-352.0a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 88h106.5"></path> <path d="M305.5 88h106.5"></path> <g class="non-terminal "> <path d="M166.5 88h0.0"></path> <path d="M305.5 88h0.0"></path> <rect height="22" width="139" x="166.5" y="77"></rect> <text x="236" y="92"><number-token></text> </g> </g> <path d="M412.0 88a10 10 0 0 1 10 10v0a10 10 0 0 1 -10 10h-352.0a10 10 0 0 0 -10 10v8a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 136h104.0"></path> <path d="M308.0 136h104.0"></path> <g> <path d="M164.0 136h0.0"></path> <path d="M269.5 136h0.0"></path> <path d="M164.0 136a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M184.0 116h65.5"></path> </g> <path d="M249.5 116a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M164.0 136h20"></path> <g> <path d="M184.0 136h0.0"></path> <path d="M249.5 136h0.0"></path> <path d="M184.0 136h10"></path> <g class="non-terminal "> <path d="M194.0 136h0.0"></path> <path d="M239.5 136h0.0"></path> <rect height="22" width="45.5" x="194" y="125"></rect> <text x="216.75" y="140">wsp</text> </g> <path d="M239.5 136h10"></path> <path d="M194.0 136a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M194.0 156h45.5"></path> </g> <path d="M239.5 156a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M249.5 136h20"></path> </g> <path d="M269.5 136h10"></path> <g class="terminal "> <path d="M279.5 136h0.0"></path> <path d="M308.0 136h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="279.5" y="125"></rect> <text x="293.75" y="140">)</text> </g> </g> <path d="M412.0 136h10"></path> <path d="M422.0 136h0.0"></path> </g> <path d="M422.0 136h10"></path> <path d="M 432.0 136 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="svg-matrix"><a class="self-link" href="#svg-matrix"></a>matrix <dd> <pre>"matrix" wsp* "(" wsp* number comma-wsp? number comma-wsp? number comma-wsp? number comma-wsp? number comma-wsp? number wsp* ")" </pre> <dd> <div class="railroad"> <svg class="railroad-diagram" height="215" viewBox="0 0 634.5 215" width="634.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <path d="M40 40h10"></path> <g> <path d="M50 40h0.0"></path> <path d="M50.0 40h10"></path> <g> <path d="M60.0 40h87.0"></path> <path d="M487.5 40h87.0"></path> <g class="terminal "> <path d="M147.0 40h0.0"></path> <path d="M218.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="71" x="147" y="29"></rect> <text x="182.5" y="44">matrix</text> </g> <path d="M218.0 40h10"></path> <g> <path d="M228.0 40h0.0"></path> <path d="M333.5 40h0.0"></path> <path d="M228.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M248.0 20h65.5"></path> </g> <path d="M313.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M228.0 40h20"></path> <g> <path d="M248.0 40h0.0"></path> <path d="M313.5 40h0.0"></path> <path d="M248.0 40h10"></path> <g class="non-terminal "> <path d="M258.0 40h0.0"></path> <path d="M303.5 40h0.0"></path> <rect height="22" width="45.5" x="258" y="29"></rect> <text x="280.75" y="44">wsp</text> </g> <path d="M303.5 40h10"></path> <path d="M258.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M258.0 60h45.5"></path> </g> <path d="M303.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M313.5 40h20"></path> </g> <path d="M333.5 40h10"></path> <g class="terminal "> <path d="M343.5 40h0.0"></path> <path d="M372.0 40h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="343.5" y="29"></rect> <text x="357.75" y="44">(</text> </g> <path d="M372.0 40h10"></path> <g> <path d="M382.0 40h0.0"></path> <path d="M487.5 40h0.0"></path> <path d="M382.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M402.0 20h65.5"></path> </g> <path d="M467.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M382.0 40h20"></path> <g> <path d="M402.0 40h0.0"></path> <path d="M467.5 40h0.0"></path> <path d="M402.0 40h10"></path> <g class="non-terminal "> <path d="M412.0 40h0.0"></path> <path d="M457.5 40h0.0"></path> <rect height="22" width="45.5" x="412" y="29"></rect> <text x="434.75" y="44">wsp</text> </g> <path d="M457.5 40h10"></path> <path d="M412.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M412.0 60h45.5"></path> </g> <path d="M457.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M467.5 40h20"></path> </g> </g> <path d="M574.5 40a10 10 0 0 1 10 10v8a10 10 0 0 1 -10 10h-514.5a10 10 0 0 0 -10 10v16a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 104h10.0"></path> <path d="M564.5 104h10.0"></path> <g class="non-terminal "> <path d="M70.0 104h0.0"></path> <path d="M209.0 104h0.0"></path> <rect height="22" width="139" x="70" y="93"></rect> <text x="139.5" y="108"><number-token></text> </g> <path d="M209.0 104h10"></path> <g> <path d="M219.0 104h0.0"></path> <path d="M564.5 104h0.0"></path> <path d="M219.0 104a10 10 0 0 0 10 -10v-8a10 10 0 0 1 10 -10"></path> <g> <path d="M239.0 76h305.5"></path> </g> <path d="M544.5 76a10 10 0 0 1 10 10v8a10 10 0 0 0 10 10"></path> <path d="M219.0 104h20"></path> <g> <path d="M239.0 104h0.0"></path> <path d="M544.5 104h0.0"></path> <path d="M239.0 104h10"></path> <g> <path d="M249.0 104h0.0"></path> <path d="M534.5 104h0.0"></path> <g> <path d="M249.0 104h0.0"></path> <path d="M385.5 104h0.0"></path> <path d="M249.0 104a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M269.0 84h96.5"></path> </g> <path d="M365.5 84a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M249.0 104h20"></path> <g class="non-terminal "> <path d="M269.0 104h0.0"></path> <path d="M365.5 104h0.0"></path> <rect height="22" width="96.5" x="269" y="93"></rect> <text x="317.25" y="108">comma-wsp</text> </g> <path d="M365.5 104h20"></path> </g> <path d="M385.5 104h10"></path> <g class="non-terminal "> <path d="M395.5 104h0.0"></path> <path d="M534.5 104h0.0"></path> <rect height="22" width="139" x="395.5" y="93"></rect> <text x="465" y="108"><number-token></text> </g> </g> <path d="M534.5 104h10"></path> <path d="M249.0 104a10 10 0 0 0 -10 10v7a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M249.0 131h134.25"></path> <path d="M400.25 131h134.25"></path> <text class="comment" x="391.75" y="136">4</text> </g> <path d="M534.5 131a10 10 0 0 0 10 -10v-7a10 10 0 0 0 -10 -10"></path> </g> <path d="M544.5 104h20"></path> </g> </g> <path d="M574.5 104a10 10 0 0 1 10 10v23a10 10 0 0 1 -10 10h-514.5a10 10 0 0 0 -10 10v8a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 175h185.25"></path> <path d="M389.25 175h185.25"></path> <g> <path d="M245.25 175h0.0"></path> <path d="M350.75 175h0.0"></path> <path d="M245.25 175a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M265.25 155h65.5"></path> </g> <path d="M330.75 155a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M245.25 175h20"></path> <g> <path d="M265.25 175h0.0"></path> <path d="M330.75 175h0.0"></path> <path d="M265.25 175h10"></path> <g class="non-terminal "> <path d="M275.25 175h0.0"></path> <path d="M320.75 175h0.0"></path> <rect height="22" width="45.5" x="275.25" y="164"></rect> <text x="298" y="179">wsp</text> </g> <path d="M320.75 175h10"></path> <path d="M275.25 175a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M275.25 195h45.5"></path> </g> <path d="M320.75 195a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M330.75 175h20"></path> </g> <path d="M350.75 175h10"></path> <g class="terminal "> <path d="M360.75 175h0.0"></path> <path d="M389.25 175h0.0"></path> <rect height="22" rx="10" ry="10" width="28.5" x="360.75" y="164"></rect> <text x="375" y="179">)</text> </g> </g> <path d="M574.5 175h10"></path> <path d="M584.5 175h0.0"></path> </g> <path d="M584.5 175h10"></path> <path d="M 594.5 175 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="svg-transform-function"><a class="self-link" href="#svg-transform-function"></a>transform <dd> <pre>matrix | translate | scale | rotate | skewX | skewY </pre> <dd> <div class="railroad"> <svg class="railroad-diagram" height="212" viewBox="0 0 216.5 212" width="216.5"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 31h0.0"></path> <path d="M176.5 31h0.0"></path> <path d="M40.0 31h20"></path> <g class="non-terminal "> <path d="M60.0 31h0.0"></path> <path d="M156.5 31h0.0"></path> <rect height="22" width="96.5" x="60" y="20"></rect> <text x="108.25" y="35">translate</text> </g> <path d="M156.5 31h20"></path> <path d="M40.0 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M60.0 61h17.0"></path> <path d="M139.5 61h17.0"></path> <rect height="22" width="62.5" x="77" y="50"></rect> <text x="108.25" y="65">scale</text> </g> <path d="M156.5 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path> <path d="M40.0 31a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M60.0 91h12.75"></path> <path d="M143.75 91h12.75"></path> <rect height="22" width="71" x="72.75" y="80"></rect> <text x="108.25" y="95">rotate</text> </g> <path d="M156.5 91a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path> <path d="M40.0 31a10 10 0 0 1 10 10v70a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M60.0 121h17.0"></path> <path d="M139.5 121h17.0"></path> <rect height="22" width="62.5" x="77" y="110"></rect> <text x="108.25" y="125">skewX</text> </g> <path d="M156.5 121a10 10 0 0 0 10 -10v-70a10 10 0 0 1 10 -10"></path> <path d="M40.0 31a10 10 0 0 1 10 10v100a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M60.0 151h17.0"></path> <path d="M139.5 151h17.0"></path> <rect height="22" width="62.5" x="77" y="140"></rect> <text x="108.25" y="155">skewY</text> </g> <path d="M156.5 151a10 10 0 0 0 10 -10v-100a10 10 0 0 1 10 -10"></path> <path d="M40.0 31a10 10 0 0 1 10 10v130a10 10 0 0 0 10 10"></path> <g class="non-terminal "> <path d="M60.0 181h12.75"></path> <path d="M143.75 181h12.75"></path> <rect height="22" width="71" x="72.75" y="170"></rect> <text x="108.25" y="185">matrix</text> </g> <path d="M156.5 181a10 10 0 0 0 10 -10v-130a10 10 0 0 1 10 -10"></path> </g> <path d="M 176.5 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="svg-transforms"><a class="self-link" href="#svg-transforms"></a>transforms <dd> <pre>transform | transform comma-wsp? transforms </pre> <dd> <div class="railroad"> <svg class="railroad-diagram" height="101" viewBox="0 0 478.0 101" width="478.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 21v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 31h0.0"></path> <path d="M438.0 31h0.0"></path> <path d="M40.0 31h20"></path> <g class="non-terminal "> <path d="M60.0 31h130.75"></path> <path d="M287.25 31h130.75"></path> <rect height="22" width="96.5" x="190.75" y="20"></rect> <text x="239" y="35">transform</text> </g> <path d="M418.0 31h20"></path> <path d="M40.0 31a10 10 0 0 1 10 10v19a10 10 0 0 0 10 10"></path> <g> <path d="M60.0 70h0.0"></path> <path d="M418.0 70h0.0"></path> <g class="non-terminal "> <path d="M60.0 70h0.0"></path> <path d="M156.5 70h0.0"></path> <rect height="22" width="96.5" x="60" y="59"></rect> <text x="108.25" y="74">transform</text> </g> <path d="M156.5 70h10"></path> <g> <path d="M166.5 70h0.0"></path> <path d="M303.0 70h0.0"></path> <path d="M166.5 70a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M186.5 50h96.5"></path> </g> <path d="M283.0 50a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M166.5 70h20"></path> <g class="non-terminal "> <path d="M186.5 70h0.0"></path> <path d="M283.0 70h0.0"></path> <rect height="22" width="96.5" x="186.5" y="59"></rect> <text x="234.75" y="74">comma-wsp</text> </g> <path d="M283.0 70h20"></path> </g> <path d="M303.0 70h10"></path> <g class="non-terminal "> <path d="M313.0 70h0.0"></path> <path d="M418.0 70h0.0"></path> <rect height="22" width="105" x="313" y="59"></rect> <text x="365.5" y="74">transforms</text> </g> </g> <path d="M418.0 70a10 10 0 0 0 10 -10v-19a10 10 0 0 1 10 -10"></path> </g> <path d="M 438.0 31 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> <dt id="svg-transform-list"><a class="self-link" href="#svg-transform-list"></a>transform-list <dd> <pre>wsp* transforms? wsp*</pre> <dd> <div class="railroad"> <svg class="railroad-diagram" height="80" viewBox="0 0 436.0 80" width="436.0"> <g transform="translate(.5 .5)"> <g> <path d="M20 30v20m10 -20v20m-10 -10h20"></path> </g> <g> <path d="M40 40h0.0"></path> <path d="M145.5 40h0.0"></path> <path d="M40.0 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M60.0 20h65.5"></path> </g> <path d="M125.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M40.0 40h20"></path> <g> <path d="M60.0 40h0.0"></path> <path d="M125.5 40h0.0"></path> <path d="M60.0 40h10"></path> <g class="non-terminal "> <path d="M70.0 40h0.0"></path> <path d="M115.5 40h0.0"></path> <rect height="22" width="45.5" x="70" y="29"></rect> <text x="92.75" y="44">wsp</text> </g> <path d="M115.5 40h10"></path> <path d="M70.0 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M70.0 60h45.5"></path> </g> <path d="M115.5 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M125.5 40h20"></path> </g> <g> <path d="M145.5 40h0.0"></path> <path d="M290.5 40h0.0"></path> <path d="M145.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M165.5 20h105.0"></path> </g> <path d="M270.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M145.5 40h20"></path> <g class="non-terminal "> <path d="M165.5 40h0.0"></path> <path d="M270.5 40h0.0"></path> <rect height="22" width="105" x="165.5" y="29"></rect> <text x="218" y="44">transforms</text> </g> <path d="M270.5 40h20"></path> </g> <g> <path d="M290.5 40h0.0"></path> <path d="M396.0 40h0.0"></path> <path d="M290.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path> <g> <path d="M310.5 20h65.5"></path> </g> <path d="M376.0 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path> <path d="M290.5 40h20"></path> <g> <path d="M310.5 40h0.0"></path> <path d="M376.0 40h0.0"></path> <path d="M310.5 40h10"></path> <g class="non-terminal "> <path d="M320.5 40h0.0"></path> <path d="M366.0 40h0.0"></path> <rect height="22" width="45.5" x="320.5" y="29"></rect> <text x="343.25" y="44">wsp</text> </g> <path d="M366.0 40h10"></path> <path d="M320.5 40a10 10 0 0 0 -10 10v0a10 10 0 0 0 10 10"></path> <g> <path d="M320.5 60h45.5"></path> </g> <path d="M366.0 60a10 10 0 0 0 10 -10v0a10 10 0 0 0 -10 -10"></path> </g> <path d="M376.0 40h20"></path> </g> <path d="M 396.0 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path> </g> </svg> </div> </dl> <h3 class="heading settled" data-level="6.3" id="svg-transform-functions"><span class="secno">6.3. </span><span class="content">SVG transform functions</span><a class="self-link" href="#svg-transform-functions"></a></h3> <p>SVG transform functions of the <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute⑧">transform</a>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute" id="ref-for-PatternElementPatternTransformAttribute④">patternTransform</a></code>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute" id="ref-for-LinearGradientElementGradientTransformAttribute④">gradientTransform</a></code> attributes defined by the syntax above are mapped to CSS <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function⑦"><transform-function></a>s as follows:</p> <table class="data" id="term-matching"> <thead> <tr> <th>SVG transform function <th>CSS <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function⑧"><transform-function></a> <th>Additional notes <tbody> <tr> <th><a href="#svg-translate">translate</a> <td><a class="production css" data-link-type="function" href="#funcdef-transform-translate" id="ref-for-funcdef-transform-translate①"><translate()></a> <td>Number values interpreted as CSS <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value④"><length></a> types with <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-4/#px" id="ref-for-px">px</a> units. <tr> <th><a href="#svg-scale">scale</a> <td><a class="production css" data-link-type="function" href="#funcdef-transform-scale" id="ref-for-funcdef-transform-scale①"><scale()></a> <td> <tr> <th><a href="#svg-rotate">rotate</a> <td><a class="production css" data-link-type="function" href="#funcdef-transform-rotate" id="ref-for-funcdef-transform-rotate①"><rotate()></a> <td>Only single value version. Number value interpreted as CSS <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#angle-value" id="ref-for-angle-value"><angle></a> type with <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-4/#deg" id="ref-for-deg">deg</a> unit. <tr> <th><a href="#svg-skewX">skewX</a> <td><a class="production css" data-link-type="function" href="#funcdef-transform-skewx" id="ref-for-funcdef-transform-skewx"><skewX()></a> <td>Number value interpreted as CSS <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#angle-value" id="ref-for-angle-value①"><angle></a> type with <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-4/#deg" id="ref-for-deg①">deg</a> unit. <tr> <th><a href="#svg-skewY">skewY</a> <td><a class="production css" data-link-type="function" href="#funcdef-transform-skewy" id="ref-for-funcdef-transform-skewy"><skewY()></a> <td>Number value interpreted as CSS <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#angle-value" id="ref-for-angle-value②"><angle></a> type with <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-4/#deg" id="ref-for-deg②">deg</a> unit. <tr> <th><a href="#svg-matrix">matrix</a> <td><a class="production css" data-link-type="function" href="#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix②"><matrix()></a> <td> </table> <p>The SVG transform function <a href="#svg-rotate">rotate</a> with 3 values can not be mapped to a corresponding CSS <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function⑨"><transform-function></a>. The 2 optional number values represent a horizontal translation value <span class="css">cx</span> followed by a vertical translation value <span class="css">cy</span>. Both number values get interpreted as CSS <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#length-value" id="ref-for-length-value⑤"><length></a> types with <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-4/#px" id="ref-for-px①">px</a> units and define the origin for rotation. The behavior is equivalent to an initial translation by <span class="css">cx</span>, <span class="css">cy</span>, a rotation defined by the first number value interpreted as <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#angle-value" id="ref-for-angle-value③"><angle></a> type with <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-values-4/#deg" id="ref-for-deg③">deg</a> unit followed by a translation by <span class="css">-cx</span>, <span class="css">-cy</span>.</p> <p>A <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute⑨">transform</a> attribute can be the start or end value of a CSS Transition. If the value of a <span id="ref-for-TransformAttribute①⓪">transform</span> attribute is the start or end value of a CSS Transition and the SVG <a href="#svg-transform-list">transform list</a> contains at least one <a href="#svg-rotate">rotate</a> transform function with 3 values, the individual SVG transform functions must get <a data-link-type="dfn" href="#post-multiplied" id="ref-for-post-multiplied②">post-multiplied</a> and the resulting matrix must get mapped to a <a class="production css" data-link-type="function" href="#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix③"><matrix()></a> CSS <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function①⓪"><transform-function></a> and used as start/end value of the CSS Transition.</p> <h3 class="heading settled" data-level="6.4" id="svg-user-coordinate-space"><span class="secno">6.4. </span><span class="content">User coordinate space</span><a class="self-link" href="#svg-user-coordinate-space"></a></h3> <p>For the <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern" id="ref-for-elementdef-pattern①">pattern</a></code> element, the <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute" id="ref-for-PatternElementPatternTransformAttribute⑤">patternTransform</a></code> attribute and <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform②①">transform</a> property define an additional transformation in the pattern coordinate system. See <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG/pservers.html#PatternElementPatternUnitsAttribute" id="ref-for-PatternElementPatternUnitsAttribute①">patternUnits</a></code> attribute for details <a data-link-type="biblio" href="#biblio-svg2" title="Scalable Vector Graphics (SVG) 2">[SVG2]</a>.</p> <p>For the <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-linearGradient" id="ref-for-elementdef-linearGradient①">linearGradient</a></code> and <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-radialGradient" id="ref-for-elementdef-radialGradient①">radialGradient</a></code> elements, the <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute" id="ref-for-LinearGradientElementGradientTransformAttribute⑤">gradientTransform</a></code> attribute and <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform②②">transform</a> property define an additional transformation in the gradient coordinate system. See <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG/pservers.html#LinearGradientElementGradientUnitsAttribute" id="ref-for-LinearGradientElementGradientUnitsAttribute①">gradientUnits</a></code> attribute for details <a data-link-type="biblio" href="#biblio-svg2" title="Scalable Vector Graphics (SVG) 2">[SVG2]</a>.</p> <p>For the <code><a data-link-type="element" href="https://drafts.fxtf.org/css-masking-1/#elementdef-clippath" id="ref-for-elementdef-clippath②">clipPath</a></code> element, the <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute①①">transform</a> attribute and <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform②③">transform</a> property define an additional transformation in the clipping path coordinate space. See <code><a data-link-type="element-sub" href="https://drafts.fxtf.org/css-masking-1/#element-attrdef-clippath-clippathunits" id="ref-for-element-attrdef-clippath-clippathunits①">clipPathUnits</a></code> attribute for details <a data-link-type="biblio" href="#biblio-css-masking" title="CSS Masking Module Level 1">[CSS-MASKING]</a>.</p> <p>For all other <a data-link-type="dfn" href="#transformable-element" id="ref-for-transformable-element④">transformable elements</a> the <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute①②">transform</a> attribute and <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform②④">transform</a> property define a transformation in the current user coordinate system of the parent. All percentage values of the <span id="ref-for-TransformAttribute①③">transform</span> attribute are relative to the element’s <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box⑧">reference box</a>.</p> <div class="example" id="example-bb84e563"> <a class="self-link" href="#example-bb84e563"></a> <p>The <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin①②">transform-origin</a> property on the pattern in the following example specifies a <span class="css">50%</span> translation of the origin in the horizontal and vertical dimension. The <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform②⑤">transform</a> property specifies a translation as well, but in absolute lengths.</p> <pre><code class="highlight"><c- f><svg</c-> <c- e>xmlns=</c-><c- s>"http://www.w3.org/2000/svg"</c-><c- f>></c-> <c- f><style></c-> pattern { transform: rotate(45deg); transform-origin: 50% 50%; } <c- f></style></c-> <c- f><defs></c-> <c- f><pattern</c-> <c- e>id=</c-><c- s>"pattern-1"</c-><c- f>></c-> <c- f><rect</c-> <c- e>id=</c-><c- s>"rect1"</c-> <c- e>width=</c-><c- s>"100"</c-> <c- e>height=</c-><c- s>"100"</c-> <c- e>fill=</c-><c- s>"blue"</c-> <c- f>/></c-> <c- f></pattern></c-> <c- f></defs></c-> <c- f><rect</c-> <c- e>width=</c-><c- s>"200"</c-> <c- e>height=</c-><c- s>"200"</c-> <c- e>fill=</c-><c- s>"url(#pattern-1)"</c-> <c- f>/></c-> <c- f></svg></c-> </code></pre> <p>An SVG <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern" id="ref-for-elementdef-pattern②">pattern</a></code> element doesn’t have a bounding box. The <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box⑨">reference box</a> of the referencing <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/shapes.html#elementdef-rect" id="ref-for-elementdef-rect②">rect</a></code> element is used instead to solve the relative values of the <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin①③">transform-origin</a> property. Therefore the point of origin will get translated by 100 pixels temporarily to rotate the user space of the <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern" id="ref-for-elementdef-pattern③">pattern</a></code> elements content.</p> </div> <h3 class="heading settled" data-level="6.5" id="transform-attribute-dom"><span class="secno">6.5. </span><span class="content">SVG DOM interface for the <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute①④">transform</a> attribute</span><a class="self-link" href="#transform-attribute-dom"></a></h3> <p>The SVG specification defines the "<a href="https://www.w3.org/TR/2011/REC-SVG11-20110816/coords.html#InterfaceSVGAnimatedTransformList">SVGAnimatedTransformList</a>" interface in the SVG DOM to provide access to the animated and the base value of the SVG <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute①⑤">transform</a>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute" id="ref-for-LinearGradientElementGradientTransformAttribute⑥">gradientTransform</a></code> and <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute" id="ref-for-PatternElementPatternTransformAttribute⑥">patternTransform</a></code> attributes. To ensure backwards compatibility, this API must still be supported by user agents.</p> <p><code class="idl"><a data-link-type="idl" href="https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__baseVal" id="ref-for-__svg__SVGAnimatedPreserveAspectRatio__baseVal">baseVal</a></code> gives the author the possibility to access and modify the values of the SVG <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute①⑥">transform</a>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute" id="ref-for-PatternElementPatternTransformAttribute⑦">patternTransform</a></code>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute" id="ref-for-LinearGradientElementGradientTransformAttribute⑦">gradientTransform</a></code> attributes. To provide the necessary backwards compatibility to the SVG DOM, <code class="idl"><a data-link-type="idl" href="https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__baseVal" id="ref-for-__svg__SVGAnimatedPreserveAspectRatio__baseVal①">baseVal</a></code> must reflect the values of this author style sheet. All modifications to SVG DOM objects of <code class="idl"><a data-link-type="idl" href="https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__baseVal" id="ref-for-__svg__SVGAnimatedPreserveAspectRatio__baseVal②">baseVal</a></code> must affect this author style sheet immediately.</p> <p><code class="idl"><a data-link-type="idl" href="https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__animVal" id="ref-for-__svg__SVGAnimatedPreserveAspectRatio__animVal">animVal</a></code> represents the computed style of the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform②⑥">transform</a> property. Therefore it includes all applied <a href="https://www.w3.org/TR/css3-transitions/">CSS3 Transitions</a>, <a href="https://www.w3.org/TR/css3-animations/">CSS3 Animations</a> or SVG Animations if any of those are underway. The computed style and SVG DOM objects of <code class="idl"><a data-link-type="idl" href="https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__animVal" id="ref-for-__svg__SVGAnimatedPreserveAspectRatio__animVal①">animVal</a></code> can not be modified.</p> <h2 class="heading settled" data-level="7" id="transform-functions"><span class="secno">7. </span><span class="content">The Transform Functions</span><a class="self-link" href="#transform-functions"></a></h2> <p>The value of the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform②⑦">transform</a> property is a list of <dfn class="dfn-paneled css" data-dfn-type="type" data-export id="typedef-transform-function"><transform-function></dfn>. The set of allowed transform functions is given below. In the following functions, a <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#zero-value" id="ref-for-zero-value"><zero></a> behaves the same as <span class="css">0deg</span> ("unitless 0" angles are preserved for legacy compat). A percentage for horizontal translations is relative to the width of the <a data-link-type="dfn" href="#reference-box" id="ref-for-reference-box①⓪">reference box</a>. A percentage for vertical translations is relative to the height of the <span id="ref-for-reference-box①①">reference box</span>.</p> <h3 class="heading settled" data-level="7.1" id="two-d-transform-functions"><span class="secno">7.1. </span><span class="content">2D Transform Functions</span><a class="self-link" href="#two-d-transform-functions"></a></h3> <dl> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-matrix">matrix()</dfn> = matrix( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#number-value" id="ref-for-number-value"><number></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-comma" id="ref-for-mult-comma">#{6}</a> )</span> <dd data-md> <p>specifies a 2D transformation in the form of a <a href="#MatrixDefined">transformation matrix</a> of the six values a, b, c, d, e, f.</p> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-translate">translate()</dfn> = translate( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage④"><length-percentage></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma">,</a> <span class="production" id="ref-for-typedef-length-percentage⑤"><length-percentage></span><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt②">?</a> )</span> <dd data-md> <p>specifies a <a href="#TranslateDefined">2D translation</a> by the vector [tx, ty], where tx is the first translation-value parameter and ty is the optional second translation-value parameter. If <em><ty></em> is not provided, ty has zero as a value.</p> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-translatex">translateX()</dfn> = translateX( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage⑥"><length-percentage></a> )</span> <dd data-md> <p>specifies a <a href="#TranslateDefined">translation</a> by the given amount in the X direction.</p> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-translatey">translateY()</dfn> = translateY( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#typedef-length-percentage" id="ref-for-typedef-length-percentage⑦"><length-percentage></a> )</span> <dd data-md> <p>specifies a <a href="#TranslateDefined">translation</a> by the given amount in the Y direction.</p> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-scale">scale()</dfn> = scale( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#number-value" id="ref-for-number-value①"><number></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma①">,</a> <span class="production" id="ref-for-number-value②"><number></span><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt③">?</a> )</span> <dd data-md> <p>specifies a <a href="#ScaleDefined">2D scale</a> operation by the [sx,sy] scaling vector described by the 2 parameters. If the second parameter is not provided, it takes a value equal to the first. For example, scale(1, 1) would leave an element unchanged, while scale(2, 2) would cause it to appear twice as long in both the X and Y axes, or four times its typical geometric size.</p> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-scalex">scaleX()</dfn> = scaleX( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#number-value" id="ref-for-number-value③"><number></a> )</span> <dd data-md> <p>specifies a <a href="#ScaleDefined">2D scale</a> operation using the [sx,1] scaling vector, where sx is given as the parameter.</p> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-scaley">scaleY()</dfn> = scaleY( <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#number-value" id="ref-for-number-value④"><number></a> )</span> <dd data-md> <p>specifies a <a href="#ScaleDefined">2D scale</a> operation using the [1,sy] scaling vector, where sy is given as the parameter.</p> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-rotate">rotate()</dfn> = rotate( [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#angle-value" id="ref-for-angle-value④"><angle></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②②">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#zero-value" id="ref-for-zero-value①"><zero></a> ] )</span> <dd data-md> <p>specifies a <a href="#RotateDefined">2D rotation</a> by the angle specified in the parameter about the origin of the element, as defined by the <a class="property css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin①④">transform-origin</a> property. For example, <span class="css">rotate(90deg)</span> would cause elements to appear rotated one-quarter of a turn in the clockwise direction.</p> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-skew">skew()</dfn> = skew( [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#angle-value" id="ref-for-angle-value⑤"><angle></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②③">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#zero-value" id="ref-for-zero-value②"><zero></a> ] <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma②">,</a> [ <span class="production" id="ref-for-angle-value⑥"><angle></span> <span id="ref-for-comb-one②④">|</span> <span class="production" id="ref-for-zero-value③"><zero></span> ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt④">?</a> )</span> <dd data-md> <p>specifies a <a href="#SkewDefined">2D skew</a> by [ax,ay] for X and Y. If the second parameter is not provided, it has a zero value.</p> <p><strong class="advisement"> <a class="css" data-link-type="maybe" href="#funcdef-transform-skew" id="ref-for-funcdef-transform-skew①">skew()</a> exists for compatibility reasons, and should not be used in new content. Use <a class="css" data-link-type="maybe" href="#funcdef-transform-skewx" id="ref-for-funcdef-transform-skewx①">skewX()</a> or <a class="css" data-link-type="maybe" href="#funcdef-transform-skewy" id="ref-for-funcdef-transform-skewy①">skewY()</a> instead, noting that the behavior of <span class="css" id="ref-for-funcdef-transform-skew②">skew()</span> is different from multiplying <span class="css" id="ref-for-funcdef-transform-skewx②">skewX()</span> with <span class="css" id="ref-for-funcdef-transform-skewy②">skewY()</span>.</strong></p> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-skewx">skewX()</dfn> = skewX( [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#angle-value" id="ref-for-angle-value⑦"><angle></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②⑤">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#zero-value" id="ref-for-zero-value④"><zero></a> ] )</span> <dd data-md> <p>specifies a <a href="#SkewXDefined">2D skew transformation along the X axis</a> by the given angle.</p> <dt data-md><span class="prod"><dfn class="dfn-paneled css" data-dfn-for="transform" data-dfn-type="function" data-export id="funcdef-transform-skewy">skewY()</dfn> = skewY( [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#angle-value" id="ref-for-angle-value⑧"><angle></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②⑥">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#zero-value" id="ref-for-zero-value⑤"><zero></a> ] )</span> <dd data-md> <p>specifies a <a href="#SkewYDefined">2D skew transformation along the Y axis</a> by the given angle.</p> </dl> <h3 class="heading settled" data-level="7.2" id="transform-primitives"><span class="secno">7.2. </span><span class="content">Transform function primitives and derivatives</span><a class="self-link" href="#transform-primitives"></a></h3> <p>Some transform functions can be represented by more generic transform functions. These transform functions are called derived transform functions, and the generic transform functions are called primitive transform functions. Two-dimensional primitives and their derived transform functions are:</p> <dl> <dt id="translate-primitive"><a class="self-link" href="#translate-primitive"></a><a class="css" data-link-type="maybe" href="#funcdef-transform-translate" id="ref-for-funcdef-transform-translate②">translate()</a> <dd>for <a class="production css" data-link-type="function" href="#funcdef-transform-translatex" id="ref-for-funcdef-transform-translatex①"><translateX()></a>, <a class="production css" data-link-type="function" href="#funcdef-transform-translatey" id="ref-for-funcdef-transform-translatey①"><translateY()></a> and <a class="production css" data-link-type="function" href="#funcdef-transform-translate" id="ref-for-funcdef-transform-translate③"><translate()></a>. <dt id="scale-primitive"><a class="self-link" href="#scale-primitive"></a><a class="css" data-link-type="maybe" href="#funcdef-transform-scale" id="ref-for-funcdef-transform-scale②">scale()</a> <dd>for <a class="production css" data-link-type="function" href="#funcdef-transform-scalex" id="ref-for-funcdef-transform-scalex①"><scaleX()></a>, <a class="production css" data-link-type="function" href="#funcdef-transform-scaley" id="ref-for-funcdef-transform-scaley①"><scaleY()></a> and <a class="production css" data-link-type="function" href="#funcdef-transform-scale" id="ref-for-funcdef-transform-scale③"><scale()></a>. </dl> <h2 class="heading settled" data-level="8" id="transform-function-lists"><span class="secno">8. </span><span class="content">The Transform Function Lists</span><a class="self-link" href="#transform-function-lists"></a></h2> <p>If a list of <a class="production css" data-link-type="type" href="#typedef-transform-function" id="ref-for-typedef-transform-function①①"><transform-function></a>s is provided, then the net effect is as if each transform function had been specified separately in the order provided.</p> <p>That is, in the absence of other styling that affects position and dimensions, a nested set of transforms is equivalent to a single list of transform functions, applied from the coordinate system of the ancestor to the <a data-link-type="dfn" href="#local-coordinate-system" id="ref-for-local-coordinate-system⑤">local coordinate system</a> of a given element. The resulting transform is the matrix multiplication of the list of transforms.</p> <div class="example" id="example-5633487a"> <a class="self-link" href="#example-5633487a"></a> For example, <pre><code class="highlight"><c- p><</c-><c- f>div</c-> <c- e>style</c-><c- o>=</c-><c- s>"transform: translate(-10px, -20px) scale(2) rotate(45deg)"</c-><c- p>/></c-> </code></pre> <p>is functionally equivalent to:</p> <pre><code class="highlight"><c- p><</c-><c- f>div</c-> <c- e>style</c-><c- o>=</c-><c- s>"transform: translate(-10px, -20px)"</c-> <c- e>id</c-><c- o>=</c-><c- s>"root"</c-><c- p>></c-> <c- p><</c-><c- f>div</c-> <c- e>style</c-><c- o>=</c-><c- s>"transform: scale(2)"</c-><c- p>></c-> <c- p><</c-><c- f>div</c-> <c- e>style</c-><c- o>=</c-><c- s>"transform: rotate(45deg)"</c-><c- p>></c-> <c- p></</c-><c- f>div</c-><c- p>></c-> <c- p></</c-><c- f>div</c-><c- p>></c-> <c- p></</c-><c- f>div</c-><c- p>></c-> </code></pre> </div> <p>If a transform function causes the <a data-link-type="dfn" href="#current-transformation-matrix" id="ref-for-current-transformation-matrix③">current transformation matrix</a> of an object to be non-invertible, the object and its content do not get displayed.</p> <div class="example" id="example-116f6ceb"> <a class="self-link" href="#example-116f6ceb"></a> <p>The object in the following example gets scaled by 0.</p> <pre><code class="highlight"><c- p><</c-><c- f>style</c-><c- p>></c-> <c- p>.</c-><c- nc>box</c-> <c- p>{</c-> <c- k>transform</c-><c- p>:</c-> scale<c- p>(</c-><c- mi>0</c-><c- p>);</c-> <c- p>}</c-> <c- p></</c-><c- f>style</c-><c- p>></c-> <c- p><</c-><c- f>div</c-> <c- e>class</c-><c- o>=</c-><c- s>"box"</c-><c- p>></c-> Not visible <c- p></</c-><c- f>div</c-><c- p>></c-> </code></pre> <p>The scaling causes a non-invertible CTM for the coordinate space of the div box. Therefore neither the div box, nor the text in it get displayed.</p> </div> <h2 class="heading settled" data-level="9" id="interpolation-of-transforms"><span class="secno">9. </span><span class="content">Interpolation of Transforms</span><a class="self-link" href="#interpolation-of-transforms"></a></h2> <p><a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#interpolation" id="ref-for-interpolation">Interpolation</a> of transform function lists is performed as follows:</p> <ul> <li id="none-none-interpolation"> <a class="self-link" href="#none-none-interpolation"></a> If both <var>V<sub>a</sub></var> and <var>V<sub>b</sub></var> are <span class="css">none</span>: <ul> <li data-md> <p><var>V<sub>result</sub></var> is <span class="css">none</span>.</p> </ul> <li id="transform-interpolation-length-fixup"> <a class="self-link" href="#transform-interpolation-length-fixup"></a> Treating <span class="css">none</span> as a list of zero length, if <var>V<sub>a</sub></var> or <var>V<sub>b</sub></var> differ in length: <ul> <li data-md> <p>extend the shorter list to the length of the longer list, setting the function at each additional position to the <a data-link-type="dfn" href="#identity-transform-function" id="ref-for-identity-transform-function">identity transform function</a> matching the function at the corresponding position in the longer list. Both transform function lists are then interpolated following the next rule.</p> </ul> <div class="example" id="example-fa107865"><a class="self-link" href="#example-fa107865"></a> For example, if <var>V<sub>a</sub></var> is <span class="css">scale(2)</span> and <var>V<sub>b</sub></var> is <span class="css">none</span> then the value <span class="css">scale(1)</span> will be used for <var>V<sub>b</sub></var> and interpolation will proceed using the next rule. Similarly, if <var>V<sub>a</sub></var> is <span class="css">scale(1)</span> and <var>V<sub>b</sub></var> is <span class="css">scale(2) rotate(50deg)</span> then the interpolation will be performed as if <var>V<sub>a</sub></var> were <span class="css">scale(1) rotate(0)</span>. </div> <li> Let <var>V<sub>result</sub></var> be an empty list. Beginning at the start of <var>V<sub>a</sub></var> and <var>V<sub>b</sub></var>, compare the corresponding functions at each position: <ul> <li data-md> <p>While the functions have either the same name, or are derivatives of the same <a href="#transform-primitives">primitive transform function</a>, interpolate the corresponding pair of functions as described in <a href="#interpolation-of-transform-functions">§ 10 Interpolation of primitives and derived transform functions</a> and append the result to <var>V<sub>result</sub></var>.</p> <li data-md> <p>If the pair do not have a common name or <a href="#transform-primitives">primitive transform function</a>, post-multiply the remaining transform functions in each of <var>V<sub>a</sub></var> and <var>V<sub>b</sub></var> respectively to produce two 4x4 matrices. <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#interpolation" id="ref-for-interpolation①">Interpolate</a> these two matrices as described in <a href="#matrix-interpolation">§ 11 Interpolation of Matrices</a>, append the result to <var>V<sub>result</sub></var>, and cease iterating over <var>V<sub>a</sub></var> and <var>V<sub>b</sub></var>.</p> </ul> <div class="example" id="example-922432e3"> <a class="self-link" href="#example-922432e3"></a> For example, if <var>V<sub>a</sub></var> is <span class="css">rotate(0deg) scale(1) translate(20px)</span> and <var>V<sub>b</sub></var> is <span class="css">rotate(270deg) translate(10px) scale(2)</span>, the <span class="css">rotate(0deg)</span> and <span class="css">rotate(360deg)</span> functions will be interpolated according to <a href="#interpolation-of-transform-functions">§ 10 Interpolation of primitives and derived transform functions</a> while the remainder of each list—<span class="css">scale(1) translate(20px)</span> and <span class="css">translate(10px) scale(2)</span>—will first be converted to equivalent 4x4 matrices and then interpolated as described in <a href="#matrix-interpolation">§ 11 Interpolation of Matrices</a>. <p>A previous version of this specification did not attempt to interpolate matching pairs of transform functions unless all functions in the list matched. As a result, the two lists in this example would be interpolated using matrix interpolation only and the <span class="css">rotate(360deg)</span> component of the second list would be lost.</p> </div> </ul> <p>In some cases, an animation might cause a transformation matrix to be singular or non-invertible. For example, an animation in which scale moves from 1 to -1. At the time when the matrix is in such a state, the transformed element is not rendered.</p> <h2 class="heading settled" data-level="10" id="interpolation-of-transform-functions"><span class="secno">10. </span><span class="content">Interpolation of primitives and derived transform functions</span><a class="self-link" href="#interpolation-of-transform-functions"></a></h2> <p>Two transform functions with the same name and the same number of arguments are interpolated numerically without a former conversion. The calculated value will be of the same transform function type with the same number of arguments. Special rules apply to <a class="production css" data-link-type="function" href="#funcdef-transform-matrix" id="ref-for-funcdef-transform-matrix④"><matrix()></a>.</p> <div class="example" id="example-1356eb1f"> <a class="self-link" href="#example-1356eb1f"></a> <p>The two transform functions <span class="css">translate(0)</span> and <span class="css">translate(100px)</span> are of the same type, have the same number of arguments and therefore can get interpolated numerically. <span class="css">translateX(100px)</span> is not of the same type and <span class="css">translate(100px, 0)</span> does not have the same number of arguments, therefore these transform functions can not get interpolated without a former conversion step.</p> </div> <p>Two different types of transform functions that share the same primitive, or transform functions of the same type with different number of arguments can be interpolated. Both transform functions need a former conversion to the common primitive first and get interpolated numerically afterwards. The computed value will be the primitive with the resulting interpolated arguments.</p> <div class="example" id="example-bd3fe5db"> <a class="self-link" href="#example-bd3fe5db"></a> <p>The following example describes a transition from <span class="css">translateX(100px)</span> to <span class="css">translateY(100px)</span> in 3 seconds on hovering over the div box. Both transform functions derive from the same primitive <a class="css" data-link-type="maybe" href="#funcdef-transform-translate" id="ref-for-funcdef-transform-translate④">translate()</a> and therefore can be interpolated.</p> <pre><code class="highlight">div <c- p>{</c-> <c- k>transform</c-><c- p>:</c-> <c- nf>translateX</c-><c- p>(</c-><c- m>100</c-><c- k>px</c-><c- p>);</c-> <c- p>}</c-> div:hover <c- p>{</c-> <c- k>transform</c-><c- p>:</c-> <c- nf>translateY</c-><c- p>(</c-><c- m>100</c-><c- k>px</c-><c- p>);</c-> <c- k>transition</c-><c- p>:</c-> transform <c- m>3</c-><c- k>s</c-><c- p>;</c-> <c- p>}</c-> </code></pre> <p>For the time of the transition both transform functions get transformed to the common primitive. <span class="css">translateX(100px)</span> gets converted to <span class="css">translate(100px, 0)</span> and <span class="css">translateY(100px)</span> gets converted to <span class="css">translate(0, 100px)</span>. Both transform functions can then get interpolated numerically.</p> </div> <p>If both transform functions share a primitive in the two-dimensional space, both transform functions get converted to the two-dimensional primitive. If one or both transform functions are three-dimensional transform functions, the common three-dimensional primitive is used.</p> <div class="example" id="example-24abc2ae"> <a class="self-link" href="#example-24abc2ae"></a> <p>In this example a two-dimensional transform function gets animated to a three-dimensional transform function. The common primitive is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-transforms-2/#funcdef-translate3d" id="ref-for-funcdef-translate3d">translate3d()</a>.</p> <pre><code class="highlight">div <c- p>{</c-> <c- k>transform</c-><c- p>:</c-> <c- nf>translateX</c-><c- p>(</c-><c- m>100</c-><c- k>px</c-><c- p>);</c-> <c- p>}</c-> div:hover <c- p>{</c-> <c- k>transform</c-><c- p>:</c-> <c- nf>translateZ</c-><c- p>(</c-><c- m>100</c-><c- k>px</c-><c- p>);</c-> <c- k>transition</c-><c- p>:</c-> transform <c- m>3</c-><c- k>s</c-><c- p>;</c-> <c- p>}</c-> </code></pre> <p>First <span class="css">translateX(100px)</span> gets converted to <span class="css">translate3d(100px, 0, 0)</span> and <span class="css">translateZ(100px)</span> to <span class="css">translate3d(0, 0, 100px)</span> respectively. Then both converted transform functions get interpolated numerically.</p> </div> <h2 class="heading settled" data-level="11" id="matrix-interpolation"><span class="secno">11. </span><span class="content">Interpolation of Matrices</span><a class="self-link" href="#matrix-interpolation"></a></h2> <p>When interpolating between two matrices, each matrix is decomposed into the corresponding translation, rotation, scale, skew. Each corresponding component of the decomposed matrices gets interpolated numerically and recomposed back to a matrix in a final step.</p> <div class="example" id="example-3a6b960d"> <a class="self-link" href="#example-3a6b960d"></a> In the following example the element gets translated by 100 pixel in both the X and Y directions and rotated by 1170° on hovering. The initial transformation is 45°. With the usage of transition, an author might expect a animated, clockwise rotation by three and a quarter turns (1170°). <pre><code class="highlight"><c- p><</c-><c- f>style</c-><c- p>></c-> <c- f>div</c-> <c- p>{</c-> <c- k>transform</c-><c- p>:</c-> rotate<c- p>(</c-><c- mi>45</c-><c- b>deg</c-><c- p>);</c-> <c- p>}</c-> <c- f>div</c-><c- p>:</c-><c- nd>hover</c-> <c- p>{</c-> <c- k>transform</c-><c- p>:</c-> translate<c- p>(</c-><c- mi>100</c-><c- b>px</c-><c- p>,</c-> <c- mi>100</c-><c- b>px</c-><c- p>)</c-> rotate<c- p>(</c-><c- mi>1215</c-><c- b>deg</c-><c- p>);</c-> <c- k>transition</c-><c- p>:</c-> <c- k>transform</c-> <c- mi>3</c-><c- b>s</c-><c- p>;</c-> <c- p>}</c-> <c- p></</c-><c- f>style</c-><c- p>></c-> <c- p><</c-><c- f>div</c-><c- p>></</c-><c- f>div</c-><c- p>></c-> </code></pre> <p>The number of transform functions on the source transform <span class="css">rotate(45deg)</span> differs from the number of transform functions on the destination transform <span class="css">translate(100px, 100px) rotate(1125deg)</span>. According to the last rule of <a href="#interpolation-of-transforms">Interpolation of Transforms</a>, both transforms must be interpolated by matrix interpolation. With converting the transformation functions to matrices, the information about the three turns gets lost and the element gets rotated by just a quarter turn (90°).</p> <p>To achieve the three and a quarter turns for the example above, source and destination transforms must fulfill the third rule of <a href="#interpolation-of-transforms">Interpolation of Transforms</a>. Source transform could look like <span class="css">translate(0, 0) rotate(45deg)</span> for a linear interpolation of the transform functions.</p> </div> <p>In the following we differ between the <a href="#interpolation-of-2d-matrices">interpolation of two 2D matrices</a> and the interpolation of two matrices where at least one matrix is not a <a data-link-type="dfn" href="#2d-matrix" id="ref-for-2d-matrix">2D matrix</a>.</p> <p>If one of the matrices for interpolation is non-invertible, the used animation function must fall-back to a discrete animation according to the rules of the respective animation specification.</p> <h3 class="heading settled" data-level="11.1" id="supporting-functions"><span class="secno">11.1. </span><span class="content">Supporting functions</span><a class="self-link" href="#supporting-functions"></a></h3> <p>The pseudo code in the next subsections make use of the following supporting functions:</p> <pre>Supporting functions (point is a 3 component vector, matrix is a 4x4 matrix, vector is a 4 component vector): double determinant(matrix) returns the 4x4 determinant of the matrix matrix inverse(matrix) returns the inverse of the passed matrix matrix transpose(matrix) returns the transpose of the passed matrix point multVecMatrix(point, matrix) multiplies the passed point by the passed matrix and returns the transformed point double length(point) returns the length of the passed vector point normalize(point) normalizes the length of the passed point to 1 double dot(point, point) returns the dot product of the passed points double sqrt(double) returns the root square of passed value double max(double y, double x) returns the bigger value of the two passed values double dot(vector, vector) returns the dot product of the passed vectors vector multVector(vector, vector) multiplies the passed vectors double sqrt(double) returns the root square of passed value double max(double y, double x) returns the bigger value of the two passed values double min(double y, double x) returns the smaller value of the two passed values double cos(double) returns the cosines of passed value double sin(double) returns the sine of passed value double acos(double) returns the inverse cosine of passed value double abs(double) returns the absolute value of the passed value double rad2deg(double) transforms a value in radian to degree and returns it double deg2rad(double) transforms a value in degree to radian and returns it Decomposition also makes use of the following function: point combine(point a, point b, double ascl, double bscl) result[0] = (ascl * a[0]) + (bscl * b[0]) result[1] = (ascl * a[1]) + (bscl * b[1]) result[2] = (ascl * a[2]) + (bscl * b[2]) return result </pre> <h3 class="heading settled" data-level="11.2" id="interpolation-of-2d-matrices"><span class="secno">11.2. </span><span class="content">Interpolation of 2D matrices</span><a class="self-link" href="#interpolation-of-2d-matrices"></a></h3> <h4 class="heading settled" data-level="11.2.1" id="decomposing-a-2d-matrix"><span class="secno">11.2.1. </span><span class="content">Decomposing a 2D matrix</span><a class="self-link" href="#decomposing-a-2d-matrix"></a></h4> <p>The pseudo code below is based upon the "unmatrix" method in "Graphics Gems II, edited by Jim Arvo".</p> <p>Matrices in the pseudo code use the column-major order. The first index on a matrix entry represents the column and the second index represents the row.</p> <pre>Input: matrix ; a 4x4 matrix Output: translation ; a 2 component vector scale ; a 2 component vector angle ; rotation m11 ; 1,1 coordinate of 2x2 matrix m12 ; 1,2 coordinate of 2x2 matrix m21 ; 2,1 coordinate of 2x2 matrix m22 ; 2,2 coordinate of 2x2 matrix Returns false if the matrix cannot be decomposed, true if it can double row0x = matrix[0][0] double row0y = matrix[0][1] double row1x = matrix[1][0] double row1y = matrix[1][1] translate[0] = matrix[3][0] translate[1] = matrix[3][1] scale[0] = sqrt(row0x * row0x + row0y * row0y) scale[1] = sqrt(row1x * row1x + row1y * row1y) // If determinant is negative, one axis was flipped. double determinant = row0x * row1y - row0y * row1x if (determinant < 0) // Flip axis with minimum unit vector dot product. if (row0x < row1y) scale[0] = -scale[0] else scale[1] = -scale[1] // Renormalize matrix to remove scale. if (scale[0]) row0x *= 1 / scale[0] row0y *= 1 / scale[0] if (scale[1]) row1x *= 1 / scale[1] row1y *= 1 / scale[1] // Compute rotation and renormalize matrix. angle = atan2(row0y, row0x); if (angle) // Rotate(-angle) = [cos(angle), sin(angle), -sin(angle), cos(angle)] // = [row0x, -row0y, row0y, row0x] // Thanks to the normalization above. double sn = -row0y double cs = row0x double m11 = row0x double m12 = row0y double m21 = row1x double m22 = row1y row0x = cs * m11 + sn * m21 row0y = cs * m12 + sn * m22 row1x = -sn * m11 + cs * m21 row1y = -sn * m12 + cs * m22 m11 = row0x m12 = row0y m21 = row1x m22 = row1y // Convert into degrees because our rotation functions expect it. angle = rad2deg(angle) return true </pre> <h4 class="heading settled" data-level="11.2.2" id="interpolation-of-decomposed-2d-matrix-values"><span class="secno">11.2.2. </span><span class="content"> Interpolation of decomposed 2D matrix values </span><a class="self-link" href="#interpolation-of-decomposed-2d-matrix-values"></a></h4> <p>Before two decomposed 2D matrix values can be interpolated, the following</p> <pre>Input: translationA ; a 2 component vector scaleA ; a 2 component vector angleA ; rotation m11A ; 1,1 coordinate of 2x2 matrix m12A ; 1,2 coordinate of 2x2 matrix m21A ; 2,1 coordinate of 2x2 matrix m22A ; 2,2 coordinate of 2x2 matrix translationB ; a 2 component vector scaleB ; a 2 component vector angleB ; rotation m11B ; 1,1 coordinate of 2x2 matrix m12B ; 1,2 coordinate of 2x2 matrix m21B ; 2,1 coordinate of 2x2 matrix m22B ; 2,2 coordinate of 2x2 matrix // If x-axis of one is flipped, and y-axis of the other, // convert to an unflipped rotation. if ((scaleA[0] < 0 && scaleB[1] < 0) || (scaleA[1] < 0 && scaleB[0] < 0)) scaleA[0] = -scaleA[0] scaleA[1] = -scaleA[1] angleA += angleA < 0 ? 180 : -180 // Don’t rotate the long way around. if (!angleA) angleA = 360 if (!angleB) angleB = 360 if (abs(angleA - angleB) > 180) if (angleA > angleB) angleA -= 360 else angleB -= 360 </pre> <p>Afterwards, each component of the decomposed values translation, scale, angle, m11 to m22 of the source matrix get linearly interpolated with each corresponding component of the destination matrix.</p> <h4 class="heading settled" data-level="11.2.3" id="recomposing-to-a-2d-matrix"><span class="secno">11.2.3. </span><span class="content">Recomposing to a 2D matrix</span><a class="self-link" href="#recomposing-to-a-2d-matrix"></a></h4> <p>After interpolation, the resulting values are used to transform the elements user space. One way to use these values is to recompose them into a 4x4 matrix. This can be done following the pseudo code below.</p> <p>Matrices in the pseudo code use the column-major order. The first index on a matrix entry represents the column and the second index represents the row.</p> <pre>Input: translation ; a 2 component vector scale ; a 2 component vector angle ; rotation m11 ; 1,1 coordinate of 2x2 matrix m12 ; 1,2 coordinate of 2x2 matrix m21 ; 2,1 coordinate of 2x2 matrix m22 ; 2,2 coordinate of 2x2 matrix Output: matrix ; a 4x4 matrix initialized to identity matrix matrix[0][0] = m11 matrix[0][1] = m12 matrix[1][0] = m21 matrix[1][1] = m22 // Translate matrix. matrix[3][0] = translate[0] * m11 + translate[1] * m21 matrix[3][1] = translate[0] * m12 + translate[1] * m22 // Rotate matrix. angle = deg2rad(angle); double cosAngle = cos(angle); double sinAngle = sin(angle); // New temporary, identity initialized, 4x4 matrix rotateMatrix rotateMatrix[0][0] = cosAngle rotateMatrix[0][1] = sinAngle rotateMatrix[1][0] = -sinAngle rotateMatrix[1][1] = cosAngle matrix = post-multiply(rotateMatrix, matrix) // Scale matrix. matrix[0][0] *= scale[0] matrix[0][1] *= scale[0] matrix[1][0] *= scale[1] matrix[1][1] *= scale[1] </pre> <h2 class="heading settled" data-level="12" id="mathematical-description"><span class="secno">12. </span><span class="content">Mathematical Description of Transform Functions</span><a class="self-link" href="#mathematical-description"></a></h2> <p>Mathematically, all transform functions can be represented as 4x4 transformation matrices of the following form:</p> <p><img alt="\begin{bmatrix} m11 & m21 & m31 & m41 \\ m12 & m22 & m32 & m42 \\ m13 & m23 & m33 & m43 \\ m14 & m24 & m34 & m44 \end{bmatrix}" height="106" src="images/4x4matrix.png" width="222"></p> <p>One translation unit on a matrix is equivalent to 1 pixel in the local coordinate system of the element.</p> <ul> <li id="MatrixDefined"> <a class="self-link" href="#MatrixDefined"></a> <p> A 2D 3x2 matrix with six parameters <em>a</em>, <em>b</em>, <em>c</em>, <em>d</em>, <em>e</em> and <em>f</em> is equivalent to the matrix: </p> <p><img alt="\begin{bmatrix} a & c & 0 & e \\ b & d & 0 & f \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}" height="106" src="images/matrix.png" width="108"></p> <li id="TranslateDefined"> <a class="self-link" href="#TranslateDefined"></a> <p> A 2D translation with the parameters <em>tx</em> and <em>ty</em> is equivalent to a 3D translation where <em>tz</em> has zero as a value. </p> <p><img alt="\begin{bmatrix} 1 & 0 & 0 & tx \\ 0 & 1 & 0 & ty \\ 0 & 0 & 1 & tz \\ 0 & 0 & 0 & 1 \end{bmatrix}" height="106" src="images/translate3d.png" width="114"></p> <li id="ScaleDefined"> <a class="self-link" href="#ScaleDefined"></a> <p> A 2D scaling with the parameters <em>sx</em> and <em>sy</em> is equivalent to a 3D scale where <em>sz</em> has one as a value. </p> <p><img alt="\begin{bmatrix} sx & 0 & 0 & 0 \\ 0 & sy & 0 & 0 \\ 0 & 0 & sz & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}" height="106" src="images/scale3d.png" width="137"></p> <li id="RotateDefined"> <a class="self-link" href="#RotateDefined"></a> <p> A 2D rotation with the parameter <em>alpha</em> is equivalent to a 3D rotation with the vector [x,y,z] where <em>x</em> has zero as a value, <em>y</em> has zero as a value, <em>z</em> has one as a value, and the parameter <em>alpha</em>. </p> <p><img alt="\begin{bmatrix} 1 - 2 \cdot (y^2 + z^2) \cdot sq & 2 \cdot (x \cdot y \cdot sq - z \cdot sc) & 2 \cdot (x \cdot z \cdot sq + y \cdot sc) & 0 \\ 2 \cdot (x \cdot y \cdot sq + z \cdot sc) & 1 - 2 \cdot (x^2 + z^2) \cdot sq & 2 \cdot (y \cdot z \cdot sq - x \cdot sc) & 0 \\ 2 \cdot (x \cdot z \cdot sq - y \cdot sc) & 2 \cdot (y \cdot z \cdot sq + x \cdot sc) & 1 - 2 \cdot (x^2 + y^2) \cdot sq & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}" height="106" src="images/rotate3dmatrix.png" width="647"></p> <p>where:</p> <p><img alt="\newline sc = \sin (\alpha/2) \cdot \cos (\alpha/2) \newline sq = \sin^2 (\alpha/2)" height="50" src="images/rotate3dvariables.png" width="221"></p> <li id="SkewDefined"> <a class="self-link" href="#SkewDefined"></a> <p> A 2D skew like transformation with the parameters <em>alpha</em> and <em>beta</em> is equivalent to the matrix: </p> <p><img alt="\begin{bmatrix} 1 & \tan(\alpha) & 0 & 0 \\ \tan(\beta) & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}" height="106" src="images/skew.png" width="205"></p> <li id="SkewXDefined"> <a class="self-link" href="#SkewXDefined"></a> <p> A 2D skew transformation along the X axis with the parameter <em>alpha</em> is equivalent to the matrix: </p> <p><img alt="\begin{bmatrix} 1 & \tan(\alpha) & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}" height="106" src="images/skewX.png" width="155"></p> <li id="SkewYDefined"> <a class="self-link" href="#SkewYDefined"></a> <p> A 2D skew transformation along the Y axis with the parameter <em>beta</em> is equivalent to the matrix: </p> <p><img alt="\begin{bmatrix} 1 & 0 & 0 & 0 \\ \tan(\beta) & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}" height="106" src="images/skewY.png" width="155"></p> </ul> <h2 class="heading settled" data-level="13" id="priv-sec"><span class="secno">13. </span><span class="content">Privacy and Security Considerations</span><a class="self-link" href="#priv-sec"></a></h2> UAs must implement transform operations in a way attackers can not infer information and mount a timing attack. <p>A timing attack is a method of obtaining information about content that is otherwise protected, based on studying the amount of time it takes for an operation to occur.</p> <p>At this point there are no information about potential privacy or security concerns specific to this specification.</p> <h2 class="no-num heading settled" id="changes"><span class="content">Changes</span><a class="self-link" href="#changes"></a></h2> <h3 class="no-num heading settled" id="CR20190214"><span class="content">Since the <a href="https://www.w3.org/TR/2019/CR-css-transforms-1-20190214/">14 February 2019 Candidate Recommendation</a></span><a class="self-link" href="#CR20190214"></a></h3> <ul> <li data-md> <p>Relax syntax of <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute①⑦">transform</a> attribute: Do not require commas between <a class="production css" data-link-type="type" href="#typedef-transform-list" id="ref-for-typedef-transform-list③"><transform-list></a> items.</p> <li data-md> <p>Simplified grammar of transform functions. (No normative impact.)</p> <li data-md> <p>Remove animation support of <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform②⑧">transform</a> from <a data-link-type="element" href="https://svgwg.org/specs/animations/#elementdef-animate" id="ref-for-elementdef-animate">animate</a> and <a data-link-type="element" href="https://svgwg.org/specs/animations/#elementdef-set" id="ref-for-elementdef-set">set</a> elements.</p> <li data-md> <p>State that transforms do not transform backgrounds that are propagated to the canvas, and clarify some other interactions with background propagation.</p> <li data-md> <p>Editorial changes.</p> </ul> <h3 class="no-num heading settled" id="WD20181130"><span class="content">Since the <a href="https://www.w3.org/TR/2018/WD-css-transforms-1-20181130/">30 November 2018 Working Draft</a></span><a class="self-link" href="#WD20181130"></a></h3> <ul> <li data-md> <p>No substantive changes</p> <li data-md> <p>Boilerplate, styling updates for CR</p> </ul> <h3 class="no-num heading settled" id="WD20171130"><span class="content">Since the <a href="https://www.w3.org/TR/2017/WD-css-transforms-1-20171130/">30 November 2017 Working Draft</a> </span><a class="self-link" href="#WD20171130"></a></h3> <ul> <li data-md> <p>Remove specification text that makes <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute" id="ref-for-PatternElementPatternTransformAttribute⑧">patternTransform</a>, <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute" id="ref-for-LinearGradientElementGradientTransformAttribute⑧">gradientTransform</a> presentation attributes representing the <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform②⑨">transform</a> property. That is going to get specified by SVG 2 <a data-link-type="biblio" href="#biblio-svg2" title="Scalable Vector Graphics (SVG) 2">[SVG2]</a>.</p> <li data-md> <p>Added <a href="#priv-sec">privacy and security</a> section.</p> <li data-md> <p>Use <a data-link-type="biblio" href="#biblio-svg2" title="Scalable Vector Graphics (SVG) 2">[SVG2]</a> definitions for <a data-link-type="dfn" href="#transformable-element" id="ref-for-transformable-element⑤">transformable elements</a>.</p> <li data-md> <p>Added special syntax for <a data-link-type="element-attr" href="https://www.w3.org/TR/SVG11/coords.html#TransformAttribute" id="ref-for-TransformAttribute①⑧">transform</a>, <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute" id="ref-for-LinearGradientElementGradientTransformAttribute⑨">gradientTransform</a></code> and <code><a data-link-type="element-sub" href="https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute" id="ref-for-PatternElementPatternTransformAttribute⑨">patternTransform</a></code> attributes.</p> <li data-md> <p>Clarify multiplication order by using terms <a data-link-type="dfn" href="#post-multiply" id="ref-for-post-multiply">post-multiply</a> and <a data-link-type="dfn" href="#pre-multiply" id="ref-for-pre-multiply">pre-multiply</a>.</p> <li data-md> <p>Clarify index order of matrix entries in pseudo-code.</p> <li data-md> <p>Clarify multiplication order in recomposition pseudo-code.</p> <li data-md> <p>Clarify behavior of <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform③⓪">transform</a> on overflow area.</p> <li data-md> <p>Remove <span class="css">translateX(0)</span>, <span class="css">translateY(0)</span>, <span class="css">scaleX(0)</span>, <span class="css">scaleY(0)</span> from the list of neutral elements.</p> <li data-md> <p>Remove any reference of 3D transformations of transform function definitions.</p> <li data-md> <p>Specify interpolation between <a class="production css" data-link-type="type" href="#typedef-transform-list" id="ref-for-typedef-transform-list④"><transform-list></a>s to match lengths and avoid matrix interpolation for the common prefix of the two lists.</p> <li data-md> <p>No <a class="property css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform③①">transform</a> on non-replaced inline boxes, table-column boxes, and table-column-group boxes.</p> <li data-md> <p>Define target coordinate space for transformations on <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern" id="ref-for-elementdef-pattern④">pattern</a></code>, <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-linearGradient" id="ref-for-elementdef-linearGradient②">linearGradient</a></code>, <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/pservers.html#elementdef-radialGradient" id="ref-for-elementdef-radialGradient②">radialGradient</a></code> and <code><a data-link-type="element" href="https://drafts.fxtf.org/css-masking-1/#elementdef-clippath" id="ref-for-elementdef-clippath③">clipPath</a></code> elements.</p> <li data-md> <p>Remove 3-value <a class="production css" data-link-type="function" href="#funcdef-transform-rotate" id="ref-for-funcdef-transform-rotate②"><rotate()></a> from transform function primitives.</p> <li data-md> <p>Be more specific about computation of <a data-link-type="dfn" href="#transformation-matrix" id="ref-for-transformation-matrix⑦">transformation matrix</a> and <a data-link-type="dfn" href="#current-transformation-matrix" id="ref-for-current-transformation-matrix④">current transformation matrix</a>.</p> <li data-md> <p>Define reference box for paint servers and <code><a data-link-type="element" href="https://drafts.fxtf.org/css-masking-1/#elementdef-clippath" id="ref-for-elementdef-clippath④">clipPath</a></code> element.</p> <li data-md> <p>Specify behavior of transform presentation attribute with 3-value-rotate as start or end value of a transition.</p> <li data-md> <p>Add <a class="css" data-link-type="maybe" href="#valdef-transform-box-stroke-box" id="ref-for-valdef-transform-box-stroke-box②">stroke-box</a> and <a class="css" data-link-type="maybe" href="#valdef-transform-box-content-box" id="ref-for-valdef-transform-box-content-box②">content-box</a> to <a class="property css" data-link-type="property" href="#propdef-transform-box" id="ref-for-propdef-transform-box②">transform-box</a>. Align box mapping behavior across all specifications.</p> <li data-md> <p>Editorial changes.</p> </ul> <h2 class="no-num heading settled" id="acknowledgments"><span class="content">Acknowledgments</span><a class="self-link" href="#acknowledgments"></a></h2> <p>The editors would like to thank Robert O’Callahan, Cameron McCormack, Tab Atkins, Gérard Talbot, L. David Baron, Rik Cabanier, Brian Birtles, Benoit Jacob, Ken Shoemake, Alan Gresley, Maciej Stochowiak, Sylvain Galineau, Rafal Pietrak, Shane Stephens, Matt Rakow, XiangHongAi, Fabio M. Costa, Nivesh Rajbhandari, Rebecca Hauck, Gregg Tavares, Graham Clift, Erik Dahlström, Alexander Zolotov, Amelia Bellamy-Royds and Boris Zbarsky for their careful reviews, comments, and corrections.</p> </main> <h2 class="no-ref no-num heading settled" id="w3c-conformance"><span class="content"> Conformance</span><a class="self-link" href="#w3c-conformance"></a></h2> <h3 class="no-ref heading settled" id="w3c-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#w3c-conventions"></a></h3> <p>Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification. </p> <p>All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119" title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</a></p> <p>Examples in this specification are introduced with the words “for example” or are set apart from the normative text with <code>class="example"</code>, like this: </p> <div class="example" id="w3c-example"> <a class="self-link" href="#w3c-example"></a> <p>This is an example of an informative example.</p> </div> <p>Informative notes begin with the word “Note” and are set apart from the normative text with <code>class="note"</code>, like this: </p> <p class="note" role="note">Note, this is an informative note.</p> <p>Advisements are normative sections styled to evoke special attention and are set apart from other normative text with <code><strong class="advisement"></code>, like this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong></p> <details class="wpt-tests-block" dir="ltr" lang="en" open> <summary>Tests</summary> <p>Tests relating to the content of this specification may be documented in “Tests” blocks like this one. Any such block is non-normative.</p> <ul class="wpt-tests-list"></ul> <hr> </details> <h3 class="no-ref heading settled" id="w3c-conformance-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#w3c-conformance-classes"></a></h3> <p>Conformance to this specification is defined for three conformance classes: </p> <dl> <dt>style sheet <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS style sheet</a>. <dt>renderer <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders documents that use them. <dt>authoring tool <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> that writes a style sheet. </dl> <p>A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module. </p> <p>A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.) </p> <p>An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module. </p> <h3 class="no-ref heading settled" id="w3c-partial"><span class="content"> Partial implementations</span><a class="self-link" href="#w3c-partial"></a></h3> <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers <strong>must</strong> treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as appropriate</a>) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents <strong>must not</strong> selectively ignore unsupported component values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.</p> <h4 class="heading settled" id="w3c-conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#w3c-conform-future-proofing"></a></h4> <p>To avoid clashes with future stable CSS features, the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p> <h3 class="no-ref heading settled" id="w3c-testing"><span class="content"> Non-experimental implementations</span><a class="self-link" href="#w3c-testing"></a></h3> <p>Once a specification reaches the Candidate Recommendation stage, non-experimental implementations are possible, and implementors should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec. </p> <p>To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group. </p> <p>Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>. Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list.</p> <script src="https://www.w3.org/scripts/TR/2021/fixup.js"></script> <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2> <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3> <ul class="index"> <li><a href="#2d-matrix">2D matrix</a><span>, in § 1.2</span> <li><a href="#valdef-transform-box-border-box">border-box</a><span>, in § 5</span> <li><a href="#valdef-transform-origin-bottom">bottom</a><span>, in § 4</span> <li><a href="#valdef-transform-origin-center">center</a><span>, in § 4</span> <li><a href="#containing-block-for-all-descendants">containing block for all descendants</a><span>, in § 2</span> <li><a href="#valdef-transform-box-content-box">content-box</a><span>, in § 5</span> <li><a href="#current-transformation-matrix">current transformation matrix</a><span>, in § 1.2</span> <li><a href="#valdef-transform-box-fill-box">fill-box</a><span>, in § 5</span> <li><a href="#identity-transform-function">identity transform function</a><span>, in § 1.2</span> <li><a href="#valdef-transform-origin-left">left</a><span>, in § 4</span> <li><a href="#local-coordinate-system">local coordinate system</a><span>, in § 1.2</span> <li><a href="#funcdef-transform-matrix">matrix()</a><span>, in § 7.1</span> <li><a href="#multiply">multiply</a><span>, in § 1.2</span> <li><a href="#post-multiplied">post-multiplied</a><span>, in § 1.2</span> <li><a href="#post-multiply">post-multiply</a><span>, in § 1.2</span> <li><a href="#pre-multiplied">pre-multiplied</a><span>, in § 1.2</span> <li><a href="#pre-multiply">pre-multiply</a><span>, in § 1.2</span> <li><a href="#reference-box">reference box</a><span>, in § 5</span> <li><a href="#valdef-transform-origin-right">right</a><span>, in § 4</span> <li><a href="#funcdef-transform-rotate">rotate()</a><span>, in § 7.1</span> <li><a href="#funcdef-transform-scale">scale()</a><span>, in § 7.1</span> <li><a href="#funcdef-transform-scalex">scaleX()</a><span>, in § 7.1</span> <li><a href="#funcdef-transform-scaley">scaleY()</a><span>, in § 7.1</span> <li><a href="#funcdef-transform-skew">skew()</a><span>, in § 7.1</span> <li><a href="#funcdef-transform-skewx">skewX()</a><span>, in § 7.1</span> <li><a href="#funcdef-transform-skewy">skewY()</a><span>, in § 7.1</span> <li><a href="#valdef-transform-box-stroke-box">stroke-box</a><span>, in § 5</span> <li><a href="#valdef-transform-origin-top">top</a><span>, in § 4</span> <li><a href="#propdef-transform">transform</a><span>, in § 3</span> <li><a href="#transformable-element">transformable element</a><span>, in § 1.2</span> <li><a href="#transformation-matrix">transformation matrix</a><span>, in § 1.2</span> <li><a href="#propdef-transform-box">transform-box</a><span>, in § 5</span> <li><a href="#transformed-element">transformed element</a><span>, in § 1.2</span> <li><a href="#typedef-transform-function"><transform-function></a><span>, in § 7</span> <li><a href="#typedef-transform-list"><transform-list></a><span>, in § 3</span> <li><a href="#propdef-transform-origin">transform-origin</a><span>, in § 4</span> <li><a href="#funcdef-transform-translate">translate()</a><span>, in § 7.1</span> <li><a href="#funcdef-transform-translatex">translateX()</a><span>, in § 7.1</span> <li><a href="#funcdef-transform-translatey">translateY()</a><span>, in § 7.1</span> <li><a href="#user-coordinate-system">user coordinate system</a><span>, in § 1.2</span> <li><a href="#valdef-transform-box-view-box">view-box</a><span>, in § 5</span> </ul> <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3> <ul class="index"> <li> <a data-link-type="biblio">[CSS-CASCADE-5]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="9cd25054">computed value</span> <li><span class="dfn-paneled" id="a4eb3c57">used value</span> </ul> <li> <a data-link-type="biblio">[CSS-MASKING]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="f00710cb">clipPath</span> <li><span class="dfn-paneled" id="ef7007e3">clipPathUnits</span> </ul> <li> <a data-link-type="biblio">[CSS-OVERFLOW-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="8b3ca704">auto</span> <li><span class="dfn-paneled" id="86928bde">overflow</span> <li><span class="dfn-paneled" id="e7ab0d6a">scroll</span> </ul> <li> <a data-link-type="biblio">[CSS-SIZING-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="68019d7a">height</span> </ul> <li> <a data-link-type="biblio">[CSS-SYNTAX-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="92700be8"><number-token></span> <li><span class="dfn-paneled" id="33a598a0">letter</span> </ul> <li> <a data-link-type="biblio">[CSS-TRANSFORMS-2]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="18f79675">translate3d()</span> </ul> <li> <a data-link-type="biblio">[CSS-VALUES-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="68487d22">#</span> <li><span class="dfn-paneled" id="f0809abc">&&</span> <li><span class="dfn-paneled" id="bedd9d42">+</span> <li><span class="dfn-paneled" id="9f9120ff">,</span> <li><span class="dfn-paneled" id="3559c926"><angle></span> <li><span class="dfn-paneled" id="18222566"><length-percentage></span> <li><span class="dfn-paneled" id="fb030e6c"><length></span> <li><span class="dfn-paneled" id="16310992"><number></span> <li><span class="dfn-paneled" id="076e8657"><zero></span> <li><span class="dfn-paneled" id="537cf076">?</span> <li><span class="dfn-paneled" id="584e9c31">calc()</span> <li><span class="dfn-paneled" id="358fd6ff">CSS-wide keywords</span> <li><span class="dfn-paneled" id="389552e4">deg</span> <li><span class="dfn-paneled" id="d8586311">interpolate</span> <li><span class="dfn-paneled" id="c974a599">interpolation</span> <li><span class="dfn-paneled" id="9ddea951">px</span> <li><span class="dfn-paneled" id="6ec67710">|</span> </ul> <li> <a data-link-type="biblio">[CSS2]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="d332e4ec">auto</span> <li><span class="dfn-paneled" id="b8c9eb8a">stacking context</span> <li><span class="dfn-paneled" id="c82d6e13">z-index</span> </ul> <li> <a data-link-type="biblio">[CSS3BG]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="f95a7c3b">background-attachment</span> <li><span class="dfn-paneled" id="d27a809f">background-position</span> <li><span class="dfn-paneled" id="164f0069">fixed</span> <li><span class="dfn-paneled" id="f47d48ea">scroll</span> </ul> <li> <a data-link-type="biblio">[CSSOM]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="4fe61159">resolved value</span> <li><span class="dfn-paneled" id="5dd50c99">resolved value special case property</span> </ul> <li> <a data-link-type="biblio">[HTML]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="a7bbaf9f">div</span> </ul> <li> <a data-link-type="biblio">[SVG-ANIMATIONS]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="0246188d">animate</span> <li><span class="dfn-paneled" id="1d7fc05e">set</span> </ul> <li> <a data-link-type="biblio">[SVG1.1]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="76fdef96">gradientTransform</span> <li><span class="dfn-paneled" id="171d64d7">gradientUnits</span> <li><span class="dfn-paneled" id="5a2dc475">patternTransform</span> <li><span class="dfn-paneled" id="fd9f73b3">patternUnits</span> <li><span class="dfn-paneled" id="b8527dcc">transform</span> </ul> <li> <a data-link-type="biblio">[SVG2]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="46df29a9">animVal</span> <li><span class="dfn-paneled" id="c349138e">baseVal</span> <li><span class="dfn-paneled" id="10c0f2e8">linearGradient</span> <li><span class="dfn-paneled" id="ff72fec7">object bounding box</span> <li><span class="dfn-paneled" id="33f830f2">paint server element</span> <li><span class="dfn-paneled" id="abdfd54a">pattern</span> <li><span class="dfn-paneled" id="409e2104">presentation attributes</span> <li><span class="dfn-paneled" id="ee061115">radialGradient</span> <li><span class="dfn-paneled" id="abbd4058">rect</span> <li><span class="dfn-paneled" id="c0807e02">renderable element</span> <li><span class="dfn-paneled" id="19d42a6f">stroke bounding box</span> <li><span class="dfn-paneled" id="7d539771">text content element</span> <li><span class="dfn-paneled" id="5fdd136e">viewBox</span> <li><span class="dfn-paneled" id="b4376d3e">viewport coordinate system</span> </ul> </ul> <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2> <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3> <dl> <dt id="biblio-css-cascade-5">[CSS-CASCADE-5] <dd>Elika Etemad; Miriam Suzanne; Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-cascade-5/"><cite>CSS Cascading and Inheritance Level 5</cite></a>. URL: <a href="https://drafts.csswg.org/css-cascade-5/">https://drafts.csswg.org/css-cascade-5/</a> <dt id="biblio-css-masking">[CSS-MASKING] <dd>Dirk Schulze; Brian Birtles; Tab Atkins Jr.. <a href="https://drafts.fxtf.org/css-masking-1/"><cite>CSS Masking Module Level 1</cite></a>. URL: <a href="https://drafts.fxtf.org/css-masking-1/">https://drafts.fxtf.org/css-masking-1/</a> <dt id="biblio-css-overflow-3">[CSS-OVERFLOW-3] <dd>Elika Etemad; Florian Rivoal. <a href="https://drafts.csswg.org/css-overflow-3/"><cite>CSS Overflow Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-overflow-3/">https://drafts.csswg.org/css-overflow-3/</a> <dt id="biblio-css-sizing-3">[CSS-SIZING-3] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://drafts.csswg.org/css-sizing-3/"><cite>CSS Box Sizing Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-sizing-3/">https://drafts.csswg.org/css-sizing-3/</a> <dt id="biblio-css-syntax-3">[CSS-SYNTAX-3] <dd>Tab Atkins Jr.; Simon Sapin. <a href="https://drafts.csswg.org/css-syntax/"><cite>CSS Syntax Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-syntax/">https://drafts.csswg.org/css-syntax/</a> <dt id="biblio-css-values-3">[CSS-VALUES-3] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://drafts.csswg.org/css-values-3/"><cite>CSS Values and Units Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-values-3/">https://drafts.csswg.org/css-values-3/</a> <dt id="biblio-css-values-4">[CSS-VALUES-4] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://drafts.csswg.org/css-values-4/"><cite>CSS Values and Units Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-values-4/">https://drafts.csswg.org/css-values-4/</a> <dt id="biblio-css2">[CSS2] <dd>Bert Bos; et al. <a href="https://drafts.csswg.org/css2/"><cite>Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</cite></a>. URL: <a href="https://drafts.csswg.org/css2/">https://drafts.csswg.org/css2/</a> <dt id="biblio-css3bg">[CSS3BG] <dd>Elika Etemad; Brad Kemper. <a href="https://drafts.csswg.org/css-backgrounds/"><cite>CSS Backgrounds and Borders Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-backgrounds/">https://drafts.csswg.org/css-backgrounds/</a> <dt id="biblio-cssom">[CSSOM] <dd>Daniel Glazman; Emilio Cobos Álvarez. <a href="https://drafts.csswg.org/cssom/"><cite>CSS Object Model (CSSOM)</cite></a>. URL: <a href="https://drafts.csswg.org/cssom/">https://drafts.csswg.org/cssom/</a> <dt id="biblio-rfc2119">[RFC2119] <dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a> <dt id="biblio-svg-animations">[SVG-ANIMATIONS] <dd><a href="https://svgwg.org/specs/animations/"><cite>SVG Animations Level 2</cite></a>. Editor's Draft. URL: <a href="https://svgwg.org/specs/animations/">https://svgwg.org/specs/animations/</a> <dt id="biblio-svg2">[SVG2] <dd>Amelia Bellamy-Royds; et al. <a href="https://svgwg.org/svg2-draft/"><cite>Scalable Vector Graphics (SVG) 2</cite></a>. URL: <a href="https://svgwg.org/svg2-draft/">https://svgwg.org/svg2-draft/</a> </dl> <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3> <dl> <dt id="biblio-css-transforms-2">[CSS-TRANSFORMS-2] <dd>Tab Atkins Jr.; et al. <a href="https://drafts.csswg.org/css-transforms-2/"><cite>CSS Transforms Module Level 2</cite></a>. URL: <a href="https://drafts.csswg.org/css-transforms-2/">https://drafts.csswg.org/css-transforms-2/</a> <dt id="biblio-cssom-view">[CSSOM-VIEW] <dd>Simon Pieters. <a href="https://drafts.csswg.org/cssom-view/"><cite>CSSOM View Module</cite></a>. URL: <a href="https://drafts.csswg.org/cssom-view/">https://drafts.csswg.org/cssom-view/</a> <dt id="biblio-html">[HTML] <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/"><cite>HTML Standard</cite></a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a> </dl> <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2> <div class="big-element-wrapper"> <table class="index"> <thead> <tr> <th scope="col">Name <th scope="col">Value <th scope="col">Initial <th scope="col">Applies to <th scope="col">Inh. <th scope="col">%ages <th scope="col">Animation type <th scope="col">Canonical order <th scope="col">Computed value <tbody> <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-transform" id="ref-for-propdef-transform③②">transform</a> <td>none | <transform-list> <td>none <td>transformable elements <td>no <td>refer to the size of reference box <td>transform list, see interpolation rules <td>per grammar <td>as specified, but with lengths made absolute <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-transform-box" id="ref-for-propdef-transform-box③">transform-box</a> <td>content-box | border-box | fill-box | stroke-box | view-box <td>view-box <td>transformable elements <td>no <td>N/A <td>discrete <td>per grammar <td>specified keyword <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-transform-origin" id="ref-for-propdef-transform-origin①⑤">transform-origin</a> <td>[ left | center | right | top | bottom | <length-percentage> ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] <length>? | [ [ center | left | right ] && [ center | top | bottom ] ] <length>? <td>50% 50% <td>transformable elements <td>no <td>refer to the size of reference box <td>by computed value <td>per grammar <td>see background-position </table> </div> <details class="mdn-anno unpositioned" data-anno-for="transform-box"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-box" title="The transform-box CSS property defines the layout box to which the transform, individual transform properties translate,scale, and rotate, and transform-origin properties relate.">transform-box</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>55+</span></span><span class="safari yes"><span>Safari</span><span>11+</span></span><span class="chrome yes"><span>Chrome</span><span>64+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="transform-origin-property"> <summary><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin" title="The transform-origin CSS property sets the origin for an element's transformations.">transform-origin</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>16+</span></span><span class="safari yes"><span>Safari</span><span>9+</span></span><span class="chrome yes"><span>Chrome</span><span>36+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>23+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>10+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>4.4+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>24+</span></span> </div> </div> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform-origin" title="The transform-origin SVG attribute sets the origin for an item's transformations.">Attribute/transform-origin</a></p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>77+</span></span><span class="safari no"><span>Safari</span><span>None</span></span><span class="chrome yes"><span>Chrome</span><span>Yes</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>Yes</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>?</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>None</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="transform-property"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform" title="The transform CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model.">transform</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>16+</span></span><span class="safari yes"><span>Safari</span><span>9+</span></span><span class="chrome yes"><span>Chrome</span><span>36+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>23+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>10+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>9+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>4.4+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>24+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-matrix"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix" title="The matrix() CSS function defines a homogeneous 2D transformation matrix. Its result is a <transform-function> data type.">transform-function/matrix</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android yes"><span>Firefox for Android</span><span>4+</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-rotate"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate" title="The rotate() CSS function defines a transformation that rotates an element around a fixed point on the 2D plane, without deforming it. Its result is a <transform-function> data type.">transform-function/rotate</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-scale"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale" title="The scale() CSS function defines a transformation that resizes an element on the 2D plane. Because the amount of scaling is defined by a vector, it can resize the horizontal and vertical dimensions at different scales. Its result is a <transform-function> data type.">transform-function/scale</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-scalex"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scaleX" title="The scaleX() CSS function defines a transformation that resizes an element along the x-axis (horizontally). Its result is a <transform-function> data type.">transform-function/scaleX</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-scaley"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scaleY" title="The scaleY() CSS function defines a transformation that resizes an element along the y-axis (vertically). Its result is a <transform-function> data type.">transform-function/scaleY</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-skew"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skew" title="The skew() CSS function defines a transformation that skews an element on the 2D plane. Its result is a <transform-function> data type.">transform-function/skew</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android yes"><span>Firefox for Android</span><span>4+</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-skewx"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skewX" title="The skewX() CSS function defines a transformation that skews an element in the horizontal direction on the 2D plane. Its result is a <transform-function> data type.">transform-function/skewX</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-skewy"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/skewY" title="The skewY() CSS function defines a transformation that skews an element in the vertical direction on the 2D plane. Its result is a <transform-function> data type.">transform-function/skewY</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-translate"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translate" title="The translate() CSS function repositions an element in the horizontal and/or vertical directions. Its result is a <transform-function> data type.">transform-function/translate</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-translatex"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translateX" title="The translateX() CSS function repositions an element horizontally on the 2D plane. Its result is a <transform-function> data type.">transform-function/translateX</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="funcdef-transform-translatey"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/translateY" title="The translateY() CSS function repositions an element vertically on the 2D plane. Its result is a <transform-function> data type.">transform-function/translateY</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="transform-functions"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function" title="The <transform-function> CSS data type represents a transformation that affects an element's appearance. Transformation functions can rotate, resize, distort, or move an element in 2D or 3D space. It is used in the transform property.">transform-function</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>3.5+</span></span><span class="safari yes"><span>Safari</span><span>3.1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>10.5+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>9+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios yes"><span>iOS Safari</span><span>3.2+</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>2+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>11+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="svg-transform"> <summary><b class="less-than-two-engines-flag" title="This feature is in less than two current engines.">⚠</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform" title="The transform attribute defines a list of transform definitions that are applied to an element and the element's children.">Attribute/transform</a></p> <p class="less-than-two-engines-text">In no current engines.</p> <div class="support"> <span class="firefox no"><span>Firefox</span><span>?</span></span><span class="safari no"><span>Safari</span><span>?</span></span><span class="chrome no"><span>Chrome</span><span>?</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink no"><span>Edge</span><span>?</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>?</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="typedef-transform-list"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/gradientTransform" title="The gradientTransform attribute contains the definition of an optional additional transformation from the gradient coordinate system onto the target coordinate system (i.e., userSpaceOnUse or objectBoundingBox). This allows for things such as skewing the gradient. This additional transformation matrix is post-multiplied to (i.e., inserted to the right of) any previously defined transformations, including the implicit transformation necessary to convert from object bounding box units to user space.">Attribute/gradientTransform</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>1.5+</span></span><span class="safari yes"><span>Safari</span><span>3+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>?</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <script>/* Boilerplate: script-dom-helper */ "use strict"; function query(sel) { return document.querySelector(sel); } function queryAll(sel) { return [...document.querySelectorAll(sel)]; } function iter(obj) { if(!obj) return []; var it = obj[Symbol.iterator]; if(it) return it; return Object.entries(obj); } function mk(tagname, attrs, ...children) { const el = document.createElement(tagname); for(const [k,v] of iter(attrs)) { if(k.slice(0,3) == "_on") { const eventName = k.slice(3); el.addEventListener(eventName, v); } else if(k[0] == "_") { // property, not attribute el[k.slice(1)] = v; } else { if(v === false || v == null) { continue; } else if(v === true) { el.setAttribute(k, ""); continue; } else { el.setAttribute(k, v); } } } append(el, children); return el; } /* Create shortcuts for every known HTML element */ [ "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "nobr", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "pre", "progress", "q", "s", "samp", "script", "section", "select", "small", "source", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "u", "ul", "var", "video", "wbr", "xmp", ].forEach(tagname=>{ mk[tagname] = (...args) => mk(tagname, ...args); }); function* nodesFromChildList(children) { for(const child of children.flat(Infinity)) { if(child instanceof Node) { yield child; } else { yield new Text(child); } } } function append(el, ...children) { for(const child of nodesFromChildList(children)) { if(el instanceof Node) el.appendChild(child); else el.push(child); } return el; } function insertAfter(el, ...children) { for(const child of nodesFromChildList(children)) { el.parentNode.insertBefore(child, el.nextSibling); } return el; } function clearContents(el) { el.innerHTML = ""; return el; } function parseHTML(markup) { if(markup.toLowerCase().trim().indexOf('<!doctype') === 0) { const doc = document.implementation.createHTMLDocument(""); doc.documentElement.innerHTML = markup; return doc; } else { const el = mk.template({}); el.innerHTML = markup; return el.content; } }</script> <script>/* Boilerplate: script-dfn-panel */ "use strict"; { let dfnPanelData = { "0246188d": {"dfnID":"0246188d","dfnText":"animate","external":true,"refSections":[{"refs":[{"id":"ref-for-elementdef-animate"}],"title":"Since the 14 February 2019 Candidate Recommendation"}],"url":"https://svgwg.org/specs/animations/#elementdef-animate"}, "076e8657": {"dfnID":"076e8657","dfnText":"<zero>","external":true,"refSections":[{"refs":[{"id":"ref-for-zero-value"}],"title":"7. The Transform Functions"},{"refs":[{"id":"ref-for-zero-value\u2460"},{"id":"ref-for-zero-value\u2461"},{"id":"ref-for-zero-value\u2462"},{"id":"ref-for-zero-value\u2463"},{"id":"ref-for-zero-value\u2464"}],"title":"7.1. 2D Transform Functions"}],"url":"https://drafts.csswg.org/css-values-4/#zero-value"}, "10c0f2e8": {"dfnID":"10c0f2e8","dfnText":"linearGradient","external":true,"refSections":[{"refs":[{"id":"ref-for-elementdef-linearGradient"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-elementdef-linearGradient\u2460"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-elementdef-linearGradient\u2461"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"https://svgwg.org/svg2-draft/pservers.html#elementdef-linearGradient"}, "16310992": {"dfnID":"16310992","dfnText":"<number>","external":true,"refSections":[{"refs":[{"id":"ref-for-number-value"},{"id":"ref-for-number-value\u2460"},{"id":"ref-for-number-value\u2461"},{"id":"ref-for-number-value\u2462"},{"id":"ref-for-number-value\u2463"}],"title":"7.1. 2D Transform Functions"}],"url":"https://drafts.csswg.org/css-values-4/#number-value"}, "164f0069": {"dfnID":"164f0069","dfnText":"fixed","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-background-attachment-fixed"}],"title":"1.1. Module Interactions"},{"refs":[{"id":"ref-for-valdef-background-attachment-fixed\u2460"}],"title":"2. The Transform Rendering Model"}],"url":"https://drafts.csswg.org/css-backgrounds-3/#valdef-background-attachment-fixed"}, "171d64d7": {"dfnID":"171d64d7","dfnText":"gradientUnits","external":true,"refSections":[{"refs":[{"id":"ref-for-LinearGradientElementGradientUnitsAttribute"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-LinearGradientElementGradientUnitsAttribute\u2460"}],"title":"6.4. User coordinate space"}],"url":"https://www.w3.org/TR/SVG/pservers.html#LinearGradientElementGradientUnitsAttribute"}, "18222566": {"dfnID":"18222566","dfnText":"<length-percentage>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-length-percentage"},{"id":"ref-for-typedef-length-percentage\u2460"},{"id":"ref-for-typedef-length-percentage\u2461"},{"id":"ref-for-typedef-length-percentage\u2462"}],"title":"4. The transform-origin Property"},{"refs":[{"id":"ref-for-typedef-length-percentage\u2463"},{"id":"ref-for-typedef-length-percentage\u2464"},{"id":"ref-for-typedef-length-percentage\u2465"},{"id":"ref-for-typedef-length-percentage\u2466"}],"title":"7.1. 2D Transform Functions"}],"url":"https://drafts.csswg.org/css-values-4/#typedef-length-percentage"}, "18f79675": {"dfnID":"18f79675","dfnText":"translate3d()","external":true,"refSections":[{"refs":[{"id":"ref-for-funcdef-translate3d"}],"title":"10. Interpolation of primitives and derived transform functions"}],"url":"https://drafts.csswg.org/css-transforms-2/#funcdef-translate3d"}, "19d42a6f": {"dfnID":"19d42a6f","dfnText":"stroke bounding box","external":true,"refSections":[{"refs":[{"id":"ref-for-TermStrokeBoundingBox"}],"title":"5. Transform reference box: the transform-box property"}],"url":"https://svgwg.org/svg2-draft/coords.html#TermStrokeBoundingBox"}, "1d7fc05e": {"dfnID":"1d7fc05e","dfnText":"set","external":true,"refSections":[{"refs":[{"id":"ref-for-elementdef-set"}],"title":"Since the 14 February 2019 Candidate Recommendation"}],"url":"https://svgwg.org/specs/animations/#elementdef-set"}, "2d-matrix": {"dfnID":"2d-matrix","dfnText":"2D matrix","external":false,"refSections":[{"refs":[{"id":"ref-for-2d-matrix"}],"title":"11. Interpolation of Matrices"}],"url":"#2d-matrix"}, "33a598a0": {"dfnID":"33a598a0","dfnText":"letter","external":true,"refSections":[{"refs":[{"id":"ref-for-letter"}],"title":"6.2. Syntax of the SVG transform attribute"}],"url":"https://drafts.csswg.org/css-syntax-3/#letter"}, "33f830f2": {"dfnID":"33f830f2","dfnText":"paint server element","external":true,"refSections":[{"refs":[{"id":"ref-for-TermPaintServerElement"}],"title":"1.2. CSS Values"}],"url":"https://svgwg.org/svg2-draft/painting.html#TermPaintServerElement"}, "3559c926": {"dfnID":"3559c926","dfnText":"<angle>","external":true,"refSections":[{"refs":[{"id":"ref-for-angle-value"},{"id":"ref-for-angle-value\u2460"},{"id":"ref-for-angle-value\u2461"},{"id":"ref-for-angle-value\u2462"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-angle-value\u2463"},{"id":"ref-for-angle-value\u2464"},{"id":"ref-for-angle-value\u2465"},{"id":"ref-for-angle-value\u2466"},{"id":"ref-for-angle-value\u2467"}],"title":"7.1. 2D Transform Functions"}],"url":"https://drafts.csswg.org/css-values-4/#angle-value"}, "358fd6ff": {"dfnID":"358fd6ff","dfnText":"CSS-wide keywords","external":true,"refSections":[{"refs":[{"id":"ref-for-css-wide-keywords"}],"title":"1.2. CSS Values"}],"url":"https://drafts.csswg.org/css-values-4/#css-wide-keywords"}, "389552e4": {"dfnID":"389552e4","dfnText":"deg","external":true,"refSections":[{"refs":[{"id":"ref-for-deg"},{"id":"ref-for-deg\u2460"},{"id":"ref-for-deg\u2461"},{"id":"ref-for-deg\u2462"}],"title":"6.3. SVG transform functions"}],"url":"https://drafts.csswg.org/css-values-4/#deg"}, "409e2104": {"dfnID":"409e2104","dfnText":"presentation attributes","external":true,"refSections":[{"refs":[{"id":"ref-for-TermPresentationAttribute"},{"id":"ref-for-TermPresentationAttribute\u2460"},{"id":"ref-for-TermPresentationAttribute\u2461"},{"id":"ref-for-TermPresentationAttribute\u2462"}],"title":"6.1. SVG presentation attributes"}],"url":"https://svgwg.org/svg2-draft/styling.html#TermPresentationAttribute"}, "46df29a9": {"dfnID":"46df29a9","dfnText":"animVal","external":true,"refSections":[{"refs":[{"id":"ref-for-__svg__SVGAnimatedPreserveAspectRatio__animVal"},{"id":"ref-for-__svg__SVGAnimatedPreserveAspectRatio__animVal\u2460"}],"title":"6.5. SVG DOM interface for the transform attribute"}],"url":"https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__animVal"}, "4fe61159": {"dfnID":"4fe61159","dfnText":"resolved value","external":true,"refSections":[{"refs":[{"id":"ref-for-resolved-value"},{"id":"ref-for-resolved-value\u2460"}],"title":"3.2. Resolved value of transform"}],"url":"https://drafts.csswg.org/cssom-1/#resolved-value"}, "537cf076": {"dfnID":"537cf076","dfnText":"?","external":true,"refSections":[{"refs":[{"id":"ref-for-mult-opt"},{"id":"ref-for-mult-opt\u2460"}],"title":"4. The transform-origin Property"},{"refs":[{"id":"ref-for-mult-opt\u2461"},{"id":"ref-for-mult-opt\u2462"},{"id":"ref-for-mult-opt\u2463"}],"title":"7.1. 2D Transform Functions"}],"url":"https://drafts.csswg.org/css-values-4/#mult-opt"}, "584e9c31": {"dfnID":"584e9c31","dfnText":"calc()","external":true,"refSections":[{"refs":[{"id":"ref-for-funcdef-calc"},{"id":"ref-for-funcdef-calc\u2460"}],"title":"3.1. Serialization of <transform-function>s"}],"url":"https://drafts.csswg.org/css-values-4/#funcdef-calc"}, "5a2dc475": {"dfnID":"5a2dc475","dfnText":"patternTransform","external":true,"refSections":[{"refs":[{"id":"ref-for-PatternElementPatternTransformAttribute"}],"title":"6.1. SVG presentation attributes"},{"refs":[{"id":"ref-for-PatternElementPatternTransformAttribute\u2460"},{"id":"ref-for-PatternElementPatternTransformAttribute\u2461"},{"id":"ref-for-PatternElementPatternTransformAttribute\u2462"}],"title":"6.2. Syntax of the SVG transform attribute"},{"refs":[{"id":"ref-for-PatternElementPatternTransformAttribute\u2463"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-PatternElementPatternTransformAttribute\u2464"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-PatternElementPatternTransformAttribute\u2465"},{"id":"ref-for-PatternElementPatternTransformAttribute\u2466"}],"title":"6.5. SVG DOM interface for the transform attribute"},{"refs":[{"id":"ref-for-PatternElementPatternTransformAttribute\u2467"},{"id":"ref-for-PatternElementPatternTransformAttribute\u2468"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute"}, "5dd50c99": {"dfnID":"5dd50c99","dfnText":"resolved value special case property","external":true,"refSections":[{"refs":[{"id":"ref-for-resolved-value-special-case-property"}],"title":"3.2. Resolved value of transform"},{"refs":[{"id":"ref-for-resolved-value-special-case-property\u2460"}],"title":"4. The transform-origin Property"}],"url":"https://drafts.csswg.org/cssom-1/#resolved-value-special-case-property"}, "5fdd136e": {"dfnID":"5fdd136e","dfnText":"viewBox","external":true,"refSections":[{"refs":[{"id":"ref-for-__svg__SVGFitToViewBox__viewBox"},{"id":"ref-for-__svg__SVGFitToViewBox__viewBox\u2460"},{"id":"ref-for-__svg__SVGFitToViewBox__viewBox\u2461"}],"title":"5. Transform reference box: the transform-box property"}],"url":"https://svgwg.org/svg2-draft/types.html#__svg__SVGFitToViewBox__viewBox"}, "68019d7a": {"dfnID":"68019d7a","dfnText":"height","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-height"}],"title":"4. The transform-origin Property"}],"url":"https://drafts.csswg.org/css-sizing-3/#propdef-height"}, "68487d22": {"dfnID":"68487d22","dfnText":"#","external":true,"refSections":[{"refs":[{"id":"ref-for-mult-comma"}],"title":"7.1. 2D Transform Functions"}],"url":"https://drafts.csswg.org/css-values-4/#mult-comma"}, "6ec67710": {"dfnID":"6ec67710","dfnText":"|","external":true,"refSections":[{"refs":[{"id":"ref-for-comb-one"}],"title":"3. The transform Property"},{"refs":[{"id":"ref-for-comb-one\u2460"},{"id":"ref-for-comb-one\u2461"},{"id":"ref-for-comb-one\u2462"},{"id":"ref-for-comb-one\u2463"},{"id":"ref-for-comb-one\u2464"},{"id":"ref-for-comb-one\u2465"},{"id":"ref-for-comb-one\u2466"},{"id":"ref-for-comb-one\u2467"},{"id":"ref-for-comb-one\u2468"},{"id":"ref-for-comb-one\u2460\u24ea"},{"id":"ref-for-comb-one\u2460\u2460"},{"id":"ref-for-comb-one\u2460\u2461"},{"id":"ref-for-comb-one\u2460\u2462"},{"id":"ref-for-comb-one\u2460\u2463"},{"id":"ref-for-comb-one\u2460\u2464"},{"id":"ref-for-comb-one\u2460\u2465"},{"id":"ref-for-comb-one\u2460\u2466"}],"title":"4. The transform-origin Property"},{"refs":[{"id":"ref-for-comb-one\u2460\u2467"},{"id":"ref-for-comb-one\u2460\u2468"},{"id":"ref-for-comb-one\u2461\u24ea"},{"id":"ref-for-comb-one\u2461\u2460"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-comb-one\u2461\u2461"},{"id":"ref-for-comb-one\u2461\u2462"},{"id":"ref-for-comb-one\u2461\u2463"},{"id":"ref-for-comb-one\u2461\u2464"},{"id":"ref-for-comb-one\u2461\u2465"}],"title":"7.1. 2D Transform Functions"}],"url":"https://drafts.csswg.org/css-values-4/#comb-one"}, "76fdef96": {"dfnID":"76fdef96","dfnText":"gradientTransform","external":true,"refSections":[{"refs":[{"id":"ref-for-LinearGradientElementGradientTransformAttribute"}],"title":"6.1. SVG presentation attributes"},{"refs":[{"id":"ref-for-LinearGradientElementGradientTransformAttribute\u2460"},{"id":"ref-for-LinearGradientElementGradientTransformAttribute\u2461"},{"id":"ref-for-LinearGradientElementGradientTransformAttribute\u2462"}],"title":"6.2. Syntax of the SVG transform attribute"},{"refs":[{"id":"ref-for-LinearGradientElementGradientTransformAttribute\u2463"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-LinearGradientElementGradientTransformAttribute\u2464"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-LinearGradientElementGradientTransformAttribute\u2465"},{"id":"ref-for-LinearGradientElementGradientTransformAttribute\u2466"}],"title":"6.5. SVG DOM interface for the transform attribute"},{"refs":[{"id":"ref-for-LinearGradientElementGradientTransformAttribute\u2467"},{"id":"ref-for-LinearGradientElementGradientTransformAttribute\u2468"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute"}, "7d539771": {"dfnID":"7d539771","dfnText":"text content element","external":true,"refSections":[{"refs":[{"id":"ref-for-TermTextContentElement"}],"title":"1.2. CSS Values"}],"url":"https://svgwg.org/svg2-draft/text.html#TermTextContentElement"}, "86928bde": {"dfnID":"86928bde","dfnText":"overflow","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-overflow"}],"title":"2. The Transform Rendering Model"}],"url":"https://drafts.csswg.org/css-overflow-3/#propdef-overflow"}, "8b3ca704": {"dfnID":"8b3ca704","dfnText":"auto","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-overflow-auto"}],"title":"2. The Transform Rendering Model"}],"url":"https://drafts.csswg.org/css-overflow-3/#valdef-overflow-auto"}, "92700be8": {"dfnID":"92700be8","dfnText":"<number-token>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-number-token"}],"title":"6.2. Syntax of the SVG transform attribute"}],"url":"https://drafts.csswg.org/css-syntax-3/#typedef-number-token"}, "9cd25054": {"dfnID":"9cd25054","dfnText":"computed value","external":true,"refSections":[{"refs":[{"id":"ref-for-computed-value"},{"id":"ref-for-computed-value\u2460"}],"title":"3.2. Resolved value of transform"}],"url":"https://drafts.csswg.org/css-cascade-5/#computed-value"}, "9ddea951": {"dfnID":"9ddea951","dfnText":"px","external":true,"refSections":[{"refs":[{"id":"ref-for-px"},{"id":"ref-for-px\u2460"}],"title":"6.3. SVG transform functions"}],"url":"https://drafts.csswg.org/css-values-4/#px"}, "9f9120ff": {"dfnID":"9f9120ff","dfnText":",","external":true,"refSections":[{"refs":[{"id":"ref-for-comb-comma"},{"id":"ref-for-comb-comma\u2460"},{"id":"ref-for-comb-comma\u2461"}],"title":"7.1. 2D Transform Functions"}],"url":"https://drafts.csswg.org/css-values-4/#comb-comma"}, "a4eb3c57": {"dfnID":"a4eb3c57","dfnText":"used value","external":true,"refSections":[{"refs":[{"id":"ref-for-used-value"}],"title":"4. The transform-origin Property"},{"refs":[{"id":"ref-for-used-value\u2460"},{"id":"ref-for-used-value\u2461"}],"title":"5. Transform reference box: the transform-box property"}],"url":"https://drafts.csswg.org/css-cascade-5/#used-value"}, "a7bbaf9f": {"dfnID":"a7bbaf9f","dfnText":"div","external":true,"refSections":[{"refs":[{"id":"ref-for-the-div-element"},{"id":"ref-for-the-div-element\u2460"}],"title":"2. The Transform Rendering Model"}],"url":"https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element"}, "abbd4058": {"dfnID":"abbd4058","dfnText":"rect","external":true,"refSections":[{"refs":[{"id":"ref-for-elementdef-rect"},{"id":"ref-for-elementdef-rect\u2460"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-elementdef-rect\u2461"}],"title":"6.4. User coordinate space"}],"url":"https://svgwg.org/svg2-draft/shapes.html#elementdef-rect"}, "abdfd54a": {"dfnID":"abdfd54a","dfnText":"pattern","external":true,"refSections":[{"refs":[{"id":"ref-for-elementdef-pattern"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-elementdef-pattern\u2460"},{"id":"ref-for-elementdef-pattern\u2461"},{"id":"ref-for-elementdef-pattern\u2462"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-elementdef-pattern\u2463"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern"}, "b4376d3e": {"dfnID":"b4376d3e","dfnText":"viewport coordinate system","external":true,"refSections":[{"refs":[{"id":"ref-for-TermViewportCoordinateSystem"}],"title":"1.2. CSS Values"},{"refs":[{"id":"ref-for-TermViewportCoordinateSystem\u2460"},{"id":"ref-for-TermViewportCoordinateSystem\u2461"},{"id":"ref-for-TermViewportCoordinateSystem\u2462"}],"title":"2. The Transform Rendering Model"}],"url":"https://svgwg.org/svg2-draft/coords.html#TermViewportCoordinateSystem"}, "b8527dcc": {"dfnID":"b8527dcc","dfnText":"transform","external":true,"refSections":[{"refs":[{"id":"ref-for-TransformAttribute"}],"title":"6. The SVG transform Attribute"},{"refs":[{"id":"ref-for-TransformAttribute\u2460"},{"id":"ref-for-TransformAttribute\u2461"},{"id":"ref-for-TransformAttribute\u2462"}],"title":"6.1. SVG presentation attributes"},{"refs":[{"id":"ref-for-TransformAttribute\u2463"},{"id":"ref-for-TransformAttribute\u2464"},{"id":"ref-for-TransformAttribute\u2465"},{"id":"ref-for-TransformAttribute\u2466"}],"title":"6.2. Syntax of the SVG transform attribute"},{"refs":[{"id":"ref-for-TransformAttribute\u2467"},{"id":"ref-for-TransformAttribute\u2468"},{"id":"ref-for-TransformAttribute\u2460\u24ea"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-TransformAttribute\u2460\u2460"},{"id":"ref-for-TransformAttribute\u2460\u2461"},{"id":"ref-for-TransformAttribute\u2460\u2462"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-TransformAttribute\u2460\u2463"},{"id":"ref-for-TransformAttribute\u2460\u2464"},{"id":"ref-for-TransformAttribute\u2460\u2465"}],"title":"6.5. SVG DOM interface for the transform attribute"},{"refs":[{"id":"ref-for-TransformAttribute\u2460\u2466"}],"title":"Since the 14 February 2019 Candidate Recommendation"},{"refs":[{"id":"ref-for-TransformAttribute\u2460\u2467"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"https://www.w3.org/TR/SVG11/coords.html#TransformAttribute"}, "b8c9eb8a": {"dfnID":"b8c9eb8a","dfnText":"stacking context","external":true,"refSections":[{"refs":[{"id":"ref-for-x43"}],"title":"1.1. Module Interactions"}],"url":"https://www.w3.org/TR/CSS2/visuren.html#x43"}, "bedd9d42": {"dfnID":"bedd9d42","dfnText":"+","external":true,"refSections":[{"refs":[{"id":"ref-for-mult-one-plus"}],"title":"3. The transform Property"}],"url":"https://drafts.csswg.org/css-values-4/#mult-one-plus"}, "c0807e02": {"dfnID":"c0807e02","dfnText":"renderable element","external":true,"refSections":[{"refs":[{"id":"ref-for-TermRenderableElement"}],"title":"1.2. CSS Values"}],"url":"https://svgwg.org/svg2-draft/render.html#TermRenderableElement"}, "c349138e": {"dfnID":"c349138e","dfnText":"baseVal","external":true,"refSections":[{"refs":[{"id":"ref-for-__svg__SVGAnimatedPreserveAspectRatio__baseVal"},{"id":"ref-for-__svg__SVGAnimatedPreserveAspectRatio__baseVal\u2460"},{"id":"ref-for-__svg__SVGAnimatedPreserveAspectRatio__baseVal\u2461"}],"title":"6.5. SVG DOM interface for the transform attribute"}],"url":"https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__baseVal"}, "c82d6e13": {"dfnID":"c82d6e13","dfnText":"z-index","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-z-index"},{"id":"ref-for-propdef-z-index\u2460"}],"title":"2. The Transform Rendering Model"}],"url":"https://drafts.csswg.org/css2/#propdef-z-index"}, "c974a599": {"dfnID":"c974a599","dfnText":"interpolation","external":true,"refSections":[{"refs":[{"id":"ref-for-interpolation"},{"id":"ref-for-interpolation\u2460"}],"title":"9. Interpolation of Transforms"}],"url":"https://drafts.csswg.org/css-values-4/#interpolation"}, "containing-block-for-all-descendants": {"dfnID":"containing-block-for-all-descendants","dfnText":"containing block for all descendants","external":false,"refSections":[{"refs":[{"id":"ref-for-containing-block-for-all-descendants"}],"title":"2. The Transform Rendering Model"}],"url":"#containing-block-for-all-descendants"}, "current-transformation-matrix": {"dfnID":"current-transformation-matrix","dfnText":"current transformation matrix","external":false,"refSections":[{"refs":[{"id":"ref-for-current-transformation-matrix"},{"id":"ref-for-current-transformation-matrix\u2460"},{"id":"ref-for-current-transformation-matrix\u2461"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-current-transformation-matrix\u2462"}],"title":"8. The Transform Function Lists"},{"refs":[{"id":"ref-for-current-transformation-matrix\u2463"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#current-transformation-matrix"}, "d27a809f": {"dfnID":"d27a809f","dfnText":"background-position","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-background-position"}],"title":"4. The transform-origin Property"}],"url":"https://drafts.csswg.org/css-backgrounds-3/#propdef-background-position"}, "d332e4ec": {"dfnID":"d332e4ec","dfnText":"auto","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-z-index-auto"}],"title":"2. The Transform Rendering Model"}],"url":"https://drafts.csswg.org/css2/#valdef-z-index-auto"}, "d8586311": {"dfnID":"d8586311","dfnText":"interpolate","external":true,"refSections":[{"refs":[{"id":"ref-for-interpolation"},{"id":"ref-for-interpolation\u2460"}],"title":"9. Interpolation of Transforms"}],"url":"https://drafts.csswg.org/css-values-4/#interpolation"}, "e7ab0d6a": {"dfnID":"e7ab0d6a","dfnText":"scroll","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-overflow-scroll"}],"title":"2. The Transform Rendering Model"}],"url":"https://drafts.csswg.org/css-overflow-3/#valdef-overflow-scroll"}, "ee061115": {"dfnID":"ee061115","dfnText":"radialGradient","external":true,"refSections":[{"refs":[{"id":"ref-for-elementdef-radialGradient"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-elementdef-radialGradient\u2460"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-elementdef-radialGradient\u2461"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"https://svgwg.org/svg2-draft/pservers.html#elementdef-radialGradient"}, "ef7007e3": {"dfnID":"ef7007e3","dfnText":"clipPathUnits","external":true,"refSections":[{"refs":[{"id":"ref-for-element-attrdef-clippath-clippathunits"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-element-attrdef-clippath-clippathunits\u2460"}],"title":"6.4. User coordinate space"}],"url":"https://drafts.fxtf.org/css-masking-1/#element-attrdef-clippath-clippathunits"}, "f00710cb": {"dfnID":"f00710cb","dfnText":"clipPath","external":true,"refSections":[{"refs":[{"id":"ref-for-elementdef-clippath"}],"title":"1.2. CSS Values"},{"refs":[{"id":"ref-for-elementdef-clippath\u2460"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-elementdef-clippath\u2461"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-elementdef-clippath\u2462"},{"id":"ref-for-elementdef-clippath\u2463"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"https://drafts.fxtf.org/css-masking-1/#elementdef-clippath"}, "f0809abc": {"dfnID":"f0809abc","dfnText":"&&","external":true,"refSections":[{"refs":[{"id":"ref-for-comb-all"}],"title":"4. The transform-origin Property"}],"url":"https://drafts.csswg.org/css-values-4/#comb-all"}, "f47d48ea": {"dfnID":"f47d48ea","dfnText":"scroll","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-background-attachment-scroll"}],"title":"2. The Transform Rendering Model"}],"url":"https://drafts.csswg.org/css-backgrounds-3/#valdef-background-attachment-scroll"}, "f95a7c3b": {"dfnID":"f95a7c3b","dfnText":"background-attachment","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-background-attachment"}],"title":"1.1. Module Interactions"},{"refs":[{"id":"ref-for-propdef-background-attachment\u2460"},{"id":"ref-for-propdef-background-attachment\u2461"}],"title":"2. The Transform Rendering Model"}],"url":"https://drafts.csswg.org/css-backgrounds-3/#propdef-background-attachment"}, "fb030e6c": {"dfnID":"fb030e6c","dfnText":"<length>","external":true,"refSections":[{"refs":[{"id":"ref-for-length-value"},{"id":"ref-for-length-value\u2460"},{"id":"ref-for-length-value\u2461"},{"id":"ref-for-length-value\u2462"}],"title":"4. The transform-origin Property"},{"refs":[{"id":"ref-for-length-value\u2463"},{"id":"ref-for-length-value\u2464"}],"title":"6.3. SVG transform functions"}],"url":"https://drafts.csswg.org/css-values-4/#length-value"}, "fd9f73b3": {"dfnID":"fd9f73b3","dfnText":"patternUnits","external":true,"refSections":[{"refs":[{"id":"ref-for-PatternElementPatternUnitsAttribute"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-PatternElementPatternUnitsAttribute\u2460"}],"title":"6.4. User coordinate space"}],"url":"https://www.w3.org/TR/SVG/pservers.html#PatternElementPatternUnitsAttribute"}, "ff72fec7": {"dfnID":"ff72fec7","dfnText":"object bounding box","external":true,"refSections":[{"refs":[{"id":"ref-for-TermObjectBoundingBox"}],"title":"5. Transform reference box: the transform-box property"}],"url":"https://svgwg.org/svg2-draft/coords.html#TermObjectBoundingBox"}, "funcdef-transform-matrix": {"dfnID":"funcdef-transform-matrix","dfnText":"matrix()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-matrix"},{"id":"ref-for-funcdef-transform-matrix\u2460"}],"title":"3.2. Resolved value of transform"},{"refs":[{"id":"ref-for-funcdef-transform-matrix\u2461"},{"id":"ref-for-funcdef-transform-matrix\u2462"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-funcdef-transform-matrix\u2463"}],"title":"10. Interpolation of primitives and derived transform functions"}],"url":"#funcdef-transform-matrix"}, "funcdef-transform-rotate": {"dfnID":"funcdef-transform-rotate","dfnText":"rotate()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-rotate"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-funcdef-transform-rotate\u2460"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-funcdef-transform-rotate\u2461"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#funcdef-transform-rotate"}, "funcdef-transform-scale": {"dfnID":"funcdef-transform-scale","dfnText":"scale()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-scale"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-funcdef-transform-scale\u2460"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-funcdef-transform-scale\u2461"},{"id":"ref-for-funcdef-transform-scale\u2462"}],"title":"7.2. Transform function primitives and derivatives"}],"url":"#funcdef-transform-scale"}, "funcdef-transform-scalex": {"dfnID":"funcdef-transform-scalex","dfnText":"scaleX()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-scalex"}],"title":"6.2. Syntax of the SVG transform attribute"},{"refs":[{"id":"ref-for-funcdef-transform-scalex\u2460"}],"title":"7.2. Transform function primitives and derivatives"}],"url":"#funcdef-transform-scalex"}, "funcdef-transform-scaley": {"dfnID":"funcdef-transform-scaley","dfnText":"scaleY()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-scaley"}],"title":"6.2. Syntax of the SVG transform attribute"},{"refs":[{"id":"ref-for-funcdef-transform-scaley\u2460"}],"title":"7.2. Transform function primitives and derivatives"}],"url":"#funcdef-transform-scaley"}, "funcdef-transform-skew": {"dfnID":"funcdef-transform-skew","dfnText":"skew()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-skew"}],"title":"6.2. Syntax of the SVG transform attribute"},{"refs":[{"id":"ref-for-funcdef-transform-skew\u2460"},{"id":"ref-for-funcdef-transform-skew\u2461"}],"title":"7.1. 2D Transform Functions"}],"url":"#funcdef-transform-skew"}, "funcdef-transform-skewx": {"dfnID":"funcdef-transform-skewx","dfnText":"skewX()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-skewx"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-funcdef-transform-skewx\u2460"},{"id":"ref-for-funcdef-transform-skewx\u2461"}],"title":"7.1. 2D Transform Functions"}],"url":"#funcdef-transform-skewx"}, "funcdef-transform-skewy": {"dfnID":"funcdef-transform-skewy","dfnText":"skewY()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-skewy"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-funcdef-transform-skewy\u2460"},{"id":"ref-for-funcdef-transform-skewy\u2461"}],"title":"7.1. 2D Transform Functions"}],"url":"#funcdef-transform-skewy"}, "funcdef-transform-translate": {"dfnID":"funcdef-transform-translate","dfnText":"translate()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-translate"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-funcdef-transform-translate\u2460"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-funcdef-transform-translate\u2461"},{"id":"ref-for-funcdef-transform-translate\u2462"}],"title":"7.2. Transform function primitives and derivatives"},{"refs":[{"id":"ref-for-funcdef-transform-translate\u2463"}],"title":"10. Interpolation of primitives and derived transform functions"}],"url":"#funcdef-transform-translate"}, "funcdef-transform-translatex": {"dfnID":"funcdef-transform-translatex","dfnText":"translateX()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-translatex"}],"title":"6.2. Syntax of the SVG transform attribute"},{"refs":[{"id":"ref-for-funcdef-transform-translatex\u2460"}],"title":"7.2. Transform function primitives and derivatives"}],"url":"#funcdef-transform-translatex"}, "funcdef-transform-translatey": {"dfnID":"funcdef-transform-translatey","dfnText":"translateY()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-transform-translatey"}],"title":"6.2. Syntax of the SVG transform attribute"},{"refs":[{"id":"ref-for-funcdef-transform-translatey\u2460"}],"title":"7.2. Transform function primitives and derivatives"}],"url":"#funcdef-transform-translatey"}, "identity-transform-function": {"dfnID":"identity-transform-function","dfnText":"identity transform function","external":false,"refSections":[{"refs":[{"id":"ref-for-identity-transform-function"}],"title":"9. Interpolation of Transforms"}],"url":"#identity-transform-function"}, "local-coordinate-system": {"dfnID":"local-coordinate-system","dfnText":"local coordinate system","external":false,"refSections":[{"refs":[{"id":"ref-for-local-coordinate-system"}],"title":"1.2. CSS Values"},{"refs":[{"id":"ref-for-local-coordinate-system\u2460"},{"id":"ref-for-local-coordinate-system\u2461"},{"id":"ref-for-local-coordinate-system\u2462"},{"id":"ref-for-local-coordinate-system\u2463"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-local-coordinate-system\u2464"}],"title":"8. The Transform Function Lists"}],"url":"#local-coordinate-system"}, "multiply": {"dfnID":"multiply","dfnText":"multiply","external":false,"refSections":[],"url":"#multiply"}, "post-multiplied": {"dfnID":"post-multiplied","dfnText":"post-multiplied","external":false,"refSections":[{"refs":[{"id":"ref-for-post-multiplied"},{"id":"ref-for-post-multiplied\u2460"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-post-multiplied\u2461"}],"title":"6.3. SVG transform functions"}],"url":"#post-multiplied"}, "post-multiply": {"dfnID":"post-multiply","dfnText":"post-multiply","external":false,"refSections":[{"refs":[{"id":"ref-for-post-multiply"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#post-multiply"}, "pre-multiplied": {"dfnID":"pre-multiplied","dfnText":"pre-multiplied","external":false,"refSections":[{"refs":[{"id":"ref-for-pre-multiplied"}],"title":"2. The Transform Rendering Model"}],"url":"#pre-multiplied"}, "pre-multiply": {"dfnID":"pre-multiply","dfnText":"pre-multiply","external":false,"refSections":[{"refs":[{"id":"ref-for-pre-multiply"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#pre-multiply"}, "propdef-transform": {"dfnID":"propdef-transform","dfnText":"transform","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-transform"}],"title":"1. Introduction"},{"refs":[{"id":"ref-for-propdef-transform\u2460"},{"id":"ref-for-propdef-transform\u2461"}],"title":"1.2. CSS Values"},{"refs":[{"id":"ref-for-propdef-transform\u2462"},{"id":"ref-for-propdef-transform\u2463"},{"id":"ref-for-propdef-transform\u2464"},{"id":"ref-for-propdef-transform\u2465"},{"id":"ref-for-propdef-transform\u2466"},{"id":"ref-for-propdef-transform\u2467"},{"id":"ref-for-propdef-transform\u2468"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-propdef-transform\u2460\u24ea"},{"id":"ref-for-propdef-transform\u2460\u2460"}],"title":"3. The transform Property"},{"refs":[{"id":"ref-for-propdef-transform\u2460\u2461"},{"id":"ref-for-propdef-transform\u2460\u2462"}],"title":"3.2. Resolved value of transform"},{"refs":[{"id":"ref-for-propdef-transform\u2460\u2463"}],"title":"4. The transform-origin Property"},{"refs":[{"id":"ref-for-propdef-transform\u2460\u2464"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-propdef-transform\u2460\u2465"},{"id":"ref-for-propdef-transform\u2460\u2466"},{"id":"ref-for-propdef-transform\u2460\u2467"}],"title":"6.1. SVG presentation attributes"},{"refs":[{"id":"ref-for-propdef-transform\u2460\u2468"},{"id":"ref-for-propdef-transform\u2461\u24ea"}],"title":"6.2. Syntax of the SVG transform attribute"},{"refs":[{"id":"ref-for-propdef-transform\u2461\u2460"},{"id":"ref-for-propdef-transform\u2461\u2461"},{"id":"ref-for-propdef-transform\u2461\u2462"},{"id":"ref-for-propdef-transform\u2461\u2463"},{"id":"ref-for-propdef-transform\u2461\u2464"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-propdef-transform\u2461\u2465"}],"title":"6.5. SVG DOM interface for the transform attribute"},{"refs":[{"id":"ref-for-propdef-transform\u2461\u2466"}],"title":"7. The Transform Functions"},{"refs":[{"id":"ref-for-propdef-transform\u2461\u2467"}],"title":"Since the 14 February 2019 Candidate Recommendation"},{"refs":[{"id":"ref-for-propdef-transform\u2461\u2468"},{"id":"ref-for-propdef-transform\u2462\u24ea"},{"id":"ref-for-propdef-transform\u2462\u2460"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#propdef-transform"}, "propdef-transform-box": {"dfnID":"propdef-transform-box","dfnText":"transform-box","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-transform-box"}],"title":"1.2. CSS Values"},{"refs":[{"id":"ref-for-propdef-transform-box\u2460"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-propdef-transform-box\u2461"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#propdef-transform-box"}, "propdef-transform-origin": {"dfnID":"propdef-transform-origin","dfnText":"transform-origin","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-transform-origin"}],"title":"1.2. CSS Values"},{"refs":[{"id":"ref-for-propdef-transform-origin\u2460"},{"id":"ref-for-propdef-transform-origin\u2461"},{"id":"ref-for-propdef-transform-origin\u2462"},{"id":"ref-for-propdef-transform-origin\u2463"},{"id":"ref-for-propdef-transform-origin\u2464"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-propdef-transform-origin\u2465"},{"id":"ref-for-propdef-transform-origin\u2466"},{"id":"ref-for-propdef-transform-origin\u2467"}],"title":"4. The transform-origin Property"},{"refs":[{"id":"ref-for-propdef-transform-origin\u2468"},{"id":"ref-for-propdef-transform-origin\u2460\u24ea"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-propdef-transform-origin\u2460\u2460"}],"title":"6.1. SVG presentation attributes"},{"refs":[{"id":"ref-for-propdef-transform-origin\u2460\u2461"},{"id":"ref-for-propdef-transform-origin\u2460\u2462"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-propdef-transform-origin\u2460\u2463"}],"title":"7.1. 2D Transform Functions"}],"url":"#propdef-transform-origin"}, "reference-box": {"dfnID":"reference-box","dfnText":"reference box","external":false,"refSections":[{"refs":[{"id":"ref-for-reference-box"}],"title":"1.2. CSS Values"},{"refs":[{"id":"ref-for-reference-box\u2460"}],"title":"3. The transform Property"},{"refs":[{"id":"ref-for-reference-box\u2461"},{"id":"ref-for-reference-box\u2462"},{"id":"ref-for-reference-box\u2463"},{"id":"ref-for-reference-box\u2464"},{"id":"ref-for-reference-box\u2465"}],"title":"4. The transform-origin Property"},{"refs":[{"id":"ref-for-reference-box\u2466"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-reference-box\u2467"},{"id":"ref-for-reference-box\u2468"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-reference-box\u2460\u24ea"},{"id":"ref-for-reference-box\u2460\u2460"}],"title":"7. The Transform Functions"}],"url":"#reference-box"}, "transformable-element": {"dfnID":"transformable-element","dfnText":"transformable element","external":false,"refSections":[{"refs":[{"id":"ref-for-transformable-element"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-transformable-element\u2460"}],"title":"3. The transform Property"},{"refs":[{"id":"ref-for-transformable-element\u2461"}],"title":"4. The transform-origin Property"},{"refs":[{"id":"ref-for-transformable-element\u2462"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-transformable-element\u2463"}],"title":"6.4. User coordinate space"},{"refs":[{"id":"ref-for-transformable-element\u2464"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#transformable-element"}, "transformation-matrix": {"dfnID":"transformation-matrix","dfnText":"transformation matrix","external":false,"refSections":[{"refs":[{"id":"ref-for-transformation-matrix"},{"id":"ref-for-transformation-matrix\u2460"},{"id":"ref-for-transformation-matrix\u2461"},{"id":"ref-for-transformation-matrix\u2462"},{"id":"ref-for-transformation-matrix\u2463"},{"id":"ref-for-transformation-matrix\u2464"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-transformation-matrix\u2465"}],"title":"4. The transform-origin Property"},{"refs":[{"id":"ref-for-transformation-matrix\u2466"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#transformation-matrix"}, "transformed-element": {"dfnID":"transformed-element","dfnText":"transformed element","external":false,"refSections":[],"url":"#transformed-element"}, "typedef-transform-function": {"dfnID":"typedef-transform-function","dfnText":"<transform-function>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-transform-function"},{"id":"ref-for-typedef-transform-function\u2460"}],"title":"2. The Transform Rendering Model"},{"refs":[{"id":"ref-for-typedef-transform-function\u2461"}],"title":"3. The transform Property"},{"refs":[{"id":"ref-for-typedef-transform-function\u2462"},{"id":"ref-for-typedef-transform-function\u2463"}],"title":"3.1. Serialization of <transform-function>s"},{"refs":[{"id":"ref-for-typedef-transform-function\u2464"}],"title":"3.2. Resolved value of transform"},{"refs":[{"id":"ref-for-typedef-transform-function\u2465"}],"title":"6.2. Syntax of the SVG transform attribute"},{"refs":[{"id":"ref-for-typedef-transform-function\u2466"},{"id":"ref-for-typedef-transform-function\u2467"},{"id":"ref-for-typedef-transform-function\u2468"},{"id":"ref-for-typedef-transform-function\u2460\u24ea"}],"title":"6.3. SVG transform functions"},{"refs":[{"id":"ref-for-typedef-transform-function\u2460\u2460"}],"title":"8. The Transform Function Lists"}],"url":"#typedef-transform-function"}, "typedef-transform-list": {"dfnID":"typedef-transform-list","dfnText":"<transform-list>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-transform-list"}],"title":"3. The transform Property"},{"refs":[{"id":"ref-for-typedef-transform-list\u2460"},{"id":"ref-for-typedef-transform-list\u2461"}],"title":"3.2. Resolved value of transform"},{"refs":[{"id":"ref-for-typedef-transform-list\u2462"}],"title":"Since the 14 February 2019 Candidate Recommendation"},{"refs":[{"id":"ref-for-typedef-transform-list\u2463"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#typedef-transform-list"}, "user-coordinate-system": {"dfnID":"user-coordinate-system","dfnText":"user coordinate system","external":false,"refSections":[],"url":"#user-coordinate-system"}, "valdef-transform-box-border-box": {"dfnID":"valdef-transform-box-border-box","dfnText":"border-box","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-transform-box-border-box"},{"id":"ref-for-valdef-transform-box-border-box\u2460"}],"title":"5. Transform reference box: the transform-box property"}],"url":"#valdef-transform-box-border-box"}, "valdef-transform-box-content-box": {"dfnID":"valdef-transform-box-content-box","dfnText":"content-box","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-transform-box-content-box"},{"id":"ref-for-valdef-transform-box-content-box\u2460"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-valdef-transform-box-content-box\u2461"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#valdef-transform-box-content-box"}, "valdef-transform-box-fill-box": {"dfnID":"valdef-transform-box-fill-box","dfnText":"fill-box","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-transform-box-fill-box"},{"id":"ref-for-valdef-transform-box-fill-box\u2460"}],"title":"5. Transform reference box: the transform-box property"}],"url":"#valdef-transform-box-fill-box"}, "valdef-transform-box-stroke-box": {"dfnID":"valdef-transform-box-stroke-box","dfnText":"stroke-box","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-transform-box-stroke-box"},{"id":"ref-for-valdef-transform-box-stroke-box\u2460"}],"title":"5. Transform reference box: the transform-box property"},{"refs":[{"id":"ref-for-valdef-transform-box-stroke-box\u2461"}],"title":"Since the 30 November 2017 Working Draft\n"}],"url":"#valdef-transform-box-stroke-box"}, "valdef-transform-box-view-box": {"dfnID":"valdef-transform-box-view-box","dfnText":"view-box","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-transform-box-view-box"}],"title":"5. Transform reference box: the transform-box property"}],"url":"#valdef-transform-box-view-box"}, "valdef-transform-origin-bottom": {"dfnID":"valdef-transform-origin-bottom","dfnText":"bottom","external":false,"refSections":[],"url":"#valdef-transform-origin-bottom"}, "valdef-transform-origin-center": {"dfnID":"valdef-transform-origin-center","dfnText":"center","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-transform-origin-center"},{"id":"ref-for-valdef-transform-origin-center\u2460"}],"title":"4. The transform-origin Property"}],"url":"#valdef-transform-origin-center"}, "valdef-transform-origin-left": {"dfnID":"valdef-transform-origin-left","dfnText":"left","external":false,"refSections":[],"url":"#valdef-transform-origin-left"}, "valdef-transform-origin-right": {"dfnID":"valdef-transform-origin-right","dfnText":"right","external":false,"refSections":[],"url":"#valdef-transform-origin-right"}, "valdef-transform-origin-top": {"dfnID":"valdef-transform-origin-top","dfnText":"top","external":false,"refSections":[],"url":"#valdef-transform-origin-top"}, }; document.addEventListener("DOMContentLoaded", ()=>{ genAllDfnPanels(); document.body.addEventListener("click", (e) => { // If not handled already, just hide all dfn panels. hideAllDfnPanels(); }); }); window.addEventListener("resize", () => { // Pin any visible dfn panel queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(el=>positionDfnPanel(el)); }); function genAllDfnPanels() { for(const panelData of Object.values(dfnPanelData)) { const dfnID = panelData.dfnID; const dfn = document.getElementById(dfnID); if(!dfn) { console.log(`Can't find dfn#${dfnID}.`, panelData); continue; } dfn.panelData = panelData; insertDfnPopupAction(dfn); } } function genDfnPanel(dfn, { dfnID, url, dfnText, refSections, external }) { const dfnPanel = mk.aside({ class: "dfn-panel on", id: `infopanel-for-${dfnID}`, "data-for": dfnID, "aria-labelled-by":`infopaneltitle-for-${dfnID}`, }, mk.span({id:`infopaneltitle-for-${dfnID}`, style:"display:none"}, `Info about the '${dfnText}' ${external?"external":""} reference.`), mk.a({href:url, class:"dfn-link"}, url), refSections.length == 0 ? [] : mk.b({}, "Referenced in:"), mk.ul({}, ...refSections.map(section=> mk.li({}, ...section.refs.map((ref, refI)=> [ mk.a({ href: `#${ref.id}` }, (refI == 0) ? section.title : `(${refI + 1})` ), " ", ] ), ), ), ), genLinkingSyntaxes(dfn), ); dfnPanel.addEventListener('click', (event) => { if (event.target.nodeName == 'A') { scrollToTargetAndHighlight(event); pinDfnPanel(dfnPanel); } event.stopPropagation(); refocusOnTarget(event); }); dfnPanel.addEventListener('keydown', (event) => { if(event.keyCode == 27) { // Escape key hideDfnPanel({dfnPanel}); event.stopPropagation(); event.preventDefault(); } }); dfnPanel.dfn = dfn; dfn.dfnPanel = dfnPanel; return dfnPanel; } function hideAllDfnPanels() { // Delete the currently-active dfn panel. queryAll(".dfn-panel").forEach(dfnPanel=>hideDfnPanel({dfnPanel})); } function showDfnPanel(dfn) { hideAllDfnPanels(); // Only display one at a time. dfn.setAttribute("aria-expanded", "true"); const dfnPanel = genDfnPanel(dfn, dfn.panelData); // Give the dfn a unique tabindex, and then // give all the tabbable panel bits successive indexes. let tabIndex = 100; dfn.tabIndex = tabIndex++; const tabbable = dfnPanel.querySelectorAll(":is(a, button)"); for (const el of tabbable) { el.tabIndex = tabIndex++; } append(document.body, dfnPanel); positionDfnPanel(dfnPanel); } function positionDfnPanel(dfnPanel) { const dfn = dfnPanel.dfn; const dfnPos = getBounds(dfn); dfnPanel.style.top = dfnPos.bottom + "px"; dfnPanel.style.left = dfnPos.left + "px"; const panelPos = dfnPanel.getBoundingClientRect(); const panelMargin = 8; const maxRight = document.body.parentNode.clientWidth - panelMargin; if (panelPos.right > maxRight) { const overflowAmount = panelPos.right - maxRight; const newLeft = Math.max(panelMargin, dfnPos.left - overflowAmount); dfnPanel.style.left = newLeft + "px"; } } function pinDfnPanel(dfnPanel) { // Switch it to "activated" state, which pins it. dfnPanel.classList.add("activated"); dfnPanel.style.position = "fixed"; dfnPanel.style.left = null; dfnPanel.style.top = null; } function hideDfnPanel({dfn, dfnPanel}) { if(!dfnPanel) dfnPanel = dfn.dfnPanel; if(!dfn) dfn = dfnPanel.dfn; dfn.dfnPanel = undefined; dfnPanel.dfn = undefined; dfn.setAttribute("aria-expanded", "false"); dfn.tabIndex = undefined; dfnPanel.remove() } function toggleDfnPanel(dfn) { if(dfn.dfnPanel) { hideDfnPanel(dfn); } else { showDfnPanel(dfn); } } function insertDfnPopupAction(dfn) { dfn.setAttribute('role', 'button'); dfn.setAttribute('aria-expanded', 'false') dfn.tabIndex = 0; dfn.classList.add('has-dfn-panel'); dfn.addEventListener('click', (event) => { toggleDfnPanel(dfn); event.stopPropagation(); }); dfn.addEventListener('keypress', (event) => { const kc = event.keyCode; // 32->Space, 13->Enter if(kc == 32 || kc == 13) { toggleDfnPanel(dfn); event.stopPropagation(); event.preventDefault(); } }); } function refocusOnTarget(event) { const target = event.target; setTimeout(() => { // Refocus on the event.target element. // This is needed after browser scrolls to the destination. target.focus(); }); } // TODO: shared util // Returns the root-level absolute position {left and top} of element. function getBounds(el, relativeTo=document.body) { const relativeRect = relativeTo.getBoundingClientRect(); const elRect = el.getBoundingClientRect(); const top = elRect.top - relativeRect.top; const left = elRect.left - relativeRect.left; return { top, left, bottom: top + elRect.height, right: left + elRect.width, } } function scrollToTargetAndHighlight(event) { let hash = event.target.hash; if (hash) { hash = decodeURIComponent(hash.substring(1)); const dest = document.getElementById(hash); if (dest) { dest.classList.add('highlighted'); setTimeout(() => dest.classList.remove('highlighted'), 1000); } } } // Functions, divided by link type, that wrap an autolink's // contents with the appropriate outer syntax. // Alternately, a string naming another type they format // the same as. function needsFor(type) { switch(type) { case "descriptor": case "value": case "element-attr": case "attr-value": case "element-state": case "method": case "constructor": case "argument": case "attribute": case "const": case "dict-member": case "event": case "enum-value": case "stringifier": case "serializer": case "iterator": case "maplike": case "setlike": case "state": case "mode": case "context": case "facet": return true; default: return false; } } function refusesFor(type) { switch(type) { case "property": case "element": case "interface": case "namespace": case "callback": case "dictionary": case "enum": case "exception": case "typedef": case "http-header": case "permission": return true; default: return false; } } function linkFormatterFromType(type) { switch(type) { case 'scheme': case 'permission': case 'dfn': return (text) => `[=${text}=]`; case 'abstract-op': return (text) => `[\$${text}\$]`; case 'function': case 'at-rule': case 'selector': case 'value': return (text) => `''${text}''`; case 'http-header': return (text) => `[:${text}:]`; case 'interface': case 'constructor': case 'method': case 'argument': case 'attribute': case 'callback': case 'dictionary': case 'dict-member': case 'enum': case 'enum-value': case 'exception': case 'const': case 'typedef': case 'stringifier': case 'serializer': case 'iterator': case 'maplike': case 'setlike': case 'extended-attribute': case 'event': case 'idl': return (text) => `{{${text}}}`; case 'element-state': case 'element-attr': case 'attr-value': case 'element': return (element) => `<{${element}}>`; case 'grammar': return (text) => `${text} (within a <pre class=prod>)`; case 'type': return (text)=> `<<${text}>>`; case 'descriptor': case 'property': return (text) => `'${text}'`; default: return; }; }; function genLinkingSyntaxes(dfn) { if(dfn.tagName != "DFN") return; const type = dfn.getAttribute('data-dfn-type'); if(!type) { console.log(`<dfn> doesn't have a data-dfn-type:`, dfn); return []; } // Return a function that wraps link text based on the type const linkFormatter = linkFormatterFromType(type); if(!linkFormatter) { console.log(`<dfn> has an unknown data-dfn-type:`, dfn); return []; } let ltAlts; if(dfn.hasAttribute('data-lt')) { ltAlts = dfn.getAttribute('data-lt') .split("|") .map(x=>x.trim()); } else { ltAlts = [dfn.textContent.trim()]; } if(type == "type") { // lt of "<foo>", but "foo" is the interior; // <<foo/bar>> is how you write it with a for, // not <foo/<bar>> or whatever. for(var i = 0; i < ltAlts.length; i++) { const lt = ltAlts[i]; const match = /<(.*)>/.exec(lt); if(match) { ltAlts[i] = match[1]; } } } let forAlts; if(dfn.hasAttribute('data-dfn-for')) { forAlts = dfn.getAttribute('data-dfn-for') .split(",") .map(x=>x.trim()); } else { forAlts = ['']; } let linkingSyntaxes = []; if(!needsFor(type)) { for(const lt of ltAlts) { linkingSyntaxes.push(linkFormatter(lt)); } } if(!refusesFor(type)) { for(const f of forAlts) { linkingSyntaxes.push(linkFormatter(`${f}/${ltAlts[0]}`)) } } return [ mk.b({}, 'Possible linking syntaxes:'), mk.ul({}, ...linkingSyntaxes.map(link => { const copyLink = async () => await navigator.clipboard.writeText(link); return mk.li({}, mk.div({ class: 'link-item' }, mk.button({ class: 'copy-icon', title: 'Copy', type: 'button', _onclick: copyLink, tabindex: 0, }, mk.span({ class: 'icon' }) ), mk.span({}, link) ) ); }) ) ]; } } </script> <script>/* Boilerplate: script-link-titles */ "use strict"; { let linkTitleData = { "https://drafts.csswg.org/css-values-4/#angle-value": "Expands to: deg | grad | rad | turn", "https://drafts.csswg.org/css-values-4/#length-value": "Expands to: advance measure | cap | ch | cm | dvb | dvh | dvi | dvmax | dvmin | dvw | em | ex | ic | in | lh | lvb | lvh | lvi | lvmax | lvmin | lvw | mm | pc | pt | px | rcap | rch | rem | rex | ric | rlh | svb | svh | svi | svmax | svmin | svw | vb | vh | vi | vmax | vmin | vw", }; function setTypeTitles() { for(let el of document.querySelectorAll("a[href]")) { if(el.href in linkTitleData && !el.hasAttribute("title")) { el.setAttribute("title", linkTitleData[el.href]); } } } document.addEventListener("DOMContentLoaded", setTypeTitles); } </script> <script>/* Boilerplate: script-position-annos */ "use strict"; { function repositionAnnoPanels(){ const panels = [...document.querySelectorAll("[data-anno-for]")]; hydratePanels(panels); let vSoFar = 0; for(const panel of panels.sort(cmpTops)) { if(panel.top < vSoFar) { panel.top = vSoFar; panel.style.top = vSoFar + "px"; } vSoFar = panel.top + panel.height + 15; } } function hydratePanels(panels) { const main = document.querySelector("main"); let mainRect; if(main) mainRect = main.getBoundingClientRect(); // First display them all, if they're not already visible. for(const panel of panels) { panel.classList.remove("unpositioned"); } // Measure them all for(const panel of panels) { const dfn = document.getElementById(panel.getAttribute("data-anno-for")); if(!dfn) { console.log("Can't find the annotation panel target:", panel); continue; } panel.dfn = dfn; panel.top = window.scrollY + dfn.getBoundingClientRect().top; let panelRect = panel.getBoundingClientRect(); panel.height = panelRect.height; if(main) { panel.overlappingMain = panelRect.left < mainRect.right; } else { panel.overlappingMain = false; } } // And finally position them for(const panel of panels) { const dfn = panel.dfn; if(!dfn) continue; panel.style.top = panel.top + "px"; panel.classList.toggle("overlapping-main", panel.overlappingMain); } } function cmpTops(a,b) { return a.top - b.top; } window.addEventListener("load", repositionAnnoPanels); window.addEventListener("resize", repositionAnnoPanels); } </script> <script>/* Boilerplate: script-ref-hints */ "use strict"; { let refsData = { "#2d-matrix": {"displayText":"2d matrix","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"2d matrix","type":"dfn","url":"#2d-matrix"}, "#containing-block-for-all-descendants": {"displayText":"containing block for all descendants","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"containing block for all descendants","type":"dfn","url":"#containing-block-for-all-descendants"}, "#current-transformation-matrix": {"displayText":"current transformation matrix","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"current transformation matrix","type":"dfn","url":"#current-transformation-matrix"}, "#funcdef-transform-matrix": {"displayText":"matrix()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"matrix()","type":"function","url":"#funcdef-transform-matrix"}, "#funcdef-transform-rotate": {"displayText":"rotate()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"rotate()","type":"function","url":"#funcdef-transform-rotate"}, "#funcdef-transform-scale": {"displayText":"scale()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"scale()","type":"function","url":"#funcdef-transform-scale"}, "#funcdef-transform-scalex": {"displayText":"scalex()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"scalex()","type":"function","url":"#funcdef-transform-scalex"}, "#funcdef-transform-scaley": {"displayText":"scaley()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"scaley()","type":"function","url":"#funcdef-transform-scaley"}, "#funcdef-transform-skew": {"displayText":"skew()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"skew()","type":"function","url":"#funcdef-transform-skew"}, "#funcdef-transform-skewx": {"displayText":"skewx()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"skewx()","type":"function","url":"#funcdef-transform-skewx"}, "#funcdef-transform-skewy": {"displayText":"skewy()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"skewy()","type":"function","url":"#funcdef-transform-skewy"}, "#funcdef-transform-translate": {"displayText":"translate()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"translate()","type":"function","url":"#funcdef-transform-translate"}, "#funcdef-transform-translatex": {"displayText":"translatex()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"translatex()","type":"function","url":"#funcdef-transform-translatex"}, "#funcdef-transform-translatey": {"displayText":"translatey()","export":true,"for_":["transform"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"translatey()","type":"function","url":"#funcdef-transform-translatey"}, "#identity-transform-function": {"displayText":"identity transform function","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"identity transform function","type":"dfn","url":"#identity-transform-function"}, "#local-coordinate-system": {"displayText":"local coordinate system","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"local coordinate system","type":"dfn","url":"#local-coordinate-system"}, "#post-multiplied": {"displayText":"post-multiplied","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"post-multiplied","type":"dfn","url":"#post-multiplied"}, "#post-multiply": {"displayText":"post-multiply","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"post-multiply","type":"dfn","url":"#post-multiply"}, "#pre-multiplied": {"displayText":"pre-multiplied","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"pre-multiplied","type":"dfn","url":"#pre-multiplied"}, "#pre-multiply": {"displayText":"pre-multiply","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"pre-multiply","type":"dfn","url":"#pre-multiply"}, "#propdef-transform": {"displayText":"transform","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"transform","type":"property","url":"#propdef-transform"}, "#propdef-transform-box": {"displayText":"transform-box","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"transform-box","type":"property","url":"#propdef-transform-box"}, "#propdef-transform-origin": {"displayText":"transform-origin","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"transform-origin","type":"property","url":"#propdef-transform-origin"}, "#reference-box": {"displayText":"reference box","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"reference box","type":"dfn","url":"#reference-box"}, "#transformable-element": {"displayText":"transformable element","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"transformable element","type":"dfn","url":"#transformable-element"}, "#transformation-matrix": {"displayText":"transformation matrix","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"transformation matrix","type":"dfn","url":"#transformation-matrix"}, "#typedef-transform-function": {"displayText":"<transform-function>","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"<transform-function>","type":"type","url":"#typedef-transform-function"}, "#typedef-transform-list": {"displayText":"<transform-list>","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"<transform-list>","type":"type","url":"#typedef-transform-list"}, "#valdef-transform-box-border-box": {"displayText":"border-box","export":true,"for_":["transform-box"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"border-box","type":"value","url":"#valdef-transform-box-border-box"}, "#valdef-transform-box-content-box": {"displayText":"content-box","export":true,"for_":["transform-box"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"content-box","type":"value","url":"#valdef-transform-box-content-box"}, "#valdef-transform-box-fill-box": {"displayText":"fill-box","export":true,"for_":["transform-box"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"fill-box","type":"value","url":"#valdef-transform-box-fill-box"}, "#valdef-transform-box-stroke-box": {"displayText":"stroke-box","export":true,"for_":["transform-box"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"stroke-box","type":"value","url":"#valdef-transform-box-stroke-box"}, "#valdef-transform-box-view-box": {"displayText":"view-box","export":true,"for_":["transform-box"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"view-box","type":"value","url":"#valdef-transform-box-view-box"}, "#valdef-transform-origin-center": {"displayText":"center","export":true,"for_":["transform-origin"],"level":"1","normative":true,"shortname":"css-transforms","spec":"css-transforms-1","status":"local","text":"center","type":"value","url":"#valdef-transform-origin-center"}, "https://drafts.csswg.org/css-backgrounds-3/#propdef-background-attachment": {"displayText":"background-attachment","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-backgrounds","spec":"css-backgrounds-3","status":"current","text":"background-attachment","type":"property","url":"https://drafts.csswg.org/css-backgrounds-3/#propdef-background-attachment"}, "https://drafts.csswg.org/css-backgrounds-3/#propdef-background-position": {"displayText":"background-position","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-backgrounds","spec":"css-backgrounds-3","status":"current","text":"background-position","type":"property","url":"https://drafts.csswg.org/css-backgrounds-3/#propdef-background-position"}, "https://drafts.csswg.org/css-backgrounds-3/#valdef-background-attachment-fixed": {"displayText":"fixed","export":true,"for_":["background-attachment"],"level":"3","normative":true,"shortname":"css-backgrounds","spec":"css-backgrounds-3","status":"current","text":"fixed","type":"value","url":"https://drafts.csswg.org/css-backgrounds-3/#valdef-background-attachment-fixed"}, "https://drafts.csswg.org/css-backgrounds-3/#valdef-background-attachment-scroll": {"displayText":"scroll","export":true,"for_":["background-attachment"],"level":"3","normative":true,"shortname":"css-backgrounds","spec":"css-backgrounds-3","status":"current","text":"scroll","type":"value","url":"https://drafts.csswg.org/css-backgrounds-3/#valdef-background-attachment-scroll"}, "https://drafts.csswg.org/css-cascade-5/#computed-value": {"displayText":"computed value","export":true,"for_":[],"level":"5","normative":true,"shortname":"css-cascade","spec":"css-cascade-5","status":"current","text":"computed value","type":"dfn","url":"https://drafts.csswg.org/css-cascade-5/#computed-value"}, "https://drafts.csswg.org/css-cascade-5/#used-value": {"displayText":"used value","export":true,"for_":[],"level":"5","normative":true,"shortname":"css-cascade","spec":"css-cascade-5","status":"current","text":"used value","type":"dfn","url":"https://drafts.csswg.org/css-cascade-5/#used-value"}, "https://drafts.csswg.org/css-overflow-3/#propdef-overflow": {"displayText":"overflow","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-overflow","spec":"css-overflow-3","status":"current","text":"overflow","type":"property","url":"https://drafts.csswg.org/css-overflow-3/#propdef-overflow"}, "https://drafts.csswg.org/css-overflow-3/#valdef-overflow-auto": {"displayText":"auto","export":true,"for_":["overflow","overflow-x","overflow-y"],"level":"3","normative":true,"shortname":"css-overflow","spec":"css-overflow-3","status":"current","text":"auto","type":"value","url":"https://drafts.csswg.org/css-overflow-3/#valdef-overflow-auto"}, "https://drafts.csswg.org/css-overflow-3/#valdef-overflow-scroll": {"displayText":"scroll","export":true,"for_":["overflow","overflow-x","overflow-y"],"level":"3","normative":true,"shortname":"css-overflow","spec":"css-overflow-3","status":"current","text":"scroll","type":"value","url":"https://drafts.csswg.org/css-overflow-3/#valdef-overflow-scroll"}, "https://drafts.csswg.org/css-sizing-3/#propdef-height": {"displayText":"height","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-sizing","spec":"css-sizing-3","status":"current","text":"height","type":"property","url":"https://drafts.csswg.org/css-sizing-3/#propdef-height"}, "https://drafts.csswg.org/css-syntax-3/#letter": {"displayText":"letter","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"current","text":"letter","type":"dfn","url":"https://drafts.csswg.org/css-syntax-3/#letter"}, "https://drafts.csswg.org/css-syntax-3/#typedef-number-token": {"displayText":"<number-token>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-syntax","spec":"css-syntax-3","status":"current","text":"<number-token>","type":"type","url":"https://drafts.csswg.org/css-syntax-3/#typedef-number-token"}, "https://drafts.csswg.org/css-transforms-2/#funcdef-translate3d": {"displayText":"translate3d()","export":true,"for_":[],"level":"2","normative":true,"shortname":"css-transforms","spec":"css-transforms-2","status":"current","text":"translate3d()","type":"function","url":"https://drafts.csswg.org/css-transforms-2/#funcdef-translate3d"}, "https://drafts.csswg.org/css-values-4/#angle-value": {"displayText":"<angle>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<angle>","type":"type","url":"https://drafts.csswg.org/css-values-4/#angle-value"}, "https://drafts.csswg.org/css-values-4/#comb-all": {"displayText":"&&","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"&&","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#comb-all"}, "https://drafts.csswg.org/css-values-4/#comb-comma": {"displayText":",","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":",","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#comb-comma"}, "https://drafts.csswg.org/css-values-4/#comb-one": {"displayText":"|","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"|","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#comb-one"}, "https://drafts.csswg.org/css-values-4/#css-wide-keywords": {"displayText":"CSS-wide keywords","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"css-wide keywords","type":"dfn","url":"https://drafts.csswg.org/css-values-4/#css-wide-keywords"}, "https://drafts.csswg.org/css-values-4/#deg": {"displayText":"deg","export":true,"for_":["<angle>"],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"deg","type":"value","url":"https://drafts.csswg.org/css-values-4/#deg"}, "https://drafts.csswg.org/css-values-4/#funcdef-calc": {"displayText":"calc()","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"calc()","type":"function","url":"https://drafts.csswg.org/css-values-4/#funcdef-calc"}, "https://drafts.csswg.org/css-values-4/#interpolation": {"displayText":"interpolation","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"interpolation","type":"dfn","url":"https://drafts.csswg.org/css-values-4/#interpolation"}, "https://drafts.csswg.org/css-values-4/#length-value": {"displayText":"<length>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<length>","type":"type","url":"https://drafts.csswg.org/css-values-4/#length-value"}, "https://drafts.csswg.org/css-values-4/#mult-comma": {"displayText":"#","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"#","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#mult-comma"}, "https://drafts.csswg.org/css-values-4/#mult-one-plus": {"displayText":"+","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"+","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#mult-one-plus"}, "https://drafts.csswg.org/css-values-4/#mult-opt": {"displayText":"?","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"?","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#mult-opt"}, "https://drafts.csswg.org/css-values-4/#number-value": {"displayText":"<number>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<number>","type":"type","url":"https://drafts.csswg.org/css-values-4/#number-value"}, "https://drafts.csswg.org/css-values-4/#px": {"displayText":"px","export":true,"for_":["<length>"],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"px","type":"value","url":"https://drafts.csswg.org/css-values-4/#px"}, "https://drafts.csswg.org/css-values-4/#typedef-length-percentage": {"displayText":"<length-percentage>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<length-percentage>","type":"type","url":"https://drafts.csswg.org/css-values-4/#typedef-length-percentage"}, "https://drafts.csswg.org/css-values-4/#zero-value": {"displayText":"<zero>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<zero>","type":"type","url":"https://drafts.csswg.org/css-values-4/#zero-value"}, "https://drafts.csswg.org/css2/#propdef-z-index": {"displayText":"z-index","export":true,"for_":[],"level":"2","normative":true,"shortname":"css","spec":"css2","status":"current","text":"z-index","type":"property","url":"https://drafts.csswg.org/css2/#propdef-z-index"}, "https://drafts.csswg.org/css2/#valdef-z-index-auto": {"displayText":"auto","export":true,"for_":["z-index"],"level":"2","normative":true,"shortname":"css","spec":"css2","status":"current","text":"auto","type":"value","url":"https://drafts.csswg.org/css2/#valdef-z-index-auto"}, "https://drafts.csswg.org/cssom-1/#resolved-value": {"displayText":"resolved value","export":true,"for_":[],"level":"1","normative":true,"shortname":"cssom","spec":"cssom-1","status":"current","text":"resolved value","type":"dfn","url":"https://drafts.csswg.org/cssom-1/#resolved-value"}, "https://drafts.csswg.org/cssom-1/#resolved-value-special-case-property": {"displayText":"resolved value special case property","export":true,"for_":[],"level":"1","normative":true,"shortname":"cssom","spec":"cssom-1","status":"current","text":"resolved value special case property","type":"dfn","url":"https://drafts.csswg.org/cssom-1/#resolved-value-special-case-property"}, "https://drafts.fxtf.org/css-masking-1/#element-attrdef-clippath-clippathunits": {"displayText":"clipPathUnits","export":true,"for_":["clipPath"],"level":"1","normative":true,"shortname":"css-masking","spec":"css-masking-1","status":"current","text":"clippathunits","type":"element-attr","url":"https://drafts.fxtf.org/css-masking-1/#element-attrdef-clippath-clippathunits"}, "https://drafts.fxtf.org/css-masking-1/#elementdef-clippath": {"displayText":"clipPath","export":true,"for_":[],"level":"1","normative":true,"shortname":"css-masking","spec":"css-masking-1","status":"current","text":"clippath","type":"element","url":"https://drafts.fxtf.org/css-masking-1/#elementdef-clippath"}, "https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element": {"displayText":"div","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"div","type":"element","url":"https://html.spec.whatwg.org/multipage/grouping-content.html#the-div-element"}, "https://svgwg.org/specs/animations/#elementdef-animate": {"displayText":"animate","export":true,"for_":[],"level":"1","normative":true,"shortname":"svg-animations","spec":"svg-animations","status":"current","text":"animate","type":"element","url":"https://svgwg.org/specs/animations/#elementdef-animate"}, "https://svgwg.org/specs/animations/#elementdef-set": {"displayText":"set","export":true,"for_":[],"level":"1","normative":true,"shortname":"svg-animations","spec":"svg-animations","status":"current","text":"set","type":"element","url":"https://svgwg.org/specs/animations/#elementdef-set"}, "https://svgwg.org/svg2-draft/coords.html#TermObjectBoundingBox": {"displayText":"object bounding box","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"object bounding box","type":"dfn","url":"https://svgwg.org/svg2-draft/coords.html#TermObjectBoundingBox"}, "https://svgwg.org/svg2-draft/coords.html#TermStrokeBoundingBox": {"displayText":"stroke bounding box","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"stroke bounding box","type":"dfn","url":"https://svgwg.org/svg2-draft/coords.html#TermStrokeBoundingBox"}, "https://svgwg.org/svg2-draft/coords.html#TermViewportCoordinateSystem": {"displayText":"viewport coordinate system","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"viewport coordinate system","type":"dfn","url":"https://svgwg.org/svg2-draft/coords.html#TermViewportCoordinateSystem"}, "https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__animVal": {"displayText":"animVal","export":true,"for_":["SVGAnimatedPreserveAspectRatio"],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"animVal","type":"attribute","url":"https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__animVal"}, "https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__baseVal": {"displayText":"baseVal","export":true,"for_":["SVGAnimatedPreserveAspectRatio"],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"baseVal","type":"attribute","url":"https://svgwg.org/svg2-draft/coords.html#__svg__SVGAnimatedPreserveAspectRatio__baseVal"}, "https://svgwg.org/svg2-draft/painting.html#TermPaintServerElement": {"displayText":"paint server element","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"paint server element","type":"dfn","url":"https://svgwg.org/svg2-draft/painting.html#TermPaintServerElement"}, "https://svgwg.org/svg2-draft/pservers.html#elementdef-linearGradient": {"displayText":"linearGradient","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"lineargradient","type":"element","url":"https://svgwg.org/svg2-draft/pservers.html#elementdef-linearGradient"}, "https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern": {"displayText":"pattern","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"pattern","type":"element","url":"https://svgwg.org/svg2-draft/pservers.html#elementdef-pattern"}, "https://svgwg.org/svg2-draft/pservers.html#elementdef-radialGradient": {"displayText":"radialGradient","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"radialgradient","type":"element","url":"https://svgwg.org/svg2-draft/pservers.html#elementdef-radialGradient"}, "https://svgwg.org/svg2-draft/render.html#TermRenderableElement": {"displayText":"renderable element","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"renderable element","type":"dfn","url":"https://svgwg.org/svg2-draft/render.html#TermRenderableElement"}, "https://svgwg.org/svg2-draft/shapes.html#elementdef-rect": {"displayText":"rect","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"rect","type":"element","url":"https://svgwg.org/svg2-draft/shapes.html#elementdef-rect"}, "https://svgwg.org/svg2-draft/styling.html#TermPresentationAttribute": {"displayText":"presentation attributes","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"presentation attributes","type":"dfn","url":"https://svgwg.org/svg2-draft/styling.html#TermPresentationAttribute"}, "https://svgwg.org/svg2-draft/text.html#TermTextContentElement": {"displayText":"text content element","export":true,"for_":[],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"text content element","type":"dfn","url":"https://svgwg.org/svg2-draft/text.html#TermTextContentElement"}, "https://svgwg.org/svg2-draft/types.html#__svg__SVGFitToViewBox__viewBox": {"displayText":"viewBox","export":true,"for_":["SVGFitToViewBox"],"level":"2","normative":true,"shortname":"svg","spec":"svg2","status":"current","text":"viewBox","type":"attribute","url":"https://svgwg.org/svg2-draft/types.html#__svg__SVGFitToViewBox__viewBox"}, "https://www.w3.org/TR/CSS2/visuren.html#x43": {"displayText":"stacking context","export":true,"for_":[],"level":"2","normative":true,"shortname":"css","spec":"css2","status":"snapshot","text":"stacking context","type":"dfn","url":"https://www.w3.org/TR/CSS2/visuren.html#x43"}, "https://www.w3.org/TR/SVG/pservers.html#LinearGradientElementGradientUnitsAttribute": {"displayText":"gradientUnits","export":true,"for_":["linearGradient"],"level":"","normative":true,"shortname":"svg1.1","spec":"svg1.1","status":"anchor-block","text":"gradientunits","type":"element-attr","url":"https://www.w3.org/TR/SVG/pservers.html#LinearGradientElementGradientUnitsAttribute"}, "https://www.w3.org/TR/SVG/pservers.html#PatternElementPatternUnitsAttribute": {"displayText":"patternUnits","export":true,"for_":["pattern"],"level":"","normative":true,"shortname":"svg1.1","spec":"svg1.1","status":"anchor-block","text":"patternunits","type":"element-attr","url":"https://www.w3.org/TR/SVG/pservers.html#PatternElementPatternUnitsAttribute"}, "https://www.w3.org/TR/SVG11/coords.html#TransformAttribute": {"displayText":"transform","export":true,"for_":[""],"level":"","normative":true,"shortname":"svg1.1","spec":"svg1.1","status":"anchor-block","text":"transform","type":"element-attr","url":"https://www.w3.org/TR/SVG11/coords.html#TransformAttribute"}, "https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute": {"displayText":"gradientTransform","export":true,"for_":["linearGradient"],"level":"","normative":true,"shortname":"svg1.1","spec":"svg1.1","status":"anchor-block","text":"gradienttransform","type":"element-attr","url":"https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementGradientTransformAttribute"}, "https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute": {"displayText":"patternTransform","export":true,"for_":["pattern"],"level":"","normative":true,"shortname":"svg1.1","spec":"svg1.1","status":"anchor-block","text":"patterntransform","type":"element-attr","url":"https://www.w3.org/TR/SVG11/pservers.html#PatternElementPatternTransformAttribute"}, }; function mkRefHint(link, ref) { const linkText = link.textContent; let dfnTextElements = ''; if (ref.displayText.toLowerCase() != linkText.toLowerCase()) { // Give the original term if it's being displayed in a different way. // But allow casing differences, they're insignificant. dfnTextElements = mk.li({}, mk.b({}, "Term: "), mk.span({}, ref.displayText) ); } const forList = ref.for_; let forListElements; if(forList.length == 0) { forListElements = []; } else if(forList.length == 1) { forListElements = mk.li({}, mk.b({}, "For: "), mk.span({}, forList[0]), ); } else { forListElements = mk.li({}, mk.b({}, "For: "), mk.ul({}, ...forList.map(forItem => mk.li({}, mk.span({}, forItem) ), ), ), ); } const url = ref.url; const safeUrl = encodeURIComponent(url); const hintPanel = mk.aside({ class: "ref-hint", id: `ref-hint-for-${safeUrl}`, "data-for": url, "aria-labelled-by": `ref-hint-for-${safeUrl}`, }, mk.ul({}, dfnTextElements, mk.li({}, mk.b({}, "URL: "), mk.a({ href: url, class: "ref" }, url), ), mk.li({}, mk.b({}, "Type: "), mk.span({}, `${ref.type}`), ), mk.li({}, mk.b({}, "Spec: "), mk.span({}, `${ref.spec ? ref.spec : ''}`), ), forListElements ), ); hintPanel.forLink = link; setupRefHintEventListeners(link, hintPanel); return hintPanel; } function hideAllRefHints() { queryAll(".ref-hint").forEach(el=>hideRefHint(el)); } function hideRefHint(refHint) { const link = refHint.forLink; link.setAttribute("aria-expanded", "false"); if(refHint.teardownEventListeners) { refHint.teardownEventListeners(); } refHint.remove(); } function showRefHint(link) { if(link.classList.contains("dfn-link")) return; const url = link.getAttribute("href"); const refHintKey = link.getAttribute("data-refhint-key"); let key = url; if(refHintKey) { key = refHintKey + "_" + url; } const ref = refsData[key]; if(!ref) return; hideAllRefHints(); // Only display one at this time. const refHint = mkRefHint(link, ref); append(document.body, refHint); link.setAttribute("aria-expanded", "true"); positionRefHint(refHint); } function setupRefHintEventListeners(link, refHint) { if (refHint.teardownEventListeners) return; // Add event handlers to hide the refHint after the user moves away // from both the link and refHint, if not hovering either within one second. let timeout = null; const startHidingRefHint = (event) => { if (timeout) { clearTimeout(timeout); } timeout = setTimeout(() => { hideRefHint(refHint); }, 1000); } const resetHidingRefHint = (event) => { if (timeout) clearTimeout(timeout); timeout = null; }; link.addEventListener("mouseleave", startHidingRefHint); link.addEventListener("mouseenter", resetHidingRefHint); link.addEventListener("blur", startHidingRefHint); link.addEventListener("focus", resetHidingRefHint); refHint.addEventListener("mouseleave", startHidingRefHint); refHint.addEventListener("mouseenter", resetHidingRefHint); refHint.addEventListener("blur", startHidingRefHint); refHint.addEventListener("focus", resetHidingRefHint); refHint.teardownEventListeners = () => { // remove event listeners resetHidingRefHint(); link.removeEventListener("mouseleave", startHidingRefHint); link.removeEventListener("mouseenter", resetHidingRefHint); link.removeEventListener("blur", startHidingRefHint); link.removeEventListener("focus", resetHidingRefHint); refHint.removeEventListener("mouseleave", startHidingRefHint); refHint.removeEventListener("mouseenter", resetHidingRefHint); refHint.removeEventListener("blur", startHidingRefHint); refHint.removeEventListener("focus", resetHidingRefHint); }; } function positionRefHint(refHint) { const link = refHint.forLink; const linkPos = getBounds(link); refHint.style.top = linkPos.bottom + "px"; refHint.style.left = linkPos.left + "px"; const panelPos = refHint.getBoundingClientRect(); const panelMargin = 8; const maxRight = document.body.parentNode.clientWidth - panelMargin; if (panelPos.right > maxRight) { const overflowAmount = panelPos.right - maxRight; const newLeft = Math.max(panelMargin, linkPos.left - overflowAmount); refHint.style.left = newLeft + "px"; } } // TODO: shared util // Returns the root-level absolute position {left and top} of element. function getBounds(el, relativeTo=document.body) { const relativeRect = relativeTo.getBoundingClientRect(); const elRect = el.getBoundingClientRect(); const top = elRect.top - relativeRect.top; const left = elRect.left - relativeRect.left; return { top, left, bottom: top + elRect.height, right: left + elRect.width, } } function showRefHintListener(e) { // If the target isn't in a link (or is a link), // just ignore it. let link = e.target.closest("a"); if(!link) return; // If the target is in a ref-hint panel // (aka a link in the already-open one), // also just ignore it. if(link.closest(".ref-hint")) return; // Otherwise, show the panel for the link. showRefHint(link); } function hideAllHintsListener(e) { // If the click is inside a ref-hint panel, ignore it. if(e.target.closest(".ref-hint")) return; // Otherwise, close all the current panels. hideAllRefHints(); } document.addEventListener("DOMContentLoaded", () => { document.body.addEventListener("mousedown", showRefHintListener); document.body.addEventListener("focus", showRefHintListener); document.body.addEventListener("click", hideAllHintsListener); }); window.addEventListener("resize", () => { // Hide any open ref hint. hideAllRefHints(); }); } </script>