UNPKG

jsdom

Version:

A JavaScript implementation of many web standards

482 lines (384 loc) • 13.3 kB
@namespace "http://www.w3.org/1999/xhtml"; @namespace svg "http://www.w3.org/2000/svg"; @namespace xml "http://www.w3.org/XML/1998/namespace"; /* https://html.spec.whatwg.org/multipage/rendering.html#hidden-elements */ area, base, basefont, datalist, head, link, meta, noembed, noframes, param, rp, script, style, template, title { display: none; } [hidden]:not([hidden=until-found i]):not(embed) { display: none; } [hidden=until-found i]:not(embed) { content-visibility: hidden; } embed[hidden] { display: inline; height: 0; width: 0; } input[type=hidden i] { display: none !important; } @media (scripting) { noscript { display: none !important; } } /* https://html.spec.whatwg.org/multipage/rendering.html#the-page */ html, body { display: block; } /* https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3 - Omits presentational hints - Omits quirks mode */ address, blockquote, center, dialog, div, figure, figcaption, footer, form, header, hr, legend, listing, main, p, plaintext, pre, search, xmp { display: block; } blockquote, figure, listing, p, plaintext, pre, xmp { margin-block: 1em; } blockquote, figure { margin-inline: 40px; } address { font-style: italic; } listing, plaintext, pre, xmp { font-family: monospace; white-space: pre; } dialog:not([open]) { display: none; } dialog { position: absolute; inset-inline-start: 0; inset-inline-end: 0; width: fit-content; height: fit-content; margin: auto; border: solid; padding: 1em; background-color: Canvas; color: CanvasText; } dialog:modal { position: fixed; overflow: auto; inset-block: 0; max-width: calc(100% - 6px - 2em); max-height: calc(100% - 6px - 2em); } dialog::backdrop { background: rgba(0,0,0,0.1); } [popover]:not(:popover-open):not(dialog[open]) { display:none; } dialog:popover-open { display:block; } [popover] { position: fixed; inset: 0; width: fit-content; height: fit-content; margin: auto; border: solid; padding: 0.25em; overflow: auto; color: CanvasText; background-color: Canvas; } :popover-open::backdrop { position: fixed; inset: 0; pointer-events: none !important; background-color: transparent; } slot { display: contents; } /* https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-3 - Omits presentational hints */ cite, dfn, em, i, var { font-style: italic; } b, strong { font-weight: bolder; } code, kbd, samp, tt { font-family: monospace; } big { font-size: larger; } small { font-size: smaller; } sub { vertical-align: sub; } sup { vertical-align: super; } sub, sup { line-height: normal; font-size: smaller; } ruby { display: ruby; } rt { display: ruby-text; } :link { color: LinkText; } :visited { color: VisitedText; } :link:active, :visited:active { color: ActiveText; } :link, :visited { text-decoration: underline; cursor: pointer; } *|*:focus-visible { outline: auto; } mark { background: Mark; color: MarkText; } abbr[title], acronym[title] { text-decoration: dotted underline; } ins, u { text-decoration: underline; } del, s, strike { text-decoration: line-through; } q::before { content: open-quote; } q::after { content: close-quote; } br { display-outside: newline; } /* this also has bidi implications */ nobr { white-space: nowrap; } wbr { display-outside: break-opportunity; } /* this also has bidi implications */ nobr wbr { white-space: normal; } /* https://html.spec.whatwg.org/multipage/rendering.html#bidi-rendering - Omits ISO-8859-8 */ [dir]:dir(ltr), bdi:dir(ltr), input[type=tel i]:dir(ltr) { direction: ltr; } [dir]:dir(rtl), bdi:dir(rtl) { direction: rtl; } address, blockquote, center, div, figure, figcaption, footer, form, header, hr, legend, listing, main, p, plaintext, pre, summary, xmp, article, aside, :heading, hgroup, nav, search, section, table, caption, colgroup, col, thead, tbody, tfoot, tr, td, th, dir, dd, dl, dt, menu, ol, ul, li, bdi, output, [dir=ltr i], [dir=rtl i], [dir=auto i] { unicode-bidi: isolate; } bdo, bdo[dir] { unicode-bidi: isolate-override; } input[dir=auto i]:is([type=search i], [type=tel i], [type=url i], [type=email i]), textarea[dir=auto i], pre[dir=auto i] { unicode-bidi: plaintext; } /* see prose for input elements whose type attribute is in the Text state */ /* the rules setting the 'content' property on br and wbr elements also has bidi implications */ /* https://html.spec.whatwg.org/multipage/rendering.html#sections-and-headings */ article, aside, :heading, hgroup, nav, section { display: block; } :heading { font-weight: bold; } :heading(1) { margin-block: 0.67em; font-size: 2.00em; } :heading(2) { margin-block: 0.83em; font-size: 1.50em; } :heading(3) { margin-block: 1.00em; font-size: 1.17em; } :heading(4) { margin-block: 1.33em; font-size: 1.00em; } :heading(5) { margin-block: 1.67em; font-size: 0.83em; } :heading(6, 7, 8, 9) { font-size: 0.67em; margin-block: 2.33em; } /* https://html.spec.whatwg.org/multipage/rendering.html#lists - Omit presentational hints - Omit quirks mode */ dir, dd, dl, dt, menu, ol, ul { display: block; } li { display: list-item; text-align: match-parent; } dir, dl, menu, ol, ul { margin-block: 1em; } :is(dir, dl, menu, ol, ul) :is(dir, dl, menu, ol, ul) { margin-block: 0; } dd { margin-inline-start: 40px; } dir, menu, ol, ul { padding-inline-start: 40px; } ol, ul, menu { counter-reset: list-item; } ol { list-style-type: decimal; } dir, menu, ul { list-style-type: disc; } :is(dir, menu, ol, ul) :is(dir, menu, ul) { list-style-type: circle; } :is(dir, menu, ol, ul) :is(dir, menu, ol, ul) :is(dir, menu, ul) { list-style-type: square; } /* https://html.spec.whatwg.org/multipage/rendering.html#tables-2 - Omit presentational hints - Omit quirks mode - Omit HTML documents */ table { display: table; } caption { display: table-caption; } colgroup, colgroup[hidden] { display: table-column-group; } col, col[hidden] { display: table-column; } thead, thead[hidden] { display: table-header-group; } tbody, tbody[hidden] { display: table-row-group; } tfoot, tfoot[hidden] { display: table-footer-group; } tr, tr[hidden] { display: table-row; } td, th { display: table-cell; } colgroup[hidden], col[hidden], thead[hidden], tbody[hidden], tfoot[hidden], tr[hidden] { visibility: collapse; } table { box-sizing: border-box; border-spacing: 2px; border-collapse: separate; text-indent: initial; } td, th { padding: 1px; } th { font-weight: bold; } caption { text-align: center; } thead, tbody, tfoot, table > tr { vertical-align: middle; } tr, td, th { vertical-align: inherit; } thead, tbody, tfoot, tr { border-color: inherit; } table[rules=none i], table[rules=groups i], table[rules=rows i], table[rules=cols i], table[rules=all i], table[frame=void i], table[frame=above i], table[frame=below i], table[frame=hsides i], table[frame=lhs i], table[frame=rhs i], table[frame=vsides i], table[frame=box i], table[frame=border i], table[rules=none i] > tr > td, table[rules=none i] > tr > th, table[rules=groups i] > tr > td, table[rules=groups i] > tr > th, table[rules=rows i] > tr > td, table[rules=rows i] > tr > th, table[rules=cols i] > tr > td, table[rules=cols i] > tr > th, table[rules=all i] > tr > td, table[rules=all i] > tr > th, table[rules=none i] > thead > tr > td, table[rules=none i] > thead > tr > th, table[rules=groups i] > thead > tr > td, table[rules=groups i] > thead > tr > th, table[rules=rows i] > thead > tr > td, table[rules=rows i] > thead > tr > th, table[rules=cols i] > thead > tr > td, table[rules=cols i] > thead > tr > th, table[rules=all i] > thead > tr > td, table[rules=all i] > thead > tr > th, table[rules=none i] > tbody > tr > td, table[rules=none i] > tbody > tr > th, table[rules=groups i] > tbody > tr > td, table[rules=groups i] > tbody > tr > th, table[rules=rows i] > tbody > tr > td, table[rules=rows i] > tbody > tr > th, table[rules=cols i] > tbody > tr > td, table[rules=cols i] > tbody > tr > th, table[rules=all i] > tbody > tr > td, table[rules=all i] > tbody > tr > th, table[rules=none i] > tfoot > tr > td, table[rules=none i] > tfoot > tr > th, table[rules=groups i] > tfoot > tr > td, table[rules=groups i] > tfoot > tr > th, table[rules=rows i] > tfoot > tr > td, table[rules=rows i] > tfoot > tr > th, table[rules=cols i] > tfoot > tr > td, table[rules=cols i] > tfoot > tr > th, table[rules=all i] > tfoot > tr > td, table[rules=all i] > tfoot > tr > th { border-color: black; } /* https://html.spec.whatwg.org/multipage/rendering.html#form-controls - Omit quirks mode */ input, button, textarea { letter-spacing: initial; word-spacing: initial; line-height: initial; } input, select, button, textarea { text-transform: initial; text-indent: initial; text-shadow: initial; appearance: auto; } input:not([type=range i], [type=checkbox i], [type=radio i]) { overflow: clip !important; overflow-clip-margin: 0 !important; } input[type=image i] { overflow-clip-margin: content-box !important; } input, select, textarea { text-align: initial; } :autofill { field-sizing: fixed !important; } input:is([type=reset i], [type=button i], [type=submit i]), button { text-align: center; } input, button { display: inline-block; } input[type=hidden i], input[type=file i], input[type=image i] { appearance: none; } input:is([type=radio i], [type=checkbox i], [type=reset i], [type=button i], [type=submit i], [type=color i], [type=search i]), select, button { box-sizing: border-box; } textarea { white-space: pre-wrap; } input:not([type=file i], [type=range i], [type=checkbox i], [type=radio i]) { align-content: unsafe center; } button, ::file-selector-button, input:is([type=color i], [type=reset i], [type=button i], [type=submit i]) { align-content: center; } /* https://html.spec.whatwg.org/multipage/rendering.html#the-hr-element-2 - Omit presentational hints */ hr { color: gray; border-style: inset; border-width: 1px; margin-block: 0.5em; margin-inline: auto; overflow: hidden; } /* https://html.spec.whatwg.org/multipage/rendering.html#the-fieldset-and-legend-elements */ fieldset { display: block; margin-inline: 2px; border: groove 2px ThreeDFace; padding-block: 0.35em 0.625em; padding-inline: 0.75em; min-inline-size: min-content; } legend { padding-inline: 2px; } legend[align=left i] { justify-self: left; } legend[align=center i] { justify-self: center; } legend[align=right i] { justify-self: right; } /* https://html.spec.whatwg.org/multipage/rendering.html#embedded-content-rendering-rules */ iframe { border: 2px inset; } video { object-fit: contain; } /* https://html.spec.whatwg.org/multipage/rendering.html#images-3 - Omit quirks mode */ img:is([sizes="auto" i], [sizes^="auto," i]) { contain: size !important; contain-intrinsic-size: 300px 150px; } /* https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements - Omit internal shadow tree styles */ details, summary { display: block; } details > summary:first-of-type { display: list-item; counter-increment: list-item 0; list-style: disclosure-closed inside; } details[open] > summary:first-of-type { list-style-type: disclosure-open; } /* https://html.spec.whatwg.org/multipage/rendering.html#the-marquee-element-2 */ marquee { display: inline-block; text-align: initial; overflow: hidden !important; } /* https://html.spec.whatwg.org/multipage/rendering.html#the-meter-element-2 */ meter { appearance: auto; } /* https://html.spec.whatwg.org/multipage/rendering.html#the-progress-element-2 */ progress { appearance: auto; } /* https://html.spec.whatwg.org/multipage/rendering.html#the-select-element-2 - Omits base appearance, internal shadow trees, and rules conditional on the rendering mode */ option { display: block; } optgroup { display: block; font-weight: bolder; } select { display: inline-block; letter-spacing: initial; word-spacing: initial; line-height: initial; } /* https://drafts.csswg.org/css-lists-3/#marker-properties */ *|*::marker, *|*::before::marker, *|*::after::marker { unicode-bidi: isolate; font-variant-numeric: tabular-nums; white-space: pre; text-transform: none; /* Enforce marker layout restrictions at the user-agent origin. */ display: inline !important; position: static !important; float: none !important; list-style: inherit !important; } /* https://drafts.csswg.org/css-color-4/#css-system-colors */ input:not([type=button i], [type=reset i], [type=submit i], [type=color i], [type=checkbox i], [type=radio i], [type=file i], [type=hidden i], [type=image i], [type=range i]), select, textarea { background-color: Field; color: FieldText; } input:is([type=reset i], [type=button i], [type=submit i], [type=color i]), button { background-color: ButtonFace; border-color: ButtonBorder; color: ButtonText; } /* https://w3c.github.io/svgwg/svg2-draft/styling.html#UAStyleSheet */ svg|svg:not(:root), svg|image, svg|marker, svg|pattern, svg|symbol { overflow: hidden; } svg|*:not(svg|svg), svg|*:not(svg|foreignObject) > svg|svg { transform-origin: 0 0; } svg|*[xml|space=preserve] { white-space-collapse: preserve-spaces; } svg|*:link, svg|*:visited { cursor: pointer; }