cssstyle
Version:
CSSStyleDeclaration Object Model implementation
1,518 lines (1,515 loc) • 86.6 kB
JavaScript
"use strict";
// autogenerated - 2025-06-08
// https://www.w3.org/Style/CSS/all-properties.en.html
var external_dependency_parsers_0 = require("../parsers.js");
var backgroundImage_export_parse, backgroundImage_export_isValid, backgroundImage_export_definition;
backgroundImage_export_parse = function parse(v) {
return external_dependency_parsers_0.parseImage(v);
};
backgroundImage_export_isValid = function isValid(v) {
if (v === "" || typeof external_dependency_parsers_0.parseKeyword(v, ["none"]) === "string") {
return true;
}
return typeof backgroundImage_export_parse(v) === "string";
};
backgroundImage_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("background", "");
this._setProperty("backgound-image", v);
} else {
this._setProperty("background-image", backgroundImage_export_parse(v));
}
},
get() {
return this.getPropertyValue("background-image");
},
enumerable: true,
configurable: true
};
var backgroundPosition_export_parse, backgroundPosition_export_isValid, backgroundPosition_export_definition;
backgroundPosition_export_parse = function parse(v) {
const parts = external_dependency_parsers_0.splitValue(v);
if (!parts.length || parts.length > 2) {
return;
}
const validKeywordsX = ["left", "center", "right"];
const validKeywordsY = ["top", "center", "bottom"];
if (parts.length === 1) {
const dim = external_dependency_parsers_0.parseMeasurement(parts[0]);
if (dim) {
return dim;
}
const validKeywords = new Set([...validKeywordsX, ...validKeywordsY]);
return external_dependency_parsers_0.parseKeyword(v, [...validKeywords]);
}
const [partX, partY] = parts;
const posX = external_dependency_parsers_0.parseMeasurement(partX) || external_dependency_parsers_0.parseKeyword(partX, validKeywordsX);
if (posX) {
const posY = external_dependency_parsers_0.parseMeasurement(partY) || external_dependency_parsers_0.parseKeyword(partY, validKeywordsY);
if (posY) {
return `${posX} ${posY}`;
}
}
};
backgroundPosition_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof backgroundPosition_export_parse(v) === "string";
};
backgroundPosition_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("background", "");
this._setProperty("backgound-position", v);
} else {
this._setProperty("background-position", backgroundPosition_export_parse(v));
}
},
get() {
return this.getPropertyValue("background-position");
},
enumerable: true,
configurable: true
};
var backgroundRepeat_export_parse, backgroundRepeat_export_isValid, backgroundRepeat_export_definition;
backgroundRepeat_export_parse = function parse(v) {
const keywords = ["repeat", "repeat-x", "repeat-y", "no-repeat", "space", "round"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
backgroundRepeat_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof backgroundRepeat_export_parse(v) === "string";
};
backgroundRepeat_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("background", "");
this._setProperty("backgound-repeat", v);
} else {
this._setProperty("background-repeat", backgroundRepeat_export_parse(v));
}
},
get() {
return this.getPropertyValue("background-repeat");
},
enumerable: true,
configurable: true
};
var backgroundAttachment_export_parse, backgroundAttachment_export_isValid, backgroundAttachment_export_definition;
backgroundAttachment_export_parse = function parse(v) {
const keywords = ["fixed", "scroll", "local"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
backgroundAttachment_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof backgroundAttachment_export_parse(v) === "string";
};
backgroundAttachment_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("background", "");
this._setProperty("backgound-attachemnt", v);
} else {
this._setProperty("background-attachment", backgroundAttachment_export_parse(v));
}
},
get() {
return this.getPropertyValue("background-attachment");
},
enumerable: true,
configurable: true
};
var backgroundColor_export_parse, backgroundColor_export_isValid, backgroundColor_export_definition;
backgroundColor_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseColor(v);
if (val) {
return val;
}
return external_dependency_parsers_0.parseKeyword(v);
};
backgroundColor_export_isValid = function isValid(v) {
if (v === "" || typeof external_dependency_parsers_0.parseKeyword(v) === "string") {
return true;
}
return external_dependency_parsers_0.isValidColor(v);
};
backgroundColor_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("background", "");
this._setProperty("backgound-color", v);
} else {
this._setProperty("background-color", backgroundColor_export_parse(v));
}
},
get() {
return this.getPropertyValue("background-color");
},
enumerable: true,
configurable: true
};
var background_export_definition;
// FIXME:
// * support multiple backgrounds
// * also fix longhands
const background_local_var_shorthandFor = new Map([["background-image", {
parse: backgroundImage_export_parse,
isValid: backgroundImage_export_isValid,
definition: backgroundImage_export_definition
}], ["background-position", {
parse: backgroundPosition_export_parse,
isValid: backgroundPosition_export_isValid,
definition: backgroundPosition_export_definition
}], ["background-repeat", {
parse: backgroundRepeat_export_parse,
isValid: backgroundRepeat_export_isValid,
definition: backgroundRepeat_export_definition
}], ["background-attachment", {
parse: backgroundAttachment_export_parse,
isValid: backgroundAttachment_export_isValid,
definition: backgroundAttachment_export_definition
}], ["background-color", {
parse: backgroundColor_export_parse,
isValid: backgroundColor_export_isValid,
definition: backgroundColor_export_definition
}]]);
background_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (v.toLowerCase() === "none" || external_dependency_parsers_0.hasVarFunc(v)) {
for (const [key] of background_local_var_shorthandFor) {
this._setProperty(key, "");
}
this._setProperty("background", v);
} else {
this._shorthandSetter("background", v, background_local_var_shorthandFor);
}
},
get() {
let val = this.getPropertyValue("background");
if (external_dependency_parsers_0.hasVarFunc(val)) {
return val;
}
val = this._shorthandGetter("background", background_local_var_shorthandFor);
if (external_dependency_parsers_0.hasVarFunc(val)) {
return "";
}
return val;
},
enumerable: true,
configurable: true
};
var borderWidth_export_parse, borderWidth_export_isValid, borderWidth_export_definition;
borderWidth_export_parse = function parse(v) {
const keywords = ["thin", "medium", "thick"];
const key = external_dependency_parsers_0.parseKeyword(v, keywords);
if (key) {
return key;
}
return external_dependency_parsers_0.parseLength(v, true);
};
borderWidth_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderWidth_export_parse(v) === "string";
};
borderWidth_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-width", v);
} else {
const positions = ["top", "right", "bottom", "left"];
this._implicitSetter("border", "width", v, borderWidth_export_isValid, borderWidth_export_parse, positions);
}
},
get() {
return this.getPropertyValue("border-width");
},
enumerable: true,
configurable: true
};
var borderStyle_export_parse, borderStyle_export_isValid, borderStyle_export_definition;
borderStyle_export_parse = function parse(v) {
const keywords = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
borderStyle_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderStyle_export_parse(v) === "string";
};
borderStyle_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (v.toLowerCase() === "none") {
v = "";
}
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-style", v);
return;
}
const positions = ["top", "right", "bottom", "left"];
this._implicitSetter("border", "style", v, borderStyle_export_isValid, borderStyle_export_parse, positions);
},
get() {
return this.getPropertyValue("border-style");
},
enumerable: true,
configurable: true
};
var borderColor_export_parse, borderColor_export_isValid, borderColor_export_definition;
borderColor_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseColor(v);
if (val) {
return val;
}
return external_dependency_parsers_0.parseKeyword(v);
};
borderColor_export_isValid = function isValid(v) {
if (v === "" || typeof external_dependency_parsers_0.parseKeyword(v) === "string") {
return true;
}
return external_dependency_parsers_0.isValidColor(v);
};
borderColor_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-color", v);
} else {
const positions = ["top", "right", "bottom", "left"];
this._implicitSetter("border", "color", v, borderColor_export_isValid, borderColor_export_parse, positions);
}
},
get() {
return this.getPropertyValue("border-color");
},
enumerable: true,
configurable: true
};
var border_export_definition;
const border_local_var_shorthandFor = new Map([["border-width", {
parse: borderWidth_export_parse,
isValid: borderWidth_export_isValid,
definition: borderWidth_export_definition
}], ["border-style", {
parse: borderStyle_export_parse,
isValid: borderStyle_export_isValid,
definition: borderStyle_export_definition
}], ["border-color", {
parse: borderColor_export_parse,
isValid: borderColor_export_isValid,
definition: borderColor_export_definition
}]]);
border_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (v.toLowerCase() === "none") {
v = "";
}
if (external_dependency_parsers_0.hasVarFunc(v)) {
for (const [key] of border_local_var_shorthandFor) {
this._setProperty(key, "");
}
this._setProperty("border", v);
} else {
this._midShorthandSetter("border", v, border_local_var_shorthandFor, ["top", "right", "bottom", "left"]);
}
},
get() {
let val = this.getPropertyValue("border");
if (external_dependency_parsers_0.hasVarFunc(val)) {
return val;
}
val = this._shorthandGetter("border", border_local_var_shorthandFor);
if (external_dependency_parsers_0.hasVarFunc(val)) {
return "";
}
return val;
},
enumerable: true,
configurable: true
};
var borderTopWidth_export_parse, borderTopWidth_export_isValid, borderTopWidth_export_definition;
borderTopWidth_export_parse = function parse(v) {
const keywords = ["thin", "medium", "thick"];
const key = external_dependency_parsers_0.parseKeyword(v, keywords);
if (key) {
return key;
}
return external_dependency_parsers_0.parseLength(v, true);
};
borderTopWidth_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderTopWidth_export_parse(v) === "string";
};
borderTopWidth_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-top", "");
this._setProperty("border-width", "");
}
this._setProperty("border-top-width", borderTopWidth_export_parse(v));
},
get() {
return this.getPropertyValue("border-top-width");
},
enumerable: true,
configurable: true
};
var borderTopStyle_export_parse, borderTopStyle_export_isValid, borderTopStyle_export_definition;
borderTopStyle_export_parse = function parse(v) {
const keywords = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
borderTopStyle_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderTopStyle_export_parse(v) === "string";
};
borderTopStyle_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
const val = borderTopStyle_export_parse(v);
if (val === "none" || val === "hidden" || v === "") {
this._setProperty("border-top-style", "");
this._setProperty("border-top-color", "");
this._setProperty("border-top-width", "");
return;
}
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-top", "");
this._setProperty("border-style", "");
}
this._setProperty("border-top-style", val);
},
get() {
return this.getPropertyValue("border-top-style");
},
enumerable: true,
configurable: true
};
var borderTopColor_export_parse, borderTopColor_export_isValid, borderTopColor_export_definition;
borderTopColor_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseColor(v);
if (val) {
return val;
}
return external_dependency_parsers_0.parseKeyword(v);
};
borderTopColor_export_isValid = function isValid(v) {
if (v === "" || typeof external_dependency_parsers_0.parseKeyword(v) === "string") {
return true;
}
return external_dependency_parsers_0.isValidColor(v);
};
borderTopColor_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-top", "");
this._setProperty("border-color", "");
}
this._setProperty("border-top-color", borderTopColor_export_parse(v));
},
get() {
return this.getPropertyValue("border-top-color");
},
enumerable: true,
configurable: true
};
var borderBottom_export_definition;
const borderBottom_local_var_shorthandFor = new Map([["border-bottom-width", {
parse: borderTopWidth_export_parse,
isValid: borderTopWidth_export_isValid,
definition: borderTopWidth_export_definition
}], ["border-bottom-style", {
parse: borderTopStyle_export_parse,
isValid: borderTopStyle_export_isValid,
definition: borderTopStyle_export_definition
}], ["border-bottom-color", {
parse: borderTopColor_export_parse,
isValid: borderTopColor_export_isValid,
definition: borderTopColor_export_definition
}]]);
borderBottom_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
for (const [key] of borderBottom_local_var_shorthandFor) {
this._setProperty(key, "");
}
this._setProperty("border", "");
this._setProperty("border-bottom", v);
} else {
this._shorthandSetter("border-bottom", v, borderBottom_local_var_shorthandFor);
}
},
get() {
let val = this.getPropertyValue("border-bottom");
if (external_dependency_parsers_0.hasVarFunc(val)) {
return val;
}
val = this._shorthandGetter("border-bottom", borderBottom_local_var_shorthandFor);
if (external_dependency_parsers_0.hasVarFunc(val)) {
return "";
}
return val;
},
enumerable: true,
configurable: true
};
var borderBottomColor_export_parse, borderBottomColor_export_isValid, borderBottomColor_export_definition;
borderBottomColor_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseColor(v);
if (val) {
return val;
}
return external_dependency_parsers_0.parseKeyword(v);
};
borderBottomColor_export_isValid = function isValid(v) {
if (v === "" || typeof external_dependency_parsers_0.parseKeyword(v) === "string") {
return true;
}
return external_dependency_parsers_0.isValidColor(v);
};
borderBottomColor_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-bottom", "");
this._setProperty("border-color", "");
}
this._setProperty("border-bottom-color", borderBottomColor_export_parse(v));
},
get() {
return this.getPropertyValue("border-bottom-color");
},
enumerable: true,
configurable: true
};
var borderBottomStyle_export_parse, borderBottomStyle_export_isValid, borderBottomStyle_export_definition;
borderBottomStyle_export_parse = function parse(v) {
const keywords = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
borderBottomStyle_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderBottomStyle_export_parse(v) === "string";
};
borderBottomStyle_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
const val = borderBottomStyle_export_parse(v);
if (val === "none" || val === "hidden") {
this._setProperty("border-bottom-style", "");
this._setProperty("border-bottom-color", "");
this._setProperty("border-bottom-width", "");
return;
}
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-bottom", "");
this._setProperty("border-style", "");
}
this._setProperty("border-bottom-style", val);
},
get() {
return this.getPropertyValue("border-bottom-style");
},
enumerable: true,
configurable: true
};
var borderBottomWidth_export_parse, borderBottomWidth_export_isValid, borderBottomWidth_export_definition;
borderBottomWidth_export_parse = function parse(v) {
const keywords = ["thin", "medium", "thick"];
const key = external_dependency_parsers_0.parseKeyword(v, keywords);
if (key) {
return key;
}
return external_dependency_parsers_0.parseLength(v, true);
};
borderBottomWidth_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderBottomWidth_export_parse(v) === "string";
};
borderBottomWidth_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-bottom", "");
this._setProperty("border-width", "");
}
this._setProperty("border-bottom-width", borderBottomWidth_export_parse(v));
},
get() {
return this.getPropertyValue("border-bottom-width");
},
enumerable: true,
configurable: true
};
var borderCollapse_export_parse, borderCollapse_export_isValid, borderCollapse_export_definition;
borderCollapse_export_parse = function parse(v) {
return external_dependency_parsers_0.parseKeyword(v, ["collapse", "separate"]);
};
borderCollapse_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderCollapse_export_parse(v) === "string";
};
borderCollapse_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
this._setProperty("border-collapse", borderCollapse_export_parse(v));
},
get() {
return this.getPropertyValue("border-collapse");
},
enumerable: true,
configurable: true
};
var borderLeft_export_definition;
const borderLeft_local_var_shorthandFor = new Map([["border-left-width", {
parse: borderTopWidth_export_parse,
isValid: borderTopWidth_export_isValid,
definition: borderTopWidth_export_definition
}], ["border-left-style", {
parse: borderTopStyle_export_parse,
isValid: borderTopStyle_export_isValid,
definition: borderTopStyle_export_definition
}], ["border-left-color", {
parse: borderTopColor_export_parse,
isValid: borderTopColor_export_isValid,
definition: borderTopColor_export_definition
}]]);
borderLeft_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
for (const [key] of borderLeft_local_var_shorthandFor) {
this._setProperty(key, "");
}
this._setProperty("border", "");
this._setProperty("border-left", v);
} else {
this._shorthandSetter("border-left", v, borderLeft_local_var_shorthandFor);
}
},
get() {
let val = this.getPropertyValue("border-left");
if (external_dependency_parsers_0.hasVarFunc(val)) {
return val;
}
val = this._shorthandGetter("border-left", borderLeft_local_var_shorthandFor);
if (external_dependency_parsers_0.hasVarFunc(val)) {
return "";
}
return val;
},
enumerable: true,
configurable: true
};
var borderLeftColor_export_parse, borderLeftColor_export_isValid, borderLeftColor_export_definition;
borderLeftColor_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseColor(v);
if (val) {
return val;
}
return external_dependency_parsers_0.parseKeyword(v);
};
borderLeftColor_export_isValid = function isValid(v) {
if (v === "" || typeof external_dependency_parsers_0.parseKeyword(v) === "string") {
return true;
}
return external_dependency_parsers_0.isValidColor(v);
};
borderLeftColor_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-left", "");
this._setProperty("border-color", "");
}
this._setProperty("border-left-color", borderLeftColor_export_parse(v));
},
get() {
return this.getPropertyValue("border-left-color");
},
enumerable: true,
configurable: true
};
var borderLeftStyle_export_parse, borderLeftStyle_export_isValid, borderLeftStyle_export_definition;
borderLeftStyle_export_parse = function parse(v) {
const keywords = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
borderLeftStyle_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderLeftStyle_export_parse(v) === "string";
};
borderLeftStyle_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
const val = borderLeftStyle_export_parse(v);
if (val === "none" || val === "hidden") {
this._setProperty("border-left-style", "");
this._setProperty("border-left-color", "");
this._setProperty("border-left-width", "");
return;
}
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-left", "");
this._setProperty("border-style", "");
}
this._setProperty("border-left-style", val);
},
get() {
return this.getPropertyValue("border-left-style");
},
enumerable: true,
configurable: true
};
var borderLeftWidth_export_parse, borderLeftWidth_export_isValid, borderLeftWidth_export_definition;
borderLeftWidth_export_parse = function parse(v) {
const keywords = ["thin", "medium", "thick"];
const key = external_dependency_parsers_0.parseKeyword(v, keywords);
if (key) {
return key;
}
return external_dependency_parsers_0.parseLength(v, true);
};
borderLeftWidth_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderLeftWidth_export_parse(v) === "string";
};
borderLeftWidth_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-left", "");
this._setProperty("border-width", "");
}
this._setProperty("border-left-width", borderLeftWidth_export_parse(v));
},
get() {
return this.getPropertyValue("border-left-width");
},
enumerable: true,
configurable: true
};
var borderRight_export_definition;
const borderRight_local_var_shorthandFor = new Map([["border-right-width", {
parse: borderTopWidth_export_parse,
isValid: borderTopWidth_export_isValid,
definition: borderTopWidth_export_definition
}], ["border-right-style", {
parse: borderTopStyle_export_parse,
isValid: borderTopStyle_export_isValid,
definition: borderTopStyle_export_definition
}], ["border-right-color", {
parse: borderTopColor_export_parse,
isValid: borderTopColor_export_isValid,
definition: borderTopColor_export_definition
}]]);
borderRight_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
for (const [key] of borderRight_local_var_shorthandFor) {
this._setProperty(key, "");
}
this._setProperty("border", "");
this._setProperty("border-right", v);
} else {
this._shorthandSetter("border-right", v, borderRight_local_var_shorthandFor);
}
},
get() {
let val = this.getPropertyValue("border-right");
if (external_dependency_parsers_0.hasVarFunc(val)) {
return val;
}
val = this._shorthandGetter("border-right", borderRight_local_var_shorthandFor);
if (external_dependency_parsers_0.hasVarFunc(val)) {
return "";
}
return val;
},
enumerable: true,
configurable: true
};
var borderRightColor_export_parse, borderRightColor_export_isValid, borderRightColor_export_definition;
borderRightColor_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseColor(v);
if (val) {
return val;
}
return external_dependency_parsers_0.parseKeyword(v);
};
borderRightColor_export_isValid = function isValid(v) {
if (v === "" || typeof external_dependency_parsers_0.parseKeyword(v) === "string") {
return true;
}
return external_dependency_parsers_0.isValidColor(v);
};
borderRightColor_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-right", "");
this._setProperty("border-color", "");
}
this._setProperty("border-right-color", borderRightColor_export_parse(v));
},
get() {
return this.getPropertyValue("border-right-color");
},
enumerable: true,
configurable: true
};
var borderRightStyle_export_parse, borderRightStyle_export_isValid, borderRightStyle_export_definition;
borderRightStyle_export_parse = function parse(v) {
const keywords = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
borderRightStyle_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderRightStyle_export_parse(v) === "string";
};
borderRightStyle_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
const val = borderRightStyle_export_parse(v);
if (val === "none" || val === "hidden") {
this._setProperty("border-right-style", "");
this._setProperty("border-right-color", "");
this._setProperty("border-right-width", "");
return;
}
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-right", "");
this._setProperty("border-style", "");
}
this._setProperty("border-right-style", val);
},
get() {
return this.getPropertyValue("border-right-style");
},
enumerable: true,
configurable: true
};
var borderRightWidth_export_parse, borderRightWidth_export_isValid, borderRightWidth_export_definition;
borderRightWidth_export_parse = function parse(v) {
const keywords = ["thin", "medium", "thick"];
const key = external_dependency_parsers_0.parseKeyword(v, keywords);
if (key) {
return key;
}
return external_dependency_parsers_0.parseLength(v, true);
};
borderRightWidth_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderRightWidth_export_parse(v) === "string";
};
borderRightWidth_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("border", "");
this._setProperty("border-right", "");
this._setProperty("border-width", "");
}
this._setProperty("border-right-width", borderRightWidth_export_parse(v));
},
get() {
return this.getPropertyValue("border-right-width");
},
enumerable: true,
configurable: true
};
var borderSpacing_export_parse, borderSpacing_export_isValid, borderSpacing_export_definition;
borderSpacing_export_parse = function parse(v) {
if (v === "") {
return v;
}
const key = external_dependency_parsers_0.parseKeyword(v);
if (key) {
return key;
}
const parts = external_dependency_parsers_0.splitValue(v);
if (!parts.length || parts.length > 2) {
return;
}
const val = [];
for (const part of parts) {
const dim = external_dependency_parsers_0.parseLength(part);
if (!dim) {
return;
}
val.push(dim);
}
return val.join(" ");
};
borderSpacing_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof borderSpacing_export_parse(v) === "string";
};
borderSpacing_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
this._setProperty("border-spacing", borderSpacing_export_parse(v));
},
get() {
return this.getPropertyValue("border-spacing");
},
enumerable: true,
configurable: true
};
var borderTop_export_definition;
const borderTop_local_var_shorthandFor = new Map([["border-top-width", {
parse: borderTopWidth_export_parse,
isValid: borderTopWidth_export_isValid,
definition: borderTopWidth_export_definition
}], ["border-top-style", {
parse: borderTopStyle_export_parse,
isValid: borderTopStyle_export_isValid,
definition: borderTopStyle_export_definition
}], ["border-top-color", {
parse: borderTopColor_export_parse,
isValid: borderTopColor_export_isValid,
definition: borderTopColor_export_definition
}]]);
borderTop_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
for (const [key] of borderTop_local_var_shorthandFor) {
this._setProperty(key, "");
}
this._setProperty("border", "");
this._setProperty("border-top", v);
} else {
this._shorthandSetter("border-top", v, borderTop_local_var_shorthandFor);
}
},
get() {
let val = this.getPropertyValue("border-top");
if (external_dependency_parsers_0.hasVarFunc(val)) {
return val;
}
val = this._shorthandGetter("border-top", borderTop_local_var_shorthandFor);
if (external_dependency_parsers_0.hasVarFunc(val)) {
return "";
}
return val;
},
enumerable: true,
configurable: true
};
var bottom_export_parse, bottom_export_isValid, bottom_export_definition;
bottom_export_parse = function parse(v) {
const dim = external_dependency_parsers_0.parseMeasurement(v);
if (dim) {
return dim;
}
return external_dependency_parsers_0.parseKeyword(v, ["auto"]);
};
bottom_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof bottom_export_parse(v) === "string";
};
bottom_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
this._setProperty("bottom", bottom_export_parse(v));
},
get() {
return this.getPropertyValue("bottom");
},
enumerable: true,
configurable: true
};
var clear_export_parse, clear_export_isValid, clear_export_definition;
clear_export_parse = function parse(v) {
const keywords = ["inline-start", "inline-end", "block-start", "block-end", "left", "right", "top", "bottom", "both-inline", "both-block", "both", "none"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
clear_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof clear_export_parse(v) === "string";
};
clear_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
this._setProperty("clear", clear_export_parse(v));
},
get() {
return this.getPropertyValue("clear");
},
enumerable: true,
configurable: true
};
var clip_export_parse, clip_export_isValid, clip_export_definition;
// deprecated
// @see https://drafts.fxtf.org/css-masking/#clip-property
clip_export_parse = function parse(v) {
if (v === "") {
return v;
}
const val = external_dependency_parsers_0.parseKeyword(v, ["auto"]);
if (val) {
return val;
}
// parse legacy <shape>
v = v.toLowerCase();
const matches = v.match(/^rect\(\s*(.*)\s*\)$/);
if (!matches) {
return;
}
const parts = matches[1].split(/\s*,\s*/);
if (parts.length !== 4) {
return;
}
const valid = parts.every(function (part, index) {
const measurement = external_dependency_parsers_0.parseMeasurement(part.trim());
parts[index] = measurement;
return typeof measurement === "string";
});
if (!valid) {
return;
}
return `rect(${parts.join(", ")})`;
};
clip_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof clip_export_parse(v) === "string";
};
clip_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
this._setProperty("clip", clip_export_parse(v));
},
get() {
return this.getPropertyValue("clip");
},
enumerable: true,
configurable: true
};
var color_export_parse, color_export_isValid, color_export_definition;
color_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseColor(v);
if (val) {
return val;
}
return external_dependency_parsers_0.parseKeyword(v);
};
color_export_isValid = function isValid(v) {
if (v === "" || typeof external_dependency_parsers_0.parseKeyword(v) === "string") {
return true;
}
return external_dependency_parsers_0.isValidColor(v);
};
color_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
this._setProperty("color", color_export_parse(v));
},
get() {
return this.getPropertyValue("color");
},
enumerable: true,
configurable: true
};
var flexGrow_export_parse, flexGrow_export_isValid, flexGrow_export_definition;
flexGrow_export_parse = function parse(v) {
return external_dependency_parsers_0.parseNumber(v, true);
};
flexGrow_export_isValid = function isValid(v) {
return typeof flexGrow_export_parse(v) === "string";
};
flexGrow_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("flex", "");
this._setProperty("flex-grow", v);
} else {
this._setProperty("flex-grow", flexGrow_export_parse(v));
}
},
get() {
return this.getPropertyValue("flex-grow");
},
enumerable: true,
configurable: true
};
var flexShrink_export_parse, flexShrink_export_isValid, flexShrink_export_definition;
flexShrink_export_parse = function parse(v) {
return external_dependency_parsers_0.parseNumber(v, true);
};
flexShrink_export_isValid = function isValid(v) {
return typeof flexShrink_export_parse(v) === "string";
};
flexShrink_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("flex", "");
this._setProperty("flex-shrink", v);
} else {
this._setProperty("flex-shrink", flexShrink_export_parse(v));
}
},
get() {
return this.getPropertyValue("flex-shrink");
},
enumerable: true,
configurable: true
};
var flexBasis_export_parse, flexBasis_export_isValid, flexBasis_export_definition;
flexBasis_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseMeasurement(v);
if (val) {
return val;
}
const keywords = ["content", "auto", "min-content", "max-content"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
flexBasis_export_isValid = function isValid(v) {
return typeof flexBasis_export_parse(v) === "string";
};
flexBasis_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("flex", "");
this._setProperty("flex-basis", v);
} else {
this._setProperty("flex-basis", flexBasis_export_parse(v));
}
},
get() {
return this.getPropertyValue("flex-basis");
},
enumerable: true,
configurable: true
};
var flex_export_parse, flex_export_isValid, flex_export_definition;
const flex_local_var_shorthandFor = new Map([["flex-grow", {
parse: flexGrow_export_parse,
isValid: flexGrow_export_isValid,
definition: flexGrow_export_definition
}], ["flex-shrink", {
parse: flexShrink_export_parse,
isValid: flexShrink_export_isValid,
definition: flexShrink_export_definition
}], ["flex-basis", {
parse: flexBasis_export_parse,
isValid: flexBasis_export_isValid,
definition: flexBasis_export_definition
}]]);
flex_export_parse = function parse(v) {
const key = external_dependency_parsers_0.parseKeyword(v, ["auto", "none"]);
if (key) {
if (key === "auto") {
return "1 1 auto";
}
if (key === "none") {
return "0 0 auto";
}
if (key === "initial") {
return "0 1 auto";
}
return;
}
const obj = external_dependency_parsers_0.parseShorthand(v, flex_local_var_shorthandFor);
if (obj) {
const flex = {
"flex-grow": "1",
"flex-shrink": "1",
"flex-basis": "0%"
};
const items = Object.entries(obj);
for (const [property, value] of items) {
flex[property] = value;
}
return [...Object.values(flex)].join(" ");
}
};
flex_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof flex_export_parse(v) === "string";
};
flex_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._shorthandSetter("flex", "", flex_local_var_shorthandFor);
this._setProperty("flex", v);
} else {
this._shorthandSetter("flex", flex_export_parse(v), flex_local_var_shorthandFor);
}
},
get() {
let val = this.getPropertyValue("flex");
if (external_dependency_parsers_0.hasVarFunc(val)) {
return val;
}
val = this._shorthandGetter("flex", flex_local_var_shorthandFor);
if (external_dependency_parsers_0.hasVarFunc(val)) {
return "";
}
return val;
},
enumerable: true,
configurable: true
};
var float_export_parse, float_export_isValid, float_export_definition;
float_export_parse = function parse(v) {
const keywords = ["left", "right", "none", "inline-start", "inline-end"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
float_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof float_export_parse(v) === "string";
};
float_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
this._setProperty("float", float_export_parse(v));
},
get() {
return this.getPropertyValue("float");
},
enumerable: true,
configurable: true
};
var floodColor_export_parse, floodColor_export_isValid, floodColor_export_definition;
floodColor_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseColor(v);
if (val) {
return val;
}
return external_dependency_parsers_0.parseKeyword(v);
};
floodColor_export_isValid = function isValid(v) {
if (v === "" || typeof external_dependency_parsers_0.parseKeyword(v) === "string") {
return true;
}
return external_dependency_parsers_0.isValidColor(v);
};
floodColor_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
this._setProperty("flood-color", floodColor_export_parse(v));
},
get() {
return this.getPropertyValue("flood-color");
},
enumerable: true,
configurable: true
};
var fontStyle_export_parse, fontStyle_export_isValid, fontStyle_export_definition;
fontStyle_export_parse = function parse(v) {
const keywords = ["normal", "italic", "oblique"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
fontStyle_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof fontStyle_export_parse(v) === "string";
};
fontStyle_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("font", "");
this._setProperty("font-style", v);
} else {
this._setProperty("font-style", fontStyle_export_parse(v));
}
},
get() {
return this.getPropertyValue("font-style");
},
enumerable: true,
configurable: true
};
var fontVariant_export_parse, fontVariant_export_isValid, fontVariant_export_definition;
fontVariant_export_parse = function parse(v) {
const num = external_dependency_parsers_0.parseNumber(v, true);
if (num && parseFloat(num) <= 1000) {
return num;
}
const keywords = ["normal", "none", "small-caps"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
fontVariant_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof fontVariant_export_parse(v) === "string";
};
fontVariant_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("font", "");
this._setProperty("font-valiant", v);
} else {
this._setProperty("font-variant", fontVariant_export_parse(v));
}
},
get() {
return this.getPropertyValue("font-variant");
},
enumerable: true,
configurable: true
};
var fontWeight_export_parse, fontWeight_export_isValid, fontWeight_export_definition;
fontWeight_export_parse = function parse(v) {
const num = external_dependency_parsers_0.parseNumber(v, true);
if (num && parseFloat(num) <= 1000) {
return num;
}
const keywords = ["normal", "bold", "lighter", "bolder"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
fontWeight_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof fontWeight_export_parse(v) === "string";
};
fontWeight_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("font", "");
this._setProperty("font-weight", v);
} else {
this._setProperty("font-weight", fontWeight_export_parse(v));
}
},
get() {
return this.getPropertyValue("font-weight");
},
enumerable: true,
configurable: true
};
var fontSize_export_parse, fontSize_export_isValid, fontSize_export_definition;
fontSize_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseMeasurement(v, true);
if (val) {
return val;
}
const keywords = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "xxx-large", "smaller", "larger"];
return external_dependency_parsers_0.parseKeyword(v, keywords);
};
fontSize_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof fontSize_export_parse(v) === "string";
};
fontSize_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("font", "");
this._setProperty("font-size", v);
} else {
this._setProperty("font-size", fontSize_export_parse(v));
}
},
get() {
return this.getPropertyValue("font-size");
},
enumerable: true,
configurable: true
};
var lineHeight_export_parse, lineHeight_export_isValid, lineHeight_export_definition;
lineHeight_export_parse = function parse(v) {
const val = external_dependency_parsers_0.parseKeyword(v, ["normal"]);
if (val) {
return val;
}
const num = external_dependency_parsers_0.parseNumber(v, true);
if (num) {
return num;
}
return external_dependency_parsers_0.parseMeasurement(v, true);
};
lineHeight_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof lineHeight_export_parse(v) === "string";
};
lineHeight_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("font", "");
this._setProperty("line-height", v);
} else {
this._setProperty("line-height", lineHeight_export_parse(v));
}
},
get() {
return this.getPropertyValue("line-height");
},
enumerable: true,
configurable: true
};
var fontFamily_export_parse, fontFamily_export_isValid, fontFamily_export_definition;
fontFamily_export_parse = function parse(v) {
if (v === "") {
return v;
}
const keywords = ["serif", "sans-serif", "system-ui", "cursive", "fantasy", "monospace"];
const val = external_dependency_parsers_0.splitValue(v, {
delimiter: ","
});
const font = [];
let valid = false;
for (const i of val) {
const str = external_dependency_parsers_0.parseString(i);
if (str) {
font.push(str);
valid = true;
continue;
}
const key = external_dependency_parsers_0.parseKeyword(i, keywords);
if (key) {
font.push(key);
valid = true;
continue;
}
// This implementation does not strictly follow the specification. The spec
// does not require the first letter of the font-family to be capitalized.
// Also, unquoted font-family names are not restricted to ASCII only.
// However, in the real world, the first letter of the ASCII font-family
// names are always capitalized, and unquoted font-family names do not
// contain spaces, e.g. `Times`, and AFAIK, non-ASCII font-family names are
// always quoted even without spaces, e.g. `"メイリオ"`.
// Therefore, it is unlikely that this implementation will cause problems.
// @see https://drafts.csswg.org/css-fonts/#font-family-prop
if (/^\s*(?:[A-Z][A-Za-z\d\s-]+)\s*$/.test(i)) {
font.push(i.trim());
valid = true;
continue;
}
if (!valid) {
return;
}
}
return font.join(", ");
};
fontFamily_export_isValid = function isValid(v) {
if (v === "") {
return true;
}
return typeof fontFamily_export_parse(v) === "string";
};
fontFamily_export_definition = {
set(v) {
v = external_dependency_parsers_0.prepareValue(v, this._global);
if (external_dependency_parsers_0.hasVarFunc(v)) {
this._setProperty("font", "");
this._setProperty("font-family", v);
} else {
this._setProperty("font-family", fontFamily_export_parse(v));
}
},
get() {
return this.getPropertyValue("font-family");
},
enumerable: true,
configurable: true
};
var font_export_parse, font_export_definition;
const font_local_var_shorthandFor = new Map([["font-style", {
parse: fontStyle_export_parse,
isValid: fontStyle_export_isValid,
definition: fontStyle_export_definition
}], ["font-variant", {
parse: fontVariant_export_parse,
isValid: fontVariant_export_isValid,
definition: fontVariant_export_definition
}], ["font-weight", {
parse: fontWeight_export_parse,
isValid: fontWeight_export_isValid,
definition: fontWeight_export_definition
}], ["font-size", {
parse: fontSize_export_parse,
isValid: fontSize_export_isValid,
definition: fontSize_export_definition
}], ["line-height", {
parse: lineHeight_export_parse,
isValid: lineHeight_export_isValid,
definition: lineHeight_export_definition
}], ["font-family", {
parse: fontFamily_export_parse,
isValid: fontFamily_export_isValid,
definition: fontFamily_export_definition
}]]);
font_export_parse = function parse(v) {
c