diff --git a/command-line/cover/Barcode.svg b/command-line/cover/Barcode.svg
new file mode 100644
index 0000000..a2bafbd
--- /dev/null
+++ b/command-line/cover/Barcode.svg
@@ -0,0 +1,28 @@
+
+
diff --git a/command-line/cover/OHP-logo-title.svg b/command-line/cover/OHP-logo-title.svg
index 16cd0dc..6c32a35 100644
--- a/command-line/cover/OHP-logo-title.svg
+++ b/command-line/cover/OHP-logo-title.svg
@@ -13,7 +13,10 @@
version="1.1"
id="svg73"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
- sodipodi:docname="OHP-logo-title.svg">
+ sodipodi:docname="OHP-logo-title.svg"
+ inkscape:export-filename="/home/mb/Documents/clusters/projects/volumetric-regimes/volumetric-regimes-book/command-line/cover/OHP-logo-title.png"
+ inkscape:export-xdpi="96"
+ inkscape:export-ydpi="96">
@@ -43,7 +46,7 @@
image/svg+xml
-
+
@@ -59,7 +62,9 @@
transform="translate(50.534457,-46.362182)"
style="fill:#ffffff">
+ id="g845"
+ transform="translate(-1481.6219)"
+ style="fill:#ffffff">
-
- OPEN HUMANITIES PRESS
-
+
+
+ OPEN HUMANITIES PRESS
diff --git a/command-line/cover/multi-remix.svg b/command-line/cover/multi-remix.svg
new file mode 100644
index 0000000..97533e8
--- /dev/null
+++ b/command-line/cover/multi-remix.svg
@@ -0,0 +1,76 @@
+
+
diff --git a/command-line/css/baseline.css b/command-line/css/baseline.css
index c87bb8c..7cd68e4 100644
--- a/command-line/css/baseline.css
+++ b/command-line/css/baseline.css
@@ -15,5 +15,5 @@
background-size: cover;
background-repeat: repeat-y;
/* start of the first baseline: half of the line-height: 18px / 2 = 9px */
- background-position-y: 7px;
+ background-position-y: 14px;
}
\ No newline at end of file
diff --git a/command-line/css/print.css b/command-line/css/print.css
index 042575d..9878278 100644
--- a/command-line/css/print.css
+++ b/command-line/css/print.css
@@ -55,7 +55,7 @@
.column-break{
/* does not work from this stylesheet, rule gets removed by paged.js??? */
/* only worked once inserted directly into the HTML */
- break-after: column;
+ /*break-after: column; */
display: block;
}
.column-break + p{
@@ -96,8 +96,8 @@ body{
/*size: 164mm 237mm;*/ /* Size of the physical printed DB06 book */
/*size: 576px 864px;*/
size: 152mm 229mm;
- bleed: 3mm;
- /*marks: crop;*/
+ /*bleed: 3mm; */
+ /*marks: crop;*/ /* needs to stay off for the final print files */
@bottom-center{
content: counter(page);
@@ -139,7 +139,6 @@ body{
margin-top: 5mm;
}
}
-
@page:first{
/* cover */
/*background: linear-gradient(180deg, #787cc0, #c0c1e7);*/
@@ -164,7 +163,6 @@ body{
content: none;
}
}
-
@page section{
/* section title pages -- color */
/*background: linear-gradient(180deg, #3741ea, #c0c1e7);*/
@@ -179,12 +177,6 @@ body{
color: white !important;
}
}
- @page section:first{
-
- @bottom-center{
- content: none;
- }
- }
@page contribution:first{
/* exception for running-header on the first page of a contribution */
margin-top: 127px;
@@ -244,9 +236,10 @@ body{
/* sections -- page flows */
div.section{
- page: section;
/* force an extra blank page before each section ... */
page-break-before: left;
+ /* and make sure it stays empty */
+ page: nomarks;
}
div.section.intro{
/* exception for the intro section, as there is no title page for this section */
@@ -260,6 +253,7 @@ div.section{
div.section h1{
/* ... and make sure that each section starts on the right */
page-break-before: right;
+ page: section;
}
div.multi{
counter-reset: page 1;
@@ -322,21 +316,24 @@ div.backcover{
div.cover,
div.backcover{
hyphens: none;
- margin: -7.5mm 0 0 20mm;
}
div.cover,
div.cover ul li,
div.backcover b{
- font-size: 17pt;
+ font-size: var(--h2-font-size);
font-family: "bitter_semi";
- line-height: 1.4;
+ line-height: var(--h2-line-height);
letter-spacing: 0.025em;
color: white;
font-weight: bold;
}
+ div.cover{
+ max-width: 300px;
+ margin: -2.5mm 0 0 12mm; /* margin-top: 17mm, margin-left: 41mm */
+ }
div.cover ul{
padding: 0;
- margin: 2em 0;
+ margin: 1.5em 0 !important;
}
div.cover ul li{
margin-bottom: 0.1em !important;
@@ -347,6 +344,7 @@ div.backcover{
}
div.backcover{
color: white;
+ margin: -4mm 0 0 24mm; /* margin-top: 17mm, margin-left: 42mm */
}
div.backcover b{
margin-left: 0;
@@ -354,6 +352,21 @@ div.backcover{
div.backcover p{
margin-bottom: var(--line-height);
}
+ div.backcover p:first-of-type{
+ margin-bottom: 9px !important;
+ }
+ div.backcover div.barcode img{
+ position: absolute;
+ width: 45mm;
+ right: -15mm; /* margin-right: 14mm */
+ bottom: -6mm; /* margin-bottom: 16mm */
+ }
+ div.backcover div.logo-ohp img{
+ position: absolute;
+ width: 50mm;
+ left: -7mm; /* margin-left: 12mm */
+ bottom: -5.5mm; /* margin-bottom: 19mm */
+ }
div.series{
font-size: var(--small-font-size);
@@ -362,12 +375,21 @@ div.series{
}
div.series.about{
width: 50%;
+ }
+ div.series.colophon,
+ div.series.colophon div#second-column{
+ width: 48mm;
}
div.series.colophon{
- columns: 2 auto;
- column-gap: 8mm;
- column-fill: auto;
- height: 207mm;
+ /*columns: 2 auto;*/
+ /*column-gap: 8mm;*/
+ /*column-fill: auto;*/
+ /*height: 207mm;*/
+ }
+ div.series.colophon div#second-column{
+ position: absolute;
+ left: 56mm;
+ top: 0mm;
}
div.series p{
margin-bottom: var(--small-line-height);
@@ -667,11 +689,15 @@ ul > li {
div.contribution.ultrasonic-dreams li,
div.contribution.lidar li,
- div.contribution.clandestine li,
+ div.contribution.signs-of-clandestine li,
div.contribution.information-for-users li{
margin-bottom: 0 !important;
}
+ div.contribution.signs-of-clandestine ul{
+ margin-top: 0 !important;
+ }
+
div.list-without-markers{
text-indent: -0.8em !important;
}
@@ -830,7 +856,7 @@ img{
div.invasive-imagination div.thumb div.thumbcaption{
width: calc(100% - 7mm);
}
- div.invasive-imagination a[href="#File:Figure06.png"] img{
+ div.invasive-imagination a[href="#File:Figure06.jpg"] img{
width: 365px !important;
}
/* Exception for Maria Dada's images */
@@ -842,7 +868,7 @@ img{
}
div.contribution.beirut-82 div.thumb {
display: inline-block;
- margin: calc(var(--line-height) - 4px) 0 -0.5em 0 !important;
+ margin: calc(var(--line-height) - 5px) 0 -0.5em 0 !important;
}
/* Exception for So-called plants */
div.contribution.so-called-plants img{
@@ -850,9 +876,9 @@ img{
margin-left: var(--second-indent) !important;
margin-bottom: 0 !important;
}
- div.contribution.so-called-plants h4{
- margin-top: 9px !important;
- }
+ /*div.contribution.so-called-plants h4{*/
+ /*margin-top: 9px !important;*/
+ /*}*/
/*div.enlarged-image img{
width: auto !important;
@@ -865,216 +891,247 @@ img{
div[data-page-number="13"] div.thumb{
margin-top: 17px;
}
- div[data-page-number="35"] div.thumb{
+ div[data-page-number="33"] div.thumb{
margin-bottom: 14px;
}
- div[data-page-number="36"] div.thumb{
+ div[data-page-number="34"] div.thumb{
margin-top: 24px;
margin-bottom: 20px;
}
- div[data-page-number="37"] div.thumb{
+ div[data-page-number="35"] div.thumb{
margin-bottom: 20px;
}
- div[data-page-number="39"] div.thumb{
+ div[data-page-number="37"] div.thumb{
margin-bottom: 13px;
}
- div[data-page-number="40"] div.thumb{
+ div[data-page-number="38"] div.thumb{
margin-top: 20px;
margin-bottom: 20px;
}
- div[data-page-number="42"] div.thumb{
+ div[data-page-number="40"] div.thumb{
margin-bottom: 26px;
}
- div[data-page-number="43"] div.thumb{
+ div[data-page-number="41"] div.thumb{
margin-bottom: 22px;
}
- div[data-page-number="44"] div.thumb{
+ div[data-page-number="42"] div.thumb{
margin-bottom: 23px;
}
- div[data-page-number="46"] div.thumb{
+ div[data-page-number="44"] div.thumb{
margin-bottom: 17px;
}
- div[data-page-number="47"] div.thumb{
+ div[data-page-number="45"] div.thumb{
margin-top: 23px;
margin-bottom: 27px;
}
- div[data-page-number="48"] div.thumb{
+ div[data-page-number="46"] div.thumb{
margin-top: 16px;
margin-bottom: 15px;
}
- div[data-page-number="51"] div.thumb{
+ div[data-page-number="49"] div.thumb{
margin-bottom: 16px;
}
- div[data-page-number="53"] div.thumb{
+ div[data-page-number="51"] div.thumb{
margin-top: 14px;
margin-bottom: 13px;
}
- div[data-page-number="56"] div.thumb{
+ div[data-page-number="54"] div.thumb{
margin-bottom: 12px;
}
- div[data-page-number="62"] pre{
+ div[data-page-number="60"] pre{
margin-top: calc(var(--line-height) - 2px);
margin-bottom: calc(var(--line-height) - 2px);
}
- div[data-page-number="63"] div.thumb{
+ div[data-page-number="61"] div.thumb{
margin-bottom: 20px;
}
- div[data-page-number="66"] pre{
- margin-top: calc(var(--line-height) - 2px);
- margin-bottom: calc(var(--line-height) - 2px);
- }
- div[data-page-number="67"] div.thumb{
+ div[data-page-number="65"] div.thumb{
margin-bottom: 15px;
}
- div[data-page-number="72"] div.thumb{
+ div[data-page-number="70"] div.thumb{
margin-bottom: 22px;
}
- div[data-page-number="88"] img[src="./images/Figure02.png"] {
+ div[data-page-number="73"] div.thumb img{
+ width: auto;
+ max-height: 423px !important;
+ }
+ div[data-page-number="86"] img[src="./images/Figure02.jpg"] {
margin-top: -8px;
}
- div[data-page-number="101"] div.thumb{
+ div[data-page-number="88"] img[src="./images/Figure06.jpg"].thumbimage {
+ width: 365px !important; /* original size */
+ }
+ div[data-page-number="99"] div.thumb{
margin-bottom: 19px;
}
- div[data-page-number="110"] img[src="./images/File_manager_overview.png"] {
+ div[data-page-number="108"] img[src="./images/File_manager_overview.jpg"] {
margin-bottom: 11px;
}
- div[data-page-number="114"] div.thumb{
+ div[data-page-number="112"] div.thumb{
margin-bottom: 13px;
}
- div[data-page-number="118"] div.thumb{
+ div[data-page-number="116"] div.thumb{
margin-top: 22px;
margin-bottom: 21px;
}
- div[data-page-number="121"] div.thumb{
+ div[data-page-number="119"] div.thumb{
margin-top: -4px;
margin-bottom: 14px;
}
- div[data-page-number="127"] div.thumb{
+ div[data-page-number="125"] div.thumb{
margin-bottom: 20px;
}
- div[data-page-number="128"] div.thumb{
+ div[data-page-number="126"] div.thumb{
margin-top: -1px;
margin-bottom: 14px;
}
- div[data-page-number="129"] div.thumb{
+ div[data-page-number="127"] div.thumb{
margin-top: 20px;
margin-bottom: 20px;
}
- div[data-page-number="131"] div.thumb{
+ div[data-page-number="129"] div.thumb{
margin-top: 21px;
margin-bottom: 22px;
}
- div[data-page-number="134"] div.thumb{
+ div[data-page-number="132"] div.thumb{
margin-top: 19px;
margin-bottom: 21px;
}
- div[data-page-number="171"] div.thumb{
+ /*div[data-page-number="140"] div.thumb{
+ margin-top: 21px;
+ }*/
+ div[data-page-number="169"] div.thumb{
margin-bottom: 16px;
}
- div[data-page-number="178"] div.thumb{
+ div[data-page-number="176"] div.thumb{
margin-bottom: 20px;
}
- div[data-page-number="179"] div.thumb{
+ div[data-page-number="177"] div.thumb{
margin-bottom: 27px;
}
- div[data-page-number="180"] div.thumb{
+ div[data-page-number="178"] div.thumb{
margin-bottom: 26px;
}
- div[data-page-number="181"] div.thumb{
+ div[data-page-number="179"] div.thumb{
margin-bottom: 19px;
}
- div[data-page-number="182"] div.thumb{
+ div[data-page-number="180"] div.thumb{
margin-bottom: 20px;
}
- div[data-page-number="183"] div.thumb{
+ div[data-page-number="181"] div.thumb{
margin-bottom: 26px;
}
- div[data-page-number="195"] div.thumb{
- margin-top: -5px;
+ div[data-page-number="193"] div.thumb{
+ margin-top: -4px;
}
- div[data-page-number="203"] p.image{
+ div[data-page-number="201"] p.image{
margin-top: 21px;
margin-bottom: 23px;
}
- div[data-page-number="236"] div.thumb{
+ div[data-page-number="234"] div.thumb{
margin-bottom: 22px;
}
- div[data-page-number="247"] div.floatnone{
+ div[data-page-number="245"] div.floatnone{
margin-top: -6px;
}
- div[data-page-number="252"] div.floatnone{
+ div[data-page-number="250"] div.floatnone{
margin-top: 5px !important;
}
- div[data-page-number="254"] div.floatnone{
+ div[data-page-number="252"] div.floatnone{
margin-top: -7px;
}
- div[data-page-number="257"] div.floatnone{
+ div[data-page-number="255"] div.floatnone{
margin-top: -2px;
}
- div[data-page-number="279"] div.thumb{
+ div[data-page-number="277"] div.thumb{
margin-top: 21px;
}
- div[data-page-number="284"] p.image{
+ div[data-page-number="282"] p.image{
margin-top: -2px !important;
}
- div[data-page-number="285"] p.image{
- margin-bottom: 22px !important;
+ div[data-page-number="283"] p.image{
+ margin-bottom: 21px !important;
}
- div[data-page-number="287"] p.image{
- margin-bottom: 20px !important;
+ div[data-page-number="285"] p.image{
+ margin-bottom: 21px !important;
}
- div[data-page-number="292"] p.image{
+ div[data-page-number="290"] p.image{
margin-bottom: 24px !important;
}
- div[data-page-number="297"] div.thumb{
+ div[data-page-number="295"] div.thumb{
margin-top: -2px;
margin-bottom: 16px;
}
- div[data-page-number="298"] div.thumb{
+ div[data-page-number="296"] div.thumb{
margin-bottom: 20px;
}
- div[data-page-number="300"] div.thumb{
+ div[data-page-number="298"] div.thumb{
margin-top: 21px;
margin-bottom: 20px;
}
- div[data-page-number="305"] div.thumb{
- margin-bottom: 20px;
+ div[data-page-number="303"] div.thumb{
+ margin-bottom: 19px;
}
- div[data-page-number="308"] div.thumb{
+ div[data-page-number="306"] div.thumb{
margin-top: 19px;
- margin-bottom: 20px;
+ margin-bottom: 21px;
}
.contribution.so-called-plants div.floatnone + p{
margin-left: var(--second-indent) !important;
text-indent: unset !important;
}
-pre{
+pre {
/* BITTER VERSION */
font-family: "bitter";
- font-size: var(--font-size);
- line-height: var(--line-height);
+ font-size: var(--small-font-size);
+ line-height: var(--small-line-height);
hyphens: none;
white-space: pre-line;
- margin: calc(var(--line-height) - 1px) 0 calc(var(--line-height) - 1px) var(--second-indent);
- border: 1px solid rgb(220,220,220);
- padding: calc(var(--line-height) / 2) var(--line-height);
+ margin: 12px 0 12px var(--second-indent);
page-break-inside: avoid;
}
+ /* BASELINE TWEAKING PRE's */
+ div[data-page-number="69"] pre {
+ margin-top: 16px !important;
+ margin-bottom: 17px !important;
+ }
+ div[data-page-number="243"] pre {
+ margin-top: 16px !important;
+ margin-bottom: 16px !important;
+ }
+ div[data-page-number="245"] pre {
+ margin-top: 14px !important;
+ margin-bottom: 15px !important;
+ }
+ div[data-page-number="251"] pre {
+ margin-top: 18px !important;
+ margin-bottom: 19px !important;
+ }
+ div[data-page-number="253"] pre {
+ margin-top: 19px !important;
+ margin-bottom: 21px !important;
+ }
+ div[data-page-number="256"] pre {
+ margin-top: 16px !important;
+ margin-bottom: 17px !important;
+ }
div.quote > pre{
border: none;
padding: 0;
page-break-inside: unset;
+ font-size: var(--font-size) !important;
font-style: italic;
white-space: pre-line;
word-wrap: break-word;
- line-height: var(--line-height);
- margin-bottom: var(--line-height);
+ line-height: var(--line-height) !important;
+ margin-top: var(--line-height) !important;
+ margin-bottom: var(--line-height) !important;
}
- div.contribution.so-called-plants pre{
+ /*div.contribution.so-called-plants pre{
margin-top: 9px;
margin-bottom: 15px;
- }
+ }*/
blockquote{
margin: 0 0 0 var(--second-indent);
font-style: italic;
diff --git a/command-line/js/paged.polyfill.js b/command-line/js/paged.polyfill.js
index c984974..3298221 100644
--- a/command-line/js/paged.polyfill.js
+++ b/command-line/js/paged.polyfill.js
@@ -1,22 +1,18 @@
/**
- * @license Paged.js v0.1.43 | MIT | https://gitlab.pagedmedia.org/tools/pagedjs
+ * @license Paged.js v0.3.5 | MIT | https://gitlab.pagedmedia.org/tools/pagedjs
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
- (global = global || self, global.PagedPolyfill = factory());
-}(this, (function () { 'use strict';
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.PagedPolyfill = factory());
+})(this, (function () { 'use strict';
- function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
- }
+ var eventEmitter = {exports: {}};
- function getCjsExportFromNamespace (n) {
- return n && n['default'] || n;
- }
+ var d$3 = {exports: {}};
- var isImplemented = function () {
+ var isImplemented$6 = function () {
var assign = Object.assign, obj;
if (typeof assign !== "function") return false;
obj = { foo: "raz" };
@@ -24,7 +20,7 @@
return (obj.foo + obj.bar + obj.trzy) === "razdwatrzy";
};
- var isImplemented$1 = function () {
+ var isImplemented$5 = function () {
try {
Object.keys("primitive");
return true;
@@ -34,34 +30,40 @@
};
// eslint-disable-next-line no-empty-function
- var noop = function () {};
+ var noop$4 = function () {};
- var _undefined = noop(); // Support ES3 engines
+ var _undefined = noop$4(); // Support ES3 engines
- var isValue = function (val) {
+ var isValue$5 = function (val) {
return (val !== _undefined) && (val !== null);
};
- var keys = Object.keys;
+ var isValue$4 = isValue$5;
- var shim = function (object) {
- return keys(isValue(object) ? Object(object) : object);
+ var keys$2 = Object.keys;
+
+ var shim$5 = function (object) {
+ return keys$2(isValue$4(object) ? Object(object) : object);
};
- var keys$1 = isImplemented$1()
+ var keys$1 = isImplemented$5()
? Object.keys
- : shim;
+ : shim$5;
+
+ var isValue$3 = isValue$5;
- var validValue = function (value) {
- if (!isValue(value)) throw new TypeError("Cannot use null or undefined");
+ var validValue$1 = function (value) {
+ if (!isValue$3(value)) throw new TypeError("Cannot use null or undefined");
return value;
};
- var max = Math.max;
+ var keys = keys$1
+ , value$3 = validValue$1
+ , max$1 = Math.max;
- var shim$1 = function (dest, src /*, …srcn*/) {
- var error, i, length = max(arguments.length, 2), assign;
- dest = Object(validValue(dest));
+ var shim$4 = function (dest, src /*, …srcn*/) {
+ var error, i, length = max$1(arguments.length, 2), assign;
+ dest = Object(value$3(dest));
assign = function (key) {
try {
dest[key] = src[key];
@@ -71,17 +73,19 @@
};
for (i = 1; i < length; ++i) {
src = arguments[i];
- keys$1(src).forEach(assign);
+ keys(src).forEach(assign);
}
if (error !== undefined) throw error;
return dest;
};
- var assign = isImplemented()
+ var assign$2 = isImplemented$6()
? Object.assign
- : shim$1;
+ : shim$4;
- var forEach = Array.prototype.forEach, create = Object.create;
+ var isValue$2 = isValue$5;
+
+ var forEach$1 = Array.prototype.forEach, create$6 = Object.create;
var process = function (src, obj) {
var key;
@@ -90,42 +94,43 @@
// eslint-disable-next-line no-unused-vars
var normalizeOptions = function (opts1 /*, …options*/) {
- var result = create(null);
- forEach.call(arguments, function (options) {
- if (!isValue(options)) return;
+ var result = create$6(null);
+ forEach$1.call(arguments, function (options) {
+ if (!isValue$2(options)) return;
process(Object(options), result);
});
return result;
};
- // Deprecated
-
- var isCallable = function (obj) {
+ var isCallable$1 = function (obj) {
return typeof obj === "function";
};
var str = "razdwatrzy";
- var isImplemented$2 = function () {
+ var isImplemented$4 = function () {
if (typeof str.contains !== "function") return false;
return (str.contains("dwa") === true) && (str.contains("foo") === false);
};
- var indexOf = String.prototype.indexOf;
+ var indexOf$3 = String.prototype.indexOf;
- var shim$2 = function (searchString/*, position*/) {
- return indexOf.call(this, searchString, arguments[1]) > -1;
+ var shim$3 = function (searchString/*, position*/) {
+ return indexOf$3.call(this, searchString, arguments[1]) > -1;
};
- var contains = isImplemented$2()
+ var contains$1 = isImplemented$4()
? String.prototype.contains
- : shim$2;
+ : shim$3;
- var d_1 = createCommonjsModule(function (module) {
+ var assign$1 = assign$2
+ , normalizeOpts = normalizeOptions
+ , isCallable = isCallable$1
+ , contains = contains$1
- var d;
+ , d$2;
- d = module.exports = function (dscr, value/*, options*/) {
+ d$2 = d$3.exports = function (dscr, value/*, options*/) {
var c, e, w, options, desc;
if ((arguments.length < 2) || (typeof dscr !== 'string')) {
options = value;
@@ -144,10 +149,10 @@
}
desc = { value: value, configurable: c, enumerable: e, writable: w };
- return !options ? desc : assign(normalizeOptions(options), desc);
+ return !options ? desc : assign$1(normalizeOpts(options), desc);
};
- d.gs = function (dscr, get, set/*, options*/) {
+ d$2.gs = function (dscr, get, set/*, options*/) {
var c, e, options, desc;
if (typeof dscr !== 'string') {
options = set;
@@ -177,18 +182,20 @@
}
desc = { get: get, set: set, configurable: c, enumerable: e };
- return !options ? desc : assign(normalizeOptions(options), desc);
+ return !options ? desc : assign$1(normalizeOpts(options), desc);
};
- });
var validCallable = function (fn) {
if (typeof fn !== "function") throw new TypeError(fn + " is not a function");
return fn;
};
- var eventEmitter = createCommonjsModule(function (module, exports) {
+ (function (module, exports) {
+
+ var d = d$3.exports
+ , callable = validCallable
- var apply = Function.prototype.apply, call = Function.prototype.call
+ , apply = Function.prototype.apply, call = Function.prototype.call
, create = Object.create, defineProperty = Object.defineProperty
, defineProperties = Object.defineProperties
, hasOwnProperty = Object.prototype.hasOwnProperty
@@ -199,7 +206,7 @@
on = function (type, listener) {
var data;
- validCallable(listener);
+ callable(listener);
if (!hasOwnProperty.call(this, '__ee__')) {
data = descriptor.value = create(null);
@@ -218,7 +225,7 @@
once = function (type, listener) {
var once, self;
- validCallable(listener);
+ callable(listener);
self = this;
on.call(this, type, once = function () {
off.call(self, type, once);
@@ -232,7 +239,7 @@
off = function (type, listener) {
var data, listeners, candidate, i;
- validCallable(listener);
+ callable(listener);
if (!hasOwnProperty.call(this, '__ee__')) return this;
data = this.__ee__;
@@ -303,10 +310,10 @@
};
descriptors = {
- on: d_1(on),
- once: d_1(once),
- off: d_1(off),
- emit: d_1(emit)
+ on: d(on),
+ once: d(once),
+ off: d(off),
+ emit: d(emit)
};
base = defineProperties({}, descriptors);
@@ -315,8 +322,9 @@
return (o == null) ? create(base) : defineProperties(Object(o), descriptors);
};
exports.methods = methods;
- });
- var eventEmitter_1 = eventEmitter.methods;
+ }(eventEmitter, eventEmitter.exports));
+
+ var EventEmitter = eventEmitter.exports;
/**
* Hooks allow for injecting functions that must all complete in order before finishing
@@ -366,11 +374,12 @@
if(executing && typeof executing["then"] === "function") {
// Task is a function that returns a promise
promises.push(executing);
+ } else {
+ // Otherwise Task resolves immediately, add resolved promise with result
+ promises.push(new Promise((resolve, reject) => {
+ resolve(executing);
+ }));
}
- // Otherwise Task resolves immediately, add resolved promise with result
- promises.push(new Promise((resolve, reject) => {
- resolve(executing);
- }));
});
@@ -591,7 +600,7 @@
return node && node.nodeType === 3;
}
- function *walk(start, limiter) {
+ function* walk$2(start, limiter) {
let node = start;
while (node) {
@@ -712,6 +721,41 @@
let fragment = document.createDocumentFragment();
+ // Handle rowspan on table
+ if (node.nodeName === "TR") {
+ let previousRow = node.previousElementSibling;
+ let previousRowDistance = 1;
+ while (previousRow) {
+ // previous row has more columns, might indicate a rowspan.
+ if (previousRow.childElementCount > node.childElementCount) {
+ const initialColumns = Array.from(node.children);
+ while (node.firstChild) {
+ node.firstChild.remove();
+ }
+ let k = 0;
+ for (let j = 0; j < previousRow.children.length; j++) {
+ let column = previousRow.children[j];
+ if (column.rowSpan && column.rowSpan > previousRowDistance) {
+ const duplicatedColumn = column.cloneNode(true);
+ // Adjust rowspan value
+ duplicatedColumn.rowSpan = column.rowSpan - previousRowDistance;
+ // Add the column to the row
+ node.appendChild(duplicatedColumn);
+ } else {
+ // Fill the gap with the initial columns (if exists)
+ const initialColumn = initialColumns[k++];
+ // The initial column can be undefined if the newly created table has less columns than the original table
+ if (initialColumn) {
+ node.appendChild(initialColumn);
+ }
+ }
+ }
+ }
+ previousRow = previousRow.previousElementSibling;
+ previousRowDistance++;
+ }
+ }
+
// Gather all ancestors
let element = node;
while(element.parentNode && element.parentNode.nodeType === 1) {
@@ -844,8 +888,20 @@
if (node.dataset && node.dataset.undisplayed) {
return false;
}
- const previousSignificantNodePage = previousSignificantNode.dataset ? previousSignificantNode.dataset.page : undefined;
- const currentNodePage = node.dataset ? node.dataset.page : undefined;
+ let previousSignificantNodePage = previousSignificantNode.dataset ? previousSignificantNode.dataset.page : undefined;
+ if (typeof previousSignificantNodePage === "undefined") {
+ const nodeWithNamedPage = getNodeWithNamedPage(previousSignificantNode);
+ if (nodeWithNamedPage) {
+ previousSignificantNodePage = nodeWithNamedPage.dataset.page;
+ }
+ }
+ let currentNodePage = node.dataset ? node.dataset.page : undefined;
+ if (typeof currentNodePage === "undefined") {
+ const nodeWithNamedPage = getNodeWithNamedPage(node, previousSignificantNode);
+ if (nodeWithNamedPage) {
+ currentNodePage = nodeWithNamedPage.dataset.page;
+ }
+ }
return currentNodePage !== previousSignificantNodePage;
}
@@ -856,10 +912,11 @@
let currentLetter;
let range;
+ const significantWhitespaces = node.parentElement && node.parentElement.nodeName === "PRE";
- while(currentOffset < max) {
+ while (currentOffset < max) {
currentLetter = currentText[currentOffset];
- if (/^[\S\u202F\u00A0]$/.test(currentLetter)) {
+ if (/^[\S\u202F\u00A0]$/.test(currentLetter) || significantWhitespaces) {
if (!range) {
range = document.createRange();
range.setStart(node, currentOffset);
@@ -878,7 +935,6 @@
if (range) {
range.setEnd(node, currentOffset);
yield range;
- range = undefined;
}
}
@@ -982,7 +1038,11 @@
}
function findRef(ref, doc) {
- return doc.querySelector(`[data-ref='${ref}']`);
+ if (doc.indexOfRefs && doc.indexOfRefs[ref]) {
+ return doc.indexOfRefs[ref];
+ } else {
+ return doc.querySelector(`[data-ref='${ref}']`);
+ }
}
function validNode(node) {
@@ -1014,7 +1074,7 @@
}
- function indexOf$1(node) {
+ function indexOf$2(node) {
let parent = node.parentNode;
if (!parent) {
return 0;
@@ -1113,6 +1173,23 @@
return null;
}
+ function getNodeWithNamedPage(node, limiter) {
+ if (node && node.dataset && node.dataset.page) {
+ return node;
+ }
+ if (node.parentNode) {
+ while ((node = node.parentNode)) {
+ if (limiter && node === limiter) {
+ return;
+ }
+ if (node.dataset && node.dataset.page) {
+ return node;
+ }
+ }
+ }
+ return null;
+ }
+
function breakInsideAvoidParentNode(node) {
while ((node = node.parentNode)) {
if (node && node.dataset && node.dataset.breakInside === "avoid") {
@@ -1209,6 +1286,25 @@
}
+ /**
+ * Render result.
+ * @class
+ */
+ class RenderResult {
+
+ constructor(breakToken, error) {
+ this.breakToken = breakToken;
+ this.error = error;
+ }
+ }
+
+ class OverflowContentError extends Error {
+ constructor(message, items) {
+ super(message);
+ this.items = items;
+ }
+ }
+
const MAX_CHARS_PER_BREAK = 1500;
/**
@@ -1231,6 +1327,7 @@
this.hooks.layoutNode = new Hook();
this.hooks.beforeOverflow = new Hook();
this.hooks.onOverflow = new Hook();
+ this.hooks.afterOverflowRemoved = new Hook();
this.hooks.onBreakToken = new Hook();
}
@@ -1242,7 +1339,7 @@
async renderTo(wrapper, source, breakToken, bounds = this.bounds) {
let start = this.getStart(source, breakToken);
- let walker = walk(start, source);
+ let walker = walk$2(start, source);
let node;
let prevNode;
@@ -1274,15 +1371,15 @@
if (newBreakToken && newBreakToken.equals(prevBreakToken)) {
console.warn("Unable to layout item: ", prevNode);
- return undefined;
+ return new RenderResult(undefined, new OverflowContentError("Unable to layout item", [prevNode]));
}
- return newBreakToken;
+ return new RenderResult(newBreakToken);
}
this.hooks && this.hooks.layoutNode.trigger(node);
// Check if the rendered element has a break set
- if (hasRenderedContent && this.shouldBreak(node)) {
+ if (hasRenderedContent && this.shouldBreak(node, start)) {
this.hooks && this.hooks.layout.trigger(wrapper, this);
let imgs = wrapper.querySelectorAll("img");
@@ -1298,7 +1395,7 @@
if (newBreakToken && newBreakToken.equals(prevBreakToken)) {
console.warn("Unable to layout item: ", node);
- return undefined;
+ return new RenderResult(undefined, new OverflowContentError("Unable to layout item", [node]));
}
length = 0;
@@ -1320,7 +1417,7 @@
// Skip to the next node if a deep clone was rendered
if (!shallow) {
- walker = walk(nodeAfter(node, source), source);
+ walker = walk$2(nodeAfter(node, source), source);
}
if (this.forceRenderBreak) {
@@ -1352,7 +1449,7 @@
if (newBreakToken && newBreakToken.equals(prevBreakToken)) {
console.warn("Unable to layout item: ", node);
- return undefined;
+ return new RenderResult(undefined, new OverflowContentError("Unable to layout item", [node]));
}
if (newBreakToken) {
@@ -1362,7 +1459,7 @@
}
- return newBreakToken;
+ return new RenderResult(newBreakToken);
}
breakAt(node, offset = 0) {
@@ -1380,17 +1477,17 @@
return newBreakToken;
}
- shouldBreak(node) {
- let previousSibling = previousSignificantNode(node);
+ shouldBreak(node, limiter) {
+ let previousNode = nodeBefore(node, limiter);
let parentNode = node.parentNode;
- let parentBreakBefore = needsBreakBefore(node) && parentNode && !previousSibling && needsBreakBefore(parentNode);
+ let parentBreakBefore = needsBreakBefore(node) && parentNode && !previousNode && needsBreakBefore(parentNode);
let doubleBreakBefore;
if (parentBreakBefore) {
doubleBreakBefore = node.dataset.breakBefore === parentNode.dataset.breakBefore;
}
- return !doubleBreakBefore && needsBreakBefore(node) || needsPreviousBreakAfter(node) || needsPageBreak(node, previousSibling);
+ return !doubleBreakBefore && needsBreakBefore(node) || needsPreviousBreakAfter(node) || needsPageBreak(node, previousNode);
}
forceBreak() {
@@ -1441,6 +1538,13 @@
dest.appendChild(clone);
}
+ if (clone.dataset && clone.dataset.ref) {
+ if (!dest.indexOfRefs) {
+ dest.indexOfRefs = {};
+ }
+ dest.indexOfRefs[clone.dataset.ref] = clone;
+ }
+
let nodeHooks = this.hooks.renderNode.triggerSync(clone, node, this);
nodeHooks.forEach((newNode) => {
if (typeof newNode != "undefined") {
@@ -1620,7 +1724,8 @@
}
if (breakToken && breakToken.node && extract) {
- this.removeOverflow(overflow, breakLetter);
+ let removed = this.removeOverflow(overflow, breakLetter);
+ this.hooks && this.hooks.afterOverflowRemoved.trigger(removed, rendered, this);
}
}
@@ -1641,7 +1746,7 @@
let end = Math.round(bounds.right);
let range;
- let walker = walk(rendered.firstChild, rendered);
+ let walker = walk$2(rendered.firstChild, rendered);
// Find Start
let next, done, node, offset, skip, breakAvoid, prev, br;
@@ -1677,6 +1782,47 @@
br = node.tagName === "BR" || node.tagName === "WBR";
}
+ let tableRow;
+ if (node.nodeName === "TR") {
+ tableRow = node;
+ } else {
+ tableRow = parentOf(node, "TR", rendered);
+ }
+ if (tableRow) {
+ // honor break-inside="avoid" in parent tbody/thead
+ let container = tableRow.parentElement;
+ if (["TBODY", "THEAD"].includes(container.nodeName)) {
+ let styles = window.getComputedStyle(container);
+ if (styles.getPropertyValue("break-inside") === "avoid") prev = container;
+ }
+
+ // Check if the node is inside a row with a rowspan
+ const table = parentOf(tableRow, "TABLE", rendered);
+ if (table) {
+ let columnCount = 0;
+ for (const cell of Array.from(table.rows[0].cells)) {
+ columnCount += parseInt(cell.getAttribute("COLSPAN") || "1");
+ }
+ if (tableRow.cells.length !== columnCount) {
+ let previousRow = tableRow.previousElementSibling;
+ let previousRowColumnCount;
+ while (previousRow !== null) {
+ previousRowColumnCount = 0;
+ for (const cell of Array.from(previousRow.cells)) {
+ previousRowColumnCount += parseInt(cell.getAttribute("COLSPAN") || "1");
+ }
+ if (previousRowColumnCount === columnCount) {
+ break;
+ }
+ previousRow = previousRow.previousElementSibling;
+ }
+ if (previousRowColumnCount === columnCount) {
+ prev = previousRow;
+ }
+ }
+ }
+ }
+
if (prev) {
range = document.createRange();
range.selectNode(prev);
@@ -1727,7 +1873,7 @@
if (skip || right <= end) {
next = nodeAfter(node, rendered);
if (next) {
- walker = walk(next, rendered);
+ walker = walk$2(next, rendered);
}
}
@@ -1767,7 +1913,7 @@
if (isText(lastChild)) {
if (lastChild.parentNode.dataset.ref) {
- lastNodeIndex = indexOf$1(lastChild);
+ lastNodeIndex = indexOf$2(lastChild);
lastChild = lastChild.parentNode;
} else {
lastChild = lastChild.previousSibling;
@@ -1879,14 +2025,14 @@
}
}
- eventEmitter(Layout.prototype);
+ EventEmitter(Layout.prototype);
/**
* Render a page
* @class
*/
class Page {
- constructor(pagesArea, pageTemplate, blank, hooks) {
+ constructor(pagesArea, pageTemplate, blank, hooks, options) {
this.pagesArea = pagesArea;
this.pageTemplate = pageTemplate;
this.blank = blank;
@@ -1896,6 +2042,8 @@
this.hooks = hooks;
+ this.settings = options || {};
+
// this.element = this.create(this.pageTemplate);
}
@@ -1916,6 +2064,7 @@
let pagebox = page.querySelector(".pagedjs_pagebox");
let area = page.querySelector(".pagedjs_page_content");
+ let footnotesArea = page.querySelector(".pagedjs_footnote_area");
let size = area.getBoundingClientRect();
@@ -1931,6 +2080,7 @@
this.element = page;
this.pagebox = pagebox;
this.area = area;
+ this.footnotesArea = footnotesArea;
return page;
}
@@ -2003,10 +2153,16 @@
this.startToken = breakToken;
- this.layoutMethod = new Layout(this.area, this.hooks, maxChars);
+ let settings = this.settings;
+ if (!settings.maxChars && maxChars) {
+ settings.maxChars = maxChars;
+ }
+
+ this.layoutMethod = new Layout(this.area, this.hooks, settings);
+
+ let renderResult = await this.layoutMethod.renderTo(this.wrapper, contents, breakToken);
+ let newBreakToken = renderResult.breakToken;
- let newBreakToken = await this.layoutMethod.renderTo(this.wrapper, contents, breakToken);
-
this.addListeners(contents);
this.endToken = newBreakToken;
@@ -2020,7 +2176,8 @@
return this.layout(contents, breakToken);
}
- let newBreakToken = await this.layoutMethod.renderTo(this.wrapper, contents, breakToken);
+ let renderResult = await this.layoutMethod.renderTo(this.wrapper, contents, breakToken);
+ let newBreakToken = renderResult.breakToken;
this.endToken = newBreakToken;
@@ -2151,7 +2308,7 @@
}
}
- eventEmitter(Page.prototype);
+ EventEmitter(Page.prototype);
/**
* Render a flow of text offscreen
@@ -2499,6 +2656,11 @@
@@ -2523,6 +2685,7 @@
this.hooks.renderNode = new Hook(this);
this.hooks.layoutNode = new Hook(this);
this.hooks.onOverflow = new Hook(this);
+ this.hooks.afterOverflowRemoved = new Hook(this);
this.hooks.onBreakToken = new Hook();
this.hooks.afterPageLayout = new Hook(this);
this.hooks.afterRendered = new Hook(this);
@@ -2631,7 +2794,7 @@
// }
async render(parsed, startAt) {
- let renderer = this.layout(parsed, startAt, this.settings);
+ let renderer = this.layout(parsed, startAt);
let done = false;
let result;
@@ -2681,7 +2844,7 @@
}
}
- async handleBreaks(node) {
+ async handleBreaks(node, force) {
let currentPage = this.total + 1;
let currentPosition = currentPage % 2 === 0 ? "left" : "right";
// TODO: Recto and Verso should reverse for rtl languages
@@ -2706,7 +2869,9 @@
breakBefore = node.dataset.breakBefore;
}
- if( previousBreakAfter &&
+ if (force) {
+ page = this.addPage(true);
+ } else if( previousBreakAfter &&
(previousBreakAfter === "left" || previousBreakAfter === "right") &&
previousBreakAfter !== currentPosition) {
page = this.addPage(true);
@@ -2736,7 +2901,7 @@
async *layout(content, startAt) {
let breakToken = startAt || false;
- while (breakToken !== undefined && ( true)) {
+ while (breakToken !== undefined && (true)) {
if (breakToken && breakToken.node) {
await this.handleBreaks(breakToken.node);
@@ -2803,7 +2968,7 @@
addPage(blank) {
let lastPage = this.pages[this.pages.length - 1];
// Create a new page from the template
- let page = new Page(this.pagesArea, this.pageTemplate, blank, this.hooks);
+ let page = new Page(this.pagesArea, this.pageTemplate, blank, this.hooks, this.settings);
this.pages.push(page);
@@ -2901,7 +3066,30 @@
}
*/
+ async clonePage(originalPage) {
+ let lastPage = this.pages[this.pages.length - 1];
+
+ let page = new Page(this.pagesArea, this.pageTemplate, false, this.hooks);
+
+ this.pages.push(page);
+
+ // Create the pages
+ page.create(undefined, lastPage && lastPage.element);
+
+ page.index(this.total);
+
+ await this.hooks.beforePageLayout.trigger(page, undefined, undefined, this);
+ this.emit("page", page);
+
+ for (const className of originalPage.element.classList) {
+ if (className !== "pagedjs_left_page" && className !== "pagedjs_right_page") {
+ page.element.classList.add(className);
+ }
+ }
+ await this.hooks.afterPageLayout.trigger(page.element, page, undefined, this);
+ this.emit("renderedPage", page);
+ }
loadFonts() {
let fontPromises = [];
@@ -2928,7 +3116,11 @@
}
- eventEmitter(Chunker.prototype);
+ EventEmitter(Chunker.prototype);
+
+ var syntax = {exports: {}};
+
+ var create$5 = {};
//
// list
@@ -2987,16 +3179,16 @@
}
var cursors = null;
- var List = function() {
+ var List$6 = function() {
this.cursor = null;
this.head = null;
this.tail = null;
};
- List.createItem = createItem;
- List.prototype.createItem = createItem;
+ List$6.createItem = createItem;
+ List$6.prototype.createItem = createItem;
- List.prototype.updateCursors = function(prevOld, prevNew, nextOld, nextNew) {
+ List$6.prototype.updateCursors = function(prevOld, prevNew, nextOld, nextNew) {
var cursor = this.cursor;
while (cursor !== null) {
@@ -3012,7 +3204,7 @@
}
};
- List.prototype.getSize = function() {
+ List$6.prototype.getSize = function() {
var size = 0;
var cursor = this.head;
@@ -3024,7 +3216,7 @@
return size;
};
- List.prototype.fromArray = function(array) {
+ List$6.prototype.fromArray = function(array) {
var cursor = null;
this.head = null;
@@ -3047,7 +3239,7 @@
return this;
};
- List.prototype.toArray = function() {
+ List$6.prototype.toArray = function() {
var cursor = this.head;
var result = [];
@@ -3059,21 +3251,21 @@
return result;
};
- List.prototype.toJSON = List.prototype.toArray;
+ List$6.prototype.toJSON = List$6.prototype.toArray;
- List.prototype.isEmpty = function() {
+ List$6.prototype.isEmpty = function() {
return this.head === null;
};
- List.prototype.first = function() {
+ List$6.prototype.first = function() {
return this.head && this.head.data;
};
- List.prototype.last = function() {
+ List$6.prototype.last = function() {
return this.tail && this.tail.data;
};
- List.prototype.each = function(fn, context) {
+ List$6.prototype.each = function(fn, context) {
var item;
if (context === undefined) {
@@ -3094,9 +3286,9 @@
releaseCursor(this);
};
- List.prototype.forEach = List.prototype.each;
+ List$6.prototype.forEach = List$6.prototype.each;
- List.prototype.eachRight = function(fn, context) {
+ List$6.prototype.eachRight = function(fn, context) {
var item;
if (context === undefined) {
@@ -3117,9 +3309,57 @@
releaseCursor(this);
};
- List.prototype.forEachRight = List.prototype.eachRight;
+ List$6.prototype.forEachRight = List$6.prototype.eachRight;
+
+ List$6.prototype.reduce = function(fn, initialValue, context) {
+ var item;
+
+ if (context === undefined) {
+ context = this;
+ }
+
+ // push cursor
+ var cursor = allocateCursor(this, null, this.head);
+ var acc = initialValue;
+
+ while (cursor.next !== null) {
+ item = cursor.next;
+ cursor.next = item.next;
+
+ acc = fn.call(context, acc, item.data, item, this);
+ }
+
+ // pop cursor
+ releaseCursor(this);
+
+ return acc;
+ };
+
+ List$6.prototype.reduceRight = function(fn, initialValue, context) {
+ var item;
+
+ if (context === undefined) {
+ context = this;
+ }
+
+ // push cursor
+ var cursor = allocateCursor(this, this.tail, null);
+ var acc = initialValue;
+
+ while (cursor.prev !== null) {
+ item = cursor.prev;
+ cursor.prev = item.prev;
+
+ acc = fn.call(context, acc, item.data, item, this);
+ }
+
+ // pop cursor
+ releaseCursor(this);
+
+ return acc;
+ };
- List.prototype.nextUntil = function(start, fn, context) {
+ List$6.prototype.nextUntil = function(start, fn, context) {
if (start === null) {
return;
}
@@ -3146,7 +3386,7 @@
releaseCursor(this);
};
- List.prototype.prevUntil = function(start, fn, context) {
+ List$6.prototype.prevUntil = function(start, fn, context) {
if (start === null) {
return;
}
@@ -3173,7 +3413,7 @@
releaseCursor(this);
};
- List.prototype.some = function(fn, context) {
+ List$6.prototype.some = function(fn, context) {
var cursor = this.head;
if (context === undefined) {
@@ -3191,8 +3431,8 @@
return false;
};
- List.prototype.map = function(fn, context) {
- var result = new List();
+ List$6.prototype.map = function(fn, context) {
+ var result = new List$6();
var cursor = this.head;
if (context === undefined) {
@@ -3207,8 +3447,8 @@
return result;
};
- List.prototype.filter = function(fn, context) {
- var result = new List();
+ List$6.prototype.filter = function(fn, context) {
+ var result = new List$6();
var cursor = this.head;
if (context === undefined) {
@@ -3225,13 +3465,13 @@
return result;
};
- List.prototype.clear = function() {
+ List$6.prototype.clear = function() {
this.head = null;
this.tail = null;
};
- List.prototype.copy = function() {
- var result = new List();
+ List$6.prototype.copy = function() {
+ var result = new List$6();
var cursor = this.head;
while (cursor !== null) {
@@ -3242,7 +3482,7 @@
return result;
};
- List.prototype.prepend = function(item) {
+ List$6.prototype.prepend = function(item) {
// head
// ^
// item
@@ -3267,19 +3507,19 @@
return this;
};
- List.prototype.prependData = function(data) {
+ List$6.prototype.prependData = function(data) {
return this.prepend(createItem(data));
};
- List.prototype.append = function(item) {
+ List$6.prototype.append = function(item) {
return this.insert(item);
};
- List.prototype.appendData = function(data) {
+ List$6.prototype.appendData = function(data) {
return this.insert(createItem(data));
};
- List.prototype.insert = function(item, before) {
+ List$6.prototype.insert = function(item, before) {
if (before !== undefined && before !== null) {
// prev before
// ^
@@ -3334,11 +3574,11 @@
return this;
};
- List.prototype.insertData = function(data, before) {
+ List$6.prototype.insertData = function(data, before) {
return this.insert(createItem(data), before);
};
- List.prototype.remove = function(item) {
+ List$6.prototype.remove = function(item) {
// item
// ^
// prev next
@@ -3370,35 +3610,35 @@
return item;
};
- List.prototype.push = function(data) {
+ List$6.prototype.push = function(data) {
this.insert(createItem(data));
};
- List.prototype.pop = function() {
+ List$6.prototype.pop = function() {
if (this.tail !== null) {
return this.remove(this.tail);
}
};
- List.prototype.unshift = function(data) {
+ List$6.prototype.unshift = function(data) {
this.prepend(createItem(data));
};
- List.prototype.shift = function() {
+ List$6.prototype.shift = function() {
if (this.head !== null) {
return this.remove(this.head);
}
};
- List.prototype.prependList = function(list) {
+ List$6.prototype.prependList = function(list) {
return this.insertList(list, this.head);
};
- List.prototype.appendList = function(list) {
+ List$6.prototype.appendList = function(list) {
return this.insertList(list);
};
- List.prototype.insertList = function(list, before) {
+ List$6.prototype.insertList = function(list, before) {
// ignore empty lists
if (list.head === null) {
return this;
@@ -3447,7 +3687,7 @@
return this;
};
- List.prototype.replace = function(oldItem, newItemOrList) {
+ List$6.prototype.replace = function(oldItem, newItemOrList) {
if ('head' in newItemOrList) {
this.insertList(newItemOrList, oldItem);
} else {
@@ -3457,9 +3697,9 @@
this.remove(oldItem);
};
- var List_1 = List;
+ var List_1 = List$6;
- var createCustomError = function createCustomError(name, message) {
+ var createCustomError$3 = function createCustomError(name, message) {
// use Object.create(), because some VMs prevent setting line/column otherwise
// (iOS Safari 10 even throws an exception)
var error = Object.create(SyntaxError.prototype);
@@ -3477,6 +3717,7 @@
return error;
};
+ var createCustomError$2 = createCustomError$3;
var MAX_LINE_LENGTH = 100;
var OFFSET_CORRECTION = 60;
var TAB_REPLACEMENT = ' ';
@@ -3527,8 +3768,8 @@
].filter(Boolean).join('\n');
}
- var SyntaxError$1 = function(message, source, offset, line, column) {
- var error = createCustomError('SyntaxError', message);
+ var SyntaxError$4 = function(message, source, offset, line, column) {
+ var error = createCustomError$2('SyntaxError', message);
error.source = source;
error.offset = offset;
@@ -3557,11 +3798,11 @@
return error;
};
- var _SyntaxError = SyntaxError$1;
+ var _SyntaxError$1 = SyntaxError$4;
// CSS Syntax Module Level 3
// https://www.w3.org/TR/css-syntax-3/
- var TYPE = {
+ var TYPE$H = {
EOF: 0, //
Ident: 1, //
Function: 2, //
@@ -3590,33 +3831,33 @@
Comment: 25
};
- var NAME = Object.keys(TYPE).reduce(function(result, key) {
- result[TYPE[key]] = key;
+ var NAME$3 = Object.keys(TYPE$H).reduce(function(result, key) {
+ result[TYPE$H[key]] = key;
return result;
}, {});
var _const = {
- TYPE: TYPE,
- NAME: NAME
+ TYPE: TYPE$H,
+ NAME: NAME$3
};
- var EOF = 0;
+ var EOF$1 = 0;
// https://drafts.csswg.org/css-syntax-3/
// § 4.2. Definitions
// digit
// A code point between U+0030 DIGIT ZERO (0) and U+0039 DIGIT NINE (9).
- function isDigit(code) {
+ function isDigit$5(code) {
return code >= 0x0030 && code <= 0x0039;
}
// hex digit
// A digit, or a code point between U+0041 LATIN CAPITAL LETTER A (A) and U+0046 LATIN CAPITAL LETTER F (F),
// or a code point between U+0061 LATIN SMALL LETTER A (a) and U+0066 LATIN SMALL LETTER F (f).
- function isHexDigit(code) {
+ function isHexDigit$4(code) {
return (
- isDigit(code) || // 0 .. 9
+ isDigit$5(code) || // 0 .. 9
(code >= 0x0041 && code <= 0x0046) || // A .. F
(code >= 0x0061 && code <= 0x0066) // a .. f
);
@@ -3624,7 +3865,7 @@
// uppercase letter
// A code point between U+0041 LATIN CAPITAL LETTER A (A) and U+005A LATIN CAPITAL LETTER Z (Z).
- function isUppercaseLetter(code) {
+ function isUppercaseLetter$1(code) {
return code >= 0x0041 && code <= 0x005A;
}
@@ -3637,7 +3878,7 @@
// letter
// An uppercase letter or a lowercase letter.
function isLetter(code) {
- return isUppercaseLetter(code) || isLowercaseLetter(code);
+ return isUppercaseLetter$1(code) || isLowercaseLetter(code);
}
// non-ASCII code point
@@ -3654,8 +3895,8 @@
// name code point
// A name-start code point, a digit, or U+002D HYPHEN-MINUS (-).
- function isName(code) {
- return isNameStart(code) || isDigit(code) || code === 0x002D;
+ function isName$2(code) {
+ return isNameStart(code) || isDigit$5(code) || code === 0x002D;
}
// non-printable code point
@@ -3674,25 +3915,25 @@
// U+000A LINE FEED. Note that U+000D CARRIAGE RETURN and U+000C FORM FEED are not included in this definition,
// as they are converted to U+000A LINE FEED during preprocessing.
// TODO: we doesn't do a preprocessing, so check a code point for U+000D CARRIAGE RETURN and U+000C FORM FEED
- function isNewline(code) {
+ function isNewline$1(code) {
return code === 0x000A || code === 0x000D || code === 0x000C;
}
// whitespace
// A newline, U+0009 CHARACTER TABULATION, or U+0020 SPACE.
- function isWhiteSpace(code) {
- return isNewline(code) || code === 0x0020 || code === 0x0009;
+ function isWhiteSpace$2(code) {
+ return isNewline$1(code) || code === 0x0020 || code === 0x0009;
}
// § 4.3.8. Check if two code points are a valid escape
- function isValidEscape(first, second) {
+ function isValidEscape$2(first, second) {
// If the first code point is not U+005C REVERSE SOLIDUS (\), return false.
if (first !== 0x005C) {
return false;
}
// Otherwise, if the second code point is a newline or EOF, return false.
- if (isNewline(second) || second === EOF) {
+ if (isNewline$1(second) || second === EOF$1) {
return false;
}
@@ -3701,7 +3942,7 @@
}
// § 4.3.9. Check if three code points would start an identifier
- function isIdentifierStart(first, second, third) {
+ function isIdentifierStart$2(first, second, third) {
// Look at the first code point:
// U+002D HYPHEN-MINUS
@@ -3711,7 +3952,7 @@
return (
isNameStart(second) ||
second === 0x002D ||
- isValidEscape(second, third)
+ isValidEscape$2(second, third)
);
}
@@ -3724,7 +3965,7 @@
// U+005C REVERSE SOLIDUS (\)
if (first === 0x005C) {
// If the first and second code points are a valid escape, return true. Otherwise, return false.
- return isValidEscape(first, second);
+ return isValidEscape$2(first, second);
}
// anything else
@@ -3733,31 +3974,31 @@
}
// § 4.3.10. Check if three code points would start a number
- function isNumberStart(first, second, third) {
+ function isNumberStart$1(first, second, third) {
// Look at the first code point:
// U+002B PLUS SIGN (+)
// U+002D HYPHEN-MINUS (-)
if (first === 0x002B || first === 0x002D) {
// If the second code point is a digit, return true.
- if (isDigit(second)) {
+ if (isDigit$5(second)) {
return 2;
}
// Otherwise, if the second code point is a U+002E FULL STOP (.)
// and the third code point is a digit, return true.
// Otherwise, return false.
- return second === 0x002E && isDigit(third) ? 3 : 0;
+ return second === 0x002E && isDigit$5(third) ? 3 : 0;
}
// U+002E FULL STOP (.)
if (first === 0x002E) {
// If the second code point is a digit, return true. Otherwise, return false.
- return isDigit(second) ? 2 : 0;
+ return isDigit$5(second) ? 2 : 0;
}
// digit
- if (isDigit(first)) {
+ if (isDigit$5(first)) {
// Return true.
return 1;
}
@@ -3772,7 +4013,7 @@
//
// detect BOM (https://en.wikipedia.org/wiki/Byte_order_mark)
- function isBOM(code) {
+ function isBOM$2(code) {
// UTF-16BE
if (code === 0xFEFF) {
return 1;
@@ -3797,70 +4038,71 @@
// > A name-start code point, a digit, or U+002D HYPHEN-MINUS (-)
// That means only ASCII code points has a special meaning and we define a maps for 0..127 codes only
var CATEGORY = new Array(0x80);
- charCodeCategory.Eof = 0x80;
- charCodeCategory.WhiteSpace = 0x82;
- charCodeCategory.Digit = 0x83;
- charCodeCategory.NameStart = 0x84;
- charCodeCategory.NonPrintable = 0x85;
+ charCodeCategory$1.Eof = 0x80;
+ charCodeCategory$1.WhiteSpace = 0x82;
+ charCodeCategory$1.Digit = 0x83;
+ charCodeCategory$1.NameStart = 0x84;
+ charCodeCategory$1.NonPrintable = 0x85;
for (var i = 0; i < CATEGORY.length; i++) {
switch (true) {
- case isWhiteSpace(i):
- CATEGORY[i] = charCodeCategory.WhiteSpace;
+ case isWhiteSpace$2(i):
+ CATEGORY[i] = charCodeCategory$1.WhiteSpace;
break;
- case isDigit(i):
- CATEGORY[i] = charCodeCategory.Digit;
+ case isDigit$5(i):
+ CATEGORY[i] = charCodeCategory$1.Digit;
break;
case isNameStart(i):
- CATEGORY[i] = charCodeCategory.NameStart;
+ CATEGORY[i] = charCodeCategory$1.NameStart;
break;
case isNonPrintable(i):
- CATEGORY[i] = charCodeCategory.NonPrintable;
+ CATEGORY[i] = charCodeCategory$1.NonPrintable;
break;
default:
- CATEGORY[i] = i || charCodeCategory.Eof;
+ CATEGORY[i] = i || charCodeCategory$1.Eof;
}
}
- function charCodeCategory(code) {
- return code < 0x80 ? CATEGORY[code] : charCodeCategory.NameStart;
+ function charCodeCategory$1(code) {
+ return code < 0x80 ? CATEGORY[code] : charCodeCategory$1.NameStart;
}
- var charCodeDefinitions = {
- isDigit: isDigit,
- isHexDigit: isHexDigit,
- isUppercaseLetter: isUppercaseLetter,
+ var charCodeDefinitions$1 = {
+ isDigit: isDigit$5,
+ isHexDigit: isHexDigit$4,
+ isUppercaseLetter: isUppercaseLetter$1,
isLowercaseLetter: isLowercaseLetter,
isLetter: isLetter,
isNonAscii: isNonAscii,
isNameStart: isNameStart,
- isName: isName,
+ isName: isName$2,
isNonPrintable: isNonPrintable,
- isNewline: isNewline,
- isWhiteSpace: isWhiteSpace,
- isValidEscape: isValidEscape,
- isIdentifierStart: isIdentifierStart,
- isNumberStart: isNumberStart,
+ isNewline: isNewline$1,
+ isWhiteSpace: isWhiteSpace$2,
+ isValidEscape: isValidEscape$2,
+ isIdentifierStart: isIdentifierStart$2,
+ isNumberStart: isNumberStart$1,
- isBOM: isBOM,
- charCodeCategory: charCodeCategory
+ isBOM: isBOM$2,
+ charCodeCategory: charCodeCategory$1
};
- var isDigit$1 = charCodeDefinitions.isDigit;
- var isHexDigit$1 = charCodeDefinitions.isHexDigit;
- var isUppercaseLetter$1 = charCodeDefinitions.isUppercaseLetter;
- var isName$1 = charCodeDefinitions.isName;
- var isWhiteSpace$1 = charCodeDefinitions.isWhiteSpace;
- var isValidEscape$1 = charCodeDefinitions.isValidEscape;
+ var charCodeDef = charCodeDefinitions$1;
+ var isDigit$4 = charCodeDef.isDigit;
+ var isHexDigit$3 = charCodeDef.isHexDigit;
+ var isUppercaseLetter = charCodeDef.isUppercaseLetter;
+ var isName$1 = charCodeDef.isName;
+ var isWhiteSpace$1 = charCodeDef.isWhiteSpace;
+ var isValidEscape$1 = charCodeDef.isValidEscape;
function getCharCode(source, offset) {
return offset < source.length ? source.charCodeAt(offset) : 0;
}
- function getNewlineLength(source, offset, code) {
+ function getNewlineLength$1(source, offset, code) {
if (code === 13 /* \r */ && getCharCode(source, offset + 1) === 10 /* \n */) {
return 2;
}
@@ -3868,18 +4110,18 @@
return 1;
}
- function cmpChar(testStr, offset, referenceCode) {
+ function cmpChar$5(testStr, offset, referenceCode) {
var code = testStr.charCodeAt(offset);
// code.toLowerCase() for A..Z
- if (isUppercaseLetter$1(code)) {
+ if (isUppercaseLetter(code)) {
code = code | 32;
}
return code === referenceCode;
}
- function cmpStr(testStr, start, end, referenceStr) {
+ function cmpStr$6(testStr, start, end, referenceStr) {
if (end - start !== referenceStr.length) {
return false;
}
@@ -3893,7 +4135,7 @@
var referenceCode = referenceStr.charCodeAt(i - start);
// testCode.toLowerCase() for A..Z
- if (isUppercaseLetter$1(testCode)) {
+ if (isUppercaseLetter(testCode)) {
testCode = testCode | 32;
}
@@ -3905,7 +4147,7 @@
return true;
}
- function findWhiteSpaceStart(source, offset) {
+ function findWhiteSpaceStart$1(source, offset) {
for (; offset >= 0; offset--) {
if (!isWhiteSpace$1(source.charCodeAt(offset))) {
break;
@@ -3915,7 +4157,7 @@
return offset + 1;
}
- function findWhiteSpaceEnd(source, offset) {
+ function findWhiteSpaceEnd$1(source, offset) {
for (; offset < source.length; offset++) {
if (!isWhiteSpace$1(source.charCodeAt(offset))) {
break;
@@ -3927,7 +4169,7 @@
function findDecimalNumberEnd(source, offset) {
for (; offset < source.length; offset++) {
- if (!isDigit$1(source.charCodeAt(offset))) {
+ if (!isDigit$4(source.charCodeAt(offset))) {
break;
}
}
@@ -3936,17 +4178,17 @@
}
// § 4.3.7. Consume an escaped code point
- function consumeEscaped(source, offset) {
+ function consumeEscaped$1(source, offset) {
// It assumes that the U+005C REVERSE SOLIDUS (\) has already been consumed and
// that the next input code point has already been verified to be part of a valid escape.
offset += 2;
// hex digit
- if (isHexDigit$1(getCharCode(source, offset - 1))) {
+ if (isHexDigit$3(getCharCode(source, offset - 1))) {
// Consume as many hex digits as possible, but no more than 5.
// Note that this means 1-6 hex digits have been consumed in total.
for (var maxOffset = Math.min(source.length, offset + 5); offset < maxOffset; offset++) {
- if (!isHexDigit$1(getCharCode(source, offset))) {
+ if (!isHexDigit$3(getCharCode(source, offset))) {
break;
}
}
@@ -3954,7 +4196,7 @@
// If the next input code point is whitespace, consume it as well.
var code = getCharCode(source, offset);
if (isWhiteSpace$1(code)) {
- offset += getNewlineLength(source, offset, code);
+ offset += getNewlineLength$1(source, offset, code);
}
}
@@ -3965,7 +4207,7 @@
// Note: This algorithm does not do the verification of the first few code points that are necessary
// to ensure the returned code points would constitute an . If that is the intended use,
// ensure that the stream starts with an identifier before calling this algorithm.
- function consumeName(source, offset) {
+ function consumeName$1(source, offset) {
// Let result initially be an empty string.
// Repeatedly consume the next input code point from the stream:
for (; offset < source.length; offset++) {
@@ -3980,7 +4222,7 @@
// the stream starts with a valid escape
if (isValidEscape$1(code, getCharCode(source, offset + 1))) {
// Consume an escaped code point. Append the returned code point to result.
- offset = consumeEscaped(source, offset) - 1;
+ offset = consumeEscaped$1(source, offset) - 1;
continue;
}
@@ -3993,7 +4235,7 @@
}
// §4.3.12. Consume a number
- function consumeNumber(source, offset) {
+ function consumeNumber$5(source, offset) {
var code = source.charCodeAt(offset);
// 2. If the next input code point is U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-),
@@ -4003,13 +4245,13 @@
}
// 3. While the next input code point is a digit, consume it and append it to repr.
- if (isDigit$1(code)) {
+ if (isDigit$4(code)) {
offset = findDecimalNumberEnd(source, offset + 1);
code = source.charCodeAt(offset);
}
// 4. If the next 2 input code points are U+002E FULL STOP (.) followed by a digit, then:
- if (code === 0x002E && isDigit$1(source.charCodeAt(offset + 1))) {
+ if (code === 0x002E && isDigit$4(source.charCodeAt(offset + 1))) {
// 4.1 Consume them.
// 4.2 Append them to repr.
code = source.charCodeAt(offset += 2);
@@ -4024,7 +4266,7 @@
// 5. If the next 2 or 3 input code points are U+0045 LATIN CAPITAL LETTER E (E)
// or U+0065 LATIN SMALL LETTER E (e), ... , followed by a digit, then:
- if (cmpChar(source, offset, 101 /* e */)) {
+ if (cmpChar$5(source, offset, 101 /* e */)) {
var sign = 0;
code = source.charCodeAt(offset + 1);
@@ -4035,7 +4277,7 @@
}
// ... followed by a digit
- if (isDigit$1(code)) {
+ if (isDigit$4(code)) {
// 5.1 Consume them.
// 5.2 Append them to repr.
@@ -4053,7 +4295,7 @@
// § 4.3.14. Consume the remnants of a bad url
// ... its sole use is to consume enough of the input stream to reach a recovery point
// where normal tokenizing can resume.
- function consumeBadUrlRemnants(source, offset) {
+ function consumeBadUrlRemnants$1(source, offset) {
// Repeatedly consume the next input code point from the stream:
for (; offset < source.length; offset++) {
var code = source.charCodeAt(offset);
@@ -4071,48 +4313,49 @@
// Note: This allows an escaped right parenthesis ("\)") to be encountered
// without ending the . This is otherwise identical to
// the "anything else" clause.
- offset = consumeEscaped(source, offset);
+ offset = consumeEscaped$1(source, offset);
}
}
return offset;
}
- var utils = {
- consumeEscaped: consumeEscaped,
- consumeName: consumeName,
- consumeNumber: consumeNumber,
- consumeBadUrlRemnants: consumeBadUrlRemnants,
+ var utils$2 = {
+ consumeEscaped: consumeEscaped$1,
+ consumeName: consumeName$1,
+ consumeNumber: consumeNumber$5,
+ consumeBadUrlRemnants: consumeBadUrlRemnants$1,
- cmpChar: cmpChar,
- cmpStr: cmpStr,
+ cmpChar: cmpChar$5,
+ cmpStr: cmpStr$6,
- getNewlineLength: getNewlineLength,
- findWhiteSpaceStart: findWhiteSpaceStart,
- findWhiteSpaceEnd: findWhiteSpaceEnd
+ getNewlineLength: getNewlineLength$1,
+ findWhiteSpaceStart: findWhiteSpaceStart$1,
+ findWhiteSpaceEnd: findWhiteSpaceEnd$1
};
- var TYPE$1 = _const.TYPE;
- var NAME$1 = _const.NAME;
+ var constants$2 = _const;
+ var TYPE$G = constants$2.TYPE;
+ var NAME$2 = constants$2.NAME;
+ var utils$1 = utils$2;
+ var cmpStr$5 = utils$1.cmpStr;
- var cmpStr$1 = utils.cmpStr;
+ var EOF = TYPE$G.EOF;
+ var WHITESPACE$c = TYPE$G.WhiteSpace;
+ var COMMENT$a = TYPE$G.Comment;
- var EOF$1 = TYPE$1.EOF;
- var WHITESPACE = TYPE$1.WhiteSpace;
- var COMMENT = TYPE$1.Comment;
-
- var OFFSET_MASK = 0x00FFFFFF;
- var TYPE_SHIFT = 24;
+ var OFFSET_MASK$1 = 0x00FFFFFF;
+ var TYPE_SHIFT$1 = 24;
- var TokenStream = function() {
+ var TokenStream$4 = function() {
this.offsetAndType = null;
this.balance = null;
this.reset();
};
- TokenStream.prototype = {
+ TokenStream$4.prototype = {
reset: function() {
this.eof = false;
this.tokenIndex = -1;
@@ -4125,16 +4368,16 @@
offset += this.tokenIndex;
if (offset < this.tokenCount) {
- return this.offsetAndType[offset] >> TYPE_SHIFT;
+ return this.offsetAndType[offset] >> TYPE_SHIFT$1;
}
- return EOF$1;
+ return EOF;
},
lookupOffset: function(offset) {
offset += this.tokenIndex;
if (offset < this.tokenCount) {
- return this.offsetAndType[offset - 1] & OFFSET_MASK;
+ return this.offsetAndType[offset - 1] & OFFSET_MASK$1;
}
return this.source.length;
@@ -4143,10 +4386,10 @@
offset += this.tokenIndex;
if (offset < this.tokenCount) {
- return cmpStr$1(
+ return cmpStr$5(
this.source,
- this.offsetAndType[offset - 1] & OFFSET_MASK,
- this.offsetAndType[offset] & OFFSET_MASK,
+ this.offsetAndType[offset - 1] & OFFSET_MASK$1,
+ this.offsetAndType[offset] & OFFSET_MASK$1,
referenceStr
);
}
@@ -4160,8 +4403,8 @@
if (tokenIndex > 0) {
return tokenIndex < this.tokenCount
- ? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK
- : this.offsetAndType[this.tokenCount] & OFFSET_MASK;
+ ? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK$1
+ : this.offsetAndType[this.tokenCount] & OFFSET_MASK$1;
}
return this.firstCharOffset;
@@ -4171,7 +4414,7 @@
getRawLength: function(startToken, mode) {
var cursor = startToken;
var balanceEnd;
- var offset = this.offsetAndType[Math.max(cursor - 1, 0)] & OFFSET_MASK;
+ var offset = this.offsetAndType[Math.max(cursor - 1, 0)] & OFFSET_MASK$1;
var type;
loop:
@@ -4183,7 +4426,7 @@
break loop;
}
- type = this.offsetAndType[cursor] >> TYPE_SHIFT;
+ type = this.offsetAndType[cursor] >> TYPE_SHIFT$1;
// check token is stop type
switch (mode(type, this.source, offset)) {
@@ -4195,12 +4438,12 @@
break loop;
default:
- offset = this.offsetAndType[cursor] & OFFSET_MASK;
-
// fast forward to the end of balanced block
if (this.balance[balanceEnd] === cursor) {
cursor = balanceEnd;
}
+
+ offset = this.offsetAndType[cursor] & OFFSET_MASK$1;
}
}
@@ -4212,13 +4455,13 @@
isDelim: function(code, offset) {
if (offset) {
return (
- this.lookupType(offset) === TYPE$1.Delim &&
+ this.lookupType(offset) === TYPE$G.Delim &&
this.source.charCodeAt(this.lookupOffset(offset)) === code
);
}
return (
- this.tokenType === TYPE$1.Delim &&
+ this.tokenType === TYPE$G.Delim &&
this.source.charCodeAt(this.tokenStart) === code
);
},
@@ -4235,7 +4478,7 @@
skipWS: function() {
for (var i = this.tokenIndex, skipTokenCount = 0; i < this.tokenCount; i++, skipTokenCount++) {
- if ((this.offsetAndType[i] >> TYPE_SHIFT) !== WHITESPACE) {
+ if ((this.offsetAndType[i] >> TYPE_SHIFT$1) !== WHITESPACE$c) {
break;
}
}
@@ -4245,7 +4488,7 @@
}
},
skipSC: function() {
- while (this.tokenType === WHITESPACE || this.tokenType === COMMENT) {
+ while (this.tokenType === WHITESPACE$c || this.tokenType === COMMENT$a) {
this.next();
}
},
@@ -4254,10 +4497,10 @@
if (next < this.tokenCount) {
this.tokenIndex = next;
- this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK;
+ this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK$1;
next = this.offsetAndType[next];
- this.tokenType = next >> TYPE_SHIFT;
- this.tokenEnd = next & OFFSET_MASK;
+ this.tokenType = next >> TYPE_SHIFT$1;
+ this.tokenEnd = next & OFFSET_MASK$1;
} else {
this.tokenIndex = this.tokenCount;
this.next();
@@ -4270,38 +4513,48 @@
this.tokenIndex = next;
this.tokenStart = this.tokenEnd;
next = this.offsetAndType[next];
- this.tokenType = next >> TYPE_SHIFT;
- this.tokenEnd = next & OFFSET_MASK;
+ this.tokenType = next >> TYPE_SHIFT$1;
+ this.tokenEnd = next & OFFSET_MASK$1;
} else {
this.tokenIndex = this.tokenCount;
this.eof = true;
- this.tokenType = EOF$1;
+ this.tokenType = EOF;
this.tokenStart = this.tokenEnd = this.source.length;
}
},
- dump: function() {
- var offset = this.firstCharOffset;
-
- return Array.prototype.slice.call(this.offsetAndType, 0, this.tokenCount).map(function(item, idx) {
+ forEachToken(fn) {
+ for (var i = 0, offset = this.firstCharOffset; i < this.tokenCount; i++) {
var start = offset;
- var end = item & OFFSET_MASK;
+ var item = this.offsetAndType[i];
+ var end = item & OFFSET_MASK$1;
+ var type = item >> TYPE_SHIFT$1;
offset = end;
- return {
- idx: idx,
- type: NAME$1[item >> TYPE_SHIFT],
+ fn(type, start, end, i);
+ }
+ },
+
+ dump() {
+ var tokens = new Array(this.tokenCount);
+
+ this.forEachToken((type, start, end, index) => {
+ tokens[index] = {
+ idx: index,
+ type: NAME$2[type],
chunk: this.source.substring(start, end),
- balance: this.balance[idx]
+ balance: this.balance[index]
};
- }, this);
+ });
+
+ return tokens;
}
};
- var TokenStream_1 = TokenStream;
+ var TokenStream_1 = TokenStream$4;
- function noop$1(value) {
+ function noop$3(value) {
return value;
}
@@ -4350,7 +4603,7 @@
function generateSequence(node, decorate, forceBraces, compact) {
var combinator = node.combinator === ' ' || compact ? node.combinator : ' ' + node.combinator + ' ';
var result = node.terms.map(function(term) {
- return generate(term, decorate, forceBraces, compact);
+ return generate$2(term, decorate, forceBraces, compact);
}).join(combinator);
if (node.explicit || forceBraces) {
@@ -4360,7 +4613,7 @@
return result;
}
- function generate(node, decorate, forceBraces, compact) {
+ function generate$2(node, decorate, forceBraces, compact) {
var result;
switch (node.type) {
@@ -4373,7 +4626,7 @@
case 'Multiplier':
// return since node is a composition
return (
- generate(node.term, decorate, forceBraces, compact) +
+ generate$2(node.term, decorate, forceBraces, compact) +
decorate(generateMultiplier(node), node)
);
@@ -4414,7 +4667,7 @@
}
var generate_1 = function(node, options) {
- var decorate = noop$1;
+ var decorate = noop$3;
var forceBraces = false;
var compact = false;
@@ -4428,23 +4681,34 @@
}
}
- return generate(node, decorate, forceBraces, compact);
+ return generate$2(node, decorate, forceBraces, compact);
};
- function fromMatchResult(matchResult) {
- var tokens = matchResult.tokens;
- var longestMatch = matchResult.longestMatch;
- var node = longestMatch < tokens.length ? tokens[longestMatch].node : null;
- var mismatchOffset = -1;
- var entries = 0;
- var css = '';
+ const createCustomError$1 = createCustomError$3;
+ const generate$1 = generate_1;
+ const defaultLoc = { offset: 0, line: 1, column: 1 };
+
+ function locateMismatch(matchResult, node) {
+ const tokens = matchResult.tokens;
+ const longestMatch = matchResult.longestMatch;
+ const mismatchNode = longestMatch < tokens.length ? tokens[longestMatch].node || null : null;
+ const badNode = mismatchNode !== node ? mismatchNode : null;
+ let mismatchOffset = 0;
+ let mismatchLength = 0;
+ let entries = 0;
+ let css = '';
+ let start;
+ let end;
+
+ for (let i = 0; i < tokens.length; i++) {
+ const token = tokens[i].value;
- for (var i = 0; i < tokens.length; i++) {
if (i === longestMatch) {
+ mismatchLength = token.length;
mismatchOffset = css.length;
}
- if (node !== null && tokens[i].node === node) {
+ if (badNode !== null && tokens[i].node === badNode) {
if (i <= longestMatch) {
entries++;
} else {
@@ -4452,33 +4716,58 @@
}
}
- css += tokens[i].value;
+ css += token;
+ }
+
+ if (longestMatch === tokens.length || entries > 1) { // last
+ start = fromLoc(badNode || node, 'end') || buildLoc(defaultLoc, css);
+ end = buildLoc(start);
+ } else {
+ start = fromLoc(badNode, 'start') ||
+ buildLoc(fromLoc(node, 'start') || defaultLoc, css.slice(0, mismatchOffset));
+ end = fromLoc(badNode, 'end') ||
+ buildLoc(start, css.substr(mismatchOffset, mismatchLength));
}
return {
- node: node,
- css: css,
- mismatchOffset: mismatchOffset === -1 ? css.length : mismatchOffset,
- last: node === null || entries > 1
+ css,
+ mismatchOffset,
+ mismatchLength,
+ start,
+ end
};
}
- function getLocation(node, point) {
- var loc = node && node.loc && node.loc[point];
+ function fromLoc(node, point) {
+ const value = node && node.loc && node.loc[point];
- if (loc) {
- return {
- offset: loc.offset,
- line: loc.line,
- column: loc.column
- };
+ if (value) {
+ return 'line' in value ? buildLoc(value) : value;
}
return null;
}
- var SyntaxReferenceError = function(type, referenceName) {
- var error = createCustomError(
+ function buildLoc({ offset, line, column }, extra) {
+ const loc = {
+ offset,
+ line,
+ column
+ };
+
+ if (extra) {
+ const lines = extra.split(/\n|\r\n?|\f/);
+
+ loc.offset += extra.length;
+ loc.line += lines.length - 1;
+ loc.column = lines.length === 1 ? loc.column + extra.length : lines.pop().length + 1;
+ }
+
+ return loc;
+ }
+
+ const SyntaxReferenceError$1 = function(type, referenceName) {
+ const error = createCustomError$1(
'SyntaxReferenceError',
type + (referenceName ? ' `' + referenceName + '`' : '')
);
@@ -4488,51 +4777,52 @@
return error;
};
- var MatchError = function(message, syntax, node, matchResult) {
- var error = createCustomError('SyntaxMatchError', message);
- var details = fromMatchResult(matchResult);
- var mismatchOffset = details.mismatchOffset || 0;
- var badNode = details.node || node;
- var end = getLocation(badNode, 'end');
- var start = details.last ? end : getLocation(badNode, 'start');
- var css = details.css;
+ const SyntaxMatchError$1 = function(message, syntax, node, matchResult) {
+ const error = createCustomError$1('SyntaxMatchError', message);
+ const {
+ css,
+ mismatchOffset,
+ mismatchLength,
+ start,
+ end
+ } = locateMismatch(matchResult, node);
error.rawMessage = message;
- error.syntax = syntax ? generate_1(syntax) : '';
+ error.syntax = syntax ? generate$1(syntax) : '';
error.css = css;
error.mismatchOffset = mismatchOffset;
- error.loc = {
- source: (badNode && badNode.loc && badNode.loc.source) || '',
- start: start,
- end: end
- };
- error.line = start ? start.line : undefined;
- error.column = start ? start.column : undefined;
- error.offset = start ? start.offset : undefined;
+ error.mismatchLength = mismatchLength;
error.message = message + '\n' +
' syntax: ' + error.syntax + '\n' +
- ' value: ' + (error.css || '') + '\n' +
+ ' value: ' + (css || '') + '\n' +
' --------' + new Array(error.mismatchOffset + 1).join('-') + '^';
+ Object.assign(error, start);
+ error.loc = {
+ source: (node && node.loc && node.loc.source) || '',
+ start,
+ end
+ };
+
return error;
};
var error = {
- SyntaxReferenceError: SyntaxReferenceError,
- MatchError: MatchError
+ SyntaxReferenceError: SyntaxReferenceError$1,
+ SyntaxMatchError: SyntaxMatchError$1
};
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var keywords = Object.create(null);
- var properties = Object.create(null);
- var HYPHENMINUS = 45; // '-'.charCodeAt()
+ var hasOwnProperty$7 = Object.prototype.hasOwnProperty;
+ var keywords$1 = Object.create(null);
+ var properties$1 = Object.create(null);
+ var HYPHENMINUS$5 = 45; // '-'.charCodeAt()
- function isCustomProperty(str, offset) {
+ function isCustomProperty$1(str, offset) {
offset = offset || 0;
return str.length - offset >= 2 &&
- str.charCodeAt(offset) === HYPHENMINUS &&
- str.charCodeAt(offset + 1) === HYPHENMINUS;
+ str.charCodeAt(offset) === HYPHENMINUS$5 &&
+ str.charCodeAt(offset + 1) === HYPHENMINUS$5;
}
function getVendorPrefix(str, offset) {
@@ -4541,8 +4831,8 @@
// verdor prefix should be at least 3 chars length
if (str.length - offset >= 3) {
// vendor prefix starts with hyper minus following non-hyper minus
- if (str.charCodeAt(offset) === HYPHENMINUS &&
- str.charCodeAt(offset + 1) !== HYPHENMINUS) {
+ if (str.charCodeAt(offset) === HYPHENMINUS$5 &&
+ str.charCodeAt(offset + 1) !== HYPHENMINUS$5) {
// vendor prefix should contain a hyper minus at the ending
var secondDashIndex = str.indexOf('-', offset + 2);
@@ -4556,20 +4846,20 @@
}
function getKeywordDescriptor(keyword) {
- if (hasOwnProperty.call(keywords, keyword)) {
- return keywords[keyword];
+ if (hasOwnProperty$7.call(keywords$1, keyword)) {
+ return keywords$1[keyword];
}
var name = keyword.toLowerCase();
- if (hasOwnProperty.call(keywords, name)) {
- return keywords[keyword] = keywords[name];
+ if (hasOwnProperty$7.call(keywords$1, name)) {
+ return keywords$1[keyword] = keywords$1[name];
}
- var custom = isCustomProperty(name, 0);
+ var custom = isCustomProperty$1(name, 0);
var vendor = !custom ? getVendorPrefix(name, 0) : '';
- return keywords[keyword] = Object.freeze({
+ return keywords$1[keyword] = Object.freeze({
basename: name.substr(vendor.length),
name: name,
vendor: vendor,
@@ -4579,8 +4869,8 @@
}
function getPropertyDescriptor(property) {
- if (hasOwnProperty.call(properties, property)) {
- return properties[property];
+ if (hasOwnProperty$7.call(properties$1, property)) {
+ return properties$1[property];
}
var name = property;
@@ -4597,20 +4887,20 @@
hack = '';
}
- var custom = isCustomProperty(name, hack.length);
+ var custom = isCustomProperty$1(name, hack.length);
// re-use result when possible (the same as for lower case)
if (!custom) {
name = name.toLowerCase();
- if (hasOwnProperty.call(properties, name)) {
- return properties[property] = properties[name];
+ if (hasOwnProperty$7.call(properties$1, name)) {
+ return properties$1[property] = properties$1[name];
}
}
var vendor = !custom ? getVendorPrefix(name, hack.length) : '';
var prefix = name.substr(0, hack.length + vendor.length);
- return properties[property] = Object.freeze({
+ return properties$1[property] = Object.freeze({
basename: name.substr(prefix.length),
name: name.substr(hack.length),
hack: hack,
@@ -4620,17 +4910,17 @@
});
}
- var names = {
+ var names$2 = {
keyword: getKeywordDescriptor,
property: getPropertyDescriptor,
- isCustomProperty: isCustomProperty,
+ isCustomProperty: isCustomProperty$1,
vendorPrefix: getVendorPrefix
};
var MIN_SIZE = 16 * 1024;
var SafeUint32Array = typeof Uint32Array !== 'undefined' ? Uint32Array : Array; // fallback on Array when TypedArray is not supported
- var adoptBuffer = function adoptBuffer(buffer, size) {
+ var adoptBuffer$2 = function adoptBuffer(buffer, size) {
if (buffer === null || buffer.length < size) {
return new SafeUint32Array(Math.max(size + 1024, MIN_SIZE));
}
@@ -4638,30 +4928,34 @@
return buffer;
};
- var TYPE$2 = _const.TYPE;
+ var TokenStream$3 = TokenStream_1;
+ var adoptBuffer$1 = adoptBuffer$2;
+ var constants$1 = _const;
+ var TYPE$F = constants$1.TYPE;
- var isNewline$1 = charCodeDefinitions.isNewline;
- var isName$2 = charCodeDefinitions.isName;
- var isValidEscape$2 = charCodeDefinitions.isValidEscape;
- var isNumberStart$1 = charCodeDefinitions.isNumberStart;
+ var charCodeDefinitions = charCodeDefinitions$1;
+ var isNewline = charCodeDefinitions.isNewline;
+ var isName = charCodeDefinitions.isName;
+ var isValidEscape = charCodeDefinitions.isValidEscape;
+ var isNumberStart = charCodeDefinitions.isNumberStart;
var isIdentifierStart$1 = charCodeDefinitions.isIdentifierStart;
- var charCodeCategory$1 = charCodeDefinitions.charCodeCategory;
+ var charCodeCategory = charCodeDefinitions.charCodeCategory;
var isBOM$1 = charCodeDefinitions.isBOM;
+ var utils = utils$2;
+ var cmpStr$4 = utils.cmpStr;
+ var getNewlineLength = utils.getNewlineLength;
+ var findWhiteSpaceEnd = utils.findWhiteSpaceEnd;
+ var consumeEscaped = utils.consumeEscaped;
+ var consumeName = utils.consumeName;
+ var consumeNumber$4 = utils.consumeNumber;
+ var consumeBadUrlRemnants = utils.consumeBadUrlRemnants;
- var cmpStr$2 = utils.cmpStr;
- var getNewlineLength$1 = utils.getNewlineLength;
- var findWhiteSpaceEnd$1 = utils.findWhiteSpaceEnd;
- var consumeEscaped$1 = utils.consumeEscaped;
- var consumeName$1 = utils.consumeName;
- var consumeNumber$1 = utils.consumeNumber;
- var consumeBadUrlRemnants$1 = utils.consumeBadUrlRemnants;
-
- var OFFSET_MASK$1 = 0x00FFFFFF;
- var TYPE_SHIFT$1 = 24;
+ var OFFSET_MASK = 0x00FFFFFF;
+ var TYPE_SHIFT = 24;
- function tokenize(source, stream) {
+ function tokenize$3(source, stream) {
function getCharCode(offset) {
return offset < sourceLength ? source.charCodeAt(offset) : 0;
}
@@ -4669,28 +4963,28 @@
// § 4.3.3. Consume a numeric token
function consumeNumericToken() {
// Consume a number and let number be the result.
- offset = consumeNumber$1(source, offset);
+ offset = consumeNumber$4(source, offset);
// If the next 3 input code points would start an identifier, then:
if (isIdentifierStart$1(getCharCode(offset), getCharCode(offset + 1), getCharCode(offset + 2))) {
// Create a with the same value and type flag as number, and a unit set initially to the empty string.
// Consume a name. Set the ’s unit to the returned value.
// Return the .
- type = TYPE$2.Dimension;
- offset = consumeName$1(source, offset);
+ type = TYPE$F.Dimension;
+ offset = consumeName(source, offset);
return;
}
// Otherwise, if the next input code point is U+0025 PERCENTAGE SIGN (%), consume it.
if (getCharCode(offset) === 0x0025) {
// Create a with the same value as number, and return it.
- type = TYPE$2.Percentage;
+ type = TYPE$F.Percentage;
offset++;
return;
}
// Otherwise, create a with the same value and type flag as number, and return it.
- type = TYPE$2.Number;
+ type = TYPE$F.Number;
}
// § 4.3.4. Consume an ident-like token
@@ -4698,20 +4992,20 @@
const nameStartOffset = offset;
// Consume a name, and let string be the result.
- offset = consumeName$1(source, offset);
+ offset = consumeName(source, offset);
// If string’s value is an ASCII case-insensitive match for "url",
// and the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.
- if (cmpStr$2(source, nameStartOffset, offset, 'url') && getCharCode(offset) === 0x0028) {
+ if (cmpStr$4(source, nameStartOffset, offset, 'url') && getCharCode(offset) === 0x0028) {
// While the next two input code points are whitespace, consume the next input code point.
- offset = findWhiteSpaceEnd$1(source, offset + 1);
+ offset = findWhiteSpaceEnd(source, offset + 1);
// If the next one or two input code points are U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('),
// or whitespace followed by U+0022 QUOTATION MARK (") or U+0027 APOSTROPHE ('),
// then create a with its value set to string and return it.
if (getCharCode(offset) === 0x0022 ||
getCharCode(offset) === 0x0027) {
- type = TYPE$2.Function;
+ type = TYPE$F.Function;
offset = nameStartOffset + 4;
return;
}
@@ -4724,13 +5018,13 @@
// Otherwise, if the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.
// Create a with its value set to string and return it.
if (getCharCode(offset) === 0x0028) {
- type = TYPE$2.Function;
+ type = TYPE$F.Function;
offset++;
return;
}
// Otherwise, create an with its value set to string and return it.
- type = TYPE$2.Ident;
+ type = TYPE$F.Ident;
}
// § 4.3.5. Consume a string token
@@ -4743,13 +5037,13 @@
}
// Initially create a with its value set to the empty string.
- type = TYPE$2.String;
+ type = TYPE$F.String;
// Repeatedly consume the next input code point from the stream:
for (; offset < source.length; offset++) {
var code = source.charCodeAt(offset);
- switch (charCodeCategory$1(code)) {
+ switch (charCodeCategory(code)) {
// ending code point
case endingCodePoint:
// Return the .
@@ -4757,17 +5051,17 @@
return;
// EOF
- case charCodeCategory$1.Eof:
+ case charCodeCategory.Eof:
// This is a parse error. Return the .
return;
// newline
- case charCodeCategory$1.WhiteSpace:
- if (isNewline$1(code)) {
+ case charCodeCategory.WhiteSpace:
+ if (isNewline(code)) {
// This is a parse error. Reconsume the current input code point,
// create a , and return it.
- offset += getNewlineLength$1(source, offset, code);
- type = TYPE$2.BadString;
+ offset += getNewlineLength(source, offset, code);
+ type = TYPE$F.BadString;
return;
}
break;
@@ -4782,13 +5076,13 @@
var nextCode = getCharCode(offset + 1);
// Otherwise, if the next input code point is a newline, consume it.
- if (isNewline$1(nextCode)) {
- offset += getNewlineLength$1(source, offset + 1, nextCode);
- } else if (isValidEscape$2(code, nextCode)) {
+ if (isNewline(nextCode)) {
+ offset += getNewlineLength(source, offset + 1, nextCode);
+ } else if (isValidEscape(code, nextCode)) {
// Otherwise, (the stream starts with a valid escape) consume
// an escaped code point and append the returned code point to
// the ’s value.
- offset = consumeEscaped$1(source, offset) - 1;
+ offset = consumeEscaped(source, offset) - 1;
}
break;
@@ -4805,16 +5099,16 @@
// automatically handles this distinction; this algorithm shouldn’t be called directly otherwise.
function consumeUrlToken() {
// Initially create a with its value set to the empty string.
- type = TYPE$2.Url;
+ type = TYPE$F.Url;
// Consume as much whitespace as possible.
- offset = findWhiteSpaceEnd$1(source, offset);
+ offset = findWhiteSpaceEnd(source, offset);
// Repeatedly consume the next input code point from the stream:
for (; offset < source.length; offset++) {
var code = source.charCodeAt(offset);
- switch (charCodeCategory$1(code)) {
+ switch (charCodeCategory(code)) {
// U+0029 RIGHT PARENTHESIS ())
case 0x0029:
// Return the .
@@ -4822,14 +5116,14 @@
return;
// EOF
- case charCodeCategory$1.Eof:
+ case charCodeCategory.Eof:
// This is a parse error. Return the .
return;
// whitespace
- case charCodeCategory$1.WhiteSpace:
+ case charCodeCategory.WhiteSpace:
// Consume as much whitespace as possible.
- offset = findWhiteSpaceEnd$1(source, offset);
+ offset = findWhiteSpaceEnd(source, offset);
// If the next input code point is U+0029 RIGHT PARENTHESIS ()) or EOF,
// consume it and return the
@@ -4843,8 +5137,8 @@
// otherwise, consume the remnants of a bad url, create a ,
// and return it.
- offset = consumeBadUrlRemnants$1(source, offset);
- type = TYPE$2.BadUrl;
+ offset = consumeBadUrlRemnants(source, offset);
+ type = TYPE$F.BadUrl;
return;
// U+0022 QUOTATION MARK (")
@@ -4854,26 +5148,26 @@
case 0x0022:
case 0x0027:
case 0x0028:
- case charCodeCategory$1.NonPrintable:
+ case charCodeCategory.NonPrintable:
// This is a parse error. Consume the remnants of a bad url,
// create a , and return it.
- offset = consumeBadUrlRemnants$1(source, offset);
- type = TYPE$2.BadUrl;
+ offset = consumeBadUrlRemnants(source, offset);
+ type = TYPE$F.BadUrl;
return;
// U+005C REVERSE SOLIDUS (\)
case 0x005C:
// If the stream starts with a valid escape, consume an escaped code point and
// append the returned code point to the ’s value.
- if (isValidEscape$2(code, getCharCode(offset + 1))) {
- offset = consumeEscaped$1(source, offset) - 1;
+ if (isValidEscape(code, getCharCode(offset + 1))) {
+ offset = consumeEscaped(source, offset) - 1;
break;
}
// Otherwise, this is a parse error. Consume the remnants of a bad url,
// create a , and return it.
- offset = consumeBadUrlRemnants$1(source, offset);
- type = TYPE$2.BadUrl;
+ offset = consumeBadUrlRemnants(source, offset);
+ type = TYPE$F.BadUrl;
return;
// anything else
@@ -4883,15 +5177,15 @@
}
if (!stream) {
- stream = new TokenStream_1();
+ stream = new TokenStream$3();
}
// ensure source is a string
source = String(source || '');
var sourceLength = source.length;
- var offsetAndType = adoptBuffer(stream.offsetAndType, sourceLength + 1); // +1 because of eof-token
- var balance = adoptBuffer(stream.balance, sourceLength + 1);
+ var offsetAndType = adoptBuffer$1(stream.offsetAndType, sourceLength + 1); // +1 because of eof-token
+ var balance = adoptBuffer$1(stream.balance, sourceLength + 1);
var tokenCount = 0;
var start = isBOM$1(getCharCode(0));
var offset = start;
@@ -4907,12 +5201,12 @@
balance[tokenCount] = sourceLength;
- switch (charCodeCategory$1(code)) {
+ switch (charCodeCategory(code)) {
// whitespace
- case charCodeCategory$1.WhiteSpace:
+ case charCodeCategory.WhiteSpace:
// Consume as much whitespace as possible. Return a .
- type = TYPE$2.WhiteSpace;
- offset = findWhiteSpaceEnd$1(source, offset + 1);
+ type = TYPE$F.WhiteSpace;
+ offset = findWhiteSpaceEnd(source, offset + 1);
break;
// U+0022 QUOTATION MARK (")
@@ -4924,9 +5218,9 @@
// U+0023 NUMBER SIGN (#)
case 0x0023:
// If the next input code point is a name code point or the next two input code points are a valid escape, then:
- if (isName$2(getCharCode(offset + 1)) || isValidEscape$2(getCharCode(offset + 1), getCharCode(offset + 2))) {
+ if (isName(getCharCode(offset + 1)) || isValidEscape(getCharCode(offset + 1), getCharCode(offset + 2))) {
// Create a .
- type = TYPE$2.Hash;
+ type = TYPE$F.Hash;
// If the next 3 input code points would start an identifier, set the ’s type flag to "id".
// if (isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {
@@ -4934,12 +5228,12 @@
// }
// Consume a name, and set the ’s value to the returned string.
- offset = consumeName$1(source, offset + 1);
+ offset = consumeName(source, offset + 1);
// Return the .
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
@@ -4954,26 +5248,26 @@
// U+0028 LEFT PARENTHESIS (()
case 0x0028:
// Return a <(-token>.
- type = TYPE$2.LeftParenthesis;
+ type = TYPE$F.LeftParenthesis;
offset++;
break;
// U+0029 RIGHT PARENTHESIS ())
case 0x0029:
// Return a <)-token>.
- type = TYPE$2.RightParenthesis;
+ type = TYPE$F.RightParenthesis;
offset++;
break;
// U+002B PLUS SIGN (+)
case 0x002B:
// If the input stream starts with a number, ...
- if (isNumberStart$1(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
+ if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
// ... reconsume the current input code point, consume a numeric token, and return it.
consumeNumericToken();
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
break;
@@ -4981,20 +5275,20 @@
// U+002C COMMA (,)
case 0x002C:
// Return a .
- type = TYPE$2.Comma;
+ type = TYPE$F.Comma;
offset++;
break;
// U+002D HYPHEN-MINUS (-)
case 0x002D:
// If the input stream starts with a number, reconsume the current input code point, consume a numeric token, and return it.
- if (isNumberStart$1(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
+ if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
consumeNumericToken();
} else {
// Otherwise, if the next 2 input code points are U+002D HYPHEN-MINUS U+003E GREATER-THAN SIGN (->), consume them and return a .
if (getCharCode(offset + 1) === 0x002D &&
getCharCode(offset + 2) === 0x003E) {
- type = TYPE$2.CDC;
+ type = TYPE$F.CDC;
offset = offset + 3;
} else {
// Otherwise, if the input stream starts with an identifier, ...
@@ -5003,7 +5297,7 @@
consumeIdentLikeToken();
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
}
@@ -5013,12 +5307,12 @@
// U+002E FULL STOP (.)
case 0x002E:
// If the input stream starts with a number, ...
- if (isNumberStart$1(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
+ if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
// ... reconsume the current input code point, consume a numeric token, and return it.
consumeNumericToken();
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
@@ -5030,13 +5324,13 @@
if (getCharCode(offset + 1) === 0x002A) {
// ... consume them and all following code points up to and including the first U+002A ASTERISK (*)
// followed by a U+002F SOLIDUS (/), or up to an EOF code point.
- type = TYPE$2.Comment;
+ type = TYPE$F.Comment;
offset = source.indexOf('*/', offset + 2) + 2;
if (offset === 1) {
offset = source.length;
}
} else {
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
break;
@@ -5044,14 +5338,14 @@
// U+003A COLON (:)
case 0x003A:
// Return a .
- type = TYPE$2.Colon;
+ type = TYPE$F.Colon;
offset++;
break;
// U+003B SEMICOLON (;)
case 0x003B:
// Return a .
- type = TYPE$2.Semicolon;
+ type = TYPE$F.Semicolon;
offset++;
break;
@@ -5062,11 +5356,11 @@
getCharCode(offset + 2) === 0x002D &&
getCharCode(offset + 3) === 0x002D) {
// ... consume them and return a .
- type = TYPE$2.CDO;
+ type = TYPE$F.CDO;
offset = offset + 4;
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
@@ -5077,11 +5371,11 @@
// If the next 3 input code points would start an identifier, ...
if (isIdentifierStart$1(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {
// ... consume a name, create an with its value set to the returned value, and return it.
- type = TYPE$2.AtKeyword;
- offset = consumeName$1(source, offset + 1);
+ type = TYPE$F.AtKeyword;
+ offset = consumeName(source, offset + 1);
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
@@ -5090,19 +5384,19 @@
// U+005B LEFT SQUARE BRACKET ([)
case 0x005B:
// Return a <[-token>.
- type = TYPE$2.LeftSquareBracket;
+ type = TYPE$F.LeftSquareBracket;
offset++;
break;
// U+005C REVERSE SOLIDUS (\)
case 0x005C:
// If the input stream starts with a valid escape, ...
- if (isValidEscape$2(code, getCharCode(offset + 1))) {
+ if (isValidEscape(code, getCharCode(offset + 1))) {
// ... reconsume the current input code point, consume an ident-like token, and return it.
consumeIdentLikeToken();
} else {
// Otherwise, this is a parse error. Return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
break;
@@ -5110,53 +5404,53 @@
// U+005D RIGHT SQUARE BRACKET (])
case 0x005D:
// Return a <]-token>.
- type = TYPE$2.RightSquareBracket;
+ type = TYPE$F.RightSquareBracket;
offset++;
break;
// U+007B LEFT CURLY BRACKET ({)
case 0x007B:
// Return a <{-token>.
- type = TYPE$2.LeftCurlyBracket;
+ type = TYPE$F.LeftCurlyBracket;
offset++;
break;
// U+007D RIGHT CURLY BRACKET (})
case 0x007D:
// Return a <}-token>.
- type = TYPE$2.RightCurlyBracket;
+ type = TYPE$F.RightCurlyBracket;
offset++;
break;
// digit
- case charCodeCategory$1.Digit:
+ case charCodeCategory.Digit:
// Reconsume the current input code point, consume a numeric token, and return it.
consumeNumericToken();
break;
// name-start code point
- case charCodeCategory$1.NameStart:
+ case charCodeCategory.NameStart:
// Reconsume the current input code point, consume an ident-like token, and return it.
consumeIdentLikeToken();
break;
// EOF
- case charCodeCategory$1.Eof:
+ case charCodeCategory.Eof:
// Return an .
break;
// anything else
default:
// Return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
switch (type) {
case balanceCloseType:
- balancePrev = balanceStart & OFFSET_MASK$1;
+ balancePrev = balanceStart & OFFSET_MASK;
balanceStart = balance[balancePrev];
- balanceCloseType = balanceStart >> TYPE_SHIFT$1;
+ balanceCloseType = balanceStart >> TYPE_SHIFT;
balance[tokenCount] = balancePrev;
balance[balancePrev++] = tokenCount;
for (; balancePrev < tokenCount; balancePrev++) {
@@ -5166,35 +5460,35 @@
}
break;
- case TYPE$2.LeftParenthesis:
- case TYPE$2.Function:
+ case TYPE$F.LeftParenthesis:
+ case TYPE$F.Function:
balance[tokenCount] = balanceStart;
- balanceCloseType = TYPE$2.RightParenthesis;
- balanceStart = (balanceCloseType << TYPE_SHIFT$1) | tokenCount;
+ balanceCloseType = TYPE$F.RightParenthesis;
+ balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;
break;
- case TYPE$2.LeftSquareBracket:
+ case TYPE$F.LeftSquareBracket:
balance[tokenCount] = balanceStart;
- balanceCloseType = TYPE$2.RightSquareBracket;
- balanceStart = (balanceCloseType << TYPE_SHIFT$1) | tokenCount;
+ balanceCloseType = TYPE$F.RightSquareBracket;
+ balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;
break;
- case TYPE$2.LeftCurlyBracket:
+ case TYPE$F.LeftCurlyBracket:
balance[tokenCount] = balanceStart;
- balanceCloseType = TYPE$2.RightCurlyBracket;
- balanceStart = (balanceCloseType << TYPE_SHIFT$1) | tokenCount;
+ balanceCloseType = TYPE$F.RightCurlyBracket;
+ balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;
break;
}
- offsetAndType[tokenCount++] = (type << TYPE_SHIFT$1) | offset;
+ offsetAndType[tokenCount++] = (type << TYPE_SHIFT) | offset;
}
// finalize buffers
- offsetAndType[tokenCount] = (TYPE$2.EOF << TYPE_SHIFT$1) | offset; //
+ offsetAndType[tokenCount] = (TYPE$F.EOF << TYPE_SHIFT) | offset; //
balance[tokenCount] = sourceLength;
balance[sourceLength] = sourceLength; // prevents false positive balance match with any token
while (balanceStart !== 0) {
- balancePrev = balanceStart & OFFSET_MASK$1;
+ balancePrev = balanceStart & OFFSET_MASK;
balanceStart = balance[balancePrev];
balance[balancePrev] = sourceLength;
}
@@ -5212,56 +5506,56 @@
}
// extend tokenizer with constants
- Object.keys(_const).forEach(function(key) {
- tokenize[key] = _const[key];
+ Object.keys(constants$1).forEach(function(key) {
+ tokenize$3[key] = constants$1[key];
});
// extend tokenizer with static methods from utils
Object.keys(charCodeDefinitions).forEach(function(key) {
- tokenize[key] = charCodeDefinitions[key];
+ tokenize$3[key] = charCodeDefinitions[key];
});
Object.keys(utils).forEach(function(key) {
- tokenize[key] = utils[key];
+ tokenize$3[key] = utils[key];
});
- var tokenizer = tokenize;
+ var tokenizer$3 = tokenize$3;
- var isDigit$2 = tokenizer.isDigit;
- var cmpChar$1 = tokenizer.cmpChar;
- var TYPE$3 = tokenizer.TYPE;
+ var isDigit$3 = tokenizer$3.isDigit;
+ var cmpChar$4 = tokenizer$3.cmpChar;
+ var TYPE$E = tokenizer$3.TYPE;
- var DELIM = TYPE$3.Delim;
- var WHITESPACE$1 = TYPE$3.WhiteSpace;
- var COMMENT$1 = TYPE$3.Comment;
- var IDENT = TYPE$3.Ident;
- var NUMBER = TYPE$3.Number;
- var DIMENSION = TYPE$3.Dimension;
- var PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
- var HYPHENMINUS$1 = 0x002D; // U+002D HYPHEN-MINUS (-)
- var N = 0x006E; // U+006E LATIN SMALL LETTER N (n)
- var DISALLOW_SIGN = true;
- var ALLOW_SIGN = false;
+ var DELIM$6 = TYPE$E.Delim;
+ var WHITESPACE$b = TYPE$E.WhiteSpace;
+ var COMMENT$9 = TYPE$E.Comment;
+ var IDENT$i = TYPE$E.Ident;
+ var NUMBER$9 = TYPE$E.Number;
+ var DIMENSION$7 = TYPE$E.Dimension;
+ var PLUSSIGN$8 = 0x002B; // U+002B PLUS SIGN (+)
+ var HYPHENMINUS$4 = 0x002D; // U+002D HYPHEN-MINUS (-)
+ var N$4 = 0x006E; // U+006E LATIN SMALL LETTER N (n)
+ var DISALLOW_SIGN$1 = true;
+ var ALLOW_SIGN$1 = false;
- function isDelim(token, code) {
- return token !== null && token.type === DELIM && token.value.charCodeAt(0) === code;
+ function isDelim$1(token, code) {
+ return token !== null && token.type === DELIM$6 && token.value.charCodeAt(0) === code;
}
function skipSC(token, offset, getNextToken) {
- while (token !== null && (token.type === WHITESPACE$1 || token.type === COMMENT$1)) {
+ while (token !== null && (token.type === WHITESPACE$b || token.type === COMMENT$9)) {
token = getNextToken(++offset);
}
return offset;
}
- function checkInteger(token, valueOffset, disallowSign, offset) {
+ function checkInteger$1(token, valueOffset, disallowSign, offset) {
if (!token) {
return 0;
}
var code = token.value.charCodeAt(valueOffset);
- if (code === PLUSSIGN || code === HYPHENMINUS$1) {
+ if (code === PLUSSIGN$8 || code === HYPHENMINUS$4) {
if (disallowSign) {
// Number sign is not allowed
return 0;
@@ -5270,7 +5564,7 @@
}
for (; valueOffset < token.value.length; valueOffset++) {
- if (!isDigit$2(token.value.charCodeAt(valueOffset))) {
+ if (!isDigit$3(token.value.charCodeAt(valueOffset))) {
// Integer is expected
return 0;
}
@@ -5281,7 +5575,7 @@
// ...
// ... ['+' | '-']
- function consumeB(token, offset_, getNextToken) {
+ function consumeB$1(token, offset_, getNextToken) {
var sign = false;
var offset = skipSC(token, offset_, getNextToken);
@@ -5291,13 +5585,13 @@
return offset_;
}
- if (token.type !== NUMBER) {
- if (isDelim(token, PLUSSIGN) || isDelim(token, HYPHENMINUS$1)) {
+ if (token.type !== NUMBER$9) {
+ if (isDelim$1(token, PLUSSIGN$8) || isDelim$1(token, HYPHENMINUS$4)) {
sign = true;
offset = skipSC(getNextToken(++offset), offset, getNextToken);
token = getNextToken(offset);
- if (token === null && token.type !== NUMBER) {
+ if (token === null && token.type !== NUMBER$9) {
return 0;
}
} else {
@@ -5307,13 +5601,13 @@
if (!sign) {
var code = token.value.charCodeAt(0);
- if (code !== PLUSSIGN && code !== HYPHENMINUS$1) {
+ if (code !== PLUSSIGN$8 && code !== HYPHENMINUS$4) {
// Number sign is expected
return 0;
}
}
- return checkInteger(token, sign ? 0 : 1, sign, offset);
+ return checkInteger$1(token, sign ? 0 : 1, sign, offset);
}
// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
@@ -5326,8 +5620,8 @@
}
//
- if (token.type === NUMBER) {
- return checkInteger(token, 0, ALLOW_SIGN, offset); // b
+ if (token.type === NUMBER$9) {
+ return checkInteger$1(token, 0, ALLOW_SIGN$1, offset); // b
}
// -n
@@ -5335,9 +5629,9 @@
// -n ['+' | '-']
// -n-
//
- else if (token.type === IDENT && token.value.charCodeAt(0) === HYPHENMINUS$1) {
+ else if (token.type === IDENT$i && token.value.charCodeAt(0) === HYPHENMINUS$4) {
// expect 1st char is N
- if (!cmpChar$1(token.value, 1, N)) {
+ if (!cmpChar$4(token.value, 1, N$4)) {
return 0;
}
@@ -5346,26 +5640,26 @@
// -n
// -n ['+' | '-']
case 2:
- return consumeB(getNextToken(++offset), offset, getNextToken);
+ return consumeB$1(getNextToken(++offset), offset, getNextToken);
// -n-
case 3:
- if (token.value.charCodeAt(2) !== HYPHENMINUS$1) {
+ if (token.value.charCodeAt(2) !== HYPHENMINUS$4) {
return 0;
}
offset = skipSC(getNextToken(++offset), offset, getNextToken);
token = getNextToken(offset);
- return checkInteger(token, 0, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, 0, DISALLOW_SIGN$1, offset);
//
default:
- if (token.value.charCodeAt(2) !== HYPHENMINUS$1) {
+ if (token.value.charCodeAt(2) !== HYPHENMINUS$4) {
return 0;
}
- return checkInteger(token, 3, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, 3, DISALLOW_SIGN$1, offset);
}
}
@@ -5374,13 +5668,13 @@
// '+'? n ['+' | '-']
// '+'? n-
// '+'?
- else if (token.type === IDENT || (isDelim(token, PLUSSIGN) && getNextToken(offset + 1).type === IDENT)) {
+ else if (token.type === IDENT$i || (isDelim$1(token, PLUSSIGN$8) && getNextToken(offset + 1).type === IDENT$i)) {
// just ignore a plus
- if (token.type !== IDENT) {
+ if (token.type !== IDENT$i) {
token = getNextToken(++offset);
}
- if (token === null || !cmpChar$1(token.value, 0, N)) {
+ if (token === null || !cmpChar$4(token.value, 0, N$4)) {
return 0;
}
@@ -5389,26 +5683,26 @@
// '+'? n
// '+'? n ['+' | '-']
case 1:
- return consumeB(getNextToken(++offset), offset, getNextToken);
+ return consumeB$1(getNextToken(++offset), offset, getNextToken);
// '+'? n-
case 2:
- if (token.value.charCodeAt(1) !== HYPHENMINUS$1) {
+ if (token.value.charCodeAt(1) !== HYPHENMINUS$4) {
return 0;
}
offset = skipSC(getNextToken(++offset), offset, getNextToken);
token = getNextToken(offset);
- return checkInteger(token, 0, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, 0, DISALLOW_SIGN$1, offset);
// '+'?
default:
- if (token.value.charCodeAt(1) !== HYPHENMINUS$1) {
+ if (token.value.charCodeAt(1) !== HYPHENMINUS$4) {
return 0;
}
- return checkInteger(token, 2, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, 2, DISALLOW_SIGN$1, offset);
}
}
@@ -5417,12 +5711,12 @@
//
//
// ['+' | '-']
- else if (token.type === DIMENSION) {
+ else if (token.type === DIMENSION$7) {
var code = token.value.charCodeAt(0);
- var sign = code === PLUSSIGN || code === HYPHENMINUS$1 ? 1 : 0;
+ var sign = code === PLUSSIGN$8 || code === HYPHENMINUS$4 ? 1 : 0;
for (var i = sign; i < token.value.length; i++) {
- if (!isDigit$2(token.value.charCodeAt(i))) {
+ if (!isDigit$3(token.value.charCodeAt(i))) {
break;
}
}
@@ -5432,7 +5726,7 @@
return 0;
}
- if (!cmpChar$1(token.value, i, N)) {
+ if (!cmpChar$4(token.value, i, N$4)) {
return 0;
}
@@ -5440,9 +5734,9 @@
//
// ['+' | '-']
if (i + 1 === token.value.length) {
- return consumeB(getNextToken(++offset), offset, getNextToken);
+ return consumeB$1(getNextToken(++offset), offset, getNextToken);
} else {
- if (token.value.charCodeAt(i + 1) !== HYPHENMINUS$1) {
+ if (token.value.charCodeAt(i + 1) !== HYPHENMINUS$4) {
return 0;
}
@@ -5451,11 +5745,11 @@
offset = skipSC(getNextToken(++offset), offset, getNextToken);
token = getNextToken(offset);
- return checkInteger(token, 0, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, 0, DISALLOW_SIGN$1, offset);
}
//
else {
- return checkInteger(token, i + 2, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, i + 2, DISALLOW_SIGN$1, offset);
}
}
}
@@ -5463,24 +5757,24 @@
return 0;
};
- var isHexDigit$2 = tokenizer.isHexDigit;
- var cmpChar$2 = tokenizer.cmpChar;
- var TYPE$4 = tokenizer.TYPE;
+ var isHexDigit$2 = tokenizer$3.isHexDigit;
+ var cmpChar$3 = tokenizer$3.cmpChar;
+ var TYPE$D = tokenizer$3.TYPE;
- var IDENT$1 = TYPE$4.Ident;
- var DELIM$1 = TYPE$4.Delim;
- var NUMBER$1 = TYPE$4.Number;
- var DIMENSION$1 = TYPE$4.Dimension;
- var PLUSSIGN$1 = 0x002B; // U+002B PLUS SIGN (+)
- var HYPHENMINUS$2 = 0x002D; // U+002D HYPHEN-MINUS (-)
- var QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)
- var U = 0x0075; // U+0075 LATIN SMALL LETTER U (u)
+ var IDENT$h = TYPE$D.Ident;
+ var DELIM$5 = TYPE$D.Delim;
+ var NUMBER$8 = TYPE$D.Number;
+ var DIMENSION$6 = TYPE$D.Dimension;
+ var PLUSSIGN$7 = 0x002B; // U+002B PLUS SIGN (+)
+ var HYPHENMINUS$3 = 0x002D; // U+002D HYPHEN-MINUS (-)
+ var QUESTIONMARK$2 = 0x003F; // U+003F QUESTION MARK (?)
+ var U$2 = 0x0075; // U+0075 LATIN SMALL LETTER U (u)
- function isDelim$1(token, code) {
- return token !== null && token.type === DELIM$1 && token.value.charCodeAt(0) === code;
+ function isDelim(token, code) {
+ return token !== null && token.type === DELIM$5 && token.value.charCodeAt(0) === code;
}
- function startsWith(token, code) {
+ function startsWith$1(token, code) {
return token.value.charCodeAt(0) === code;
}
@@ -5488,7 +5782,7 @@
for (var pos = offset, hexlen = 0; pos < token.value.length; pos++) {
var code = token.value.charCodeAt(pos);
- if (code === HYPHENMINUS$2 && allowDash && hexlen !== 0) {
+ if (code === HYPHENMINUS$3 && allowDash && hexlen !== 0) {
if (hexSequence(token, offset + hexlen + 1, false) > 0) {
return 6; // dissallow following question marks
}
@@ -5512,7 +5806,7 @@
return 0; // nothing consumed
}
- while (isDelim$1(getNextToken(length), QUESTIONMARK)) {
+ while (isDelim(getNextToken(length), QUESTIONMARK$2)) {
if (++consumed > 6) {
return 0; // too many question marks
}
@@ -5546,7 +5840,7 @@
var length = 0;
// should start with `u` or `U`
- if (token === null || token.type !== IDENT$1 || !cmpChar$2(token.value, 0, U)) {
+ if (token === null || token.type !== IDENT$h || !cmpChar$3(token.value, 0, U$2)) {
return 0;
}
@@ -5557,18 +5851,18 @@
// u '+' '?'*
// u '+' '?'+
- if (isDelim$1(token, PLUSSIGN$1)) {
+ if (isDelim(token, PLUSSIGN$7)) {
token = getNextToken(++length);
if (token === null) {
return 0;
}
- if (token.type === IDENT$1) {
+ if (token.type === IDENT$h) {
// u '+' '?'*
return withQuestionMarkSequence(hexSequence(token, 0, true), ++length, getNextToken);
}
- if (isDelim$1(token, QUESTIONMARK)) {
+ if (isDelim(token, QUESTIONMARK$2)) {
// u '+' '?'+
return withQuestionMarkSequence(1, ++length, getNextToken);
}
@@ -5580,8 +5874,8 @@
// u '?'*
// u
// u
- if (token.type === NUMBER$1) {
- if (!startsWith(token, PLUSSIGN$1)) {
+ if (token.type === NUMBER$8) {
+ if (!startsWith$1(token, PLUSSIGN$7)) {
return 0;
}
@@ -5596,10 +5890,10 @@
return length;
}
- if (token.type === DIMENSION$1 || token.type === NUMBER$1) {
+ if (token.type === DIMENSION$6 || token.type === NUMBER$8) {
// u
// u
- if (!startsWith(token, HYPHENMINUS$2) || !hexSequence(token, 1, false)) {
+ if (!startsWith$1(token, HYPHENMINUS$3) || !hexSequence(token, 1, false)) {
return 0;
}
@@ -5611,8 +5905,8 @@
}
// u '?'*
- if (token.type === DIMENSION$1) {
- if (!startsWith(token, PLUSSIGN$1)) {
+ if (token.type === DIMENSION$6) {
+ if (!startsWith$1(token, PLUSSIGN$7)) {
return 0;
}
@@ -5622,16 +5916,17 @@
return 0;
};
- var isIdentifierStart$2 = tokenizer.isIdentifierStart;
- var isHexDigit$3 = tokenizer.isHexDigit;
- var isDigit$3 = tokenizer.isDigit;
- var cmpStr$3 = tokenizer.cmpStr;
- var consumeNumber$2 = tokenizer.consumeNumber;
- var TYPE$5 = tokenizer.TYPE;
+ var tokenizer$2 = tokenizer$3;
+ var isIdentifierStart = tokenizer$2.isIdentifierStart;
+ var isHexDigit$1 = tokenizer$2.isHexDigit;
+ var isDigit$2 = tokenizer$2.isDigit;
+ var cmpStr$3 = tokenizer$2.cmpStr;
+ var consumeNumber$3 = tokenizer$2.consumeNumber;
+ var TYPE$C = tokenizer$2.TYPE;
+ var anPlusB = genericAnPlusB;
+ var urange = genericUrange;
-
-
- var cssWideKeywords = ['unset', 'initial', 'inherit'];
+ var cssWideKeywords$1 = ['unset', 'initial', 'inherit'];
var calcFunctionNames = ['calc(', '-moz-calc(', '-webkit-calc('];
// https://www.w3.org/TR/css-values-3/#lengths
@@ -5726,7 +6021,7 @@
return (
str.charCodeAt(offset) === 0x005C && // U+005C REVERSE SOLIDUS (\)
- isDigit$3(str.charCodeAt(offset + 1))
+ isDigit$2(str.charCodeAt(offset + 1))
);
}
@@ -5779,7 +6074,7 @@
return 0;
}
- if (token.type === TYPE$5.Function && eqStrAny(token.value, calcFunctionNames)) {
+ if (token.type === TYPE$C.Function && eqStrAny(token.value, calcFunctionNames)) {
return consumeFunction(token, getNextToken);
}
@@ -5821,14 +6116,14 @@
//
// See also: https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident
function customIdent(token) {
- if (token === null || token.type !== TYPE$5.Ident) {
+ if (token === null || token.type !== TYPE$C.Ident) {
return 0;
}
var name = token.value.toLowerCase();
// The CSS-wide keywords are not valid s
- if (eqStrAny(name, cssWideKeywords)) {
+ if (eqStrAny(name, cssWideKeywords$1)) {
return 0;
}
@@ -5853,7 +6148,7 @@
// NOTE: Current implementation treat `--` as a valid name since most (all?) major browsers treat it as valid.
function customPropertyName(token) {
// ... defined as any valid identifier
- if (token === null || token.type !== TYPE$5.Ident) {
+ if (token === null || token.type !== TYPE$C.Ident) {
return 0;
}
@@ -5870,7 +6165,7 @@
// In other words, a hex color is written as a hash character, "#", followed by some number of digits 0-9 or
// letters a-f (the case of the letters doesn’t matter - #00ff00 is identical to #00FF00).
function hexColor(token) {
- if (token === null || token.type !== TYPE$5.Hash) {
+ if (token === null || token.type !== TYPE$C.Hash) {
return 0;
}
@@ -5882,7 +6177,7 @@
}
for (var i = 1; i < length; i++) {
- if (!isHexDigit$3(token.value.charCodeAt(i))) {
+ if (!isHexDigit$1(token.value.charCodeAt(i))) {
return 0;
}
}
@@ -5891,11 +6186,11 @@
}
function idSelector(token) {
- if (token === null || token.type !== TYPE$5.Hash) {
+ if (token === null || token.type !== TYPE$C.Hash) {
return 0;
}
- if (!isIdentifierStart$2(charCode(token.value, 1), charCode(token.value, 2), charCode(token.value, 3))) {
+ if (!isIdentifierStart(charCode(token.value, 1), charCode(token.value, 2), charCode(token.value, 3))) {
return 0;
}
@@ -5919,14 +6214,14 @@
do {
switch (token.type) {
// ... does not contain , ,
- case TYPE$5.BadString:
- case TYPE$5.BadUrl:
+ case TYPE$C.BadString:
+ case TYPE$C.BadUrl:
break scan;
// ... unmatched <)-token>, <]-token>, or <}-token>,
- case TYPE$5.RightCurlyBracket:
- case TYPE$5.RightParenthesis:
- case TYPE$5.RightSquareBracket:
+ case TYPE$C.RightCurlyBracket:
+ case TYPE$C.RightParenthesis:
+ case TYPE$C.RightSquareBracket:
if (token.balance > token.index || token.balance < startIdx) {
break scan;
}
@@ -5935,7 +6230,7 @@
break;
// ... or top-level tokens
- case TYPE$5.Semicolon:
+ case TYPE$C.Semicolon:
if (level === 0) {
break scan;
}
@@ -5943,17 +6238,17 @@
break;
// ... or tokens with a value of "!"
- case TYPE$5.Delim:
+ case TYPE$C.Delim:
if (token.value === '!' && level === 0) {
break scan;
}
break;
- case TYPE$5.Function:
- case TYPE$5.LeftParenthesis:
- case TYPE$5.LeftSquareBracket:
- case TYPE$5.LeftCurlyBracket:
+ case TYPE$C.Function:
+ case TYPE$C.LeftParenthesis:
+ case TYPE$C.LeftSquareBracket:
+ case TYPE$C.LeftCurlyBracket:
level++;
break;
}
@@ -5987,14 +6282,14 @@
do {
switch (token.type) {
// ... does not contain , ,
- case TYPE$5.BadString:
- case TYPE$5.BadUrl:
+ case TYPE$C.BadString:
+ case TYPE$C.BadUrl:
break scan;
// ... unmatched <)-token>, <]-token>, or <}-token>,
- case TYPE$5.RightCurlyBracket:
- case TYPE$5.RightParenthesis:
- case TYPE$5.RightSquareBracket:
+ case TYPE$C.RightCurlyBracket:
+ case TYPE$C.RightParenthesis:
+ case TYPE$C.RightSquareBracket:
if (token.balance > token.index || token.balance < startIdx) {
break scan;
}
@@ -6019,11 +6314,11 @@
function dimension(type) {
return function(token, getNextToken, opts) {
- if (token === null || token.type !== TYPE$5.Dimension) {
+ if (token === null || token.type !== TYPE$C.Dimension) {
return 0;
}
- var numberEnd = consumeNumber$2(token.value, 0);
+ var numberEnd = consumeNumber$3(token.value, 0);
// check unit
if (type !== null) {
@@ -6055,7 +6350,7 @@
// https://drafts.csswg.org/css-values-4/#percentages
function percentage(token, getNextToken, opts) {
// ... corresponds to the production
- if (token === null || token.type !== TYPE$5.Percentage) {
+ if (token === null || token.type !== TYPE$C.Percentage) {
return 0;
}
@@ -6083,7 +6378,7 @@
}
return function(token, getNextToken, opts) {
- if (token !== null && token.type === TYPE$5.Number) {
+ if (token !== null && token.type === TYPE$C.Number) {
if (Number(token.value) === 0) {
return 1;
}
@@ -6102,7 +6397,7 @@
return 0;
}
- var numberEnd = consumeNumber$2(token.value, 0);
+ var numberEnd = consumeNumber$3(token.value, 0);
var isNumber = numberEnd === token.value.length;
if (!isNumber && !isPostfixIeHack(token.value, numberEnd)) {
return 0;
@@ -6120,7 +6415,7 @@
// https://drafts.csswg.org/css-values-4/#integers
function integer(token, getNextToken, opts) {
// ... corresponds to a subset of the production
- if (token === null || token.type !== TYPE$5.Number) {
+ if (token === null || token.type !== TYPE$C.Number) {
return 0;
}
@@ -6130,7 +6425,7 @@
// When written literally, an integer is one or more decimal digits 0 through 9 ...
for (; i < token.value.length; i++) {
- if (!isDigit$3(token.value.charCodeAt(i))) {
+ if (!isDigit$2(token.value.charCodeAt(i))) {
return 0;
}
}
@@ -6143,44 +6438,44 @@
return 1;
}
- var generic = {
+ var generic$1 = {
// token types
- 'ident-token': tokenType(TYPE$5.Ident),
- 'function-token': tokenType(TYPE$5.Function),
- 'at-keyword-token': tokenType(TYPE$5.AtKeyword),
- 'hash-token': tokenType(TYPE$5.Hash),
- 'string-token': tokenType(TYPE$5.String),
- 'bad-string-token': tokenType(TYPE$5.BadString),
- 'url-token': tokenType(TYPE$5.Url),
- 'bad-url-token': tokenType(TYPE$5.BadUrl),
- 'delim-token': tokenType(TYPE$5.Delim),
- 'number-token': tokenType(TYPE$5.Number),
- 'percentage-token': tokenType(TYPE$5.Percentage),
- 'dimension-token': tokenType(TYPE$5.Dimension),
- 'whitespace-token': tokenType(TYPE$5.WhiteSpace),
- 'CDO-token': tokenType(TYPE$5.CDO),
- 'CDC-token': tokenType(TYPE$5.CDC),
- 'colon-token': tokenType(TYPE$5.Colon),
- 'semicolon-token': tokenType(TYPE$5.Semicolon),
- 'comma-token': tokenType(TYPE$5.Comma),
- '[-token': tokenType(TYPE$5.LeftSquareBracket),
- ']-token': tokenType(TYPE$5.RightSquareBracket),
- '(-token': tokenType(TYPE$5.LeftParenthesis),
- ')-token': tokenType(TYPE$5.RightParenthesis),
- '{-token': tokenType(TYPE$5.LeftCurlyBracket),
- '}-token': tokenType(TYPE$5.RightCurlyBracket),
+ 'ident-token': tokenType(TYPE$C.Ident),
+ 'function-token': tokenType(TYPE$C.Function),
+ 'at-keyword-token': tokenType(TYPE$C.AtKeyword),
+ 'hash-token': tokenType(TYPE$C.Hash),
+ 'string-token': tokenType(TYPE$C.String),
+ 'bad-string-token': tokenType(TYPE$C.BadString),
+ 'url-token': tokenType(TYPE$C.Url),
+ 'bad-url-token': tokenType(TYPE$C.BadUrl),
+ 'delim-token': tokenType(TYPE$C.Delim),
+ 'number-token': tokenType(TYPE$C.Number),
+ 'percentage-token': tokenType(TYPE$C.Percentage),
+ 'dimension-token': tokenType(TYPE$C.Dimension),
+ 'whitespace-token': tokenType(TYPE$C.WhiteSpace),
+ 'CDO-token': tokenType(TYPE$C.CDO),
+ 'CDC-token': tokenType(TYPE$C.CDC),
+ 'colon-token': tokenType(TYPE$C.Colon),
+ 'semicolon-token': tokenType(TYPE$C.Semicolon),
+ 'comma-token': tokenType(TYPE$C.Comma),
+ '[-token': tokenType(TYPE$C.LeftSquareBracket),
+ ']-token': tokenType(TYPE$C.RightSquareBracket),
+ '(-token': tokenType(TYPE$C.LeftParenthesis),
+ ')-token': tokenType(TYPE$C.RightParenthesis),
+ '{-token': tokenType(TYPE$C.LeftCurlyBracket),
+ '}-token': tokenType(TYPE$C.RightCurlyBracket),
// token type aliases
- 'string': tokenType(TYPE$5.String),
- 'ident': tokenType(TYPE$5.Ident),
+ 'string': tokenType(TYPE$C.String),
+ 'ident': tokenType(TYPE$C.Ident),
// complex types
'custom-ident': customIdent,
'custom-property-name': customPropertyName,
'hex-color': hexColor,
'id-selector': idSelector, // element( )
- 'an-plus-b': genericAnPlusB,
- 'urange': genericUrange,
+ 'an-plus-b': anPlusB,
+ 'urange': urange,
'declaration-value': declarationValue,
'any-value': anyValue,
@@ -6207,7 +6502,9 @@
'-ms-legacy-expression': func('expression')
};
- var _SyntaxError$1 = function SyntaxError(message, input, offset) {
+ var createCustomError = createCustomError$3;
+
+ var _SyntaxError = function SyntaxError(message, input, offset) {
var error = createCustomError('SyntaxError', message);
error.input = input;
@@ -6220,18 +6517,20 @@
return error;
};
- var TAB = 9;
- var N$1 = 10;
- var F = 12;
- var R = 13;
- var SPACE = 32;
+ var SyntaxError$3 = _SyntaxError;
+
+ var TAB$1 = 9;
+ var N$3 = 10;
+ var F$2 = 12;
+ var R$2 = 13;
+ var SPACE$2 = 32;
- var Tokenizer = function(str) {
+ var Tokenizer$1 = function(str) {
this.str = str;
this.pos = 0;
};
- Tokenizer.prototype = {
+ Tokenizer$1.prototype = {
charCodeAt: function(pos) {
return pos < this.str.length ? this.str.charCodeAt(pos) : 0;
},
@@ -6247,7 +6546,7 @@
findWsEnd: function(pos) {
for (; pos < this.str.length; pos++) {
var code = this.str.charCodeAt(pos);
- if (code !== R && code !== N$1 && code !== F && code !== SPACE && code !== TAB) {
+ if (code !== R$2 && code !== N$3 && code !== F$2 && code !== SPACE$2 && code !== TAB$1) {
break;
}
}
@@ -6268,36 +6567,37 @@
return this.pos < this.str.length ? this.str.charAt(this.pos++) : '';
},
error: function(message) {
- throw new _SyntaxError$1(message, this.str, this.pos);
+ throw new SyntaxError$3(message, this.str, this.pos);
}
};
- var tokenizer$1 = Tokenizer;
+ var tokenizer$1 = Tokenizer$1;
- var TAB$1 = 9;
+ var Tokenizer = tokenizer$1;
+ var TAB = 9;
var N$2 = 10;
var F$1 = 12;
var R$1 = 13;
var SPACE$1 = 32;
- var EXCLAMATIONMARK = 33; // !
- var NUMBERSIGN = 35; // #
- var AMPERSAND = 38; // &
+ var EXCLAMATIONMARK$3 = 33; // !
+ var NUMBERSIGN$4 = 35; // #
+ var AMPERSAND$1 = 38; // &
var APOSTROPHE = 39; // '
- var LEFTPARENTHESIS = 40; // (
- var RIGHTPARENTHESIS = 41; // )
- var ASTERISK = 42; // *
- var PLUSSIGN$2 = 43; // +
- var COMMA = 44; // ,
+ var LEFTPARENTHESIS$7 = 40; // (
+ var RIGHTPARENTHESIS$7 = 41; // )
+ var ASTERISK$6 = 42; // *
+ var PLUSSIGN$6 = 43; // +
+ var COMMA$4 = 44; // ,
var HYPERMINUS = 45; // -
var LESSTHANSIGN = 60; // <
- var GREATERTHANSIGN = 62; // >
+ var GREATERTHANSIGN$2 = 62; // >
var QUESTIONMARK$1 = 63; // ?
var COMMERCIALAT = 64; // @
- var LEFTSQUAREBRACKET = 91; // [
- var RIGHTSQUAREBRACKET = 93; // ]
- var LEFTCURLYBRACKET = 123; // {
- var VERTICALLINE = 124; // |
- var RIGHTCURLYBRACKET = 125; // }
+ var LEFTSQUAREBRACKET$4 = 91; // [
+ var RIGHTSQUAREBRACKET$2 = 93; // ]
+ var LEFTCURLYBRACKET$4 = 123; // {
+ var VERTICALLINE$3 = 124; // |
+ var RIGHTCURLYBRACKET$2 = 125; // }
var INFINITY = 8734; // ∞
var NAME_CHAR = createCharMap(function(ch) {
return /[a-zA-Z0-9\-]/.test(ch);
@@ -6372,20 +6672,20 @@
var min = null;
var max = null;
- tokenizer.eat(LEFTCURLYBRACKET);
+ tokenizer.eat(LEFTCURLYBRACKET$4);
min = scanNumber(tokenizer);
- if (tokenizer.charCode() === COMMA) {
+ if (tokenizer.charCode() === COMMA$4) {
tokenizer.pos++;
- if (tokenizer.charCode() !== RIGHTCURLYBRACKET) {
+ if (tokenizer.charCode() !== RIGHTCURLYBRACKET$2) {
max = scanNumber(tokenizer);
}
} else {
max = min;
}
- tokenizer.eat(RIGHTCURLYBRACKET);
+ tokenizer.eat(RIGHTCURLYBRACKET$2);
return {
min: Number(min),
@@ -6398,7 +6698,7 @@
var comma = false;
switch (tokenizer.charCode()) {
- case ASTERISK:
+ case ASTERISK$6:
tokenizer.pos++;
range = {
@@ -6408,7 +6708,7 @@
break;
- case PLUSSIGN$2:
+ case PLUSSIGN$6:
tokenizer.pos++;
range = {
@@ -6428,12 +6728,12 @@
break;
- case NUMBERSIGN:
+ case NUMBERSIGN$4:
tokenizer.pos++;
comma = true;
- if (tokenizer.charCode() === LEFTCURLYBRACKET) {
+ if (tokenizer.charCode() === LEFTCURLYBRACKET$4) {
range = readMultiplierRange(tokenizer);
} else {
range = {
@@ -6444,7 +6744,7 @@
break;
- case LEFTCURLYBRACKET:
+ case LEFTCURLYBRACKET$4:
range = readMultiplierRange(tokenizer);
break;
@@ -6485,7 +6785,7 @@
};
}
- function readProperty(tokenizer) {
+ function readProperty$1(tokenizer) {
var name;
tokenizer.eat(LESSTHANSIGN);
@@ -6494,7 +6794,7 @@
name = scanWord(tokenizer);
tokenizer.eat(APOSTROPHE);
- tokenizer.eat(GREATERTHANSIGN);
+ tokenizer.eat(GREATERTHANSIGN$2);
return maybeMultiplied(tokenizer, {
type: 'Property',
@@ -6515,7 +6815,7 @@
var max = null; // Infinity
var sign = 1;
- tokenizer.eat(LEFTSQUAREBRACKET);
+ tokenizer.eat(LEFTSQUAREBRACKET$4);
if (tokenizer.charCode() === HYPERMINUS) {
tokenizer.peek();
@@ -6529,7 +6829,7 @@
}
scanSpaces(tokenizer);
- tokenizer.eat(COMMA);
+ tokenizer.eat(COMMA$4);
scanSpaces(tokenizer);
if (tokenizer.charCode() === INFINITY) {
@@ -6545,7 +6845,7 @@
max = sign * Number(scanNumber(tokenizer));
}
- tokenizer.eat(RIGHTSQUAREBRACKET);
+ tokenizer.eat(RIGHTSQUAREBRACKET$2);
// If no range is indicated, either by using the bracketed range notation
// or in the property description, then [−∞,∞] is assumed.
@@ -6567,18 +6867,18 @@
tokenizer.eat(LESSTHANSIGN);
name = scanWord(tokenizer);
- if (tokenizer.charCode() === LEFTPARENTHESIS &&
- tokenizer.nextCharCode() === RIGHTPARENTHESIS) {
+ if (tokenizer.charCode() === LEFTPARENTHESIS$7 &&
+ tokenizer.nextCharCode() === RIGHTPARENTHESIS$7) {
tokenizer.pos += 2;
name += '()';
}
- if (tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos)) === LEFTSQUAREBRACKET) {
+ if (tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos)) === LEFTSQUAREBRACKET$4) {
scanSpaces(tokenizer);
opts = readTypeRange(tokenizer);
}
- tokenizer.eat(GREATERTHANSIGN);
+ tokenizer.eat(GREATERTHANSIGN$2);
return maybeMultiplied(tokenizer, {
type: 'Type',
@@ -6592,7 +6892,7 @@
name = scanWord(tokenizer);
- if (tokenizer.charCode() === LEFTPARENTHESIS) {
+ if (tokenizer.charCode() === LEFTPARENTHESIS$7) {
tokenizer.pos++;
return {
@@ -6708,13 +7008,13 @@
function readGroup(tokenizer) {
var result;
- tokenizer.eat(LEFTSQUAREBRACKET);
+ tokenizer.eat(LEFTSQUAREBRACKET$4);
result = readImplicitGroup(tokenizer);
- tokenizer.eat(RIGHTSQUAREBRACKET);
+ tokenizer.eat(RIGHTSQUAREBRACKET$2);
result.explicit = true;
- if (tokenizer.charCode() === EXCLAMATIONMARK) {
+ if (tokenizer.charCode() === EXCLAMATIONMARK$3) {
tokenizer.pos++;
result.disallowEmpty = true;
}
@@ -6730,38 +7030,38 @@
}
switch (code) {
- case RIGHTSQUAREBRACKET:
+ case RIGHTSQUAREBRACKET$2:
// don't eat, stop scan a group
break;
- case LEFTSQUAREBRACKET:
+ case LEFTSQUAREBRACKET$4:
return maybeMultiplied(tokenizer, readGroup(tokenizer));
case LESSTHANSIGN:
return tokenizer.nextCharCode() === APOSTROPHE
- ? readProperty(tokenizer)
+ ? readProperty$1(tokenizer)
: readType(tokenizer);
- case VERTICALLINE:
+ case VERTICALLINE$3:
return {
type: 'Combinator',
value: tokenizer.substringToPos(
- tokenizer.nextCharCode() === VERTICALLINE
+ tokenizer.nextCharCode() === VERTICALLINE$3
? tokenizer.pos + 2
: tokenizer.pos + 1
)
};
- case AMPERSAND:
+ case AMPERSAND$1:
tokenizer.pos++;
- tokenizer.eat(AMPERSAND);
+ tokenizer.eat(AMPERSAND$1);
return {
type: 'Combinator',
value: '&&'
};
- case COMMA:
+ case COMMA$4:
tokenizer.pos++;
return {
type: 'Comma'
@@ -6774,7 +7074,7 @@
});
case SPACE$1:
- case TAB$1:
+ case TAB:
case N$2:
case R$1:
case F$1:
@@ -6796,15 +7096,15 @@
return maybeToken(tokenizer);
- case ASTERISK:
- case PLUSSIGN$2:
+ case ASTERISK$6:
+ case PLUSSIGN$6:
case QUESTIONMARK$1:
- case NUMBERSIGN:
- case EXCLAMATIONMARK:
+ case NUMBERSIGN$4:
+ case EXCLAMATIONMARK$3:
// prohibited tokens (used as a multiplier start)
break;
- case LEFTCURLYBRACKET:
+ case LEFTCURLYBRACKET$4:
// LEFTCURLYBRACKET is allowed since mdn/data uses it w/o quoting
// check next char isn't a number, because it's likely a disjoined multiplier
code = tokenizer.nextCharCode();
@@ -6820,8 +7120,8 @@
}
}
- function parse(source) {
- var tokenizer = new tokenizer$1(source);
+ function parse$2(source) {
+ var tokenizer = new Tokenizer(source);
var result = readImplicitGroup(tokenizer);
if (tokenizer.pos !== source.length) {
@@ -6838,13 +7138,13 @@
// warm up parse to elimitate code branches that never execute
// fix soft deoptimizations (insufficient type feedback)
- parse('[a&&#|<\'c\'>*||e() f{2} /,(% g#{1,2} h{2,})]!');
+ parse$2('[a&&#|<\'c\'>*||e() f{2} /,(% g#{1,2} h{2,})]!');
- var parse_1 = parse;
+ var parse_1 = parse$2;
var noop$2 = function() {};
- function ensureFunction(value) {
+ function ensureFunction$1(value) {
return typeof value === 'function' ? value : noop$2;
}
@@ -6884,8 +7184,8 @@
if (typeof options === 'function') {
enter = options;
} else if (options) {
- enter = ensureFunction(options.enter);
- leave = ensureFunction(options.leave);
+ enter = ensureFunction$1(options.enter);
+ leave = ensureFunction$1(options.leave);
}
if (enter === noop$2 && leave === noop$2) {
@@ -6895,7 +7195,9 @@
walk(node);
};
- var tokenStream = new TokenStream_1();
+ var tokenize$2 = tokenizer$3;
+ var TokenStream$2 = TokenStream_1;
+ var tokenStream = new TokenStream$2();
var astToTokens = {
decorator: function(handlers) {
var curNode = null;
@@ -6923,19 +7225,19 @@
}
},
result: function() {
- return prepareTokens(buffer, nodes);
+ return prepareTokens$1(buffer, nodes);
}
};
}
};
- function prepareTokens(str, nodes) {
+ function prepareTokens$1(str, nodes) {
var tokens = [];
var nodesOffset = 0;
var nodesIndex = 0;
var currentNode = nodes ? nodes[nodesIndex].node : null;
- tokenizer(str, tokenStream);
+ tokenize$2(str, tokenStream);
while (!tokenStream.eof) {
if (nodes) {
@@ -6961,29 +7263,31 @@
var prepareTokens_1 = function(value, syntax) {
if (typeof value === 'string') {
- return prepareTokens(value, null);
+ return prepareTokens$1(value, null);
}
return syntax.generate(value, astToTokens);
};
- var MATCH = { type: 'Match' };
- var MISMATCH = { type: 'Mismatch' };
- var DISALLOW_EMPTY = { type: 'DisallowEmpty' };
- var LEFTPARENTHESIS$1 = 40; // (
- var RIGHTPARENTHESIS$1 = 41; // )
+ var parse$1 = parse_1;
+
+ var MATCH$1 = { type: 'Match' };
+ var MISMATCH$1 = { type: 'Mismatch' };
+ var DISALLOW_EMPTY$1 = { type: 'DisallowEmpty' };
+ var LEFTPARENTHESIS$6 = 40; // (
+ var RIGHTPARENTHESIS$6 = 41; // )
function createCondition(match, thenBranch, elseBranch) {
// reduce node count
- if (thenBranch === MATCH && elseBranch === MISMATCH) {
+ if (thenBranch === MATCH$1 && elseBranch === MISMATCH$1) {
return match;
}
- if (match === MATCH && thenBranch === MATCH && elseBranch === MATCH) {
+ if (match === MATCH$1 && thenBranch === MATCH$1 && elseBranch === MATCH$1) {
return match;
}
- if (match.type === 'If' && match.else === MISMATCH && thenBranch === MATCH) {
+ if (match.type === 'If' && match.else === MISMATCH$1 && thenBranch === MATCH$1) {
thenBranch = match.then;
match = match.match;
}
@@ -6999,8 +7303,8 @@
function isFunctionType(name) {
return (
name.length > 2 &&
- name.charCodeAt(name.length - 2) === LEFTPARENTHESIS$1 &&
- name.charCodeAt(name.length - 1) === RIGHTPARENTHESIS$1
+ name.charCodeAt(name.length - 2) === LEFTPARENTHESIS$6 &&
+ name.charCodeAt(name.length - 1) === RIGHTPARENTHESIS$6
);
}
@@ -7027,7 +7331,7 @@
// else MISMATCH
// else MISMATCH
// else MISMATCH
- var result = MATCH;
+ var result = MATCH$1;
for (var i = terms.length - 1; i >= 0; i--) {
var term = terms[i];
@@ -7035,7 +7339,7 @@
result = createCondition(
term,
result,
- MISMATCH
+ MISMATCH$1
);
}
return result;
@@ -7053,7 +7357,7 @@
// then MATCH
// else MISMATCH
- var result = MISMATCH;
+ var result = MISMATCH$1;
var map = null;
for (var i = terms.length - 1; i >= 0; i--) {
@@ -7068,7 +7372,7 @@
type: 'Enum',
map: map
},
- MATCH,
+ MATCH$1,
result
);
}
@@ -7087,7 +7391,7 @@
// create a new conditonal node
result = createCondition(
term,
- MATCH,
+ MATCH$1,
result
);
}
@@ -7130,7 +7434,7 @@
// then MATCH
// else MISMATCH
// else MISMATCH
- var result = MISMATCH;
+ var result = MISMATCH$1;
for (var i = terms.length - 1; i >= 0; i--) {
var term = terms[i];
@@ -7145,7 +7449,7 @@
false
);
} else {
- thenClause = MATCH;
+ thenClause = MATCH$1;
}
result = createCondition(
@@ -7193,7 +7497,7 @@
// then MATCH
// else MATCH
// else MISMATCH
- var result = atLeastOneTermMatched ? MATCH : MISMATCH;
+ var result = atLeastOneTermMatched ? MATCH$1 : MISMATCH$1;
for (var i = terms.length - 1; i >= 0; i--) {
var term = terms[i];
@@ -7208,7 +7512,7 @@
true
);
} else {
- thenClause = MATCH;
+ thenClause = MATCH$1;
}
result = createCondition(
@@ -7222,15 +7526,15 @@
}
function buildMultiplierMatchGraph(node) {
- var result = MATCH;
- var matchTerm = buildMatchGraph(node.term);
+ var result = MATCH$1;
+ var matchTerm = buildMatchGraph$1(node.term);
if (node.max === 0) {
// disable repeating of empty match to prevent infinite loop
matchTerm = createCondition(
matchTerm,
- DISALLOW_EMPTY,
- MISMATCH
+ DISALLOW_EMPTY$1,
+ MISMATCH$1
);
// an occurrence count is not limited, make a cycle;
@@ -7238,12 +7542,12 @@
result = createCondition(
matchTerm,
null, // will be a loop
- MISMATCH
+ MISMATCH$1
);
result.then = createCondition(
- MATCH,
- MATCH,
+ MATCH$1,
+ MATCH$1,
result // make a loop
);
@@ -7251,28 +7555,28 @@
result.then.else = createCondition(
{ type: 'Comma', syntax: node },
result,
- MISMATCH
+ MISMATCH$1
);
}
} else {
// create a match node chain for [min .. max] interval with optional matches
for (var i = node.min || 1; i <= node.max; i++) {
- if (node.comma && result !== MATCH) {
+ if (node.comma && result !== MATCH$1) {
result = createCondition(
{ type: 'Comma', syntax: node },
result,
- MISMATCH
+ MISMATCH$1
);
}
result = createCondition(
matchTerm,
createCondition(
- MATCH,
- MATCH,
+ MATCH$1,
+ MATCH$1,
result
),
- MISMATCH
+ MISMATCH$1
);
}
}
@@ -7280,25 +7584,25 @@
if (node.min === 0) {
// allow zero match
result = createCondition(
- MATCH,
- MATCH,
+ MATCH$1,
+ MATCH$1,
result
);
} else {
// create a match node chain to collect [0 ... min - 1] required matches
for (var i = 0; i < node.min - 1; i++) {
- if (node.comma && result !== MATCH) {
+ if (node.comma && result !== MATCH$1) {
result = createCondition(
{ type: 'Comma', syntax: node },
result,
- MISMATCH
+ MISMATCH$1
);
}
result = createCondition(
matchTerm,
result,
- MISMATCH
+ MISMATCH$1
);
}
}
@@ -7306,7 +7610,7 @@
return result;
}
- function buildMatchGraph(node) {
+ function buildMatchGraph$1(node) {
if (typeof node === 'function') {
return {
type: 'Generic',
@@ -7318,15 +7622,15 @@
case 'Group':
var result = buildGroupMatchGraph(
node.combinator,
- node.terms.map(buildMatchGraph),
+ node.terms.map(buildMatchGraph$1),
false
);
if (node.disallowEmpty) {
result = createCondition(
result,
- DISALLOW_EMPTY,
- MISMATCH
+ DISALLOW_EMPTY$1,
+ MISMATCH$1
);
}
@@ -7399,30 +7703,30 @@
}
}
- var matchGraph = {
- MATCH: MATCH,
- MISMATCH: MISMATCH,
- DISALLOW_EMPTY: DISALLOW_EMPTY,
+ var matchGraph$1 = {
+ MATCH: MATCH$1,
+ MISMATCH: MISMATCH$1,
+ DISALLOW_EMPTY: DISALLOW_EMPTY$1,
buildMatchGraph: function(syntaxTree, ref) {
if (typeof syntaxTree === 'string') {
- syntaxTree = parse_1(syntaxTree);
+ syntaxTree = parse$1(syntaxTree);
}
return {
type: 'MatchGraph',
- match: buildMatchGraph(syntaxTree),
+ match: buildMatchGraph$1(syntaxTree),
syntax: ref || null,
source: syntaxTree
};
}
};
- var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
-
- var MATCH$1 = matchGraph.MATCH;
- var MISMATCH$1 = matchGraph.MISMATCH;
- var DISALLOW_EMPTY$1 = matchGraph.DISALLOW_EMPTY;
- var TYPE$6 = _const.TYPE;
+ var hasOwnProperty$6 = Object.prototype.hasOwnProperty;
+ var matchGraph = matchGraph$1;
+ var MATCH = matchGraph.MATCH;
+ var MISMATCH = matchGraph.MISMATCH;
+ var DISALLOW_EMPTY = matchGraph.DISALLOW_EMPTY;
+ var TYPE$B = _const.TYPE;
var STUB = 0;
var TOKEN = 1;
@@ -7473,18 +7777,28 @@
return true;
}
+ function isContextEdgeDelim(token) {
+ if (token.type !== TYPE$B.Delim) {
+ return false;
+ }
+
+ // Fix matching for unicode-range: U+30??, U+FF00-FF9F
+ // Probably we need to check out previous match instead
+ return token.value !== '?';
+ }
+
function isCommaContextStart(token) {
if (token === null) {
return true;
}
return (
- token.type === TYPE$6.Comma ||
- token.type === TYPE$6.Function ||
- token.type === TYPE$6.LeftParenthesis ||
- token.type === TYPE$6.LeftSquareBracket ||
- token.type === TYPE$6.LeftCurlyBracket ||
- token.type === TYPE$6.Delim
+ token.type === TYPE$B.Comma ||
+ token.type === TYPE$B.Function ||
+ token.type === TYPE$B.LeftParenthesis ||
+ token.type === TYPE$B.LeftSquareBracket ||
+ token.type === TYPE$B.LeftCurlyBracket ||
+ isContextEdgeDelim(token)
);
}
@@ -7494,10 +7808,10 @@
}
return (
- token.type === TYPE$6.RightParenthesis ||
- token.type === TYPE$6.RightSquareBracket ||
- token.type === TYPE$6.RightCurlyBracket ||
- token.type === TYPE$6.Delim
+ token.type === TYPE$B.RightParenthesis ||
+ token.type === TYPE$B.RightSquareBracket ||
+ token.type === TYPE$B.RightCurlyBracket ||
+ token.type === TYPE$B.Delim
);
}
@@ -7506,7 +7820,7 @@
do {
tokenIndex++;
token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;
- } while (token !== null && (token.type === TYPE$6.WhiteSpace || token.type === TYPE$6.Comment));
+ } while (token !== null && (token.type === TYPE$B.WhiteSpace || token.type === TYPE$B.Comment));
}
function getNextToken(offset) {
@@ -7634,7 +7948,7 @@
if (token !== null) {
// doesn't mismatch if just one token left and it's an IE hack
if (tokenIndex !== tokens.length - 1 || (token.value !== '\\0' && token.value !== '\\9')) {
- state = MISMATCH$1;
+ state = MISMATCH;
break;
}
}
@@ -7648,12 +7962,12 @@
state = thenStack.nextState;
// check match is not empty
- if (state === DISALLOW_EMPTY$1) {
+ if (state === DISALLOW_EMPTY) {
if (thenStack.matchStack === matchStack) {
- state = MISMATCH$1;
+ state = MISMATCH;
break;
} else {
- state = MATCH$1;
+ state = MATCH;
}
}
@@ -7703,11 +8017,11 @@
case 'If':
// IMPORTANT: else stack push must go first,
// since it stores the state of thenStack before changes
- if (state.else !== MISMATCH$1) {
+ if (state.else !== MISMATCH) {
pushElseStack(state.else);
}
- if (state.then !== MATCH$1) {
+ if (state.then !== MATCH) {
pushThenStack(state.then);
}
@@ -7729,18 +8043,18 @@
if (state.index === terms.length) {
// no matches at all or it's required all terms to be matched
if (state.mask === 0 || state.syntax.all) {
- state = MISMATCH$1;
+ state = MISMATCH;
break;
}
// a partial match is ok
- state = MATCH$1;
+ state = MATCH;
break;
}
// all terms are matched
if (state.mask === (1 << terms.length) - 1) {
- state = MATCH$1;
+ state = MATCH;
break;
}
@@ -7782,13 +8096,13 @@
name = name.replace(/\\[09].*$/, '');
}
- if (hasOwnProperty$1.call(state.map, name)) {
+ if (hasOwnProperty$6.call(state.map, name)) {
state = state.map[name];
break;
}
}
- state = MISMATCH$1;
+ state = MISMATCH;
break;
case 'Generic':
@@ -7800,9 +8114,9 @@
addTokenToMatch();
}
- state = MATCH$1;
+ state = MATCH;
} else {
- state = MISMATCH$1;
+ state = MISMATCH;
}
break;
@@ -7810,7 +8124,7 @@
case 'Type':
case 'Property':
var syntaxDict = state.type === 'Type' ? 'types' : 'properties';
- var dictSyntax = hasOwnProperty$1.call(syntaxes, syntaxDict) ? syntaxes[syntaxDict][state.name] : null;
+ var dictSyntax = hasOwnProperty$6.call(syntaxes, syntaxDict) ? syntaxes[syntaxDict][state.name] : null;
if (!dictSyntax || !dictSyntax.match) {
throw new Error(
@@ -7827,7 +8141,7 @@
// https://drafts.csswg.org/css-values-4/#custom-idents
// When parsing positionally-ambiguous keywords in a property value, a production
// can only claim the keyword if no other unfulfilled production can claim it.
- (state.name === 'custom-ident' && token.type === TYPE$6.Ident) ||
+ (state.name === 'custom-ident' && token.type === TYPE$B.Ident) ||
// https://drafts.csswg.org/css-values-4/#lengths
// ... if a `0` could be parsed as either a or a in a property (such as line-height),
@@ -7839,7 +8153,7 @@
syntaxStash = stateSnapshotFromSyntax(state, elseStack);
}
- state = MISMATCH$1;
+ state = MISMATCH;
break;
}
}
@@ -7861,45 +8175,45 @@
if (areStringsEqualCaseInsensitive(keywordName, name)) {
addTokenToMatch();
- state = MATCH$1;
+ state = MATCH;
break;
}
}
- state = MISMATCH$1;
+ state = MISMATCH;
break;
case 'AtKeyword':
case 'Function':
if (token !== null && areStringsEqualCaseInsensitive(token.value, state.name)) {
addTokenToMatch();
- state = MATCH$1;
+ state = MATCH;
break;
}
- state = MISMATCH$1;
+ state = MISMATCH;
break;
case 'Token':
if (token !== null && token.value === state.value) {
addTokenToMatch();
- state = MATCH$1;
+ state = MATCH;
break;
}
- state = MISMATCH$1;
+ state = MISMATCH;
break;
case 'Comma':
- if (token !== null && token.type === TYPE$6.Comma) {
+ if (token !== null && token.type === TYPE$B.Comma) {
if (isCommaContextStart(matchStack.token)) {
- state = MISMATCH$1;
+ state = MISMATCH;
} else {
addTokenToMatch();
- state = isCommaContextEnd(token) ? MISMATCH$1 : MATCH$1;
+ state = isCommaContextEnd(token) ? MISMATCH : MATCH;
}
} else {
- state = isCommaContextStart(matchStack.token) || isCommaContextEnd(token) ? MATCH$1 : MISMATCH$1;
+ state = isCommaContextStart(matchStack.token) || isCommaContextEnd(token) ? MATCH : MISMATCH;
}
break;
@@ -7916,9 +8230,9 @@
addTokenToMatch();
}
- state = MATCH$1;
+ state = MATCH;
} else {
- state = MISMATCH$1;
+ state = MISMATCH;
}
break;
@@ -7992,7 +8306,7 @@
return matchResult;
}
- function matchAsTree(tokens, matchGraph, syntaxes) {
+ function matchAsTree$1(tokens, matchGraph, syntaxes) {
var matchResult = internalMatch(tokens, matchGraph, syntaxes || {});
if (matchResult.match === null) {
@@ -8041,7 +8355,7 @@
var match = {
matchAsList: matchAsList,
- matchAsTree: matchAsTree,
+ matchAsTree: matchAsTree$1,
getTotalIterationCount: function() {
return totalIterationCount;
}
@@ -8120,13 +8434,15 @@
});
}
- var trace = {
+ var trace$1 = {
getTrace: getTrace,
isType: isType,
isProperty: isProperty,
isKeyword: isKeyword
};
+ var List$5 = List_1;
+
function getFirstMatchNode(matchNode) {
if ('node' in matchNode) {
return matchNode.node;
@@ -8153,7 +8469,7 @@
lexer.syntax.walk(ast, function(node, item, list) {
if (node === start) {
- var nodes = new List_1();
+ var nodes = new List$5();
do {
nodes.appendData(item.data);
@@ -8187,11 +8503,12 @@
return fragments;
}
- var search = {
+ var search$1 = {
matchFragments: matchFragments
};
- var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
+ var List$4 = List_1;
+ var hasOwnProperty$5 = Object.prototype.hasOwnProperty;
function isValidNumber(value) {
// Number.isInteger(value) && value >= 0
@@ -8221,7 +8538,7 @@
for (var key in node) {
var valid = true;
- if (hasOwnProperty$2.call(node, key) === false) {
+ if (hasOwnProperty$5.call(node, key) === false) {
continue;
}
@@ -8266,7 +8583,7 @@
if (typeof fieldType === 'string') {
valid = node[key] && node[key].type === fieldType;
} else if (Array.isArray(fieldType)) {
- valid = node[key] instanceof List_1;
+ valid = node[key] instanceof List$4;
}
}
}
@@ -8280,8 +8597,8 @@
}
for (var key in fields) {
- if (hasOwnProperty$2.call(fields, key) &&
- hasOwnProperty$2.call(node, key) === false) {
+ if (hasOwnProperty$5.call(fields, key) &&
+ hasOwnProperty$5.call(node, key) === false) {
warn(node, 'Field `' + type + '.' + key + '` is missed');
}
}
@@ -8299,7 +8616,7 @@
};
for (var key in structure) {
- if (hasOwnProperty$2.call(structure, key) === false) {
+ if (hasOwnProperty$5.call(structure, key) === false) {
continue;
}
@@ -8338,7 +8655,7 @@
if (config.node) {
for (var name in config.node) {
- if (hasOwnProperty$2.call(config.node, name)) {
+ if (hasOwnProperty$5.call(config.node, name)) {
var nodeType = config.node[name];
if (nodeType.structure) {
@@ -8354,21 +8671,21 @@
}
};
- var SyntaxReferenceError$1 = error.SyntaxReferenceError;
- var MatchError$1 = error.MatchError;
-
-
-
-
-
-
- var buildMatchGraph$1 = matchGraph.buildMatchGraph;
- var matchAsTree$1 = match.matchAsTree;
-
-
+ var SyntaxReferenceError = error.SyntaxReferenceError;
+ var SyntaxMatchError = error.SyntaxMatchError;
+ var names$1 = names$2;
+ var generic = generic$1;
+ var parse = parse_1;
+ var generate = generate_1;
+ var walk = walk$1;
+ var prepareTokens = prepareTokens_1;
+ var buildMatchGraph = matchGraph$1.buildMatchGraph;
+ var matchAsTree = match.matchAsTree;
+ var trace = trace$1;
+ var search = search$1;
var getStructureFromConfig = structure.getStructureFromConfig;
- var cssWideKeywords$1 = buildMatchGraph$1('inherit | initial | unset');
- var cssWideKeywordsWithExpression = buildMatchGraph$1('inherit | initial | unset | <-ms-legacy-expression>');
+ var cssWideKeywords = buildMatchGraph('inherit | initial | unset');
+ var cssWideKeywordsWithExpression = buildMatchGraph('inherit | initial | unset | <-ms-legacy-expression>');
function dumpMapSyntax(map, compact, syntaxAsAst) {
var result = {};
@@ -8377,13 +8694,30 @@
if (map[name].syntax) {
result[name] = syntaxAsAst
? map[name].syntax
- : generate_1(map[name].syntax, { compact: compact });
+ : generate(map[name].syntax, { compact: compact });
}
}
return result;
}
+ function dumpAtruleMapSyntax(map, compact, syntaxAsAst) {
+ const result = {};
+
+ for (const [name, atrule] of Object.entries(map)) {
+ result[name] = {
+ prelude: atrule.prelude && (
+ syntaxAsAst
+ ? atrule.prelude.syntax
+ : generate(atrule.prelude.syntax, { compact })
+ ),
+ descriptors: atrule.descriptors && dumpMapSyntax(atrule.descriptors, compact, syntaxAsAst)
+ };
+ }
+
+ return result;
+ }
+
function valueHasVar(tokens) {
for (var i = 0; i < tokens.length; i++) {
if (tokens[i].value.toLowerCase() === 'var(') {
@@ -8407,7 +8741,7 @@
}
function matchSyntax(lexer, syntax, value, useCommon) {
- var tokens = prepareTokens_1(value, lexer.syntax);
+ var tokens = prepareTokens(value, lexer.syntax);
var result;
if (valueHasVar(tokens)) {
@@ -8415,15 +8749,15 @@
}
if (useCommon) {
- result = matchAsTree$1(tokens, lexer.valueCommonSyntax, lexer);
+ result = matchAsTree(tokens, lexer.valueCommonSyntax, lexer);
}
if (!useCommon || !result.match) {
- result = matchAsTree$1(tokens, syntax.match, lexer);
+ result = matchAsTree(tokens, syntax.match, lexer);
if (!result.match) {
return buildMatchResult(
null,
- new MatchError$1(result.reason, syntax.syntax, value, result),
+ new SyntaxMatchError(result.reason, syntax.syntax, value, result),
result.iterations
);
}
@@ -8432,8 +8766,8 @@
return buildMatchResult(result.match, null, result.iterations);
}
- var Lexer = function(config, syntax, structure) {
- this.valueCommonSyntax = cssWideKeywords$1;
+ var Lexer$1 = function(config, syntax, structure) {
+ this.valueCommonSyntax = cssWideKeywords;
this.syntax = syntax;
this.generic = false;
this.atrules = {};
@@ -8469,7 +8803,7 @@
}
};
- Lexer.prototype = {
+ Lexer$1.prototype = {
structure: {},
checkStructure: function(ast) {
function collectWarning(node, message) {
@@ -8493,7 +8827,7 @@
return warns.length ? warns : false;
},
- createDescriptor: function(syntax, type, name) {
+ createDescriptor: function(syntax, type, name, parent = null) {
var ref = {
type: type,
name: name
@@ -8501,19 +8835,20 @@
var descriptor = {
type: type,
name: name,
+ parent: parent,
syntax: null,
match: null
};
if (typeof syntax === 'function') {
- descriptor.match = buildMatchGraph$1(syntax, ref);
+ descriptor.match = buildMatchGraph(syntax, ref);
} else {
if (typeof syntax === 'string') {
// lazy parsing on first access
Object.defineProperty(descriptor, 'syntax', {
get: function() {
Object.defineProperty(descriptor, 'syntax', {
- value: parse_1(syntax)
+ value: parse(syntax)
});
return descriptor.syntax;
@@ -8527,7 +8862,7 @@
Object.defineProperty(descriptor, 'match', {
get: function() {
Object.defineProperty(descriptor, 'match', {
- value: buildMatchGraph$1(descriptor.syntax, ref)
+ value: buildMatchGraph(descriptor.syntax, ref)
});
return descriptor.match;
@@ -8538,20 +8873,34 @@
return descriptor;
},
addAtrule_: function(name, syntax) {
- this.atrules[name] = {
- prelude: syntax.prelude ? this.createDescriptor(syntax.prelude, 'AtrulePrelude', name) : null,
+ if (!syntax) {
+ return;
+ }
+
+ this.atrules[name] = {
+ type: 'Atrule',
+ name: name,
+ prelude: syntax.prelude ? this.createDescriptor(syntax.prelude, 'AtrulePrelude', name) : null,
descriptors: syntax.descriptors
- ? Object.keys(syntax.descriptors).reduce((res, name) => {
- res[name] = this.createDescriptor(syntax.descriptors[name], 'AtruleDescriptor', name);
+ ? Object.keys(syntax.descriptors).reduce((res, descName) => {
+ res[descName] = this.createDescriptor(syntax.descriptors[descName], 'AtruleDescriptor', descName, name);
return res;
}, {})
: null
};
},
addProperty_: function(name, syntax) {
+ if (!syntax) {
+ return;
+ }
+
this.properties[name] = this.createDescriptor(syntax, 'Property', name);
},
addType_: function(name, syntax) {
+ if (!syntax) {
+ return;
+ }
+
this.types[name] = this.createDescriptor(syntax, 'Type', name);
if (syntax === generic['-ms-legacy-expression']) {
@@ -8559,48 +8908,84 @@
}
},
- matchAtrulePrelude: function(atruleName, prelude) {
- var atrule = names.keyword(atruleName);
+ checkAtruleName: function(atruleName) {
+ if (!this.getAtrule(atruleName)) {
+ return new SyntaxReferenceError('Unknown at-rule', '@' + atruleName);
+ }
+ },
+ checkAtrulePrelude: function(atruleName, prelude) {
+ let error = this.checkAtruleName(atruleName);
- var atrulePreludeSyntax = atrule.vendor
- ? this.getAtrulePrelude(atrule.name) || this.getAtrulePrelude(atrule.basename)
- : this.getAtrulePrelude(atrule.name);
+ if (error) {
+ return error;
+ }
- if (!atrulePreludeSyntax) {
- if (atrule.basename in this.atrules) {
- return buildMatchResult(null, new Error('At-rule `' + atruleName + '` should not contain a prelude'));
- }
+ var atrule = this.getAtrule(atruleName);
- return buildMatchResult(null, new SyntaxReferenceError$1('Unknown at-rule', atruleName));
+ if (!atrule.prelude && prelude) {
+ return new SyntaxError('At-rule `@' + atruleName + '` should not contain a prelude');
}
- return matchSyntax(this, atrulePreludeSyntax, prelude, true);
+ if (atrule.prelude && !prelude) {
+ return new SyntaxError('At-rule `@' + atruleName + '` should contain a prelude');
+ }
},
- matchAtruleDescriptor: function(atruleName, descriptorName, value) {
- var atrule = names.keyword(atruleName);
- var descriptor = names.keyword(descriptorName);
+ checkAtruleDescriptorName: function(atruleName, descriptorName) {
+ let error = this.checkAtruleName(atruleName);
- var atruleEntry = atrule.vendor
- ? this.atrules[atrule.name] || this.atrules[atrule.basename]
- : this.atrules[atrule.name];
+ if (error) {
+ return error;
+ }
+
+ var atrule = this.getAtrule(atruleName);
+ var descriptor = names$1.keyword(descriptorName);
+
+ if (!atrule.descriptors) {
+ return new SyntaxError('At-rule `@' + atruleName + '` has no known descriptors');
+ }
+
+ if (!atrule.descriptors[descriptor.name] &&
+ !atrule.descriptors[descriptor.basename]) {
+ return new SyntaxReferenceError('Unknown at-rule descriptor', descriptorName);
+ }
+ },
+ checkPropertyName: function(propertyName) {
+ var property = names$1.property(propertyName);
+
+ // don't match syntax for a custom property
+ if (property.custom) {
+ return new Error('Lexer matching doesn\'t applicable for custom properties');
+ }
+
+ if (!this.getProperty(propertyName)) {
+ return new SyntaxReferenceError('Unknown property', propertyName);
+ }
+ },
- if (!atruleEntry) {
- return buildMatchResult(null, new SyntaxReferenceError$1('Unknown at-rule', atruleName));
+ matchAtrulePrelude: function(atruleName, prelude) {
+ var error = this.checkAtrulePrelude(atruleName, prelude);
+
+ if (error) {
+ return buildMatchResult(null, error);
}
- if (!atruleEntry.descriptors) {
- return buildMatchResult(null, new Error('At-rule `' + atruleName + '` has no known descriptors'));
+ if (!prelude) {
+ return buildMatchResult(null, null);
}
- var atruleDescriptorSyntax = descriptor.vendor
- ? atruleEntry.descriptors[descriptor.name] || atruleEntry.descriptors[descriptor.basename]
- : atruleEntry.descriptors[descriptor.name];
+ return matchSyntax(this, this.getAtrule(atruleName).prelude, prelude, false);
+ },
+ matchAtruleDescriptor: function(atruleName, descriptorName, value) {
+ var error = this.checkAtruleDescriptorName(atruleName, descriptorName);
- if (!atruleDescriptorSyntax) {
- return buildMatchResult(null, new SyntaxReferenceError$1('Unknown at-rule descriptor', descriptorName));
+ if (error) {
+ return buildMatchResult(null, error);
}
- return matchSyntax(this, atruleDescriptorSyntax, value, true);
+ var atrule = this.getAtrule(atruleName);
+ var descriptor = names$1.keyword(descriptorName);
+
+ return matchSyntax(this, atrule.descriptors[descriptor.name] || atrule.descriptors[descriptor.basename], value, false);
},
matchDeclaration: function(node) {
if (node.type !== 'Declaration') {
@@ -8610,35 +8995,26 @@
return this.matchProperty(node.property, node.value);
},
matchProperty: function(propertyName, value) {
- var property = names.property(propertyName);
-
- // don't match syntax for a custom property
- if (property.custom) {
- return buildMatchResult(null, new Error('Lexer matching doesn\'t applicable for custom properties'));
- }
-
- var propertySyntax = property.vendor
- ? this.getProperty(property.name) || this.getProperty(property.basename)
- : this.getProperty(property.name);
+ var error = this.checkPropertyName(propertyName);
- if (!propertySyntax) {
- return buildMatchResult(null, new SyntaxReferenceError$1('Unknown property', propertyName));
+ if (error) {
+ return buildMatchResult(null, error);
}
- return matchSyntax(this, propertySyntax, value, true);
+ return matchSyntax(this, this.getProperty(propertyName), value, true);
},
matchType: function(typeName, value) {
var typeSyntax = this.getType(typeName);
if (!typeSyntax) {
- return buildMatchResult(null, new SyntaxReferenceError$1('Unknown type', typeName));
+ return buildMatchResult(null, new SyntaxReferenceError('Unknown type', typeName));
}
return matchSyntax(this, typeSyntax, value, false);
},
match: function(syntax, value) {
if (typeof syntax !== 'string' && (!syntax || !syntax.type)) {
- return buildMatchResult(null, new SyntaxReferenceError$1('Bad syntax'));
+ return buildMatchResult(null, new SyntaxReferenceError('Bad syntax'));
}
if (typeof syntax === 'string' || !syntax.match) {
@@ -8667,16 +9043,31 @@
return result;
},
- getAtrulePrelude: function(atruleName) {
- return this.atrules.hasOwnProperty(atruleName) ? this.atrules[atruleName].prelude : null;
+ getAtrule: function(atruleName, fallbackBasename = true) {
+ var atrule = names$1.keyword(atruleName);
+ var atruleEntry = atrule.vendor && fallbackBasename
+ ? this.atrules[atrule.name] || this.atrules[atrule.basename]
+ : this.atrules[atrule.name];
+
+ return atruleEntry || null;
+ },
+ getAtrulePrelude: function(atruleName, fallbackBasename = true) {
+ const atrule = this.getAtrule(atruleName, fallbackBasename);
+
+ return atrule && atrule.prelude || null;
},
getAtruleDescriptor: function(atruleName, name) {
return this.atrules.hasOwnProperty(atruleName) && this.atrules.declarators
? this.atrules[atruleName].declarators[name] || null
: null;
},
- getProperty: function(name) {
- return this.properties.hasOwnProperty(name) ? this.properties[name] : null;
+ getProperty: function(propertyName, fallbackBasename = true) {
+ var property = names$1.property(propertyName);
+ var propertyEntry = property.vendor && fallbackBasename
+ ? this.properties[property.name] || this.properties[property.basename]
+ : this.properties[property.name];
+
+ return propertyEntry || null;
},
getType: function(name) {
return this.types.hasOwnProperty(name) ? this.types[name] : null;
@@ -8690,7 +9081,7 @@
broken[name] = false;
if (descriptor.syntax !== null) {
- walk$1(descriptor.syntax, function(node) {
+ walk(descriptor.syntax, function(node) {
if (node.type !== 'Type' && node.type !== 'Property') {
return;
}
@@ -8736,7 +9127,8 @@
return {
generic: this.generic,
types: dumpMapSyntax(this.types, !pretty, syntaxAsAst),
- properties: dumpMapSyntax(this.properties, !pretty, syntaxAsAst)
+ properties: dumpMapSyntax(this.properties, !pretty, syntaxAsAst),
+ atrules: dumpAtruleMapSyntax(this.atrules, !pretty, syntaxAsAst)
};
},
toString: function() {
@@ -8744,20 +9136,21 @@
}
};
- var Lexer_1 = Lexer;
+ var Lexer_1 = Lexer$1;
- var definitionSyntax = {
- SyntaxError: _SyntaxError$1,
+ var definitionSyntax$1 = {
+ SyntaxError: _SyntaxError,
parse: parse_1,
generate: generate_1,
walk: walk$1
};
- var isBOM$2 = tokenizer.isBOM;
+ var adoptBuffer = adoptBuffer$2;
+ var isBOM = tokenizer$3.isBOM;
- var N$3 = 10;
- var F$2 = 12;
- var R$2 = 13;
+ var N$1 = 10;
+ var F = 12;
+ var R = 13;
function computeLinesAndColumns(host, source) {
var sourceLength = source.length;
@@ -8765,7 +9158,7 @@
var line = host.startLine;
var columns = adoptBuffer(host.columns, sourceLength);
var column = host.startColumn;
- var startOffset = source.length > 0 ? isBOM$2(source.charCodeAt(0)) : 0;
+ var startOffset = source.length > 0 ? isBOM(source.charCodeAt(0)) : 0;
for (var i = startOffset; i < sourceLength; i++) { // -1
var code = source.charCodeAt(i);
@@ -8773,8 +9166,8 @@
lines[i] = line;
columns[i] = column++;
- if (code === N$3 || code === R$2 || code === F$2) {
- if (code === R$2 && i + 1 < sourceLength && source.charCodeAt(i + 1) === N$3) {
+ if (code === N$1 || code === R || code === F) {
+ if (code === R && i + 1 < sourceLength && source.charCodeAt(i + 1) === N$1) {
i++;
lines[i] = line;
columns[i] = column;
@@ -8792,13 +9185,13 @@
host.columns = columns;
}
- var OffsetToLocation = function() {
+ var OffsetToLocation$1 = function() {
this.lines = null;
this.columns = null;
this.linesAndColumnsComputed = false;
};
- OffsetToLocation.prototype = {
+ OffsetToLocation$1.prototype = {
setSource: function(source, startOffset, startLine, startColumn) {
this.source = source;
this.startOffset = typeof startOffset === 'undefined' ? 0 : startOffset;
@@ -8842,13 +9235,13 @@
}
};
- var OffsetToLocation_1 = OffsetToLocation;
+ var OffsetToLocation_1 = OffsetToLocation$1;
- var TYPE$7 = tokenizer.TYPE;
- var WHITESPACE$2 = TYPE$7.WhiteSpace;
- var COMMENT$2 = TYPE$7.Comment;
+ var TYPE$A = tokenizer$3.TYPE;
+ var WHITESPACE$a = TYPE$A.WhiteSpace;
+ var COMMENT$8 = TYPE$A.Comment;
- var sequence = function readSequence(recognizer) {
+ var sequence$1 = function readSequence(recognizer) {
var children = this.createList();
var child = null;
var context = {
@@ -8862,11 +9255,11 @@
while (!this.scanner.eof) {
switch (this.scanner.tokenType) {
- case COMMENT$2:
+ case COMMENT$8:
this.scanner.next();
continue;
- case WHITESPACE$2:
+ case WHITESPACE$a:
if (context.ignoreWS) {
this.scanner.next();
} else {
@@ -8899,20 +9292,27 @@
return children;
};
- var findWhiteSpaceStart$1 = utils.findWhiteSpaceStart;
-
- var noop$3 = function() {};
-
- var TYPE$8 = _const.TYPE;
- var NAME$2 = _const.NAME;
- var WHITESPACE$3 = TYPE$8.WhiteSpace;
- var IDENT$2 = TYPE$8.Ident;
- var FUNCTION = TYPE$8.Function;
- var URL$1 = TYPE$8.Url;
- var HASH = TYPE$8.Hash;
- var PERCENTAGE = TYPE$8.Percentage;
- var NUMBER$2 = TYPE$8.Number;
- var NUMBERSIGN$1 = 0x0023; // U+0023 NUMBER SIGN (#)
+ var OffsetToLocation = OffsetToLocation_1;
+ var SyntaxError$2 = _SyntaxError$1;
+ var TokenStream$1 = TokenStream_1;
+ var List$3 = List_1;
+ var tokenize$1 = tokenizer$3;
+ var constants = _const;
+ var { findWhiteSpaceStart, cmpStr: cmpStr$2 } = utils$2;
+ var sequence = sequence$1;
+ var noop$1 = function() {};
+
+ var TYPE$z = constants.TYPE;
+ var NAME$1 = constants.NAME;
+ var WHITESPACE$9 = TYPE$z.WhiteSpace;
+ var COMMENT$7 = TYPE$z.Comment;
+ var IDENT$g = TYPE$z.Ident;
+ var FUNCTION$6 = TYPE$z.Function;
+ var URL$4 = TYPE$z.Url;
+ var HASH$5 = TYPE$z.Hash;
+ var PERCENTAGE$3 = TYPE$z.Percentage;
+ var NUMBER$7 = TYPE$z.Number;
+ var NUMBERSIGN$3 = 0x0023; // U+0023 NUMBER SIGN (#)
var NULL = 0;
function createParseContext(name) {
@@ -8978,14 +9378,14 @@
return parserConfig;
}
- var create$1 = function createParser(config) {
+ var create$4 = function createParser(config) {
var parser = {
- scanner: new TokenStream_1(),
- locationMap: new OffsetToLocation_1(),
+ scanner: new TokenStream$1(),
+ locationMap: new OffsetToLocation(),
filename: '',
needPositions: false,
- onParseError: noop$3,
+ onParseError: noop$1,
onParseErrorThrow: false,
parseAtrulePrelude: true,
parseRulePrelude: true,
@@ -8995,10 +9395,10 @@
readSequence: sequence,
createList: function() {
- return new List_1();
+ return new List$3();
},
createSingleNodeList: function(node) {
- return new List_1().appendData(node);
+ return new List$3().appendData(node);
},
getFirstListNode: function(list) {
return list && list.first();
@@ -9030,7 +9430,7 @@
lookupNonWSType: function(offset) {
do {
var type = this.scanner.lookupType(offset++);
- if (type !== WHITESPACE$3) {
+ if (type !== WHITESPACE$9) {
return type;
}
} while (type !== NULL);
@@ -9041,13 +9441,13 @@
eat: function(tokenType) {
if (this.scanner.tokenType !== tokenType) {
var offset = this.scanner.tokenStart;
- var message = NAME$2[tokenType] + ' is expected';
+ var message = NAME$1[tokenType] + ' is expected';
// tweak message and offset
switch (tokenType) {
- case IDENT$2:
+ case IDENT$g:
// when identifier is expected but there is a function or url
- if (this.scanner.tokenType === FUNCTION || this.scanner.tokenType === URL$1) {
+ if (this.scanner.tokenType === FUNCTION$6 || this.scanner.tokenType === URL$4) {
offset = this.scanner.tokenEnd - 1;
message = 'Identifier is expected but function found';
} else {
@@ -9055,16 +9455,16 @@
}
break;
- case HASH:
- if (this.scanner.isDelim(NUMBERSIGN$1)) {
+ case HASH$5:
+ if (this.scanner.isDelim(NUMBERSIGN$3)) {
this.scanner.next();
offset++;
message = 'Name is expected';
}
break;
- case PERCENTAGE:
- if (this.scanner.tokenType === NUMBER$2) {
+ case PERCENTAGE$3:
+ if (this.scanner.tokenType === NUMBER$7) {
offset = this.scanner.tokenEnd;
message = 'Percent sign is expected';
}
@@ -9094,7 +9494,7 @@
consumeFunctionName: function() {
var name = this.scanner.source.substring(this.scanner.tokenStart, this.scanner.tokenEnd - 1);
- this.eat(FUNCTION);
+ this.eat(FUNCTION$6);
return name;
},
@@ -9128,10 +9528,10 @@
var location = typeof offset !== 'undefined' && offset < this.scanner.source.length
? this.locationMap.getLocation(offset)
: this.scanner.eof
- ? this.locationMap.getLocation(findWhiteSpaceStart$1(this.scanner.source, this.scanner.source.length - 1))
+ ? this.locationMap.getLocation(findWhiteSpaceStart(this.scanner.source, this.scanner.source.length - 1))
: this.locationMap.getLocation(this.scanner.tokenStart);
- throw new _SyntaxError(
+ throw new SyntaxError$2(
message || 'Unexpected input',
this.scanner.source,
location.offset,
@@ -9150,9 +9550,10 @@
options = options || {};
var context = options.context || 'default';
+ var onComment = options.onComment;
var ast;
- tokenizer(source, parser.scanner);
+ tokenize$1(source, parser.scanner);
parser.locationMap.setSource(
source,
options.offset,
@@ -9162,7 +9563,7 @@
parser.filename = options.filename || '';
parser.needPositions = Boolean(options.positions);
- parser.onParseError = typeof options.onParseError === 'function' ? options.onParseError : noop$3;
+ parser.onParseError = typeof options.onParseError === 'function' ? options.onParseError : noop$1;
parser.onParseErrorThrow = false;
parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;
parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;
@@ -9173,6 +9574,19 @@
throw new Error('Unknown context `' + context + '`');
}
+ if (typeof onComment === 'function') {
+ parser.scanner.forEachToken((type, start, end) => {
+ if (type === COMMENT$7) {
+ const loc = parser.getLocation(start, end);
+ const value = cmpStr$2(source, end - 2, end, '*/')
+ ? source.slice(start + 2, end - 2)
+ : source.slice(start + 2, end);
+
+ onComment(value, loc);
+ }
+ });
+ }
+
ast = parser.context[context].call(parser, options);
if (!parser.scanner.eof) {
@@ -9183,7 +9597,14 @@
};
};
+ var sourceMapGenerator = {};
+
+ var base64Vlq = {};
+
+ var base64$1 = {};
+
/* -*- Mode: js; js-indent-level: 2; -*- */
+
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -9195,7 +9616,7 @@
/**
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
*/
- var encode = function (number) {
+ base64$1.encode = function (number) {
if (0 <= number && number < intToCharMap.length) {
return intToCharMap[number];
}
@@ -9206,7 +9627,7 @@
* Decode a single base 64 character code digit to an integer. Returns -1 on
* failure.
*/
- var decode = function (charCode) {
+ base64$1.decode = function (charCode) {
var bigA = 65; // 'A'
var bigZ = 90; // 'Z'
@@ -9251,12 +9672,8 @@
return -1;
};
- var base64 = {
- encode: encode,
- decode: decode
- };
-
/* -*- Mode: js; js-indent-level: 2; -*- */
+
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -9293,7 +9710,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+ var base64 = base64$1;
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
@@ -9347,7 +9764,7 @@
/**
* Returns the base 64 VLQ encoded value.
*/
- var encode$1 = function base64VLQ_encode(aValue) {
+ base64Vlq.encode = function base64VLQ_encode(aValue) {
var encoded = "";
var digit;
@@ -9371,7 +9788,7 @@
* Decodes the next base 64 VLQ value from the given string and returns the
* value and the rest of the string via the out parameter.
*/
- var decode$1 = function base64VLQ_decode(aStr, aIndex, aOutParam) {
+ base64Vlq.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
var strLen = aStr.length;
var result = 0;
var shift = 0;
@@ -9397,13 +9814,11 @@
aOutParam.rest = aIndex;
};
- var base64Vlq = {
- encode: encode$1,
- decode: decode$1
- };
+ var util$3 = {};
- var util = createCommonjsModule(function (module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
+
+ (function (exports) {
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -9891,31 +10306,20 @@
return normalize(sourceURL);
}
exports.computeSourceURL = computeSourceURL;
- });
- var util_1 = util.getArg;
- var util_2 = util.urlParse;
- var util_3 = util.urlGenerate;
- var util_4 = util.normalize;
- var util_5 = util.join;
- var util_6 = util.isAbsolute;
- var util_7 = util.relative;
- var util_8 = util.toSetString;
- var util_9 = util.fromSetString;
- var util_10 = util.compareByOriginalPositions;
- var util_11 = util.compareByGeneratedPositionsDeflated;
- var util_12 = util.compareByGeneratedPositionsInflated;
- var util_13 = util.parseSourceMapInput;
- var util_14 = util.computeSourceURL;
+ }(util$3));
+
+ var arraySet = {};
/* -*- Mode: js; js-indent-level: 2; -*- */
+
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
-
- var has = Object.prototype.hasOwnProperty;
+ var util$2 = util$3;
+ var has$1 = Object.prototype.hasOwnProperty;
var hasNativeMap = typeof Map !== "undefined";
/**
@@ -9924,7 +10328,7 @@
* element is O(1). Removing elements from the set is not supported. Only
* strings are supported for membership.
*/
- function ArraySet() {
+ function ArraySet$1() {
this._array = [];
this._set = hasNativeMap ? new Map() : Object.create(null);
}
@@ -9932,8 +10336,8 @@
/**
* Static method for creating ArraySet instances from an existing array.
*/
- ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
- var set = new ArraySet();
+ ArraySet$1.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
+ var set = new ArraySet$1();
for (var i = 0, len = aArray.length; i < len; i++) {
set.add(aArray[i], aAllowDuplicates);
}
@@ -9946,7 +10350,7 @@
*
* @returns Number
*/
- ArraySet.prototype.size = function ArraySet_size() {
+ ArraySet$1.prototype.size = function ArraySet_size() {
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
};
@@ -9955,9 +10359,9 @@
*
* @param String aStr
*/
- ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
- var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
- var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
+ ArraySet$1.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
+ var sStr = hasNativeMap ? aStr : util$2.toSetString(aStr);
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has$1.call(this._set, sStr);
var idx = this._array.length;
if (!isDuplicate || aAllowDuplicates) {
this._array.push(aStr);
@@ -9976,12 +10380,12 @@
*
* @param String aStr
*/
- ArraySet.prototype.has = function ArraySet_has(aStr) {
+ ArraySet$1.prototype.has = function ArraySet_has(aStr) {
if (hasNativeMap) {
return this._set.has(aStr);
} else {
- var sStr = util.toSetString(aStr);
- return has.call(this._set, sStr);
+ var sStr = util$2.toSetString(aStr);
+ return has$1.call(this._set, sStr);
}
};
@@ -9990,15 +10394,15 @@
*
* @param String aStr
*/
- ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
+ ArraySet$1.prototype.indexOf = function ArraySet_indexOf(aStr) {
if (hasNativeMap) {
var idx = this._set.get(aStr);
if (idx >= 0) {
return idx;
}
} else {
- var sStr = util.toSetString(aStr);
- if (has.call(this._set, sStr)) {
+ var sStr = util$2.toSetString(aStr);
+ if (has$1.call(this._set, sStr)) {
return this._set[sStr];
}
}
@@ -10011,7 +10415,7 @@
*
* @param Number aIdx
*/
- ArraySet.prototype.at = function ArraySet_at(aIdx) {
+ ArraySet$1.prototype.at = function ArraySet_at(aIdx) {
if (aIdx >= 0 && aIdx < this._array.length) {
return this._array[aIdx];
}
@@ -10023,24 +10427,23 @@
* indicated by indexOf). Note that this is a copy of the internal array used
* for storing the members so that no one can mess with internal state.
*/
- ArraySet.prototype.toArray = function ArraySet_toArray() {
+ ArraySet$1.prototype.toArray = function ArraySet_toArray() {
return this._array.slice();
};
- var ArraySet_1 = ArraySet;
+ arraySet.ArraySet = ArraySet$1;
- var arraySet = {
- ArraySet: ArraySet_1
- };
+ var mappingList = {};
/* -*- Mode: js; js-indent-level: 2; -*- */
+
/*
* Copyright 2014 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
-
+ var util$1 = util$3;
/**
* Determine whether mappingB is after mappingA with respect to generated
@@ -10053,7 +10456,7 @@
var columnA = mappingA.generatedColumn;
var columnB = mappingB.generatedColumn;
return lineB > lineA || lineB == lineA && columnB >= columnA ||
- util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
+ util$1.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
}
/**
@@ -10061,7 +10464,7 @@
* performance conscious manner. It trades a neglibable overhead in general
* case for a large speedup in case of mappings being added in order.
*/
- function MappingList() {
+ function MappingList$1() {
this._array = [];
this._sorted = true;
// Serves as infimum
@@ -10074,7 +10477,7 @@
*
* NOTE: The order of the mappings is NOT guaranteed.
*/
- MappingList.prototype.unsortedForEach =
+ MappingList$1.prototype.unsortedForEach =
function MappingList_forEach(aCallback, aThisArg) {
this._array.forEach(aCallback, aThisArg);
};
@@ -10084,7 +10487,7 @@
*
* @param Object aMapping
*/
- MappingList.prototype.add = function MappingList_add(aMapping) {
+ MappingList$1.prototype.add = function MappingList_add(aMapping) {
if (generatedPositionAfter(this._last, aMapping)) {
this._last = aMapping;
this._array.push(aMapping);
@@ -10103,31 +10506,28 @@
* an immutable borrow. If you want to take ownership, you must make your own
* copy.
*/
- MappingList.prototype.toArray = function MappingList_toArray() {
+ MappingList$1.prototype.toArray = function MappingList_toArray() {
if (!this._sorted) {
- this._array.sort(util.compareByGeneratedPositionsInflated);
+ this._array.sort(util$1.compareByGeneratedPositionsInflated);
this._sorted = true;
}
return this._array;
};
- var MappingList_1 = MappingList;
-
- var mappingList = {
- MappingList: MappingList_1
- };
+ mappingList.MappingList = MappingList$1;
/* -*- Mode: js; js-indent-level: 2; -*- */
+
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
-
-
- var ArraySet$1 = arraySet.ArraySet;
- var MappingList$1 = mappingList.MappingList;
+ var base64VLQ = base64Vlq;
+ var util = util$3;
+ var ArraySet = arraySet.ArraySet;
+ var MappingList = mappingList.MappingList;
/**
* An instance of the SourceMapGenerator represents a source map which is
@@ -10137,30 +10537,30 @@
* - file: The filename of the generated source.
* - sourceRoot: A root for all relative URLs in this source map.
*/
- function SourceMapGenerator(aArgs) {
+ function SourceMapGenerator$1(aArgs) {
if (!aArgs) {
aArgs = {};
}
this._file = util.getArg(aArgs, 'file', null);
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
- this._sources = new ArraySet$1();
- this._names = new ArraySet$1();
- this._mappings = new MappingList$1();
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+ this._mappings = new MappingList();
this._sourcesContents = null;
}
- SourceMapGenerator.prototype._version = 3;
+ SourceMapGenerator$1.prototype._version = 3;
/**
* Creates a new SourceMapGenerator based on a SourceMapConsumer
*
* @param aSourceMapConsumer The SourceMap.
*/
- SourceMapGenerator.fromSourceMap =
+ SourceMapGenerator$1.fromSourceMap =
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
var sourceRoot = aSourceMapConsumer.sourceRoot;
- var generator = new SourceMapGenerator({
+ var generator = new SourceMapGenerator$1({
file: aSourceMapConsumer.file,
sourceRoot: sourceRoot
});
@@ -10218,7 +10618,7 @@
* - source: The original source file (relative to the sourceRoot).
* - name: An optional original token name for this mapping.
*/
- SourceMapGenerator.prototype.addMapping =
+ SourceMapGenerator$1.prototype.addMapping =
function SourceMapGenerator_addMapping(aArgs) {
var generated = util.getArg(aArgs, 'generated');
var original = util.getArg(aArgs, 'original', null);
@@ -10256,7 +10656,7 @@
/**
* Set the source content for a source file.
*/
- SourceMapGenerator.prototype.setSourceContent =
+ SourceMapGenerator$1.prototype.setSourceContent =
function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
var source = aSourceFile;
if (this._sourceRoot != null) {
@@ -10296,7 +10696,7 @@
* paths. If so, those relative source paths need to be rewritten
* relative to the SourceMapGenerator.
*/
- SourceMapGenerator.prototype.applySourceMap =
+ SourceMapGenerator$1.prototype.applySourceMap =
function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
var sourceFile = aSourceFile;
// If aSourceFile is omitted, we will use the file property of the SourceMap
@@ -10316,8 +10716,8 @@
}
// Applying the SourceMap can add and remove items from the sources and
// the names array.
- var newSources = new ArraySet$1();
- var newNames = new ArraySet$1();
+ var newSources = new ArraySet();
+ var newNames = new ArraySet();
// Find mappings for the "sourceFile"
this._mappings.unsortedForEach(function (mapping) {
@@ -10384,7 +10784,7 @@
* To maintain consistency, we validate that any new mapping being added falls
* in to one of these categories.
*/
- SourceMapGenerator.prototype._validateMapping =
+ SourceMapGenerator$1.prototype._validateMapping =
function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
aName) {
// When aOriginal is truthy but has empty values for .line and .column,
@@ -10427,7 +10827,7 @@
* Serialize the accumulated mappings in to the stream of base 64 VLQs
* specified by the source map format.
*/
- SourceMapGenerator.prototype._serializeMappings =
+ SourceMapGenerator$1.prototype._serializeMappings =
function SourceMapGenerator_serializeMappings() {
var previousGeneratedColumn = 0;
var previousGeneratedLine = 1;
@@ -10462,27 +10862,27 @@
}
}
- next += base64Vlq.encode(mapping.generatedColumn
+ next += base64VLQ.encode(mapping.generatedColumn
- previousGeneratedColumn);
previousGeneratedColumn = mapping.generatedColumn;
if (mapping.source != null) {
sourceIdx = this._sources.indexOf(mapping.source);
- next += base64Vlq.encode(sourceIdx - previousSource);
+ next += base64VLQ.encode(sourceIdx - previousSource);
previousSource = sourceIdx;
// lines are stored 0-based in SourceMap spec version 3
- next += base64Vlq.encode(mapping.originalLine - 1
+ next += base64VLQ.encode(mapping.originalLine - 1
- previousOriginalLine);
previousOriginalLine = mapping.originalLine - 1;
- next += base64Vlq.encode(mapping.originalColumn
+ next += base64VLQ.encode(mapping.originalColumn
- previousOriginalColumn);
previousOriginalColumn = mapping.originalColumn;
if (mapping.name != null) {
nameIdx = this._names.indexOf(mapping.name);
- next += base64Vlq.encode(nameIdx - previousName);
+ next += base64VLQ.encode(nameIdx - previousName);
previousName = nameIdx;
}
}
@@ -10493,7 +10893,7 @@
return result;
};
- SourceMapGenerator.prototype._generateSourcesContent =
+ SourceMapGenerator$1.prototype._generateSourcesContent =
function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
return aSources.map(function (source) {
if (!this._sourcesContents) {
@@ -10512,7 +10912,7 @@
/**
* Externalize the source map.
*/
- SourceMapGenerator.prototype.toJSON =
+ SourceMapGenerator$1.prototype.toJSON =
function SourceMapGenerator_toJSON() {
var map = {
version: this._version,
@@ -10536,26 +10936,22 @@
/**
* Render the source map being generated to a string.
*/
- SourceMapGenerator.prototype.toString =
+ SourceMapGenerator$1.prototype.toString =
function SourceMapGenerator_toString() {
return JSON.stringify(this.toJSON());
};
- var SourceMapGenerator_1 = SourceMapGenerator;
-
- var sourceMapGenerator = {
- SourceMapGenerator: SourceMapGenerator_1
- };
+ sourceMapGenerator.SourceMapGenerator = SourceMapGenerator$1;
- var SourceMapGenerator$1 = sourceMapGenerator.SourceMapGenerator;
+ var SourceMapGenerator = sourceMapGenerator.SourceMapGenerator;
var trackNodes = {
Atrule: true,
Selector: true,
Declaration: true
};
- var sourceMap = function generateSourceMap(handlers) {
- var map = new SourceMapGenerator$1();
+ var sourceMap$1 = function generateSourceMap(handlers) {
+ var map = new SourceMapGenerator();
var line = 1;
var column = 0;
var generated = {
@@ -10643,7 +11039,8 @@
return handlers;
};
- var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
+ var sourceMap = sourceMap$1;
+ var hasOwnProperty$4 = Object.prototype.hasOwnProperty;
function processChildren(node, delimeter) {
var list = node.children;
@@ -10663,9 +11060,9 @@
}
}
- var create$2 = function createGenerator(config) {
+ var create$3 = function createGenerator(config) {
function processNode(node) {
- if (hasOwnProperty$3.call(types, node.type)) {
+ if (hasOwnProperty$4.call(types, node.type)) {
types[node.type].call(this, node);
} else {
throw new Error('Unknown node type: ' + node.type);
@@ -10709,13 +11106,15 @@
};
};
- var create$3 = function createConvertors(walk) {
+ var List$2 = List_1;
+
+ var create$2 = function createConvertors(walk) {
return {
fromPlainObject: function(ast) {
walk(ast, {
enter: function(node) {
- if (node.children && node.children instanceof List_1 === false) {
- node.children = new List_1().fromArray(node.children);
+ if (node.children && node.children instanceof List$2 === false) {
+ node.children = new List$2().fromArray(node.children);
}
}
});
@@ -10725,7 +11124,7 @@
toPlainObject: function(ast) {
walk(ast, {
leave: function(node) {
- if (node.children && node.children instanceof List_1) {
+ if (node.children && node.children instanceof List$2) {
node.children = node.children.toArray();
}
}
@@ -10736,11 +11135,11 @@
};
};
- var hasOwnProperty$4 = Object.prototype.hasOwnProperty;
- var noop$4 = function() {};
+ var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
+ var noop = function() {};
- function ensureFunction$1(value) {
- return typeof value === 'function' ? value : noop$4;
+ function ensureFunction(value) {
+ return typeof value === 'function' ? value : noop;
}
function invokeForType(fn, type) {
@@ -10756,7 +11155,7 @@
var walkers = [];
for (var key in structure) {
- if (hasOwnProperty$4.call(structure, key) === false) {
+ if (hasOwnProperty$3.call(structure, key) === false) {
continue;
}
@@ -10801,7 +11200,7 @@
var types = {};
for (var name in config.node) {
- if (hasOwnProperty$4.call(config.node, name)) {
+ if (hasOwnProperty$3.call(config.node, name)) {
var nodeType = config.node[name];
if (!nodeType.structure) {
@@ -10824,7 +11223,7 @@
fields.reverse();
}
- return function(node, context, walk) {
+ return function(node, context, walk, walkReducer) {
var prevContextValue;
if (useContext) {
@@ -10838,13 +11237,15 @@
if (!field.nullable || ref) {
if (field.type === 'list') {
- if (reverse) {
- ref.forEachRight(walk);
- } else {
- ref.forEach(walk);
+ var breakWalk = reverse
+ ? ref.reduceRight(walkReducer, false)
+ : ref.reduce(walkReducer, false);
+
+ if (breakWalk) {
+ return true;
}
- } else {
- walk(ref);
+ } else if (walk(ref)) {
+ return true;
}
}
}
@@ -10879,13 +11280,15 @@
};
}
- var create$4 = function createWalker(config) {
+ var create$1 = function createWalker(config) {
var types = getTypesFromConfig(config);
var iteratorsNatural = {};
var iteratorsReverse = {};
+ var breakWalk = Symbol('break-walk');
+ var skipNode = Symbol('skip-node');
for (var name in types) {
- if (hasOwnProperty$4.call(types, name) && types[name] !== null) {
+ if (hasOwnProperty$3.call(types, name) && types[name] !== null) {
iteratorsNatural[name] = createTypeIterator(types[name], false);
iteratorsReverse[name] = createTypeIterator(types[name], true);
}
@@ -10896,19 +11299,38 @@
var walk = function(root, options) {
function walkNode(node, item, list) {
- enter.call(context, node, item, list);
+ var enterRet = enter.call(context, node, item, list);
+
+ if (enterRet === breakWalk) {
+ debugger;
+ return true;
+ }
+
+ if (enterRet === skipNode) {
+ return false;
+ }
if (iterators.hasOwnProperty(node.type)) {
- iterators[node.type](node, context, walkNode);
+ if (iterators[node.type](node, context, walkNode, walkReducer)) {
+ return true;
+ }
}
- leave.call(context, node, item, list);
+ if (leave.call(context, node, item, list) === breakWalk) {
+ return true;
+ }
+
+ return false;
}
- var enter = noop$4;
- var leave = noop$4;
+ var walkReducer = (ret, data, item, list) => ret || walkNode(data, item, list);
+ var enter = noop;
+ var leave = noop;
var iterators = iteratorsNatural;
var context = {
+ break: breakWalk,
+ skip: skipNode,
+
root: root,
stylesheet: null,
atrule: null,
@@ -10923,8 +11345,8 @@
if (typeof options === 'function') {
enter = options;
} else if (options) {
- enter = ensureFunction$1(options.enter);
- leave = ensureFunction$1(options.leave);
+ enter = ensureFunction(options.enter);
+ leave = ensureFunction(options.leave);
if (options.reverse) {
iterators = iteratorsReverse;
@@ -10944,26 +11366,23 @@
}
}
- if (enter === noop$4 && leave === noop$4) {
+ if (enter === noop && leave === noop) {
throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
}
- // swap handlers in reverse mode to invert visit order
- if (options.reverse) {
- var tmp = enter;
- enter = leave;
- leave = tmp;
- }
-
walkNode(root);
};
+ walk.break = breakWalk;
+ walk.skip = skipNode;
+
walk.find = function(ast, fn) {
var found = null;
walk(ast, function(node, item, list) {
- if (found === null && fn.call(this, node, item, list)) {
+ if (fn.call(this, node, item, list)) {
found = node;
+ return breakWalk;
}
});
@@ -10976,8 +11395,9 @@
walk(ast, {
reverse: true,
enter: function(node, item, list) {
- if (found === null && fn.call(this, node, item, list)) {
+ if (fn.call(this, node, item, list)) {
found = node;
+ return breakWalk;
}
}
});
@@ -11000,14 +11420,16 @@
return walk;
};
- var clone = function clone(node) {
+ var List$1 = List_1;
+
+ var clone$1 = function clone(node) {
var result = {};
for (var key in node) {
var value = node[key];
if (value) {
- if (Array.isArray(value) || value instanceof List_1) {
+ if (Array.isArray(value) || value instanceof List$1) {
value = value.map(clone);
} else if (value.constructor === Object) {
value = clone(value);
@@ -11020,84 +11442,138 @@
return result;
};
- var hasOwnProperty$5 = Object.prototype.hasOwnProperty;
- var shape = {
+ const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
+ const shape$1 = {
generic: true,
- types: {},
- atrules: {},
- properties: {},
- parseContext: {},
- scope: {},
+ types: appendOrAssign,
+ atrules: {
+ prelude: appendOrAssignOrNull,
+ descriptors: appendOrAssignOrNull
+ },
+ properties: appendOrAssign,
+ parseContext: assign,
+ scope: deepAssign,
atrule: ['parse'],
pseudo: ['parse'],
node: ['name', 'structure', 'parse', 'generate', 'walkContext']
};
- function isObject(value) {
+ function isObject$2(value) {
return value && value.constructor === Object;
}
function copy(value) {
- if (isObject(value)) {
- return Object.assign({}, value);
- } else {
- return value;
- }
+ return isObject$2(value)
+ ? Object.assign({}, value)
+ : value;
+ }
+
+ function assign(dest, src) {
+ return Object.assign(dest, src);
}
- function extend(dest, src) {
- for (var key in src) {
- if (hasOwnProperty$5.call(src, key)) {
- if (isObject(dest[key])) {
- extend(dest[key], copy(src[key]));
+
+ function deepAssign(dest, src) {
+ for (const key in src) {
+ if (hasOwnProperty$2.call(src, key)) {
+ if (isObject$2(dest[key])) {
+ deepAssign(dest[key], copy(src[key]));
} else {
dest[key] = copy(src[key]);
}
}
}
+
+ return dest;
+ }
+
+ function append(a, b) {
+ if (typeof b === 'string' && /^\s*\|/.test(b)) {
+ return typeof a === 'string'
+ ? a + b
+ : b.replace(/^\s*\|\s*/, '');
+ }
+
+ return b || null;
+ }
+
+ function appendOrAssign(a, b) {
+ if (typeof b === 'string') {
+ return append(a, b);
+ }
+
+ const result = Object.assign({}, a);
+ for (let key in b) {
+ if (hasOwnProperty$2.call(b, key)) {
+ result[key] = append(hasOwnProperty$2.call(a, key) ? a[key] : undefined, b[key]);
+ }
+ }
+
+ return result;
+ }
+
+ function appendOrAssignOrNull(a, b) {
+ const result = appendOrAssign(a, b);
+
+ return !isObject$2(result) || Object.keys(result).length
+ ? result
+ : null;
}
- function mix(dest, src, shape) {
- for (var key in shape) {
- if (hasOwnProperty$5.call(shape, key) === false) {
+ function mix$1(dest, src, shape) {
+ for (const key in shape) {
+ if (hasOwnProperty$2.call(shape, key) === false) {
continue;
}
if (shape[key] === true) {
if (key in src) {
- if (hasOwnProperty$5.call(src, key)) {
+ if (hasOwnProperty$2.call(src, key)) {
dest[key] = copy(src[key]);
}
}
} else if (shape[key]) {
- if (isObject(shape[key])) {
- var res = {};
- extend(res, dest[key]);
- extend(res, src[key]);
- dest[key] = res;
+ if (typeof shape[key] === 'function') {
+ const fn = shape[key];
+ dest[key] = fn({}, dest[key]);
+ dest[key] = fn(dest[key] || {}, src[key]);
+ } else if (isObject$2(shape[key])) {
+ const result = {};
+
+ for (let name in dest[key]) {
+ result[name] = mix$1({}, dest[key][name], shape[key]);
+ }
+
+ for (let name in src[key]) {
+ result[name] = mix$1(result[name] || {}, src[key][name], shape[key]);
+ }
+
+ dest[key] = result;
} else if (Array.isArray(shape[key])) {
- var res = {};
- var innerShape = shape[key].reduce(function(s, k) {
+ const res = {};
+ const innerShape = shape[key].reduce(function(s, k) {
s[k] = true;
return s;
}, {});
- for (var name in dest[key]) {
- if (hasOwnProperty$5.call(dest[key], name)) {
- res[name] = {};
- if (dest[key] && dest[key][name]) {
- mix(res[name], dest[key][name], innerShape);
- }
+
+ for (const [name, value] of Object.entries(dest[key] || {})) {
+ res[name] = {};
+ if (value) {
+ mix$1(res[name], value, innerShape);
}
}
- for (var name in src[key]) {
- if (hasOwnProperty$5.call(src[key], name)) {
+
+ for (const name in src[key]) {
+ if (hasOwnProperty$2.call(src[key], name)) {
if (!res[name]) {
res[name] = {};
}
+
if (src[key] && src[key][name]) {
- mix(res[name], src[key][name], innerShape);
+ mix$1(res[name], src[key][name], innerShape);
}
}
}
+
dest[key] = res;
}
}
@@ -11105,21 +11581,33 @@
return dest;
}
- var mix_1 = function(dest, src) {
- return mix(dest, src, shape);
- };
+ var mix_1 = (dest, src) => mix$1(dest, src, shape$1);
+
+ var List = List_1;
+ var SyntaxError$1 = _SyntaxError$1;
+ var TokenStream = TokenStream_1;
+ var Lexer = Lexer_1;
+ var definitionSyntax = definitionSyntax$1;
+ var tokenize = tokenizer$3;
+ var createParser = create$4;
+ var createGenerator = create$3;
+ var createConvertor = create$2;
+ var createWalker = create$1;
+ var clone = clone$1;
+ var names = names$2;
+ var mix = mix_1;
function createSyntax(config) {
- var parse = create$1(config);
- var walk = create$4(config);
- var generate = create$2(config);
- var convert = create$3(walk);
+ var parse = createParser(config);
+ var walk = createWalker(config);
+ var generate = createGenerator(config);
+ var convert = createConvertor(walk);
var syntax = {
- List: List_1,
- SyntaxError: _SyntaxError,
- TokenStream: TokenStream_1,
- Lexer: Lexer_1,
+ List: List,
+ SyntaxError: SyntaxError$1,
+ TokenStream: TokenStream,
+ Lexer: Lexer,
vendorPrefix: names.vendorPrefix,
keyword: names.keyword,
@@ -11129,10 +11617,10 @@
definitionSyntax: definitionSyntax,
lexer: null,
createLexer: function(config) {
- return new Lexer_1(config, syntax, syntax.lexer.structure);
+ return new Lexer(config, syntax, syntax.lexer.structure);
},
- tokenize: tokenizer,
+ tokenize: tokenize,
parse: parse,
walk: walk,
generate: generate,
@@ -11146,19 +11634,19 @@
toPlainObject: convert.toPlainObject,
createSyntax: function(config) {
- return createSyntax(mix_1({}, config));
+ return createSyntax(mix({}, config));
},
fork: function(extension) {
- var base = mix_1({}, config); // copy of config
+ var base = mix({}, config); // copy of config
return createSyntax(
typeof extension === 'function'
? extension(base, Object.assign)
- : mix_1(base, extension)
+ : mix(base, extension)
);
}
};
- syntax.lexer = new Lexer_1({
+ syntax.lexer = new Lexer({
generic: true,
types: config.types,
atrules: config.atrules,
@@ -11168,15 +11656,11 @@
return syntax;
}
- var create_1 = function(config) {
- return createSyntax(mix_1({}, config));
- };
-
- var create$5 = {
- create: create_1
+ create$5.create = function(config) {
+ return createSyntax(mix({}, config));
};
- var atRules = {
+ var require$$0 = {
"@charset": {
syntax: "@charset \"\";",
groups: [
@@ -11197,7 +11681,7 @@
"additive-symbols": {
syntax: "[ && ]#",
media: "all",
- initial: "N/A",
+ initial: "n/a (required)",
percentages: "no",
computed: "asSpecified",
order: "orderOfAppearance",
@@ -11269,7 +11753,7 @@
symbols: {
syntax: "+",
media: "all",
- initial: "N/A",
+ initial: "n/a (required)",
percentages: "no",
computed: "asSpecified",
order: "orderOfAppearance",
@@ -11476,7 +11960,7 @@
percentages: "no",
computed: "asSpecified",
order: "uniqueOrder",
- status: "experimental"
+ status: "standard"
},
marks: {
syntax: "none | [ crop || cross ]",
@@ -11488,11 +11972,64 @@
percentages: "no",
computed: "asSpecified",
order: "orderOfAppearance",
- status: "experimental"
+ status: "standard"
+ },
+ size: {
+ syntax: "{1,2} | auto | [ || [ portrait | landscape ] ]",
+ media: [
+ "visual",
+ "paged"
+ ],
+ initial: "auto",
+ percentages: "no",
+ computed: "asSpecifiedRelativeToAbsoluteLengths",
+ order: "orderOfAppearance",
+ status: "standard"
}
},
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@page"
+ },
+ "@property": {
+ syntax: "@property {\n \n}",
+ interfaces: [
+ "CSS",
+ "CSSPropertyRule"
+ ],
+ groups: [
+ "CSS Houdini"
+ ],
+ descriptors: {
+ syntax: {
+ syntax: "",
+ media: "all",
+ percentages: "no",
+ initial: "n/a (required)",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental"
+ },
+ inherits: {
+ syntax: "true | false",
+ media: "all",
+ percentages: "no",
+ initial: "auto",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental"
+ },
+ "initial-value": {
+ syntax: "",
+ media: "all",
+ initial: "n/a (required)",
+ percentages: "no",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental"
+ }
+ },
+ status: "experimental",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@property"
},
"@supports": {
syntax: "@supports {\n \n}",
@@ -11633,6 +12170,18 @@
order: "uniqueOrder",
status: "standard"
},
+ "viewport-fit": {
+ syntax: "auto | contain | cover",
+ media: [
+ "visual",
+ "continuous"
+ ],
+ initial: "auto",
+ percentages: "no",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "standard"
+ },
width: {
syntax: "{1,2}",
media: [
@@ -11672,11 +12221,6 @@
}
};
- var atRules$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': atRules
- });
-
var all = {
syntax: "initial | inherit | unset | revert",
media: "noPracticalMedia",
@@ -11728,7 +12272,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/animation"
};
var appearance = {
- syntax: "none | auto | button | textfield | ",
+ syntax: "none | auto | textfield | menulist-button | ",
media: "all",
inherited: false,
animationType: "discrete",
@@ -11741,7 +12285,7 @@
computed: "asSpecified",
order: "perGrammar",
status: "experimental",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-moz-appearance"
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/appearance"
};
var azimuth = {
syntax: " | [ [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards",
@@ -11888,7 +12432,7 @@
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/clip"
};
- var color = {
+ var color$1 = {
syntax: "",
media: "visual",
inherited: true,
@@ -11947,7 +12491,7 @@
appliesto: "allElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/contain"
};
var content = {
@@ -12141,7 +12685,7 @@
"row-gap",
"column-gap"
],
- appliesto: "gridContainers",
+ appliesto: "multiColumnElementsFlexContainersGridContainers",
computed: [
"row-gap",
"column-gap"
@@ -12194,7 +12738,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/grid"
};
var height = {
- syntax: "[ | ] && [ border-box | content-box ]? | available | min-content | max-content | fit-content | auto",
+ syntax: "auto | | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -12297,7 +12841,8 @@
],
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin"
@@ -12384,7 +12929,7 @@
],
order: "perGrammar",
stacking: true,
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/offset"
};
var opacity = {
@@ -12416,7 +12961,7 @@
"CSS Flexible Box Layout"
],
initial: "0",
- appliesto: "flexItemsAndAbsolutelyPositionedFlexContainerChildren",
+ appliesto: "flexItemsGridItemsAbsolutelyPositionedContainerChildren",
computed: "asSpecified",
order: "uniqueOrder",
status: "standard",
@@ -12480,7 +13025,10 @@
],
initial: "visible",
appliesto: "blockContainersFlexContainersGridContainers",
- computed: "asSpecified",
+ computed: [
+ "overflow-x",
+ "overflow-y"
+ ],
order: "uniqueOrder",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overflow"
@@ -12509,7 +13057,8 @@
],
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/padding"
@@ -12531,7 +13080,7 @@
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/perspective"
};
- var position = {
+ var position$1 = {
syntax: "static | relative | absolute | sticky | fixed",
media: "visual",
inherited: false,
@@ -12739,7 +13288,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/widows"
};
var width = {
- syntax: "[ | ] && [ border-box | content-box ]? | available | min-content | max-content | fit-content | auto",
+ syntax: "auto | | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -12770,7 +13319,7 @@
status: "nonstandard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/zoom"
};
- var properties$1 = {
+ var require$$1 = {
"--*": {
syntax: "",
media: "all",
@@ -13010,27 +13559,59 @@
status: "nonstandard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-ms-flow-into"
},
- "-ms-high-contrast-adjust": {
- syntax: "auto | none",
+ "-ms-grid-columns": {
+ syntax: "none | | ",
media: "visual",
- inherited: true,
- animationType: "discrete",
- percentages: "no",
+ inherited: false,
+ animationType: "simpleListOfLpcDifferenceLpc",
+ percentages: "referToDimensionOfContentArea",
groups: [
- "Microsoft Extensions"
+ "CSS Grid Layout"
],
- initial: "auto",
- appliesto: "allElements",
- computed: "asSpecified",
+ initial: "none",
+ appliesto: "gridContainers",
+ computed: "asSpecifiedRelativeToAbsoluteLengths",
order: "uniqueOrder",
status: "nonstandard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-ms-high-contrast-adjust"
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-ms-grid-columns"
},
- "-ms-hyphenate-limit-chars": {
- syntax: "auto | {1,3}",
+ "-ms-grid-rows": {
+ syntax: "none | | ",
media: "visual",
- inherited: true,
- animationType: "discrete",
+ inherited: false,
+ animationType: "simpleListOfLpcDifferenceLpc",
+ percentages: "referToDimensionOfContentArea",
+ groups: [
+ "CSS Grid Layout"
+ ],
+ initial: "none",
+ appliesto: "gridContainers",
+ computed: "asSpecifiedRelativeToAbsoluteLengths",
+ order: "uniqueOrder",
+ status: "nonstandard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-ms-grid-rows"
+ },
+ "-ms-high-contrast-adjust": {
+ syntax: "auto | none",
+ media: "visual",
+ inherited: true,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "Microsoft Extensions"
+ ],
+ initial: "auto",
+ appliesto: "allElements",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "nonstandard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-ms-high-contrast-adjust"
+ },
+ "-ms-hyphenate-limit-chars": {
+ syntax: "auto | {1,3}",
+ media: "visual",
+ inherited: true,
+ animationType: "discrete",
percentages: "no",
groups: [
"Microsoft Extensions"
@@ -13575,7 +14156,7 @@
computed: "asSpecified",
order: "uniqueOrder",
status: "nonstandard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-moz-appearance"
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/appearance"
},
"-moz-binding": {
syntax: " | none",
@@ -13690,7 +14271,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-moz-float-edge"
},
"-moz-force-broken-image-icon": {
- syntax: "",
+ syntax: "",
media: "visual",
inherited: false,
animationType: "discrete",
@@ -13950,7 +14531,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-moz-window-shadow"
},
"-webkit-appearance": {
- syntax: "none | button | button-bevel | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield",
+ syntax: "none | button | button-bevel | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield | -apple-pay-button",
media: "visual",
inherited: false,
animationType: "discrete",
@@ -13963,7 +14544,7 @@
computed: "asSpecified",
order: "uniqueOrder",
status: "nonstandard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-moz-appearance"
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/appearance"
},
"-webkit-border-before": {
syntax: "<'border-width'> || <'border-style'> || <'color'>",
@@ -14474,6 +15055,22 @@
order: "uniqueOrder",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/align-self"
+ },
+ "align-tracks": {
+ syntax: "[ normal | | | ? ]#",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Grid Layout"
+ ],
+ initial: "normal",
+ appliesto: "gridContainersWithMasonryLayoutInTheirBlockAxis",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/align-tracks"
},
all: all,
animation: animation,
@@ -14636,7 +15233,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecified",
order: "uniqueOrder",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/backdrop-filter"
},
"backface-visibility": {
@@ -14804,7 +15401,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/background-position"
},
"background-position-x": {
- syntax: "[ center | [ left | right | x-start | x-end ]? ? ]#",
+ syntax: "[ center | [ [ left | right | x-start | x-end ]? ? ]! ]#",
media: "visual",
inherited: false,
animationType: "discrete",
@@ -14820,7 +15417,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/background-position-x"
},
"background-position-y": {
- syntax: "[ center | [ top | bottom | y-start | y-end ]? ? ]#",
+ syntax: "[ center | [ [ top | bottom | y-start | y-end ]? ? ]! ]#",
media: "visual",
inherited: false,
animationType: "discrete",
@@ -14896,7 +15493,7 @@
syntax: "<'width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "blockSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -14985,7 +15582,11 @@
syntax: "<'border-top-width'> || <'border-top-style'> || <'color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: [
+ "border-block-end-color",
+ "border-block-end-style",
+ "border-block-end-width"
+ ],
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15009,7 +15610,7 @@
syntax: "<'border-top-color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "color",
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15041,7 +15642,7 @@
syntax: "<'border-top-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -15057,7 +15658,11 @@
syntax: "<'border-top-width'> || <'border-top-style'> || <'color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: [
+ "border-block-start-color",
+ "border-block-start-style",
+ "border-block-start-width"
+ ],
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15081,7 +15686,7 @@
syntax: "<'border-top-color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "color",
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15113,7 +15718,7 @@
syntax: "<'border-top-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -15496,7 +16101,11 @@
syntax: "<'border-top-width'> || <'border-top-style'> || <'color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: [
+ "border-inline-end-color",
+ "border-inline-end-style",
+ "border-inline-end-width"
+ ],
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15568,7 +16177,7 @@
syntax: "<'border-top-color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "color",
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15600,7 +16209,7 @@
syntax: "<'border-top-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -15616,7 +16225,11 @@
syntax: "<'border-top-width'> || <'border-top-style'> || <'color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: [
+ "border-inline-start-color",
+ "border-inline-start-style",
+ "border-inline-start-width"
+ ],
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15640,7 +16253,7 @@
syntax: "<'border-top-color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "color",
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15672,7 +16285,7 @@
syntax: "<'border-top-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -16423,7 +17036,7 @@
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/clip-path"
},
- color: color,
+ color: color$1,
"color-adjust": {
syntax: "economy | exact",
media: "visual",
@@ -16895,7 +17508,7 @@
"::first-line",
"::placeholder"
],
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/font-variation-settings"
},
"font-size": {
@@ -16939,6 +17552,22 @@
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/font-size-adjust"
+ },
+ "font-smooth": {
+ syntax: "auto | never | always | | ",
+ media: "visual",
+ inherited: true,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Fonts"
+ ],
+ initial: "auto",
+ appliesto: "allElements",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "nonstandard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/font-smooth"
},
"font-stretch": {
syntax: "",
@@ -17514,7 +18143,7 @@
groups: [
"CSS Images"
],
- initial: "0deg",
+ initial: "from-image",
appliesto: "allElements",
computed: "angleRoundedToNextQuarter",
order: "uniqueOrder",
@@ -17604,7 +18233,7 @@
syntax: "<'width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "inlineSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -17761,6 +18390,22 @@
order: "uniqueOrder",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/justify-self"
+ },
+ "justify-tracks": {
+ syntax: "[ normal | | ? [ | left | right ] ]#",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Grid Layout"
+ ],
+ initial: "normal",
+ appliesto: "gridContainersWithMasonryLayoutInTheirInlineAxis",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/justify-tracks"
},
left: left,
"letter-spacing": {
@@ -17786,7 +18431,7 @@
"line-break": {
syntax: "auto | loose | normal | strict | anywhere",
media: "visual",
- inherited: false,
+ inherited: true,
animationType: "discrete",
percentages: "no",
groups: [
@@ -17944,7 +18589,7 @@
syntax: "<'margin-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "dependsOnLayoutModel",
groups: [
"CSS Logical Properties"
@@ -17960,7 +18605,7 @@
syntax: "<'margin-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "dependsOnLayoutModel",
groups: [
"CSS Logical Properties"
@@ -17986,7 +18631,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin-bottom"
@@ -18011,7 +18657,7 @@
syntax: "<'margin-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "dependsOnLayoutModel",
groups: [
"CSS Logical Properties"
@@ -18027,7 +18673,7 @@
syntax: "<'margin-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "dependsOnLayoutModel",
groups: [
"CSS Logical Properties"
@@ -18053,7 +18699,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin-left"
@@ -18072,7 +18719,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin-right"
@@ -18091,10 +18739,31 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin-top"
+ },
+ "margin-trim": {
+ syntax: "none | in-flow | all",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Box Model"
+ ],
+ initial: "none",
+ appliesto: "blockContainersAndMultiColumnContainers",
+ computed: "asSpecified",
+ order: "perGrammar",
+ alsoAppliesTo: [
+ "::first-letter",
+ "::first-line"
+ ],
+ status: "experimental",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin-trim"
},
mask: mask,
"mask-border": {
@@ -18135,7 +18804,7 @@
],
order: "perGrammar",
stacking: true,
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border"
},
"mask-border-mode": {
@@ -18151,7 +18820,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-mode"
},
"mask-border-outset": {
@@ -18167,7 +18836,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecifiedRelativeToAbsoluteLengths",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-outset"
},
"mask-border-repeat": {
@@ -18183,7 +18852,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-repeat"
},
"mask-border-slice": {
@@ -18199,7 +18868,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-slice"
},
"mask-border-source": {
@@ -18215,7 +18884,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecifiedURLsAbsolute",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-source"
},
"mask-border-width": {
@@ -18231,7 +18900,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecifiedRelativeToAbsoluteLengths",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-width"
},
"mask-clip": {
@@ -18377,12 +19046,44 @@
order: "perGrammar",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-type"
+ },
+ "masonry-auto-flow": {
+ syntax: "[ pack | next ] || [ definite-first | ordered ]",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Grid Layout"
+ ],
+ initial: "pack",
+ appliesto: "gridContainersWithMasonryLayout",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/masonry-auto-flow"
+ },
+ "math-style": {
+ syntax: "normal | compact",
+ media: "visual",
+ inherited: true,
+ animationType: "notAnimatable",
+ percentages: "no",
+ groups: [
+ "MathML"
+ ],
+ initial: "normal",
+ appliesto: "allElements",
+ computed: "asSpecified",
+ order: "perGrammar",
+ status: "standard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/math-style"
},
"max-block-size": {
syntax: "<'max-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "blockSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18391,11 +19092,11 @@
appliesto: "sameAsWidthAndHeight",
computed: "sameAsMaxWidthAndMaxHeight",
order: "uniqueOrder",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/max-block-size"
},
"max-height": {
- syntax: " | | none | max-content | min-content | fit-content | fill-available",
+ syntax: "none | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -18414,7 +19115,7 @@
syntax: "<'max-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "inlineSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18423,7 +19124,7 @@
appliesto: "sameAsWidthAndHeight",
computed: "sameAsMaxWidthAndMaxHeight",
order: "uniqueOrder",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/max-inline-size"
},
"max-lines": {
@@ -18442,7 +19143,7 @@
status: "experimental"
},
"max-width": {
- syntax: " | | none | max-content | min-content | fit-content | fill-available",
+ syntax: "none | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -18461,7 +19162,7 @@
syntax: "<'min-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "blockSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18474,7 +19175,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/min-block-size"
},
"min-height": {
- syntax: " | | auto | max-content | min-content | fit-content | fill-available",
+ syntax: "auto | | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -18493,7 +19194,7 @@
syntax: "<'min-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "inlineSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18506,7 +19207,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/min-inline-size"
},
"min-width": {
- syntax: " | | auto | max-content | min-content | fit-content | fill-available",
+ syntax: "auto | | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -18584,7 +19285,7 @@
appliesto: "transformableElements",
computed: "forLengthAbsoluteValueOtherwisePercentage",
order: "perGrammar",
- status: "experimental"
+ status: "standard"
},
"offset-distance": {
syntax: "",
@@ -18599,11 +19300,11 @@
appliesto: "transformableElements",
computed: "forLengthAbsoluteValueOtherwisePercentage",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/offset-distance"
},
"offset-path": {
- syntax: "none | ray( [ && ? && contain? ] ) | | | [ || ]",
+ syntax: "none | ray( [ && && contain? ] ) | | | [ || ]",
media: "visual",
inherited: false,
animationType: "angleOrBasicShapeOrPath",
@@ -18616,7 +19317,7 @@
computed: "asSpecified",
order: "perGrammar",
stacking: true,
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/offset-path"
},
"offset-position": {
@@ -18647,7 +19348,7 @@
appliesto: "transformableElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/offset-rotate"
},
opacity: opacity,
@@ -18744,7 +19445,7 @@
appliesto: "allElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental"
+ status: "standard"
},
"overflow-block": {
syntax: "visible | hidden | clip | scroll | auto",
@@ -18757,9 +19458,9 @@
],
initial: "auto",
appliesto: "blockContainersFlexContainersGridContainers",
- computed: "asSpecified",
+ computed: "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
order: "perGrammar",
- status: "experimental"
+ status: "standard"
},
"overflow-clip-box": {
syntax: "padding-box | content-box",
@@ -18788,9 +19489,9 @@
],
initial: "auto",
appliesto: "blockContainersFlexContainersGridContainers",
- computed: "asSpecified",
+ computed: "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
order: "perGrammar",
- status: "experimental"
+ status: "standard"
},
"overflow-wrap": {
syntax: "normal | break-word | anywhere",
@@ -18819,7 +19520,7 @@
],
initial: "visible",
appliesto: "blockContainersFlexContainersGridContainers",
- computed: "asSpecified",
+ computed: "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
order: "uniqueOrder",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overflow-x"
@@ -18835,7 +19536,7 @@
],
initial: "visible",
appliesto: "blockContainersFlexContainersGridContainers",
- computed: "asSpecified",
+ computed: "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
order: "uniqueOrder",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overflow-y"
@@ -18853,8 +19554,40 @@
appliesto: "nonReplacedBlockAndInlineBlockElements",
computed: "asSpecified",
order: "uniqueOrder",
- status: "nonstandard",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior"
+ },
+ "overscroll-behavior-block": {
+ syntax: "contain | none | auto",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Box Model"
+ ],
+ initial: "auto",
+ appliesto: "nonReplacedBlockAndInlineBlockElements",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "standard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-block"
+ },
+ "overscroll-behavior-inline": {
+ syntax: "contain | none | auto",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Box Model"
+ ],
+ initial: "auto",
+ appliesto: "nonReplacedBlockAndInlineBlockElements",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "standard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-inline"
},
"overscroll-behavior-x": {
syntax: "contain | none | auto",
@@ -18869,7 +19602,7 @@
appliesto: "nonReplacedBlockAndInlineBlockElements",
computed: "asSpecified",
order: "uniqueOrder",
- status: "nonstandard",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-x"
},
"overscroll-behavior-y": {
@@ -18885,7 +19618,7 @@
appliesto: "nonReplacedBlockAndInlineBlockElements",
computed: "asSpecified",
order: "uniqueOrder",
- status: "nonstandard",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-y"
},
padding: padding,
@@ -18909,7 +19642,7 @@
syntax: "<'padding-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18925,7 +19658,7 @@
syntax: "<'padding-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18951,7 +19684,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/padding-bottom"
@@ -18976,7 +19710,7 @@
syntax: "<'padding-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18992,7 +19726,7 @@
syntax: "<'padding-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -19018,8 +19752,9 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
- ],
+ "::first-letter",
+ "::first-line"
+ ],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/padding-left"
},
@@ -19037,7 +19772,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/padding-right"
@@ -19056,7 +19792,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/padding-top"
@@ -19131,7 +19868,7 @@
appliesto: "textElements",
computed: "asSpecified",
order: "uniqueOrder",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/paint-order"
},
perspective: perspective,
@@ -19227,7 +19964,7 @@
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/pointer-events"
},
- position: position,
+ position: position$1,
quotes: quotes,
resize: resize,
right: right,
@@ -19311,6 +20048,22 @@
order: "perGrammar",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/scrollbar-color"
+ },
+ "scrollbar-gutter": {
+ syntax: "auto | [ stable | always ] && both? && force?",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Overflow"
+ ],
+ initial: "auto",
+ appliesto: "allElements",
+ computed: "asSpecified",
+ order: "perGrammar",
+ status: "standard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/scrollbar-gutter"
},
"scrollbar-width": {
syntax: "auto | thin | none",
@@ -19959,7 +20712,7 @@
syntax: "none | all | [ digits ? ]",
media: "visual",
inherited: true,
- animationType: "discrete",
+ animationType: "notAnimatable",
percentages: "no",
groups: [
"CSS Writing Modes"
@@ -20065,7 +20818,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip"
},
"text-decoration-skip-ink": {
- syntax: "auto | none",
+ syntax: "auto | all | none",
media: "visual",
inherited: true,
animationType: "discrete",
@@ -20077,7 +20830,7 @@
appliesto: "allElements",
computed: "asSpecified",
order: "orderOfAppearance",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip-ink"
},
"text-decoration-style": {
@@ -20102,11 +20855,11 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/text-decoration-style"
},
"text-decoration-thickness": {
- syntax: "auto | from-font | ",
+ syntax: "auto | from-font | | ",
media: "visual",
inherited: false,
animationType: "byComputedValueType",
- percentages: "no",
+ percentages: "referToElementFontSize",
groups: [
"CSS Text Decoration"
],
@@ -20337,11 +21090,11 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/text-transform"
},
"text-underline-offset": {
- syntax: "auto | from-font | ",
+ syntax: "auto | | ",
media: "visual",
inherited: true,
animationType: "byComputedValueType",
- percentages: "no",
+ percentages: "referToElementFontSize",
groups: [
"CSS Text Decoration"
],
@@ -20358,7 +21111,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/text-underline-offset"
},
"text-underline-position": {
- syntax: "auto | [ under || [ left | right ] ]",
+ syntax: "auto | from-font | [ under || [ left | right ] ]",
media: "visual",
inherited: true,
animationType: "discrete",
@@ -20392,7 +21145,7 @@
},
transform: transform,
"transform-box": {
- syntax: "border-box | fill-box | view-box",
+ syntax: "content-box | border-box | fill-box | stroke-box | view-box",
media: "visual",
inherited: false,
animationType: "discrete",
@@ -20400,10 +21153,10 @@
groups: [
"CSS Transforms"
],
- initial: "border-box ",
+ initial: "view-box",
appliesto: "transformableElements",
computed: "asSpecified",
- order: "uniqueOrder",
+ order: "perGrammar",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/transform-box"
},
@@ -20683,77 +21436,18 @@
zoom: zoom
};
- var properties$2 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- all: all,
- animation: animation,
- appearance: appearance,
- azimuth: azimuth,
- background: background,
- border: border,
- bottom: bottom,
- clear: clear,
- clip: clip,
- color: color,
- columns: columns,
- contain: contain,
- content: content,
- cursor: cursor,
- direction: direction,
- display: display,
- filter: filter,
- flex: flex,
- float: float,
- font: font,
- gap: gap,
- grid: grid,
- height: height,
- hyphens: hyphens,
- inset: inset,
- isolation: isolation,
- left: left,
- margin: margin,
- mask: mask,
- offset: offset,
- opacity: opacity,
- order: order,
- orphans: orphans,
- outline: outline,
- overflow: overflow,
- padding: padding,
- perspective: perspective,
- position: position,
- quotes: quotes,
- resize: resize,
- right: right,
- rotate: rotate,
- scale: scale,
- top: top,
- transform: transform,
- transition: transition,
- translate: translate,
- visibility: visibility,
- widows: widows,
- width: width,
- zoom: zoom,
- 'default': properties$1
- });
-
var attachment = {
syntax: "scroll | fixed | local"
};
var box = {
syntax: "border-box | padding-box | content-box"
};
- var color$1 = {
+ var color = {
syntax: " | | | | | | currentcolor | "
};
var combinator = {
syntax: "'>' | '+' | '~' | [ '||' ]"
};
- var compat = {
- syntax: "searchfield | textarea | push-button | button-bevel | slider-horizontal | checkbox | radio | square-button | menulist | menulist-button | listbox | meter | progress-bar"
- };
var gradient = {
syntax: " | | | | "
};
@@ -20763,10 +21457,10 @@
var image = {
syntax: " | | | | | | "
};
- var nth = {
+ var nth$1 = {
syntax: " | even | odd"
};
- var position$1 = {
+ var position = {
syntax: "[ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | ] [ top | center | bottom | ]? | [ [ left | right ] ] && [ [ top | bottom ] ] ]"
};
var quote = {
@@ -20775,7 +21469,7 @@
var shadow = {
syntax: "inset? && {2,4} && ?"
};
- var shape$1 = {
+ var shape = {
syntax: "rect(, , , )"
};
var size = {
@@ -20787,7 +21481,7 @@
var target = {
syntax: " | | "
};
- var syntaxes = {
+ var require$$2 = {
"absolute-size": {
syntax: "xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large"
},
@@ -20832,7 +21526,7 @@
syntax: "[ first | last ]? baseline"
},
"basic-shape": {
- syntax: " | | | "
+ syntax: " | | | | "
},
"bg-image": {
syntax: "none | "
@@ -20886,7 +21580,7 @@
"clip-source": {
syntax: ""
},
- color: color$1,
+ color: color,
"color-stop": {
syntax: " | "
},
@@ -20903,7 +21597,9 @@
"common-lig-values": {
syntax: "[ common-ligatures | no-common-ligatures ]"
},
- compat: compat,
+ "compat-auto": {
+ syntax: "searchfield | textarea | push-button | slider-horizontal | checkbox | radio | square-button | menulist | listbox | meter | progress-bar | button"
+ },
"composite-style": {
syntax: "clear | copy | source-over | source-in | source-out | source-atop | destination-over | destination-in | destination-out | destination-atop | xor"
},
@@ -20959,7 +21655,7 @@
syntax: "cross-fade( , ? )"
},
"cubic-bezier-timing-function": {
- syntax: "ease | ease-in | ease-out | ease-in-out | cubic-bezier(, , , )"
+ syntax: "ease | ease-in | ease-out | ease-in-out | cubic-bezier(, ,