Auto merge of #23856 - servo:stylo-engines, r=nox

Stylo: replace product={gecko,servo} with engine={gecko,servo-2013,servo-2020}

Renaming the variable helped make sure I looked at every use.

Also auto-generate relevant parts of `CSSStyleDeclaration.webidl`, to make libscript compile accordingly.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23856)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-07-30 02:40:38 -04:00 committed by GitHub
commit 8e7daa77b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 993 additions and 1100 deletions

View file

@ -49,7 +49,7 @@ serde_json = "1.0"
servo_config = {path = "../config"} servo_config = {path = "../config"}
servo_url = {path = "../url"} servo_url = {path = "../url"}
smallvec = { version = "0.6", features = ["std", "union"] } smallvec = { version = "0.6", features = ["std", "union"] }
style = {path = "../style", features = ["servo"]} style = {path = "../style", features = ["servo", "servo-layout-2013"]}
style_traits = {path = "../style_traits"} style_traits = {path = "../style_traits"}
unicode-bidi = {version = "0.3", features = ["with_serde"]} unicode-bidi = {version = "0.3", features = ["with_serde"]}
unicode-script = {version = "0.3", features = ["harfbuzz"]} unicode-script = {version = "0.3", features = ["harfbuzz"]}

View file

@ -43,11 +43,8 @@ set(globalgen_deps
${bindings_src}/parser/WebIDL.py ${bindings_src}/parser/WebIDL.py
) )
set(bindinggen_deps set(bindinggen_deps
${globalgen_deps}
${bindings_src}/BindingGen.py ${bindings_src}/BindingGen.py
${bindings_src}/Bindings.conf
${bindings_src}/Configuration.py
${bindings_src}/CodegenRust.py
${bindings_src}/parser/WebIDL.py
) )
add_custom_command( add_custom_command(
@ -71,26 +68,12 @@ add_custom_command(
${bindings_src}/Bindings.conf ${bindings_src}/Bindings.conf
. .
${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}
DEPENDS Bindings _cache ${globalgen_deps} ${webidls} ${PROJECT_BINARY_DIR}/../css-properties.json
${PROJECT_SOURCE_DIR}/../../target/doc/servo
DEPENDS Bindings _cache ${globalgen_deps} ${webidls} ${PROJECT_BINARY_DIR}/../css-properties.json
VERBATIM VERBATIM
) )
add_custom_command(
OUTPUT apis.html
COMMAND ${PYTHON_EXECUTABLE} -B ${bindings_src}/pythonpath.py -I ${bindings_src}/parser -I ${bindings_src}/ply
${bindings_src}/GlobalGen.py
--cachedir=_cache
--filelist=webidls.list
--only-html
${bindings_src}/Bindings.conf
.
${PROJECT_SOURCE_DIR}
DEPENDS _cache ${globalgen_deps} ${webidls}
VERBATIM
)
add_custom_target(supported-apis DEPENDS apis.html)
# We need an intermediate custom target for this, due to this misfeature: # We need an intermediate custom target for this, due to this misfeature:
# > If any dependency is an OUTPUT of another custom command in the same # > If any dependency is an OUTPUT of another custom command in the same
# > directory CMake automatically brings the other custom command into the # > directory CMake automatically brings the other custom command into the

View file

@ -15,6 +15,11 @@ use std::time::Instant;
fn main() { fn main() {
let start = Instant::now(); let start = Instant::now();
let style_out_dir = PathBuf::from(env::var_os("DEP_SERVO_STYLE_CRATE_OUT_DIR").unwrap());
let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
let json = "css-properties.json";
std::fs::copy(style_out_dir.join(json), out_dir.join(json)).unwrap();
// This must use the Ninja generator -- it's the only one that // This must use the Ninja generator -- it's the only one that
// parallelizes cmake's output properly. (Cmake generates // parallelizes cmake's output properly. (Cmake generates
// separate makefiles, each of which try to build // separate makefiles, each of which try to build
@ -35,9 +40,7 @@ fn main() {
start.elapsed().as_secs() start.elapsed().as_secs()
); );
let json = PathBuf::from(env::var_os("OUT_DIR").unwrap()) let json = out_dir.join("build").join("InterfaceObjectMapData.json");
.join("build")
.join("InterfaceObjectMapData.json");
let json: Value = serde_json::from_reader(File::open(&json).unwrap()).unwrap(); let json: Value = serde_json::from_reader(File::open(&json).unwrap()).unwrap();
let mut map = phf_codegen::Map::new(); let mut map = phf_codegen::Map::new();
for (key, value) in json.as_object().unwrap() { for (key, value) in json.as_object().unwrap() {

View file

@ -7550,7 +7550,7 @@ impl %(base)s {
def SupportedDomApis(config): def SupportedDomApis(config):
descriptors = config.getDescriptors(isExposedConditionally=False) descriptors = config.getDescriptors(isExposedConditionally=False)
base_path = os.path.join('dom', 'bindings', 'codegen') base_path = os.path.dirname(__file__)
with open(os.path.join(base_path, 'apis.html.template')) as f: with open(os.path.join(base_path, 'apis.html.template')) as f:
base_template = f.read() base_template = f.read()
with open(os.path.join(base_path, 'api.html.template')) as f: with open(os.path.join(base_path, 'api.html.template')) as f:

View file

@ -7,6 +7,7 @@
import sys import sys
import os import os
import json
sys.path.append(os.path.join(".", "parser")) sys.path.append(os.path.join(".", "parser"))
sys.path.append(os.path.join(".", "ply")) sys.path.append(os.path.join(".", "ply"))
import WebIDL import WebIDL
@ -28,12 +29,10 @@ def generate_file(config, name, filename):
def main(): def main():
# Parse arguments. # Parse arguments.
from optparse import OptionParser from optparse import OptionParser
usageString = "usage: %prog [options] configFile outputdir webidldir [files]" usageString = "usage: %prog [options] configFile outputdir webidldir cssProperties.json docServoDir [files]"
o = OptionParser(usage=usageString) o = OptionParser(usage=usageString)
o.add_option("--cachedir", dest='cachedir', default=None, o.add_option("--cachedir", dest='cachedir', default=None,
help="Directory in which to cache lex/parse tables.") help="Directory in which to cache lex/parse tables.")
o.add_option("--only-html", dest='only_html', action="store_true",
help="Only generate HTML from WebIDL inputs")
o.add_option("--filelist", dest='filelist', default=None, o.add_option("--filelist", dest='filelist', default=None,
help="A file containing the list (one per line) of webidl files to process.") help="A file containing the list (one per line) of webidl files to process.")
(options, args) = o.parse_args() (options, args) = o.parse_args()
@ -44,8 +43,10 @@ def main():
configFile = args[0] configFile = args[0]
outputdir = args[1] outputdir = args[1]
baseDir = args[2] baseDir = args[2]
css_properties_json = args[3]
doc_servo = args[4]
if options.filelist is not None: if options.filelist is not None:
fileList = (l.strip() for l in open(options.filelist).xreadlines()) fileList = [l.strip() for l in open(options.filelist).xreadlines()]
else: else:
fileList = args[3:] fileList = args[3:]
@ -56,9 +57,11 @@ def main():
with open(fullPath, 'rb') as f: with open(fullPath, 'rb') as f:
lines = f.readlines() lines = f.readlines()
parser.parse(''.join(lines), fullPath) parser.parse(''.join(lines), fullPath)
add_css_properties_attributes(fileList, css_properties_json, parser)
parserResults = parser.finish() parserResults = parser.finish()
if not options.only_html:
# Write the parser results out to a pickle. # Write the parser results out to a pickle.
resultsPath = os.path.join(outputdir, 'ParserResults.pkl') resultsPath = os.path.join(outputdir, 'ParserResults.pkl')
with open(resultsPath, 'wb') as resultsFile: with open(resultsPath, 'wb') as resultsFile:
@ -67,11 +70,6 @@ def main():
# Load the configuration. # Load the configuration.
config = Configuration(configFile, parserResults) config = Configuration(configFile, parserResults)
to_generate = [
('SupportedDomApis', 'apis.html'),
]
if not options.only_html:
to_generate = [ to_generate = [
('PrototypeList', 'PrototypeList.rs'), ('PrototypeList', 'PrototypeList.rs'),
('RegisterBindings', 'RegisterBindings.rs'), ('RegisterBindings', 'RegisterBindings.rs'),
@ -86,5 +84,60 @@ def main():
for name, filename in to_generate: for name, filename in to_generate:
generate_file(config, name, os.path.join(outputdir, filename)) generate_file(config, name, os.path.join(outputdir, filename))
generate_file(config, 'SupportedDomApis', os.path.join(doc_servo, 'apis.html'))
def add_css_properties_attributes(webidl_files, css_properties_json, parser):
for filename in webidl_files:
if os.path.basename(filename) == "CSSStyleDeclaration.webidl":
break
else:
return
css_properties = json.load(open(css_properties_json, "rb"))
idl = "partial interface CSSStyleDeclaration {\n%s\n};\n" % "\n".join(
" [%sCEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString %s;" % (
('Pref="%s", ' % data["pref"] if data["pref"] else ""),
attribute_name
)
for (kind, properties_list) in sorted(css_properties.items())
for (property_name, data) in sorted(properties_list.items())
for attribute_name in attribute_names(property_name)
)
parser.parse(idl.encode("utf-8"), "CSSStyleDeclaration_generated.webidl")
def attribute_names(property_name):
# https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-dashed-attribute
if property_name != "float":
yield property_name
else:
yield "_float"
# https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute
if "-" in property_name:
yield "".join(camel_case(property_name))
# https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-webkit-cased-attribute
if property_name.startswith("-webkit-"):
yield "".join(camel_case(property_name), True)
# https://drafts.csswg.org/cssom/#css-property-to-idl-attribute
def camel_case(chars, webkit_prefixed=False):
if webkit_prefixed:
chars = chars[1:]
next_is_uppercase = False
for c in chars:
if c == '-':
next_is_uppercase = True
elif next_is_uppercase:
next_is_uppercase = False
# Should be ASCII-uppercase, but all non-custom CSS property names are within ASCII
yield c.upper()
else:
yield c
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -3344,7 +3344,7 @@ class IDLBuiltinType(IDLType):
[self.location, attribute.location]) [self.location, attribute.location])
assert not self.nullable() assert not self.nullable()
if not attribute.hasValue(): if not attribute.hasValue():
raise WebIDLError("[TreatNullAs] must take an identifier argument" raise WebIDLError("[TreatNullAs] must take an identifier argument",
[attribute.location]) [attribute.location])
value = attribute.value() value = attribute.value()
if value != 'EmptyString': if value != 'EmptyString':

View file

@ -26,479 +26,4 @@ interface CSSStyleDeclaration {
attribute DOMString cssFloat; attribute DOMString cssFloat;
}; };
partial interface CSSStyleDeclaration { // Auto-generated in GlobalGen.py: accessors for each CSS property
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString all;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backgroundColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backgroundPosition;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background-position;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backgroundPositionX;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background-position-x;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backgroundPositionY;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background-position-y;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backgroundRepeat;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background-repeat;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backgroundImage;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background-image;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backgroundAttachment;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background-attachment;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backgroundSize;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background-size;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backgroundOrigin;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background-origin;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backgroundClip;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString background-clip;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderRadius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-radius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderSpacing;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-spacing;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBottom;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-bottom;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBottomColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-bottom-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBottomLeftRadius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-bottom-left-radius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBottomRightRadius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-bottom-right-radius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBottomStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-bottom-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBottomWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-bottom-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderLeft;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-left;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderLeftColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-left-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderLeftStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-left-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderLeftWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-left-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderRight;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-right;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderRightColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-right-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderRightStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-right-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderRightWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-right-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderTop;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-top;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderTopColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-top-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderTopLeftRadius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-top-left-radius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderTopRightRadius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-top-right-radius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderTopStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-top-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderTopWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-top-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-image-source;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderImageSource;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-image-slice;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderImageSlice;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-image-repeat;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderImageRepeat;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-image-outset;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderImageOutset;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-image-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderImageWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-image;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderImage;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-start-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockStartColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-start-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockStartWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-start-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockStartStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-end-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockEndColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-end-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockEndWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-end-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockEndStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-end;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockEnd;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block-start;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlockStart;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-block;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderBlock;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-start-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineStartColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-start-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineStartWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-start-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineStartStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-end-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineEndColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-end-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineEndWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-end-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineEndStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-start;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineStart;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline-end;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInlineEnd;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-inline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderInline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString content;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString display;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString opacity;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString visibility;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString cursor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString boxSizing;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString box-sizing;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString boxShadow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString box-shadow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString textShadow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString text-shadow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString _float;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString clear;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString clip;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transform;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transformOrigin;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transform-origin;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString perspective;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString perspectiveOrigin;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString perspective-origin;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transformStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transform-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backfaceVisibility;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString backface-visibility;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString rotate;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString scale;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString translate;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString direction;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString unicodeBidi;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString unicode-bidi;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString filter;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString inset;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString lineHeight;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString line-height;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString mixBlendMode;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString mix-blend-mode;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString verticalAlign;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString vertical-align;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString listStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString list-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString listStylePosition;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString list-style-position;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString listStyleType;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString list-style-type;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString listStyleImage;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString list-style-image;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString quotes;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString counterIncrement;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString counter-increment;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString counterReset;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString counter-reset;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflowBlock;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflow-block;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflowInline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflow-inline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflowX;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflow-x;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflowY;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflow-y;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflowWrap;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString overflow-wrap;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString tableLayout;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString table-layout;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderCollapse;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-collapse;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString emptyCells;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString empty-cells;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString captionSide;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString caption-side;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString whiteSpace;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString white-space;
[Pref="layout.writing-mode.enabled", CEReactions, SetterThrows]
attribute [TreatNullAs=EmptyString] DOMString writingMode;
[Pref="layout.writing-mode.enabled", CEReactions, SetterThrows]
attribute [TreatNullAs=EmptyString] DOMString writing-mode;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString letterSpacing;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString letter-spacing;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString wordBreak;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString word-break;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString wordSpacing;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString word-spacing;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString wordWrap;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString word-wrap;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString textOverflow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString text-overflow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString textAlign;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString text-align;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString textDecoration;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString text-decoration;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString textDecorationLine;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString text-decoration-line;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString textIndent;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString text-indent;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString textJustify;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString text-justify;
// [CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString textOrientation;
// [CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString text-orientation;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString textRendering;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString text-rendering;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString textTransform;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString text-transform;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString font;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString fontFamily;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString font-family;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString fontSize;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString font-size;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString fontStretch;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString font-stretch;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString fontStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString font-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString fontVariant;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString font-variant;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString fontVariantCaps;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString font-variant-caps;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString fontWeight;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString font-weight;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString marginBottom;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin-bottom;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString marginLeft;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin-left;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString marginRight;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin-right;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString marginTop;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin-top;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin-block-start;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString marginBlockStart;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin-block-end;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString marginBlockEnd;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin-block;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString marginBlock;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin-inline-start;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString marginInlineStart;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin-inline-end;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString marginInlineEnd;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString margin-inline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString marginInline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString paddingBottom;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding-bottom;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString paddingLeft;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding-left;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString paddingRight;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding-right;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString paddingTop;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding-top;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding-block-start;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString paddingBlockStart;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding-block-end;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString paddingBlockEnd;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding-block;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString paddingBlock;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding-inline-start;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString paddingInlineStart;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding-inline-end;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString paddingInlineEnd;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString padding-inline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString paddingInline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString outline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString outlineColor;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString outline-color;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString outlineStyle;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString outline-style;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString outlineWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString outline-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString outlineOffset;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString outline-offset;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString position;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString pointerEvents;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString pointer-events;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString top;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString right;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString left;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString bottom;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString offset-block-start;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString offsetBlockStart;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString offset-block-end;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString offsetBlockEnd;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString offset-inline-start;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString offsetInlineStart;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString offset-inline-end;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString offsetInlineEnd;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString inset-block-start;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString insetBlockStart;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString inset-block-end;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString insetBlockEnd;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString inset-block;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString insetBlock;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString inset-inline-start;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString insetInlineStart;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString inset-inline-end;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString insetInlineEnd;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString inset-inline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString insetInline;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString height;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString minHeight;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString min-height;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString maxHeight;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString max-height;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString minWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString min-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString maxWidth;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString max-width;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString block-size;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString blockSize;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString inline-size;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString inlineSize;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString max-block-size;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString maxBlockSize;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString max-inline-size;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString maxInlineSize;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString min-block-size;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString minBlockSize;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString min-inline-size;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString minInlineSize;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString zIndex;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString z-index;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString imageRendering;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString image-rendering;
[Pref="layout.columns.enabled", CEReactions, SetterThrows]
attribute [TreatNullAs=EmptyString] DOMString columnCount;
[Pref="layout.columns.enabled", CEReactions, SetterThrows]
attribute [TreatNullAs=EmptyString] DOMString column-count;
[Pref="layout.columns.enabled", CEReactions, SetterThrows]
attribute [TreatNullAs=EmptyString] DOMString columnWidth;
[Pref="layout.columns.enabled", CEReactions, SetterThrows]
attribute [TreatNullAs=EmptyString] DOMString column-width;
[Pref="layout.columns.enabled", CEReactions, SetterThrows]
attribute [TreatNullAs=EmptyString] DOMString columns;
[Pref="layout.columns.enabled", CEReactions, SetterThrows]
attribute [TreatNullAs=EmptyString] DOMString columnGap;
[Pref="layout.columns.enabled", CEReactions, SetterThrows]
attribute [TreatNullAs=EmptyString] DOMString column-gap;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transition;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transitionDuration;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transition-duration;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transitionTimingFunction;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transition-timing-function;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transitionProperty;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transition-property;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transitionDelay;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString transition-delay;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flex;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flexFlow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flex-flow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flexDirection;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flex-direction;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flexWrap;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flex-wrap;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString justifyContent;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString justify-content;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString alignItems;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString align-items;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString alignContent;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString align-content;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString order;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flexBasis;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flex-basis;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flexGrow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flex-grow;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flexShrink;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString flex-shrink;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString alignSelf;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString align-self;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animation;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animation-name;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animationName;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animation-duration;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animationDuration;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animation-timing-function;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animationTimingFunction;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animation-iteration-count;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animationIterationCount;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animation-direction;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animationDirection;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animation-play-state;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animationPlayState;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animation-fill-mode;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animationFillMode;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animation-delay;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString animationDelay;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-end-end-radius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderEndEndRadius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-start-end-radius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderStartEndRadius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-start-start-radius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderStartStartRadius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border-end-start-radius;
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString borderEndStartRadius;
};

View file

@ -8,7 +8,7 @@ publish = false
build = "build.rs" build = "build.rs"
# https://github.com/rust-lang/cargo/issues/3544 # https://github.com/rust-lang/cargo/issues/3544
links = "for some reason the links key is required to pass data around between build scripts" links = "servo_style_crate"
[lib] [lib]
name = "style" name = "style"
@ -20,7 +20,8 @@ gecko = ["style_traits/gecko", "fallible/known_system_malloc", "bindgen", "regex
servo = ["serde", "style_traits/servo", "servo_atoms", "servo_config", "html5ever", servo = ["serde", "style_traits/servo", "servo_atoms", "servo_config", "html5ever",
"cssparser/serde", "encoding_rs", "malloc_size_of/servo", "arrayvec/use_union", "cssparser/serde", "encoding_rs", "malloc_size_of/servo", "arrayvec/use_union",
"servo_url", "string_cache", "crossbeam-channel", "to_shmem/servo", "servo_arc/servo"] "servo_url", "string_cache", "crossbeam-channel", "to_shmem/servo", "servo_arc/servo"]
"servo-layout-2020" = [] servo-layout-2013 = []
servo-layout-2020 = []
gecko_debug = [] gecko_debug = []
gecko_refcount_logging = [] gecko_refcount_logging = []
gecko_profiler = [] gecko_profiler = []

View file

@ -89,14 +89,19 @@ fn generate_properties() {
let script = Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap()) let script = Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap())
.join("properties") .join("properties")
.join("build.py"); .join("build.py");
let product = if cfg!(feature = "gecko") {
"gecko" #[cfg(feature = "gecko")]
} else { let engine = "gecko";
"servo"
}; #[cfg(feature = "servo-layout-2013")]
let engine = "servo-2013";
#[cfg(feature = "servo-layout-2020")]
let engine = "servo-2020";
let status = Command::new(&*PYTHON) let status = Command::new(&*PYTHON)
.arg(&script) .arg(&script)
.arg(product) .arg(engine)
.arg("style-crate") .arg("style-crate")
.status() .status()
.unwrap(); .unwrap();
@ -117,6 +122,9 @@ fn main() {
feature flags at the same time." feature flags at the same time."
); );
} }
if gecko && (cfg!(feature = "servo-layout-2013") || cfg!(feature = "servo-layout-2020")) {
panic!("The 'servo-layout-*' features can only be enabled together with 'servo'.");
}
println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=build.rs");
println!("cargo:out_dir={}", env::var("OUT_DIR").unwrap()); println!("cargo:out_dir={}", env::var("OUT_DIR").unwrap());
generate_properties(); generate_properties();

View file

@ -30,35 +30,36 @@ STYLE_STRUCT_LIST = [
"effects", "effects",
"font", "font",
"inherited_box", "inherited_box",
"inherited_svg",
"inherited_table", "inherited_table",
"inherited_text", "inherited_text",
"inherited_ui", "inherited_ui",
"inherited_svg",
"list", "list",
"margin", "margin",
"outline", "outline",
"padding", "padding",
"position", "position",
"svg",
"table", "table",
"text", "text",
"ui", "ui",
"svg",
"xul", "xul",
] ]
def main(): def main():
usage = ("Usage: %s [ servo | gecko ] [ style-crate | geckolib <template> | html ]" % usage = ("Usage: %s [ servo-2013 | servo-2020 | gecko ] [ style-crate | geckolib <template> | html ]" %
sys.argv[0]) sys.argv[0])
if len(sys.argv) < 3: if len(sys.argv) < 3:
abort(usage) abort(usage)
product = sys.argv[1] engine = sys.argv[1]
output = sys.argv[2] output = sys.argv[2]
if product not in ["servo", "gecko"] or output not in ["style-crate", "geckolib", "html"]: if engine not in ["servo-2013", "servo-2020", "gecko"] \
or output not in ["style-crate", "geckolib", "html"]:
abort(usage) abort(usage)
properties = data.PropertiesData(product=product) properties = data.PropertiesData(engine=engine)
files = {} files = {}
for kind in ["longhands", "shorthands"]: for kind in ["longhands", "shorthands"]:
files[kind] = {} files[kind] = {}
@ -69,13 +70,13 @@ def main():
continue continue
files[kind][struct] = render( files[kind][struct] = render(
file_name, file_name,
product=product, engine=engine,
data=properties, data=properties,
) )
properties_template = os.path.join(BASE, "properties.mako.rs") properties_template = os.path.join(BASE, "properties.mako.rs")
files["properties"] = render( files["properties"] = render(
properties_template, properties_template,
product=product, engine=engine,
data=properties, data=properties,
__file__=properties_template, __file__=properties_template,
OUT_DIR=OUT_DIR, OUT_DIR=OUT_DIR,
@ -90,18 +91,42 @@ def main():
files[kind][struct], files[kind][struct],
) )
if product == "gecko": if engine == "gecko":
template = os.path.join(BASE, "gecko.mako.rs") template = os.path.join(BASE, "gecko.mako.rs")
rust = render(template, data=properties) rust = render(template, data=properties)
write(OUT_DIR, "gecko_properties.rs", rust) write(OUT_DIR, "gecko_properties.rs", rust)
if engine in ["servo-2013", "servo-2020"]:
if engine == "servo-2013":
pref_attr = "servo_2013_pref"
if engine == "servo-2020":
pref_attr = "servo_2020_pref"
properties_dict = {
kind: {
p.name: {
"pref": getattr(p, pref_attr)
}
for prop in properties_list
if prop.enabled_in_content()
for p in [prop] + prop.alias
}
for kind, properties_list in [
("longhands", properties.longhands),
("shorthands", properties.shorthands)
]
}
as_html = render(os.path.join(BASE, "properties.html.mako"), properties=properties_dict)
as_json = json.dumps(properties_dict, indent=4, sort_keys=True)
doc_servo = os.path.join(BASE, "..", "..", "..", "target", "doc", "servo")
write(doc_servo, "css-properties.html", as_html)
write(doc_servo, "css-properties.json", as_json)
write(OUT_DIR, "css-properties.json", as_json)
elif output == "geckolib": elif output == "geckolib":
if len(sys.argv) < 4: if len(sys.argv) < 4:
abort(usage) abort(usage)
template = sys.argv[3] template = sys.argv[3]
header = render(template, data=properties) header = render(template, data=properties)
sys.stdout.write(header) sys.stdout.write(header)
elif output == "html":
write_html(properties)
def abort(message): def abort(message):
@ -139,19 +164,5 @@ def write(directory, filename, content):
abort("Found \"{}\" in {} ({})".format(python_addr.group(0), filename, full_path)) abort("Found \"{}\" in {} ({})".format(python_addr.group(0), filename, full_path))
def write_html(properties):
properties = dict(
(p.name, {
"flag": p.servo_pref,
"shorthand": hasattr(p, "sub_properties")
})
for p in properties.longhands + properties.shorthands
)
doc_servo = os.path.join(BASE, "..", "..", "..", "target", "doc", "servo")
html = render(os.path.join(BASE, "properties.html.mako"), properties=properties)
write(doc_servo, "css-properties.html", html)
write(doc_servo, "css-properties.json", json.dumps(properties, indent=4))
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -639,13 +639,8 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
{ {
// TODO(emilio): Use get_font_if_mutated instead. if let Some(font) = builder.get_font_if_mutated() {
if self.seen.contains(LonghandId::FontStyle) || font.compute_font_hash();
self.seen.contains(LonghandId::FontWeight) ||
self.seen.contains(LonghandId::FontStretch) ||
self.seen.contains(LonghandId::FontFamily)
{
builder.mutate_font().compute_font_hash();
} }
} }
} }

View file

@ -29,8 +29,8 @@ SYSTEM_FONT_LONGHANDS = """font_family font_size font_style
font_optical_sizing""".split() font_optical_sizing""".split()
def maybe_moz_logical_alias(product, side, prop): def maybe_moz_logical_alias(engine, side, prop):
if product == "gecko" and side[1]: if engine == "gecko" and side[1]:
axis, dir = side[0].split("-") axis, dir = side[0].split("-")
if axis == "inline": if axis == "inline":
return prop % dir return prop % dir
@ -73,9 +73,12 @@ def parse_aliases(value):
class Keyword(object): class Keyword(object):
def __init__(self, name, values, gecko_constant_prefix=None, def __init__(self, name, values, gecko_constant_prefix=None,
gecko_enum_prefix=None, custom_consts=None, gecko_enum_prefix=None, custom_consts=None,
extra_gecko_values=None, extra_servo_values=None, extra_gecko_values=None,
aliases=None, extra_servo_2013_values=None,
extra_gecko_aliases=None, extra_servo_2020_values=None,
gecko_aliases=None,
servo_2013_aliases=None,
servo_2020_aliases=None,
gecko_strip_moz_prefix=None, gecko_strip_moz_prefix=None,
gecko_inexhaustive=None): gecko_inexhaustive=None):
self.name = name self.name = name
@ -87,40 +90,35 @@ class Keyword(object):
"NS_STYLE_" + self.name.upper().replace("-", "_") "NS_STYLE_" + self.name.upper().replace("-", "_")
self.gecko_enum_prefix = gecko_enum_prefix self.gecko_enum_prefix = gecko_enum_prefix
self.extra_gecko_values = (extra_gecko_values or "").split() self.extra_gecko_values = (extra_gecko_values or "").split()
self.extra_servo_values = (extra_servo_values or "").split() self.extra_servo_2013_values = (extra_servo_2013_values or "").split()
self.aliases = parse_aliases(aliases or "") self.extra_servo_2020_values = (extra_servo_2020_values or "").split()
self.extra_gecko_aliases = parse_aliases(extra_gecko_aliases or "") self.gecko_aliases = parse_aliases(gecko_aliases or "")
self.servo_2013_aliases = parse_aliases(servo_2013_aliases or "")
self.servo_2020_aliases = parse_aliases(servo_2020_aliases or "")
self.consts_map = {} if custom_consts is None else custom_consts self.consts_map = {} if custom_consts is None else custom_consts
self.gecko_strip_moz_prefix = True \ self.gecko_strip_moz_prefix = True \
if gecko_strip_moz_prefix is None else gecko_strip_moz_prefix if gecko_strip_moz_prefix is None else gecko_strip_moz_prefix
self.gecko_inexhaustive = gecko_inexhaustive or (gecko_enum_prefix is None) self.gecko_inexhaustive = gecko_inexhaustive or (gecko_enum_prefix is None)
def gecko_values(self): def values_for(self, engine):
if engine == "gecko":
return self.values + self.extra_gecko_values return self.values + self.extra_gecko_values
elif engine == "servo-2013":
def servo_values(self): return self.values + self.extra_servo_2013_values
return self.values + self.extra_servo_values elif engine == "servo-2020":
return self.values + self.extra_servo_2020_values
def gecko_aliases(self):
aliases = self.aliases.copy()
aliases.update(self.extra_gecko_aliases)
return aliases
def values_for(self, product):
if product == "gecko":
return self.gecko_values()
elif product == "servo":
return self.servo_values()
else: else:
raise Exception("Bad product: " + product) raise Exception("Bad engine: " + engine)
def aliases_for(self, product): def aliases_for(self, engine):
if product == "gecko": if engine == "gecko":
return self.gecko_aliases() return self.gecko_aliases
elif product == "servo": elif engine == "servo-2013":
return self.aliases return self.servo_2013_aliases
elif engine == "servo-2020":
return self.servo_2020_aliases
else: else:
raise Exception("Bad product: " + product) raise Exception("Bad engine: " + engine)
def gecko_constant(self, value): def gecko_constant(self, value):
moz_stripped = (value.replace("-moz-", '') moz_stripped = (value.replace("-moz-", '')
@ -172,7 +170,10 @@ def to_phys(name, logical, physical):
class Longhand(object): class Longhand(object):
def __init__(self, style_struct, name, spec=None, animation_value_type=None, keyword=None, def __init__(self, style_struct, name, spec=None, animation_value_type=None, keyword=None,
predefined_type=None, servo_pref=None, gecko_pref=None, predefined_type=None,
servo_2013_pref=None,
servo_2020_pref=None,
gecko_pref=None,
enabled_in="content", need_index=False, enabled_in="content", need_index=False,
gecko_ffi_name=None, gecko_ffi_name=None,
has_effect_on_gecko_scrollbars=None, has_effect_on_gecko_scrollbars=None,
@ -191,7 +192,8 @@ class Longhand(object):
self.ident = to_rust_ident(name) self.ident = to_rust_ident(name)
self.camel_case = to_camel_case(self.ident) self.camel_case = to_camel_case(self.ident)
self.style_struct = style_struct self.style_struct = style_struct
self.servo_pref = servo_pref self.servo_2013_pref = servo_2013_pref
self.servo_2020_pref = servo_2020_pref
self.gecko_pref = gecko_pref self.gecko_pref = gecko_pref
self.has_effect_on_gecko_scrollbars = has_effect_on_gecko_scrollbars self.has_effect_on_gecko_scrollbars = has_effect_on_gecko_scrollbars
assert ( assert (
@ -270,10 +272,15 @@ class Longhand(object):
return [to_phys(self.name, logical_side, physical_side) return [to_phys(self.name, logical_side, physical_side)
for physical_side in physical] for physical_side in physical]
def experimental(self, product): def experimental(self, engine):
if product == "gecko": if engine == "gecko":
return bool(self.gecko_pref) return bool(self.gecko_pref)
return bool(self.servo_pref) elif engine == "servo-2013":
return bool(self.servo_2013_pref)
elif engine == "servo-2020":
return bool(self.servo_2020_pref)
else:
raise Exception("Bad engine: " + engine)
# FIXME(emilio): Shorthand and Longhand should really share a base class. # FIXME(emilio): Shorthand and Longhand should really share a base class.
def explicitly_enabled_in_ua_sheets(self): def explicitly_enabled_in_ua_sheets(self):
@ -285,10 +292,15 @@ class Longhand(object):
def enabled_in_content(self): def enabled_in_content(self):
return self.enabled_in == "content" return self.enabled_in == "content"
def may_be_disabled_in(self, shorthand, product): def may_be_disabled_in(self, shorthand, engine):
if product == "gecko": if engine == "gecko":
return self.gecko_pref and self.gecko_pref != shorthand.gecko_pref return self.gecko_pref and self.gecko_pref != shorthand.gecko_pref
return self.servo_pref and self.servo_pref != shorthand.servo_pref elif engine == "servo-2013":
return self.servo_2013_pref and self.servo_2013_pref != shorthand.servo_2013_pref
elif engine == "servo-2020":
return self.servo_2020_pref and self.servo_2020_pref != shorthand.servo_2020_pref
else:
raise Exception("Bad engine: " + engine)
def base_type(self): def base_type(self):
if self.predefined_type and not self.is_vector: if self.predefined_type and not self.is_vector:
@ -394,7 +406,10 @@ class Longhand(object):
class Shorthand(object): class Shorthand(object):
def __init__(self, name, sub_properties, spec=None, servo_pref=None, gecko_pref=None, def __init__(self, name, sub_properties, spec=None,
servo_2013_pref=None,
servo_2020_pref=None,
gecko_pref=None,
enabled_in="content", enabled_in="content",
allowed_in_keyframe_block=True, alias=None, extra_prefixes=None, allowed_in_keyframe_block=True, alias=None, extra_prefixes=None,
allowed_in_page_rule=False, flags=None): allowed_in_page_rule=False, flags=None):
@ -404,7 +419,8 @@ class Shorthand(object):
self.spec = spec self.spec = spec
self.ident = to_rust_ident(name) self.ident = to_rust_ident(name)
self.camel_case = to_camel_case(self.ident) self.camel_case = to_camel_case(self.ident)
self.servo_pref = servo_pref self.servo_2013_pref = servo_2013_pref
self.servo_2020_pref = servo_2020_pref
self.gecko_pref = gecko_pref self.gecko_pref = gecko_pref
self.sub_properties = sub_properties self.sub_properties = sub_properties
assert enabled_in in ["", "ua", "chrome", "content"] assert enabled_in in ["", "ua", "chrome", "content"]
@ -442,10 +458,15 @@ class Shorthand(object):
def type(): def type():
return "shorthand" return "shorthand"
def experimental(self, product): def experimental(self, engine):
if product == "gecko": if engine == "gecko":
return bool(self.gecko_pref) return bool(self.gecko_pref)
return bool(self.servo_pref) elif engine == "servo-2013":
return bool(self.servo_2013_pref)
elif engine == "servo-2020":
return bool(self.servo_2020_pref)
else:
raise Exception("Bad engine: " + engine)
# FIXME(emilio): Shorthand and Longhand should really share a base class. # FIXME(emilio): Shorthand and Longhand should really share a base class.
def explicitly_enabled_in_ua_sheets(self): def explicitly_enabled_in_ua_sheets(self):
@ -468,10 +489,11 @@ class Alias(object):
self.camel_case = to_camel_case(self.ident) self.camel_case = to_camel_case(self.ident)
self.original = original self.original = original
self.enabled_in = original.enabled_in self.enabled_in = original.enabled_in
self.servo_pref = original.servo_pref
self.animatable = original.animatable self.animatable = original.animatable
self.transitionable = original.transitionable self.servo_2013_pref = original.servo_2013_pref
self.servo_2020_pref = original.servo_2020_pref
self.gecko_pref = gecko_pref self.gecko_pref = gecko_pref
self.transitionable = original.transitionable
self.allowed_in_page_rule = original.allowed_in_page_rule self.allowed_in_page_rule = original.allowed_in_page_rule
self.allowed_in_keyframe_block = original.allowed_in_keyframe_block self.allowed_in_keyframe_block = original.allowed_in_keyframe_block
@ -479,10 +501,15 @@ class Alias(object):
def type(): def type():
return "alias" return "alias"
def experimental(self, product): def experimental(self, engine):
if product == "gecko": if engine == "gecko":
return bool(self.gecko_pref) return bool(self.gecko_pref)
return bool(self.servo_pref) elif engine == "servo-2013":
return bool(self.servo_2013_pref)
elif engine == "servo-2020":
return bool(self.servo_2020_pref)
else:
raise Exception("Bad engine: " + engine)
def explicitly_enabled_in_ua_sheets(self): def explicitly_enabled_in_ua_sheets(self):
return self.enabled_in in ["ua", "chrome"] return self.enabled_in in ["ua", "chrome"]
@ -536,8 +563,8 @@ class StyleStruct(object):
class PropertiesData(object): class PropertiesData(object):
def __init__(self, product): def __init__(self, engine):
self.product = product self.engine = engine
self.style_structs = [] self.style_structs = []
self.current_style_struct = None self.current_style_struct = None
self.longhands = [] self.longhands = []
@ -559,13 +586,13 @@ class PropertiesData(object):
def add_prefixed_aliases(self, property): def add_prefixed_aliases(self, property):
# FIXME Servo's DOM architecture doesn't support vendor-prefixed properties. # FIXME Servo's DOM architecture doesn't support vendor-prefixed properties.
# See servo/servo#14941. # See servo/servo#14941.
if self.product == "gecko": if self.engine == "gecko":
for (prefix, pref) in property.extra_prefixes: for (prefix, pref) in property.extra_prefixes:
property.alias.append(('-%s-%s' % (prefix, property.name), pref)) property.alias.append(('-%s-%s' % (prefix, property.name), pref))
def declare_longhand(self, name, products="gecko servo", **kwargs): def declare_longhand(self, name, engines=None, **kwargs):
products = products.split() engines = engines.split()
if self.product not in products: if self.engine not in engines:
return return
longhand = Longhand(self.current_style_struct, name, **kwargs) longhand = Longhand(self.current_style_struct, name, **kwargs)
@ -580,9 +607,9 @@ class PropertiesData(object):
return longhand return longhand
def declare_shorthand(self, name, sub_properties, products="gecko servo", *args, **kwargs): def declare_shorthand(self, name, sub_properties, engines, *args, **kwargs):
products = products.split() engines = engines.split()
if self.product not in products: if self.engine not in engines:
return return
sub_properties = [self.longhands_by_name[s] for s in sub_properties] sub_properties = [self.longhands_by_name[s] for s in sub_properties]
@ -605,7 +632,7 @@ def _add_logical_props(data, props):
groups = set() groups = set()
for prop in props: for prop in props:
if prop not in data.longhands_by_name: if prop not in data.longhands_by_name:
assert data.product == "servo" assert data.engine in ["servo-2013", "servo-2020"]
continue continue
prop = data.longhands_by_name[prop] prop = data.longhands_by_name[prop]
if prop.logical_group: if prop.logical_group:
@ -616,8 +643,8 @@ def _add_logical_props(data, props):
# These are probably Gecko bugs and should be supported per spec. # These are probably Gecko bugs and should be supported per spec.
def _remove_common_first_line_and_first_letter_properties(props, product): def _remove_common_first_line_and_first_letter_properties(props, engine):
if product == "gecko": if engine == "gecko":
props.remove("-moz-tab-size") props.remove("-moz-tab-size")
props.remove("hyphens") props.remove("hyphens")
props.remove("line-break") props.remove("line-break")
@ -644,6 +671,8 @@ class PropertyRestrictions:
@staticmethod @staticmethod
def shorthand(data, shorthand): def shorthand(data, shorthand):
if shorthand not in data.shorthands_by_name:
return []
return map(lambda p: p.name, data.shorthands_by_name[shorthand].sub_properties) return map(lambda p: p.name, data.shorthands_by_name[shorthand].sub_properties)
@staticmethod @staticmethod
@ -680,7 +709,7 @@ class PropertyRestrictions:
_add_logical_props(data, props) _add_logical_props(data, props)
_remove_common_first_line_and_first_letter_properties(props, data.product) _remove_common_first_line_and_first_letter_properties(props, data.engine)
return props return props
# https://drafts.csswg.org/css-pseudo/#first-line-styling # https://drafts.csswg.org/css-pseudo/#first-line-styling
@ -714,7 +743,7 @@ class PropertyRestrictions:
props.remove(prop) props.remove(prop)
props.remove("box-shadow") props.remove("box-shadow")
_remove_common_first_line_and_first_letter_properties(props, data.product) _remove_common_first_line_and_first_letter_properties(props, data.engine)
return props return props
# https://drafts.csswg.org/css-pseudo/#placeholder # https://drafts.csswg.org/css-pseudo/#placeholder

View file

@ -367,7 +367,7 @@
pub use self::single_value::SpecifiedValue as SingleSpecifiedValue; pub use self::single_value::SpecifiedValue as SingleSpecifiedValue;
% if not simple_vector_bindings and product == "gecko": % if not simple_vector_bindings and engine == "gecko":
impl SpecifiedValue { impl SpecifiedValue {
fn compute_iter<'a, 'cx, 'cx_a>( fn compute_iter<'a, 'cx, 'cx_a>(
&'a self, &'a self,
@ -486,7 +486,7 @@
_ => panic!("entered the wrong cascade_property() implementation"), _ => panic!("entered the wrong cascade_property() implementation"),
}; };
% if property.ident in SYSTEM_FONT_LONGHANDS and product == "gecko": % if property.ident in SYSTEM_FONT_LONGHANDS and engine == "gecko":
if let Some(sf) = specified_value.get_system() { if let Some(sf) = specified_value.get_system() {
longhands::system_font::resolve_system_font(sf, context); longhands::system_font::resolve_system_font(sf, context);
} }
@ -497,7 +497,7 @@
.set_writing_mode_dependency(context.builder.writing_mode); .set_writing_mode_dependency(context.builder.writing_mode);
% endif % endif
% if property.is_vector and not property.simple_vector_bindings and product == "gecko": % if property.is_vector and not property.simple_vector_bindings and engine == "gecko":
// In the case of a vector property we want to pass down an // In the case of a vector property we want to pass down an
// iterator so that this can be computed without allocation. // iterator so that this can be computed without allocation.
// //
@ -543,9 +543,13 @@
<%def name="single_keyword_system(name, values, **kwargs)"> <%def name="single_keyword_system(name, values, **kwargs)">
<% <%
keyword_kwargs = {a: kwargs.pop(a, None) for a in [ keyword_kwargs = {a: kwargs.pop(a, None) for a in [
'gecko_constant_prefix', 'gecko_enum_prefix', 'gecko_constant_prefix',
'extra_gecko_values', 'extra_servo_values', 'gecko_enum_prefix',
'custom_consts', 'gecko_inexhaustive', 'extra_gecko_values',
'extra_servo_2013_values',
'extra_servo_2020_values',
'custom_consts',
'gecko_inexhaustive',
]} ]}
keyword = keyword=Keyword(name, values, **keyword_kwargs) keyword = keyword=Keyword(name, values, **keyword_kwargs)
%> %>
@ -569,12 +573,12 @@
ToShmem, ToShmem,
)] )]
pub enum T { pub enum T {
% for value in keyword.values_for(product): % for value in keyword.values_for(engine):
${to_camel_case(value)}, ${to_camel_case(value)},
% endfor % endfor
} }
${gecko_keyword_conversion(keyword, keyword.values_for(product), type="T", cast_to="i32")} ${gecko_keyword_conversion(keyword, keyword.values_for(engine), type="T", cast_to="i32")}
} }
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))] #[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
@ -594,13 +598,15 @@
fn to_computed_value(&self, _cx: &Context) -> Self::ComputedValue { fn to_computed_value(&self, _cx: &Context) -> Self::ComputedValue {
match *self { match *self {
SpecifiedValue::Keyword(v) => v, SpecifiedValue::Keyword(v) => v,
% if engine == "gecko":
SpecifiedValue::System(_) => { SpecifiedValue::System(_) => {
% if product == "gecko":
_cx.cached_system_font.as_ref().unwrap().${to_rust_ident(name)} _cx.cached_system_font.as_ref().unwrap().${to_rust_ident(name)}
% else:
unreachable!()
% endif
} }
% else:
SpecifiedValue::System(system_font) => {
match system_font {}
}
% endif
} }
} }
fn from_computed_value(other: &computed_value::T) -> Self { fn from_computed_value(other: &computed_value::T) -> Self {
@ -635,7 +641,7 @@
<%def name="gecko_keyword_conversion(keyword, values=None, type='SpecifiedValue', cast_to=None)"> <%def name="gecko_keyword_conversion(keyword, values=None, type='SpecifiedValue', cast_to=None)">
<% <%
if not values: if not values:
values = keyword.values_for(product) values = keyword.values_for(engine)
maybe_cast = "as %s" % cast_to if cast_to else "" maybe_cast = "as %s" % cast_to if cast_to else ""
const_type = cast_to if cast_to else "u32" const_type = cast_to if cast_to else "u32"
%> %>
@ -703,10 +709,17 @@
extra_specified=None, needs_conversion=False, **kwargs)"> extra_specified=None, needs_conversion=False, **kwargs)">
<% <%
keyword_kwargs = {a: kwargs.pop(a, None) for a in [ keyword_kwargs = {a: kwargs.pop(a, None) for a in [
'gecko_constant_prefix', 'gecko_enum_prefix', 'gecko_constant_prefix',
'extra_gecko_values', 'extra_servo_values', 'gecko_enum_prefix',
'aliases', 'extra_gecko_aliases', 'custom_consts', 'extra_gecko_values',
'gecko_inexhaustive', 'gecko_strip_moz_prefix', 'extra_servo_2013_values',
'extra_servo_2020_values',
'gecko_aliases',
'servo_2013_aliases',
'servo_2020_aliases',
'custom_consts',
'gecko_inexhaustive',
'gecko_strip_moz_prefix',
]} ]}
%> %>
@ -716,7 +729,7 @@
% if include_aliases: % if include_aliases:
<% <%
aliases = [] aliases = []
for alias, v in keyword.aliases_for(product).iteritems(): for alias, v in keyword.aliases_for(engine).iteritems():
if variant == v: if variant == v:
aliases.append(alias) aliases.append(alias)
%> %>
@ -742,7 +755,7 @@
ToShmem, ToShmem,
)] )]
pub enum SpecifiedValue { pub enum SpecifiedValue {
${variants(keyword.values_for(product) + extra_specified.split(), bool(extra_specified))} ${variants(keyword.values_for(engine) + extra_specified.split(), bool(extra_specified))}
} }
% else: % else:
pub use self::computed_value::T as SpecifiedValue; pub use self::computed_value::T as SpecifiedValue;
@ -754,7 +767,7 @@
#[derive(Parse, SpecifiedValueInfo, ToComputedValue, ToShmem)] #[derive(Parse, SpecifiedValueInfo, ToComputedValue, ToShmem)]
% endif % endif
pub enum T { pub enum T {
${variants(data.longhands_by_name[name].keyword.values_for(product), not extra_specified)} ${variants(data.longhands_by_name[name].keyword.values_for(engine), not extra_specified)}
} }
} }
#[inline] #[inline]
@ -773,10 +786,10 @@
% if needs_conversion: % if needs_conversion:
<% <%
conversion_values = keyword.values_for(product) conversion_values = keyword.values_for(engine)
if extra_specified: if extra_specified:
conversion_values += extra_specified.split() conversion_values += extra_specified.split()
conversion_values += keyword.aliases_for(product).keys() conversion_values += keyword.aliases_for(engine).keys()
%> %>
${gecko_keyword_conversion(keyword, values=conversion_values)} ${gecko_keyword_conversion(keyword, values=conversion_values)}
% endif % endif
@ -848,11 +861,11 @@
pub struct LonghandsToSerialize<'a> { pub struct LonghandsToSerialize<'a> {
% for sub_property in shorthand.sub_properties: % for sub_property in shorthand.sub_properties:
pub ${sub_property.ident}: pub ${sub_property.ident}:
% if sub_property.may_be_disabled_in(shorthand, product): % if sub_property.may_be_disabled_in(shorthand, engine):
Option< Option<
% endif % endif
&'a longhands::${sub_property.ident}::SpecifiedValue, &'a longhands::${sub_property.ident}::SpecifiedValue,
% if sub_property.may_be_disabled_in(shorthand, product): % if sub_property.may_be_disabled_in(shorthand, engine):
>, >,
% endif % endif
% endfor % endfor
@ -891,7 +904,7 @@
( (
% for sub_property in shorthand.sub_properties: % for sub_property in shorthand.sub_properties:
% if sub_property.may_be_disabled_in(shorthand, product): % if sub_property.may_be_disabled_in(shorthand, engine):
${sub_property.ident}, ${sub_property.ident},
% else: % else:
Some(${sub_property.ident}), Some(${sub_property.ident}),
@ -919,13 +932,13 @@
use crate::properties::{NonCustomPropertyId, LonghandId}; use crate::properties::{NonCustomPropertyId, LonghandId};
input.parse_entirely(|input| parse_value(context, input)).map(|longhands| { input.parse_entirely(|input| parse_value(context, input)).map(|longhands| {
% for sub_property in shorthand.sub_properties: % for sub_property in shorthand.sub_properties:
% if sub_property.may_be_disabled_in(shorthand, product): % if sub_property.may_be_disabled_in(shorthand, engine):
if NonCustomPropertyId::from(LonghandId::${sub_property.camel_case}).allowed_in(context) { if NonCustomPropertyId::from(LonghandId::${sub_property.camel_case}).allowed_in(context) {
% endif % endif
declarations.push(PropertyDeclaration::${sub_property.camel_case}( declarations.push(PropertyDeclaration::${sub_property.camel_case}(
longhands.${sub_property.ident} longhands.${sub_property.ident}
)); ));
% if sub_property.may_be_disabled_in(shorthand, product): % if sub_property.may_be_disabled_in(shorthand, engine):
} }
% endif % endif
% endfor % endfor

View file

@ -391,7 +391,7 @@ impl AnimationValue {
x.boxed, x.boxed,
not x.is_animatable_with_computed_value, not x.is_animatable_with_computed_value,
x.style_struct.inherited, x.style_struct.inherited,
x.ident in SYSTEM_FONT_LONGHANDS and product == "gecko", x.ident in SYSTEM_FONT_LONGHANDS and engine == "gecko",
) )
%> %>
@ -851,7 +851,7 @@ impl Animate for AnimatedFilter {
Ok(Filter::${func}(animate_multiplicative_factor(this, other, procedure)?)) Ok(Filter::${func}(animate_multiplicative_factor(this, other, procedure)?))
}, },
% endfor % endfor
% if product == "gecko": % if engine == "gecko":
(&Filter::DropShadow(ref this), &Filter::DropShadow(ref other)) => { (&Filter::DropShadow(ref this), &Filter::DropShadow(ref other)) => {
Ok(Filter::DropShadow(this.animate(other, procedure)?)) Ok(Filter::DropShadow(this.animate(other, procedure)?))
}, },
@ -871,7 +871,7 @@ impl ToAnimatedZero for AnimatedFilter {
% for func in ['Brightness', 'Contrast', 'Opacity', 'Saturate']: % for func in ['Brightness', 'Contrast', 'Opacity', 'Saturate']:
Filter::${func}(_) => Ok(Filter::${func}(1.)), Filter::${func}(_) => Ok(Filter::${func}(1.)),
% endfor % endfor
% if product == "gecko": % if engine == "gecko":
Filter::DropShadow(ref this) => Ok(Filter::DropShadow(this.to_animated_zero()?)), Filter::DropShadow(ref this) => Ok(Filter::DropShadow(this.to_animated_zero()?)),
% endif % endif
_ => Err(()), _ => Err(()),

View file

@ -10,6 +10,7 @@ ${helpers.predefined_type(
"background-color", "background-color",
"Color", "Color",
"computed::Color::transparent()", "computed::Color::transparent()",
engines="gecko servo-2013 servo-2020",
initial_specified_value="SpecifiedValue::transparent()", initial_specified_value="SpecifiedValue::transparent()",
spec="https://drafts.csswg.org/css-backgrounds/#background-color", spec="https://drafts.csswg.org/css-backgrounds/#background-color",
animation_value_type="AnimatedColor", animation_value_type="AnimatedColor",
@ -21,6 +22,8 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"background-image", "background-image",
"ImageLayer", "ImageLayer",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_value="computed::ImageLayer::none()", initial_value="computed::ImageLayer::none()",
initial_specified_value="specified::ImageLayer::none()", initial_specified_value="specified::ImageLayer::none()",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image", spec="https://drafts.csswg.org/css-backgrounds/#the-background-image",
@ -33,6 +36,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"background-position-" + axis, "background-position-" + axis,
"position::" + direction + "Position", "position::" + direction + "Position",
engines="gecko servo-2013",
initial_value="computed::LengthPercentage::zero()", initial_value="computed::LengthPercentage::zero()",
initial_specified_value="SpecifiedValue::initial_specified_value()", initial_specified_value="SpecifiedValue::initial_specified_value()",
spec="https://drafts.csswg.org/css-backgrounds-4/#propdef-background-position-" + axis, spec="https://drafts.csswg.org/css-backgrounds-4/#propdef-background-position-" + axis,
@ -46,6 +50,7 @@ ${helpers.predefined_type(
"background-repeat", "background-repeat",
"BackgroundRepeat", "BackgroundRepeat",
"computed::BackgroundRepeat::repeat()", "computed::BackgroundRepeat::repeat()",
engines="gecko servo-2013",
initial_specified_value="specified::BackgroundRepeat::repeat()", initial_specified_value="specified::BackgroundRepeat::repeat()",
animation_value_type="discrete", animation_value_type="discrete",
vector=True, vector=True,
@ -54,7 +59,8 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"background-attachment", "background-attachment",
"scroll fixed" + (" local" if product == "gecko" else ""), "scroll fixed" + (" local" if engine == "gecko" else ""),
engines="gecko servo-2013",
vector=True, vector=True,
gecko_enum_prefix="StyleImageLayerAttachment", gecko_enum_prefix="StyleImageLayerAttachment",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment", spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment",
@ -64,6 +70,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"background-clip", "background-clip",
"border-box padding-box content-box", "border-box padding-box content-box",
engines="gecko servo-2013",
extra_gecko_values="text", extra_gecko_values="text",
vector=True, extra_prefixes="webkit", vector=True, extra_prefixes="webkit",
gecko_enum_prefix="StyleGeometryBox", gecko_enum_prefix="StyleGeometryBox",
@ -75,6 +82,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"background-origin", "background-origin",
"padding-box border-box content-box", "padding-box border-box content-box",
engines="gecko servo-2013",
vector=True, extra_prefixes="webkit", vector=True, extra_prefixes="webkit",
gecko_enum_prefix="StyleGeometryBox", gecko_enum_prefix="StyleGeometryBox",
gecko_inexhaustive=True, gecko_inexhaustive=True,
@ -85,6 +93,7 @@ ${helpers.single_keyword(
${helpers.predefined_type( ${helpers.predefined_type(
"background-size", "background-size",
"BackgroundSize", "BackgroundSize",
engines="gecko servo-2013",
initial_value="computed::BackgroundSize::auto()", initial_value="computed::BackgroundSize::auto()",
initial_specified_value="specified::BackgroundSize::auto()", initial_specified_value="specified::BackgroundSize::auto()",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-size", spec="https://drafts.csswg.org/css-backgrounds/#the-background-size",
@ -100,6 +109,8 @@ ${helpers.single_keyword(
color-burn hard-light soft-light difference exclusion hue color-burn hard-light soft-light difference exclusion hue
saturation color luminosity""", saturation color luminosity""",
gecko_constant_prefix="NS_STYLE_BLEND", gecko_constant_prefix="NS_STYLE_BLEND",
vector=True, products="gecko", animation_value_type="discrete", vector=True,
engines="gecko",
animation_value_type="discrete",
spec="https://drafts.fxtf.org/compositing/#background-blend-mode", spec="https://drafts.fxtf.org/compositing/#background-blend-mode",
)} )}

View file

@ -23,7 +23,9 @@
${helpers.predefined_type( ${helpers.predefined_type(
"border-%s-color" % side_name, "Color", "border-%s-color" % side_name, "Color",
"computed_value::T::currentcolor()", "computed_value::T::currentcolor()",
alias=maybe_moz_logical_alias(product, side, "-moz-border-%s-color"), engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
alias=maybe_moz_logical_alias(engine, side, "-moz-border-%s-color"),
spec=maybe_logical_spec(side, "color"), spec=maybe_logical_spec(side, "color"),
animation_value_type="AnimatedColor", animation_value_type="AnimatedColor",
logical=is_logical, logical=is_logical,
@ -35,7 +37,8 @@
${helpers.predefined_type( ${helpers.predefined_type(
"border-%s-style" % side_name, "BorderStyle", "border-%s-style" % side_name, "BorderStyle",
"specified::BorderStyle::None", "specified::BorderStyle::None",
alias=maybe_moz_logical_alias(product, side, "-moz-border-%s-style"), engines="gecko servo-2013 servo-2020",
alias=maybe_moz_logical_alias(engine, side, "-moz-border-%s-style"),
spec=maybe_logical_spec(side, "style"), spec=maybe_logical_spec(side, "style"),
animation_value_type="discrete" if not is_logical else "none", animation_value_type="discrete" if not is_logical else "none",
logical=is_logical, logical=is_logical,
@ -47,8 +50,10 @@
"border-%s-width" % side_name, "border-%s-width" % side_name,
"BorderSideWidth", "BorderSideWidth",
"crate::values::computed::NonNegativeLength::new(3.)", "crate::values::computed::NonNegativeLength::new(3.)",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
computed_type="crate::values::computed::NonNegativeLength", computed_type="crate::values::computed::NonNegativeLength",
alias=maybe_moz_logical_alias(product, side, "-moz-border-%s-width"), alias=maybe_moz_logical_alias(engine, side, "-moz-border-%s-width"),
spec=maybe_logical_spec(side, "width"), spec=maybe_logical_spec(side, "width"),
animation_value_type="NonNegativeLength", animation_value_type="NonNegativeLength",
logical=is_logical, logical=is_logical,
@ -73,6 +78,7 @@
"BorderCornerRadius", "BorderCornerRadius",
"computed::BorderCornerRadius::zero()", "computed::BorderCornerRadius::zero()",
"parse", "parse",
engines="gecko servo-2013",
extra_prefixes=prefixes, extra_prefixes=prefixes,
spec=maybe_logical_spec(corner, "radius"), spec=maybe_logical_spec(corner, "radius"),
boxed=True, boxed=True,
@ -85,18 +91,18 @@
${helpers.single_keyword( ${helpers.single_keyword(
"box-decoration-break", "box-decoration-break",
"slice clone", "slice clone",
engines="gecko",
gecko_enum_prefix="StyleBoxDecorationBreak", gecko_enum_prefix="StyleBoxDecorationBreak",
spec="https://drafts.csswg.org/css-break/#propdef-box-decoration-break", spec="https://drafts.csswg.org/css-break/#propdef-box-decoration-break",
products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-float-edge", "-moz-float-edge",
"content-box margin-box", "content-box margin-box",
engines="gecko",
gecko_ffi_name="mFloatEdge", gecko_ffi_name="mFloatEdge",
gecko_enum_prefix="StyleFloatEdge", gecko_enum_prefix="StyleFloatEdge",
products="gecko",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-float-edge)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-float-edge)",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
@ -104,18 +110,20 @@ ${helpers.single_keyword(
${helpers.predefined_type( ${helpers.predefined_type(
"border-image-source", "border-image-source",
"ImageLayer", "ImageLayer",
engines="gecko servo-2013",
initial_value="computed::ImageLayer::none()", initial_value="computed::ImageLayer::none()",
initial_specified_value="specified::ImageLayer::none()", initial_specified_value="specified::ImageLayer::none()",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image", spec="https://drafts.csswg.org/css-backgrounds/#the-background-image",
vector=False, vector=False,
animation_value_type="discrete", animation_value_type="discrete",
boxed=product == "servo", boxed=engine == "servo-2013",
ignored_when_colors_disabled=True ignored_when_colors_disabled=True
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
"border-image-outset", "border-image-outset",
"NonNegativeLengthOrNumberRect", "NonNegativeLengthOrNumberRect",
engines="gecko servo-2013",
initial_value="generics::rect::Rect::all(computed::NonNegativeLengthOrNumber::zero())", initial_value="generics::rect::Rect::all(computed::NonNegativeLengthOrNumber::zero())",
initial_specified_value="generics::rect::Rect::all(specified::NonNegativeLengthOrNumber::zero())", initial_specified_value="generics::rect::Rect::all(specified::NonNegativeLengthOrNumber::zero())",
spec="https://drafts.csswg.org/css-backgrounds/#border-image-outset", spec="https://drafts.csswg.org/css-backgrounds/#border-image-outset",
@ -127,6 +135,7 @@ ${helpers.predefined_type(
"border-image-repeat", "border-image-repeat",
"BorderImageRepeat", "BorderImageRepeat",
"computed::BorderImageRepeat::stretch()", "computed::BorderImageRepeat::stretch()",
engines="gecko servo-2013",
initial_specified_value="specified::BorderImageRepeat::stretch()", initial_specified_value="specified::BorderImageRepeat::stretch()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat", spec="https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat",
@ -135,6 +144,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"border-image-width", "border-image-width",
"BorderImageWidth", "BorderImageWidth",
engines="gecko servo-2013",
initial_value="computed::BorderImageWidth::all(computed::BorderImageSideWidth::one())", initial_value="computed::BorderImageWidth::all(computed::BorderImageSideWidth::one())",
initial_specified_value="specified::BorderImageWidth::all(specified::BorderImageSideWidth::one())", initial_specified_value="specified::BorderImageWidth::all(specified::BorderImageSideWidth::one())",
spec="https://drafts.csswg.org/css-backgrounds/#border-image-width", spec="https://drafts.csswg.org/css-backgrounds/#border-image-width",
@ -145,6 +155,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"border-image-slice", "border-image-slice",
"BorderImageSlice", "BorderImageSlice",
engines="gecko servo-2013",
initial_value="computed::BorderImageSlice::hundred_percent()", initial_value="computed::BorderImageSlice::hundred_percent()",
initial_specified_value="specified::BorderImageSlice::hundred_percent()", initial_specified_value="specified::BorderImageSlice::hundred_percent()",
spec="https://drafts.csswg.org/css-backgrounds/#border-image-slice", spec="https://drafts.csswg.org/css-backgrounds/#border-image-slice",

View file

@ -13,19 +13,19 @@ ${helpers.predefined_type(
"display", "display",
"Display", "Display",
"computed::Display::inline()", "computed::Display::inline()",
engines="gecko servo-2013 servo-2020",
initial_specified_value="specified::Display::inline()", initial_specified_value="specified::Display::inline()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-display/#propdef-display", spec="https://drafts.csswg.org/css-display/#propdef-display",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
needs_context=product == "gecko"
)} )}
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-top-layer", "-moz-top-layer",
"none top", "none top",
engines="gecko",
gecko_constant_prefix="NS_STYLE_TOP_LAYER", gecko_constant_prefix="NS_STYLE_TOP_LAYER",
gecko_ffi_name="mTopLayer", gecko_ffi_name="mTopLayer",
products="gecko",
animation_value_type="none", animation_value_type="none",
enabled_in="ua", enabled_in="ua",
spec="Internal (not web-exposed)", spec="Internal (not web-exposed)",
@ -36,7 +36,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"-servo-top-layer", "-servo-top-layer",
"none top", "none top",
products="servo", engines="servo-2013 servo-2020",
animation_value_type="none", animation_value_type="none",
enabled_in="ua", enabled_in="ua",
spec="Internal (not web-exposed)", spec="Internal (not web-exposed)",
@ -44,7 +44,8 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"position", "position",
"static absolute relative fixed sticky", "static absolute relative fixed" + (" sticky" if engine in ["gecko", "servo-2013"] else ""),
engines="gecko servo-2013 servo-2020",
animation_value_type="discrete", animation_value_type="discrete",
flags="CREATES_STACKING_CONTEXT ABSPOS_CB", flags="CREATES_STACKING_CONTEXT ABSPOS_CB",
spec="https://drafts.csswg.org/css-position/#position-property", spec="https://drafts.csswg.org/css-position/#position-property",
@ -55,6 +56,8 @@ ${helpers.predefined_type(
"float", "float",
"Float", "Float",
"computed::Float::None", "computed::Float::None",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::Float::None", initial_specified_value="specified::Float::None",
spec="https://drafts.csswg.org/css-box/#propdef-float", spec="https://drafts.csswg.org/css-box/#propdef-float",
animation_value_type="discrete", animation_value_type="discrete",
@ -67,6 +70,7 @@ ${helpers.predefined_type(
"clear", "clear",
"Clear", "Clear",
"computed::Clear::None", "computed::Clear::None",
engines="gecko servo-2013",
animation_value_type="discrete", animation_value_type="discrete",
needs_context=False, needs_context=False,
gecko_ffi_name="mBreakType", gecko_ffi_name="mBreakType",
@ -78,6 +82,7 @@ ${helpers.predefined_type(
"vertical-align", "vertical-align",
"VerticalAlign", "VerticalAlign",
"computed::VerticalAlign::baseline()", "computed::VerticalAlign::baseline()",
engines="gecko servo-2013",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align", spec="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align",
servo_restyle_damage = "reflow", servo_restyle_damage = "reflow",
@ -85,17 +90,22 @@ ${helpers.predefined_type(
// CSS 2.1, Section 11 - Visual effects // CSS 2.1, Section 11 - Visual effects
${helpers.single_keyword("-servo-overflow-clip-box", "padding-box content-box", ${helpers.single_keyword(
products="servo", animation_value_type="none", enabled_in="ua", "-servo-overflow-clip-box",
"padding-box content-box",
engines="servo-2013",
animation_value_type="none",
enabled_in="ua",
spec="Internal, not web-exposed, \ spec="Internal, not web-exposed, \
may be standardized in the future (https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-clip-box)")} may be standardized in the future (https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-clip-box)",
)}
% for direction in ["inline", "block"]: % for direction in ["inline", "block"]:
${helpers.predefined_type( ${helpers.predefined_type(
"overflow-clip-box-" + direction, "overflow-clip-box-" + direction,
"OverflowClipBox", "OverflowClipBox",
"computed::OverflowClipBox::PaddingBox", "computed::OverflowClipBox::PaddingBox",
products="gecko", engines="gecko",
enabled_in="ua", enabled_in="ua",
needs_context=False, needs_context=False,
gecko_pref="layout.css.overflow-clip-box.enabled", gecko_pref="layout.css.overflow-clip-box.enabled",
@ -111,6 +121,8 @@ ${helpers.single_keyword("-servo-overflow-clip-box", "padding-box content-box",
full_name, full_name,
"Overflow", "Overflow",
"computed::Overflow::Visible", "computed::Overflow::Visible",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
logical_group="overflow", logical_group="overflow",
logical=logical, logical=logical,
animation_value_type="discrete", animation_value_type="discrete",
@ -125,8 +137,8 @@ ${helpers.predefined_type(
"overflow-anchor", "overflow-anchor",
"OverflowAnchor", "OverflowAnchor",
"computed::OverflowAnchor::Auto", "computed::OverflowAnchor::Auto",
engines="gecko",
initial_specified_value="specified::OverflowAnchor::Auto", initial_specified_value="specified::OverflowAnchor::Auto",
products="gecko",
needs_context=False, needs_context=False,
gecko_pref="layout.css.scroll-anchoring.enabled", gecko_pref="layout.css.scroll-anchoring.enabled",
spec="https://drafts.csswg.org/css-scroll-anchoring/#exclusion-api", spec="https://drafts.csswg.org/css-scroll-anchoring/#exclusion-api",
@ -139,6 +151,8 @@ ${helpers.predefined_type(
"transition-duration", "transition-duration",
"Time", "Time",
"computed::Time::zero()", "computed::Time::zero()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::Time::zero()", initial_specified_value="specified::Time::zero()",
parse_method="parse_non_negative", parse_method="parse_non_negative",
vector=True, vector=True,
@ -152,6 +166,8 @@ ${helpers.predefined_type(
"transition-timing-function", "transition-timing-function",
"TimingFunction", "TimingFunction",
"computed::TimingFunction::ease()", "computed::TimingFunction::ease()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::TimingFunction::ease()", initial_specified_value="specified::TimingFunction::ease()",
vector=True, vector=True,
need_index=True, need_index=True,
@ -164,6 +180,8 @@ ${helpers.predefined_type(
"transition-property", "transition-property",
"TransitionProperty", "TransitionProperty",
"computed::TransitionProperty::all()", "computed::TransitionProperty::all()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::TransitionProperty::all()", initial_specified_value="specified::TransitionProperty::all()",
vector=True, vector=True,
allow_empty="NotInitial", allow_empty="NotInitial",
@ -177,6 +195,8 @@ ${helpers.predefined_type(
"transition-delay", "transition-delay",
"Time", "Time",
"computed::Time::zero()", "computed::Time::zero()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::Time::zero()", initial_specified_value="specified::Time::zero()",
vector=True, vector=True,
need_index=True, need_index=True,
@ -191,6 +211,8 @@ ${helpers.predefined_type(
"animation-name", "animation-name",
"AnimationName", "AnimationName",
"computed::AnimationName::none()", "computed::AnimationName::none()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::AnimationName::none()", initial_specified_value="specified::AnimationName::none()",
vector=True, vector=True,
need_index=True, need_index=True,
@ -204,6 +226,8 @@ ${helpers.predefined_type(
"animation-duration", "animation-duration",
"Time", "Time",
"computed::Time::zero()", "computed::Time::zero()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::Time::zero()", initial_specified_value="specified::Time::zero()",
parse_method="parse_non_negative", parse_method="parse_non_negative",
vector=True, vector=True,
@ -219,6 +243,8 @@ ${helpers.predefined_type(
"animation-timing-function", "animation-timing-function",
"TimingFunction", "TimingFunction",
"computed::TimingFunction::ease()", "computed::TimingFunction::ease()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::TimingFunction::ease()", initial_specified_value="specified::TimingFunction::ease()",
vector=True, vector=True,
need_index=True, need_index=True,
@ -232,6 +258,8 @@ ${helpers.predefined_type(
"animation-iteration-count", "animation-iteration-count",
"AnimationIterationCount", "AnimationIterationCount",
"computed::AnimationIterationCount::one()", "computed::AnimationIterationCount::one()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::AnimationIterationCount::one()", initial_specified_value="specified::AnimationIterationCount::one()",
vector=True, vector=True,
need_index=True, need_index=True,
@ -245,6 +273,8 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"animation-direction", "animation-direction",
"normal reverse alternate alternate-reverse", "normal reverse alternate alternate-reverse",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
need_index=True, need_index=True,
animation_value_type="none", animation_value_type="none",
vector=True, vector=True,
@ -259,6 +289,8 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"animation-play-state", "animation-play-state",
"running paused", "running paused",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
need_index=True, need_index=True,
animation_value_type="none", animation_value_type="none",
vector=True, vector=True,
@ -271,6 +303,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"animation-fill-mode", "animation-fill-mode",
"none forwards backwards both", "none forwards backwards both",
engines="gecko servo-2013",
need_index=True, need_index=True,
animation_value_type="none", animation_value_type="none",
vector=True, vector=True,
@ -285,6 +318,8 @@ ${helpers.predefined_type(
"animation-delay", "animation-delay",
"Time", "Time",
"computed::Time::zero()", "computed::Time::zero()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::Time::zero()", initial_specified_value="specified::Time::zero()",
vector=True, vector=True,
need_index=True, need_index=True,
@ -300,6 +335,8 @@ ${helpers.predefined_type(
"transform", "transform",
"Transform", "Transform",
"generics::transform::Transform::none()", "generics::transform::Transform::none()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
extra_prefixes=transform_extra_prefixes, extra_prefixes=transform_extra_prefixes,
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
flags="CREATES_STACKING_CONTEXT FIXPOS_CB \ flags="CREATES_STACKING_CONTEXT FIXPOS_CB \
@ -312,6 +349,7 @@ ${helpers.predefined_type(
"rotate", "rotate",
"Rotate", "Rotate",
"generics::transform::Rotate::None", "generics::transform::Rotate::None",
engines="gecko servo-2013",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
boxed=True, boxed=True,
flags="CREATES_STACKING_CONTEXT FIXPOS_CB CAN_ANIMATE_ON_COMPOSITOR", flags="CREATES_STACKING_CONTEXT FIXPOS_CB CAN_ANIMATE_ON_COMPOSITOR",
@ -324,6 +362,7 @@ ${helpers.predefined_type(
"scale", "scale",
"Scale", "Scale",
"generics::transform::Scale::None", "generics::transform::Scale::None",
engines="gecko servo-2013",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
boxed=True, boxed=True,
flags="CREATES_STACKING_CONTEXT FIXPOS_CB CAN_ANIMATE_ON_COMPOSITOR", flags="CREATES_STACKING_CONTEXT FIXPOS_CB CAN_ANIMATE_ON_COMPOSITOR",
@ -336,6 +375,7 @@ ${helpers.predefined_type(
"translate", "translate",
"Translate", "Translate",
"generics::transform::Translate::None", "generics::transform::Translate::None",
engines="gecko servo-2013",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
boxed=True, boxed=True,
flags="CREATES_STACKING_CONTEXT FIXPOS_CB CAN_ANIMATE_ON_COMPOSITOR", flags="CREATES_STACKING_CONTEXT FIXPOS_CB CAN_ANIMATE_ON_COMPOSITOR",
@ -349,7 +389,7 @@ ${helpers.predefined_type(
"offset-path", "offset-path",
"OffsetPath", "OffsetPath",
"computed::OffsetPath::none()", "computed::OffsetPath::none()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
gecko_pref="layout.css.motion-path.enabled", gecko_pref="layout.css.motion-path.enabled",
flags="CREATES_STACKING_CONTEXT FIXPOS_CB", flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
@ -362,7 +402,7 @@ ${helpers.predefined_type(
"offset-distance", "offset-distance",
"LengthPercentage", "LengthPercentage",
"computed::LengthPercentage::zero()", "computed::LengthPercentage::zero()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
gecko_pref="layout.css.motion-path.enabled", gecko_pref="layout.css.motion-path.enabled",
spec="https://drafts.fxtf.org/motion-1/#offset-distance-property", spec="https://drafts.fxtf.org/motion-1/#offset-distance-property",
@ -374,7 +414,7 @@ ${helpers.predefined_type(
"offset-rotate", "offset-rotate",
"OffsetRotate", "OffsetRotate",
"computed::OffsetRotate::auto()", "computed::OffsetRotate::auto()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
gecko_pref="layout.css.motion-path.enabled", gecko_pref="layout.css.motion-path.enabled",
spec="https://drafts.fxtf.org/motion-1/#offset-rotate-property", spec="https://drafts.fxtf.org/motion-1/#offset-rotate-property",
@ -386,7 +426,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"scroll-behavior", "scroll-behavior",
"auto smooth", "auto smooth",
products="gecko", engines="gecko",
spec="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior", spec="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
@ -395,7 +435,7 @@ ${helpers.predefined_type(
"scroll-snap-align", "scroll-snap-align",
"ScrollSnapAlign", "ScrollSnapAlign",
"computed::ScrollSnapAlign::none()", "computed::ScrollSnapAlign::none()",
products="gecko", engines="gecko",
gecko_pref="layout.css.scroll-snap-v1.enabled", gecko_pref="layout.css.scroll-snap-v1.enabled",
spec="https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align", spec="https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align",
animation_value_type="discrete", animation_value_type="discrete",
@ -405,7 +445,7 @@ ${helpers.predefined_type(
"scroll-snap-type", "scroll-snap-type",
"ScrollSnapType", "ScrollSnapType",
"computed::ScrollSnapType::none()", "computed::ScrollSnapType::none()",
products="gecko", engines="gecko",
spec="https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-type", spec="https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-type",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
@ -415,7 +455,7 @@ ${helpers.predefined_type(
"overscroll-behavior-" + axis, "overscroll-behavior-" + axis,
"OverscrollBehavior", "OverscrollBehavior",
"computed::OverscrollBehavior::Auto", "computed::OverscrollBehavior::Auto",
products="gecko", engines="gecko",
needs_context=False, needs_context=False,
gecko_pref="layout.css.overscroll-behavior.enabled", gecko_pref="layout.css.overscroll-behavior.enabled",
spec="https://wicg.github.io/overscroll-behavior/#overscroll-behavior-properties", spec="https://wicg.github.io/overscroll-behavior/#overscroll-behavior-properties",
@ -428,7 +468,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"isolation", "isolation",
"auto isolate", "auto isolate",
products="gecko", engines="gecko",
spec="https://drafts.fxtf.org/compositing/#isolation", spec="https://drafts.fxtf.org/compositing/#isolation",
flags="CREATES_STACKING_CONTEXT", flags="CREATES_STACKING_CONTEXT",
animation_value_type="discrete", animation_value_type="discrete",
@ -438,8 +478,8 @@ ${helpers.predefined_type(
"break-after", "break-after",
"BreakBetween", "BreakBetween",
"computed::BreakBetween::Auto", "computed::BreakBetween::Auto",
engines="gecko",
needs_context=False, needs_context=False,
products="gecko",
spec="https://drafts.csswg.org/css-break/#propdef-break-after", spec="https://drafts.csswg.org/css-break/#propdef-break-after",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
@ -448,8 +488,8 @@ ${helpers.predefined_type(
"break-before", "break-before",
"BreakBetween", "BreakBetween",
"computed::BreakBetween::Auto", "computed::BreakBetween::Auto",
engines="gecko",
needs_context=False, needs_context=False,
products="gecko",
spec="https://drafts.csswg.org/css-break/#propdef-break-before", spec="https://drafts.csswg.org/css-break/#propdef-break-before",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
@ -458,8 +498,8 @@ ${helpers.predefined_type(
"break-inside", "break-inside",
"BreakWithin", "BreakWithin",
"computed::BreakWithin::Auto", "computed::BreakWithin::Auto",
engines="gecko",
needs_context=False, needs_context=False,
products="gecko",
alias="page-break-inside", alias="page-break-inside",
spec="https://drafts.csswg.org/css-break/#propdef-break-inside", spec="https://drafts.csswg.org/css-break/#propdef-break-inside",
animation_value_type="discrete", animation_value_type="discrete",
@ -471,7 +511,7 @@ ${helpers.predefined_type(
"resize", "resize",
"Resize", "Resize",
"computed::Resize::None", "computed::Resize::None",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
needs_context=False, needs_context=False,
gecko_ffi_name="mResize", gecko_ffi_name="mResize",
@ -482,6 +522,7 @@ ${helpers.predefined_type(
"perspective", "perspective",
"Perspective", "Perspective",
"computed::Perspective::none()", "computed::Perspective::none()",
engines="gecko servo-2013",
gecko_ffi_name="mChildPerspective", gecko_ffi_name="mChildPerspective",
spec="https://drafts.csswg.org/css-transforms/#perspective", spec="https://drafts.csswg.org/css-transforms/#perspective",
extra_prefixes=transform_extra_prefixes, extra_prefixes=transform_extra_prefixes,
@ -494,6 +535,7 @@ ${helpers.predefined_type(
"perspective-origin", "perspective-origin",
"Position", "Position",
"computed::position::Position::center()", "computed::position::Position::center()",
engines="gecko servo-2013",
boxed=True, boxed=True,
extra_prefixes=transform_extra_prefixes, extra_prefixes=transform_extra_prefixes,
spec="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property", spec="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property",
@ -505,6 +547,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"backface-visibility", "backface-visibility",
"visible hidden", "visible hidden",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-transforms/#backface-visibility-property", spec="https://drafts.csswg.org/css-transforms/#backface-visibility-property",
extra_prefixes=transform_extra_prefixes, extra_prefixes=transform_extra_prefixes,
animation_value_type="discrete", animation_value_type="discrete",
@ -513,8 +556,8 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"transform-box", "transform-box",
"border-box fill-box view-box", "border-box fill-box view-box",
engines="gecko",
gecko_enum_prefix="StyleGeometryBox", gecko_enum_prefix="StyleGeometryBox",
products="gecko",
gecko_pref="svg.transform-box.enabled", gecko_pref="svg.transform-box.enabled",
spec="https://drafts.csswg.org/css-transforms/#transform-box", spec="https://drafts.csswg.org/css-transforms/#transform-box",
gecko_inexhaustive="True", gecko_inexhaustive="True",
@ -524,7 +567,9 @@ ${helpers.single_keyword(
${helpers.predefined_type( ${helpers.predefined_type(
"transform-style", "transform-style",
"TransformStyle", "TransformStyle",
"computed::TransformStyle::" + ("Auto" if product == "servo" else "Flat"), "computed::TransformStyle::" + ("Flat" if engine == "gecko" else "Auto"),
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
spec="https://drafts.csswg.org/css-transforms-2/#transform-style-property", spec="https://drafts.csswg.org/css-transforms-2/#transform-style-property",
needs_context=False, needs_context=False,
extra_prefixes=transform_extra_prefixes, extra_prefixes=transform_extra_prefixes,
@ -537,6 +582,7 @@ ${helpers.predefined_type(
"transform-origin", "transform-origin",
"TransformOrigin", "TransformOrigin",
"computed::TransformOrigin::initial_value()", "computed::TransformOrigin::initial_value()",
engines="gecko servo-2013",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
extra_prefixes=transform_extra_prefixes, extra_prefixes=transform_extra_prefixes,
gecko_ffi_name="mTransformOrigin", gecko_ffi_name="mTransformOrigin",
@ -550,8 +596,8 @@ ${helpers.predefined_type(
"contain", "contain",
"Contain", "Contain",
"specified::Contain::empty()", "specified::Contain::empty()",
engines="gecko",
animation_value_type="none", animation_value_type="none",
products="gecko",
flags="CREATES_STACKING_CONTEXT FIXPOS_CB", flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
gecko_pref="layout.css.contain.enabled", gecko_pref="layout.css.contain.enabled",
spec="https://drafts.csswg.org/css-contain/#contain-property", spec="https://drafts.csswg.org/css-contain/#contain-property",
@ -563,7 +609,7 @@ ${helpers.predefined_type(
"-moz-appearance", "-moz-appearance",
"Appearance", "Appearance",
"computed::Appearance::None", "computed::Appearance::None",
products="gecko", engines="gecko",
alias="-webkit-appearance:layout.css.webkit-appearance.enabled", alias="-webkit-appearance:layout.css.webkit-appearance.enabled",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-appearance)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-appearance)",
animation_value_type="discrete", animation_value_type="discrete",
@ -574,7 +620,7 @@ ${helpers.predefined_type(
"-moz-binding", "-moz-binding",
"url::UrlOrNone", "url::UrlOrNone",
"computed::url::UrlOrNone::none()", "computed::url::UrlOrNone::none()",
products="gecko", engines="gecko",
animation_value_type="none", animation_value_type="none",
gecko_ffi_name="mBinding", gecko_ffi_name="mBinding",
gecko_pref="layout.css.moz-binding.content.enabled", gecko_pref="layout.css.moz-binding.content.enabled",
@ -585,7 +631,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-orient", "-moz-orient",
"inline block horizontal vertical", "inline block horizontal vertical",
products="gecko", engines="gecko",
gecko_ffi_name="mOrient", gecko_ffi_name="mOrient",
gecko_enum_prefix="StyleOrient", gecko_enum_prefix="StyleOrient",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-orient)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-orient)",
@ -596,7 +642,7 @@ ${helpers.predefined_type(
"will-change", "will-change",
"WillChange", "WillChange",
"computed::WillChange::auto()", "computed::WillChange::auto()",
products="gecko", engines="gecko",
animation_value_type="none", animation_value_type="none",
spec="https://drafts.csswg.org/css-will-change/#will-change", spec="https://drafts.csswg.org/css-will-change/#will-change",
)} )}
@ -604,8 +650,8 @@ ${helpers.predefined_type(
// The spec issue for the parse_method: https://github.com/w3c/csswg-drafts/issues/4102. // The spec issue for the parse_method: https://github.com/w3c/csswg-drafts/issues/4102.
${helpers.predefined_type( ${helpers.predefined_type(
"shape-image-threshold", "Opacity", "0.0", "shape-image-threshold", "Opacity", "0.0",
engines="gecko",
parse_method="parse_number", parse_method="parse_number",
products="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-shapes/#shape-image-threshold-property", spec="https://drafts.csswg.org/css-shapes/#shape-image-threshold-property",
)} )}
@ -614,7 +660,7 @@ ${helpers.predefined_type(
"shape-margin", "shape-margin",
"NonNegativeLengthPercentage", "NonNegativeLengthPercentage",
"computed::NonNegativeLengthPercentage::zero()", "computed::NonNegativeLengthPercentage::zero()",
products="gecko", engines="gecko",
animation_value_type="NonNegativeLengthPercentage", animation_value_type="NonNegativeLengthPercentage",
spec="https://drafts.csswg.org/css-shapes/#shape-margin-property", spec="https://drafts.csswg.org/css-shapes/#shape-margin-property",
)} )}
@ -623,7 +669,7 @@ ${helpers.predefined_type(
"shape-outside", "shape-outside",
"basic_shape::FloatAreaShape", "basic_shape::FloatAreaShape",
"generics::basic_shape::ShapeSource::None", "generics::basic_shape::ShapeSource::None",
products="gecko", engines="gecko",
animation_value_type="basic_shape::FloatAreaShape", animation_value_type="basic_shape::FloatAreaShape",
spec="https://drafts.csswg.org/css-shapes/#shape-outside-property", spec="https://drafts.csswg.org/css-shapes/#shape-outside-property",
)} )}
@ -632,7 +678,7 @@ ${helpers.predefined_type(
"touch-action", "touch-action",
"TouchAction", "TouchAction",
"computed::TouchAction::auto()", "computed::TouchAction::auto()",
products="gecko", engines="gecko",
gecko_pref="layout.css.touch_action.enabled", gecko_pref="layout.css.touch_action.enabled",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://compat.spec.whatwg.org/#touch-action", spec="https://compat.spec.whatwg.org/#touch-action",
@ -645,8 +691,8 @@ ${helpers.predefined_type(
"-webkit-line-clamp", "-webkit-line-clamp",
"PositiveIntegerOrNone", "PositiveIntegerOrNone",
"Either::Second(None_)", "Either::Second(None_)",
engines="gecko",
gecko_pref="layout.css.webkit-line-clamp.enabled", gecko_pref="layout.css.webkit-line-clamp.enabled",
animation_value_type="Integer", animation_value_type="Integer",
products="gecko",
spec="https://drafts.csswg.org/css-overflow-3/#line-clamp", spec="https://drafts.csswg.org/css-overflow-3/#line-clamp",
)} )}

View file

@ -10,10 +10,12 @@ ${helpers.predefined_type(
"column-width", "column-width",
"length::NonNegativeLengthOrAuto", "length::NonNegativeLengthOrAuto",
"computed::length::NonNegativeLengthOrAuto::auto()", "computed::length::NonNegativeLengthOrAuto::auto()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::length::NonNegativeLengthOrAuto::auto()", initial_specified_value="specified::length::NonNegativeLengthOrAuto::auto()",
extra_prefixes="moz", extra_prefixes="moz",
animation_value_type="NonNegativeLengthOrAuto", animation_value_type="NonNegativeLengthOrAuto",
servo_pref="layout.columns.enabled", servo_2013_pref="layout.columns.enabled",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-width", spec="https://drafts.csswg.org/css-multicol/#propdef-column-width",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
)} )}
@ -22,8 +24,10 @@ ${helpers.predefined_type(
"column-count", "column-count",
"ColumnCount", "ColumnCount",
"computed::ColumnCount::auto()", "computed::ColumnCount::auto()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::ColumnCount::auto()", initial_specified_value="specified::ColumnCount::auto()",
servo_pref="layout.columns.enabled", servo_2013_pref="layout.columns.enabled",
animation_value_type="AnimatedColumnCount", animation_value_type="AnimatedColumnCount",
extra_prefixes="moz", extra_prefixes="moz",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-count", spec="https://drafts.csswg.org/css-multicol/#propdef-column-count",
@ -33,8 +37,8 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"column-fill", "column-fill",
"balance auto", "balance auto",
engines="gecko",
extra_prefixes="moz", extra_prefixes="moz",
products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
gecko_enum_prefix="StyleColumnFill", gecko_enum_prefix="StyleColumnFill",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-fill", spec="https://drafts.csswg.org/css-multicol/#propdef-column-fill",
@ -44,9 +48,9 @@ ${helpers.predefined_type(
"column-rule-width", "column-rule-width",
"BorderSideWidth", "BorderSideWidth",
"crate::values::computed::NonNegativeLength::new(3.)", "crate::values::computed::NonNegativeLength::new(3.)",
engines="gecko",
initial_specified_value="specified::BorderSideWidth::Medium", initial_specified_value="specified::BorderSideWidth::Medium",
computed_type="crate::values::computed::NonNegativeLength", computed_type="crate::values::computed::NonNegativeLength",
products="gecko",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-width", spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-width",
animation_value_type="NonNegativeLength", animation_value_type="NonNegativeLength",
extra_prefixes="moz", extra_prefixes="moz",
@ -57,8 +61,8 @@ ${helpers.predefined_type(
"column-rule-color", "column-rule-color",
"Color", "Color",
"computed_value::T::currentcolor()", "computed_value::T::currentcolor()",
engines="gecko",
initial_specified_value="specified::Color::currentcolor()", initial_specified_value="specified::Color::currentcolor()",
products="gecko",
animation_value_type="AnimatedColor", animation_value_type="AnimatedColor",
extra_prefixes="moz", extra_prefixes="moz",
ignored_when_colors_disabled=True, ignored_when_colors_disabled=True,
@ -69,7 +73,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"column-span", "column-span",
"none all", "none all",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
gecko_enum_prefix="StyleColumnSpan", gecko_enum_prefix="StyleColumnSpan",
gecko_pref="layout.css.column-span.enabled", gecko_pref="layout.css.column-span.enabled",
@ -82,9 +86,9 @@ ${helpers.predefined_type(
"column-rule-style", "column-rule-style",
"BorderStyle", "BorderStyle",
"computed::BorderStyle::None", "computed::BorderStyle::None",
engines="gecko",
needs_context=False, needs_context=False,
initial_specified_value="specified::BorderStyle::None", initial_specified_value="specified::BorderStyle::None",
products="gecko",
extra_prefixes="moz", extra_prefixes="moz",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-style", spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule-style",

View file

@ -10,6 +10,8 @@ ${helpers.predefined_type(
"content", "content",
"Content", "Content",
"computed::Content::normal()", "computed::Content::normal()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::Content::normal()", initial_specified_value="specified::Content::normal()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-content/#propdef-content", spec="https://drafts.csswg.org/css-content/#propdef-content",
@ -19,6 +21,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"counter-increment", "counter-increment",
"CounterIncrement", "CounterIncrement",
engines="gecko servo-2013",
initial_value="Default::default()", initial_value="Default::default()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment", spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment",
@ -28,6 +31,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"counter-reset", "counter-reset",
"CounterSetOrReset", "CounterSetOrReset",
engines="gecko servo-2013",
initial_value="Default::default()", initial_value="Default::default()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-reset", spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-reset",
@ -37,9 +41,9 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"counter-set", "counter-set",
"CounterSetOrReset", "CounterSetOrReset",
engines="gecko",
initial_value="Default::default()", initial_value="Default::default()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-set", spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-set",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
products="gecko",
)} )}

View file

@ -11,6 +11,8 @@ ${helpers.predefined_type(
"opacity", "opacity",
"Opacity", "Opacity",
"1.0", "1.0",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
flags="CREATES_STACKING_CONTEXT CAN_ANIMATE_ON_COMPOSITOR", flags="CREATES_STACKING_CONTEXT CAN_ANIMATE_ON_COMPOSITOR",
spec="https://drafts.csswg.org/css-color/#transparency", spec="https://drafts.csswg.org/css-color/#transparency",
@ -21,6 +23,8 @@ ${helpers.predefined_type(
"box-shadow", "box-shadow",
"BoxShadow", "BoxShadow",
None, None,
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
vector=True, vector=True,
simple_vector_bindings=True, simple_vector_bindings=True,
animation_value_type="AnimatedBoxShadowList", animation_value_type="AnimatedBoxShadowList",
@ -34,6 +38,8 @@ ${helpers.predefined_type(
"clip", "clip",
"ClipRectOrAuto", "ClipRectOrAuto",
"computed::ClipRectOrAuto::auto()", "computed::ClipRectOrAuto::auto()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
boxed=True, boxed=True,
allow_quirks="Yes", allow_quirks="Yes",
@ -44,6 +50,8 @@ ${helpers.predefined_type(
"filter", "filter",
"Filter", "Filter",
None, None,
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
vector=True, vector=True,
simple_vector_bindings=True, simple_vector_bindings=True,
gecko_ffi_name="mFilters", gecko_ffi_name="mFilters",
@ -59,6 +67,7 @@ ${helpers.predefined_type(
"backdrop-filter", "backdrop-filter",
"Filter", "Filter",
None, None,
engines="gecko",
vector=True, vector=True,
simple_vector_bindings=True, simple_vector_bindings=True,
gecko_ffi_name="mBackdropFilters", gecko_ffi_name="mBackdropFilters",
@ -68,7 +77,6 @@ ${helpers.predefined_type(
flags="CREATES_STACKING_CONTEXT FIXPOS_CB", flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
gecko_pref="layout.css.backdrop-filter.enabled", gecko_pref="layout.css.backdrop-filter.enabled",
spec="https://drafts.fxtf.org/filter-effects-2/#propdef-backdrop-filter", spec="https://drafts.fxtf.org/filter-effects-2/#propdef-backdrop-filter",
products="gecko",
)} )}
${helpers.single_keyword( ${helpers.single_keyword(
@ -76,6 +84,8 @@ ${helpers.single_keyword(
"""normal multiply screen overlay darken lighten color-dodge """normal multiply screen overlay darken lighten color-dodge
color-burn hard-light soft-light difference exclusion hue color-burn hard-light soft-light difference exclusion hue
saturation color luminosity""", saturation color luminosity""",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
gecko_constant_prefix="NS_STYLE_BLEND", gecko_constant_prefix="NS_STYLE_BLEND",
animation_value_type="discrete", animation_value_type="discrete",
flags="CREATES_STACKING_CONTEXT", flags="CREATES_STACKING_CONTEXT",

View file

@ -10,6 +10,8 @@
${helpers.predefined_type( ${helpers.predefined_type(
"font-family", "font-family",
"FontFamily", "FontFamily",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_value="computed::FontFamily::serif()", initial_value="computed::FontFamily::serif()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-family", spec="https://drafts.csswg.org/css-fonts/#propdef-font-family",
@ -19,6 +21,8 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"font-style", "font-style",
"FontStyle", "FontStyle",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_value="computed::FontStyle::normal()", initial_value="computed::FontStyle::normal()",
initial_specified_value="specified::FontStyle::normal()", initial_specified_value="specified::FontStyle::normal()",
animation_value_type="FontStyle", animation_value_type="FontStyle",
@ -35,6 +39,8 @@ ${helpers.predefined_type(
${helpers.single_keyword_system( ${helpers.single_keyword_system(
"font-variant-caps", "font-variant-caps",
"normal small-caps", "normal small-caps",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
extra_gecko_values="all-small-caps petite-caps all-petite-caps unicase titling-caps", extra_gecko_values="all-small-caps petite-caps all-petite-caps unicase titling-caps",
gecko_constant_prefix="NS_FONT_VARIANT_CAPS", gecko_constant_prefix="NS_FONT_VARIANT_CAPS",
gecko_ffi_name="mFont.variantCaps", gecko_ffi_name="mFont.variantCaps",
@ -47,6 +53,8 @@ ${helpers.single_keyword_system(
${helpers.predefined_type( ${helpers.predefined_type(
"font-weight", "font-weight",
"FontWeight", "FontWeight",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_value="computed::FontWeight::normal()", initial_value="computed::FontWeight::normal()",
initial_specified_value="specified::FontWeight::normal()", initial_specified_value="specified::FontWeight::normal()",
animation_value_type="Number", animation_value_type="Number",
@ -57,6 +65,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"font-size", "font-size",
"FontSize", "FontSize",
engines="gecko servo-2013 servo-2020",
initial_value="computed::FontSize::medium()", initial_value="computed::FontSize::medium()",
initial_specified_value="specified::FontSize::medium()", initial_specified_value="specified::FontSize::medium()",
animation_value_type="NonNegativeLength", animation_value_type="NonNegativeLength",
@ -68,7 +77,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"font-size-adjust", "font-size-adjust",
"FontSizeAdjust", "FontSizeAdjust",
products="gecko", engines="gecko",
initial_value="computed::FontSizeAdjust::none()", initial_value="computed::FontSizeAdjust::none()",
initial_specified_value="specified::FontSizeAdjust::none()", initial_specified_value="specified::FontSizeAdjust::none()",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
@ -78,7 +87,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"font-synthesis", "font-synthesis",
"FontSynthesis", "FontSynthesis",
products="gecko", engines="gecko",
initial_value="specified::FontSynthesis::get_initial_value()", initial_value="specified::FontSynthesis::get_initial_value()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-synthesis", spec="https://drafts.csswg.org/css-fonts/#propdef-font-synthesis",
@ -87,6 +96,8 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"font-stretch", "font-stretch",
"FontStretch", "FontStretch",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_value="computed::FontStretch::hundred()", initial_value="computed::FontStretch::hundred()",
initial_specified_value="specified::FontStretch::normal()", initial_specified_value="specified::FontStretch::normal()",
animation_value_type="Percentage", animation_value_type="Percentage",
@ -97,7 +108,7 @@ ${helpers.predefined_type(
${helpers.single_keyword_system( ${helpers.single_keyword_system(
"font-kerning", "font-kerning",
"auto none normal", "auto none normal",
products="gecko", engines="gecko",
gecko_ffi_name="mFont.kerning", gecko_ffi_name="mFont.kerning",
gecko_constant_prefix="NS_FONT_KERNING", gecko_constant_prefix="NS_FONT_KERNING",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-kerning", spec="https://drafts.csswg.org/css-fonts/#propdef-font-kerning",
@ -107,7 +118,7 @@ ${helpers.single_keyword_system(
${helpers.predefined_type( ${helpers.predefined_type(
"font-variant-alternates", "font-variant-alternates",
"FontVariantAlternates", "FontVariantAlternates",
products="gecko", engines="gecko",
initial_value="computed::FontVariantAlternates::get_initial_value()", initial_value="computed::FontVariantAlternates::get_initial_value()",
initial_specified_value="specified::FontVariantAlternates::get_initial_specified_value()", initial_specified_value="specified::FontVariantAlternates::get_initial_specified_value()",
animation_value_type="discrete", animation_value_type="discrete",
@ -117,7 +128,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"font-variant-east-asian", "font-variant-east-asian",
"FontVariantEastAsian", "FontVariantEastAsian",
products="gecko", engines="gecko",
initial_value="computed::FontVariantEastAsian::empty()", initial_value="computed::FontVariantEastAsian::empty()",
initial_specified_value="specified::FontVariantEastAsian::empty()", initial_specified_value="specified::FontVariantEastAsian::empty()",
animation_value_type="discrete", animation_value_type="discrete",
@ -127,7 +138,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"font-variant-ligatures", "font-variant-ligatures",
"FontVariantLigatures", "FontVariantLigatures",
products="gecko", engines="gecko",
initial_value="computed::FontVariantLigatures::empty()", initial_value="computed::FontVariantLigatures::empty()",
initial_specified_value="specified::FontVariantLigatures::empty()", initial_specified_value="specified::FontVariantLigatures::empty()",
animation_value_type="discrete", animation_value_type="discrete",
@ -137,7 +148,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"font-variant-numeric", "font-variant-numeric",
"FontVariantNumeric", "FontVariantNumeric",
products="gecko", engines="gecko",
initial_value="computed::FontVariantNumeric::empty()", initial_value="computed::FontVariantNumeric::empty()",
initial_specified_value="specified::FontVariantNumeric::empty()", initial_specified_value="specified::FontVariantNumeric::empty()",
animation_value_type="discrete", animation_value_type="discrete",
@ -147,7 +158,7 @@ ${helpers.predefined_type(
${helpers.single_keyword_system( ${helpers.single_keyword_system(
"font-variant-position", "font-variant-position",
"normal sub super", "normal sub super",
products="gecko", engines="gecko",
gecko_ffi_name="mFont.variantPosition", gecko_ffi_name="mFont.variantPosition",
gecko_constant_prefix="NS_FONT_VARIANT_POSITION", gecko_constant_prefix="NS_FONT_VARIANT_POSITION",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-position", spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-position",
@ -157,7 +168,7 @@ ${helpers.single_keyword_system(
${helpers.predefined_type( ${helpers.predefined_type(
"font-feature-settings", "font-feature-settings",
"FontFeatureSettings", "FontFeatureSettings",
products="gecko", engines="gecko",
initial_value="computed::FontFeatureSettings::normal()", initial_value="computed::FontFeatureSettings::normal()",
initial_specified_value="specified::FontFeatureSettings::normal()", initial_specified_value="specified::FontFeatureSettings::normal()",
extra_prefixes="moz:layout.css.prefixes.font-features", extra_prefixes="moz:layout.css.prefixes.font-features",
@ -168,7 +179,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"font-variation-settings", "font-variation-settings",
"FontVariationSettings", "FontVariationSettings",
products="gecko", engines="gecko",
gecko_pref="layout.css.font-variations.enabled", gecko_pref="layout.css.font-variations.enabled",
has_effect_on_gecko_scrollbars=False, has_effect_on_gecko_scrollbars=False,
initial_value="computed::FontVariationSettings::normal()", initial_value="computed::FontVariationSettings::normal()",
@ -180,7 +191,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"font-language-override", "font-language-override",
"FontLanguageOverride", "FontLanguageOverride",
products="gecko", engines="gecko",
initial_value="computed::FontLanguageOverride::zero()", initial_value="computed::FontLanguageOverride::zero()",
initial_specified_value="specified::FontLanguageOverride::normal()", initial_specified_value="specified::FontLanguageOverride::normal()",
animation_value_type="discrete", animation_value_type="discrete",
@ -191,7 +202,7 @@ ${helpers.predefined_type(
${helpers.single_keyword_system( ${helpers.single_keyword_system(
"font-optical-sizing", "font-optical-sizing",
"auto none", "auto none",
products="gecko", engines="gecko",
gecko_pref="layout.css.font-variations.enabled", gecko_pref="layout.css.font-variations.enabled",
has_effect_on_gecko_scrollbars=False, has_effect_on_gecko_scrollbars=False,
gecko_ffi_name="mFont.opticalSizing", gecko_ffi_name="mFont.opticalSizing",
@ -203,7 +214,7 @@ ${helpers.single_keyword_system(
${helpers.predefined_type( ${helpers.predefined_type(
"-x-lang", "-x-lang",
"XLang", "XLang",
products="gecko", engines="gecko",
initial_value="computed::XLang::get_initial_value()", initial_value="computed::XLang::get_initial_value()",
animation_value_type="none", animation_value_type="none",
enabled_in="", enabled_in="",
@ -213,7 +224,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"-moz-script-size-multiplier", "-moz-script-size-multiplier",
"MozScriptSizeMultiplier", "MozScriptSizeMultiplier",
products="gecko", engines="gecko",
initial_value="computed::MozScriptSizeMultiplier::get_initial_value()", initial_value="computed::MozScriptSizeMultiplier::get_initial_value()",
animation_value_type="none", animation_value_type="none",
gecko_ffi_name="mScriptSizeMultiplier", gecko_ffi_name="mScriptSizeMultiplier",
@ -225,8 +236,8 @@ ${helpers.predefined_type(
"-moz-script-level", "-moz-script-level",
"MozScriptLevel", "MozScriptLevel",
0, 0,
engines="gecko",
animation_value_type="none", animation_value_type="none",
products="gecko",
enabled_in="ua", enabled_in="ua",
gecko_ffi_name="mScriptLevel", gecko_ffi_name="mScriptLevel",
spec="Internal (not web-exposed)", spec="Internal (not web-exposed)",
@ -235,9 +246,9 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-math-display", "-moz-math-display",
"inline block", "inline block",
engines="gecko",
gecko_constant_prefix="NS_MATHML_DISPLAYSTYLE", gecko_constant_prefix="NS_MATHML_DISPLAYSTYLE",
gecko_ffi_name="mMathDisplay", gecko_ffi_name="mMathDisplay",
products="gecko",
enabled_in="ua", enabled_in="ua",
spec="Internal (not web-exposed)", spec="Internal (not web-exposed)",
animation_value_type="none", animation_value_type="none",
@ -249,9 +260,9 @@ ${helpers.single_keyword(
fraktur double-struck bold-fraktur sans-serif fraktur double-struck bold-fraktur sans-serif
bold-sans-serif sans-serif-italic sans-serif-bold-italic bold-sans-serif sans-serif-italic sans-serif-bold-italic
monospace initial tailed looped stretched""", monospace initial tailed looped stretched""",
engines="gecko",
gecko_constant_prefix="NS_MATHML_MATHVARIANT", gecko_constant_prefix="NS_MATHML_MATHVARIANT",
gecko_ffi_name="mMathVariant", gecko_ffi_name="mMathVariant",
products="gecko",
spec="Internal (not web-exposed)", spec="Internal (not web-exposed)",
animation_value_type="none", animation_value_type="none",
enabled_in="", enabled_in="",
@ -262,8 +273,8 @@ ${helpers.predefined_type(
"-moz-script-min-size", "-moz-script-min-size",
"MozScriptMinSize", "MozScriptMinSize",
"specified::MozScriptMinSize::get_initial_value()", "specified::MozScriptMinSize::get_initial_value()",
engines="gecko",
animation_value_type="none", animation_value_type="none",
products="gecko",
enabled_in="", enabled_in="",
gecko_ffi_name="mScriptMinSize", gecko_ffi_name="mScriptMinSize",
spec="Internal (not web-exposed)", spec="Internal (not web-exposed)",
@ -273,13 +284,13 @@ ${helpers.predefined_type(
"-x-text-zoom", "-x-text-zoom",
"XTextZoom", "XTextZoom",
"computed::XTextZoom(true)", "computed::XTextZoom(true)",
engines="gecko",
animation_value_type="none", animation_value_type="none",
products="gecko",
enabled_in="", enabled_in="",
spec="Internal (not web-exposed)", spec="Internal (not web-exposed)",
)} )}
% if product == "gecko": % if engine == "gecko":
pub mod system_font { pub mod system_font {
//! We deal with system fonts here //! We deal with system fonts here
//! //!
@ -470,7 +481,7 @@ ${helpers.predefined_type(
use cssparser::Parser; use cssparser::Parser;
// We don't parse system fonts, but in the interest of not littering // We don't parse system fonts, but in the interest of not littering
// a lot of code with `if product == gecko` conditionals, we have a // a lot of code with `if engine == "gecko"` conditionals, we have a
// dummy system font module that does nothing // dummy system font module that does nothing
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)] #[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
@ -487,11 +498,11 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-osx-font-smoothing", "-moz-osx-font-smoothing",
"auto grayscale", "auto grayscale",
engines="gecko",
gecko_constant_prefix="NS_FONT_SMOOTHING", gecko_constant_prefix="NS_FONT_SMOOTHING",
gecko_ffi_name="mFont.smoothing", gecko_ffi_name="mFont.smoothing",
gecko_pref="layout.css.osx-font-smoothing.enabled", gecko_pref="layout.css.osx-font-smoothing.enabled",
has_effect_on_gecko_scrollbars=False, has_effect_on_gecko_scrollbars=False,
products="gecko",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth)",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
@ -500,8 +511,8 @@ ${helpers.predefined_type(
"-moz-font-smoothing-background-color", "-moz-font-smoothing-background-color",
"color::MozFontSmoothingBackgroundColor", "color::MozFontSmoothingBackgroundColor",
"computed::color::MozFontSmoothingBackgroundColor::transparent()", "computed::color::MozFontSmoothingBackgroundColor::transparent()",
engines="gecko",
animation_value_type="none", animation_value_type="none",
products="gecko",
gecko_ffi_name="mFont.fontSmoothingBackgroundColor", gecko_ffi_name="mFont.fontSmoothingBackgroundColor",
enabled_in="chrome", enabled_in="chrome",
spec="None (Nonstandard internal property)", spec="None (Nonstandard internal property)",
@ -511,8 +522,8 @@ ${helpers.predefined_type(
"-moz-min-font-size-ratio", "-moz-min-font-size-ratio",
"Percentage", "Percentage",
"computed::Percentage::hundred()", "computed::Percentage::hundred()",
engines="gecko",
animation_value_type="none", animation_value_type="none",
products="gecko",
enabled_in="ua", enabled_in="ua",
spec="Nonstandard (Internal-only)", spec="Nonstandard (Internal-only)",
)} )}

View file

@ -10,6 +10,8 @@
${helpers.single_keyword( ${helpers.single_keyword(
"visibility", "visibility",
"visible hidden", "visible hidden",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
extra_gecko_values="collapse", extra_gecko_values="collapse",
gecko_ffi_name="mVisible", gecko_ffi_name="mVisible",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
@ -21,11 +23,12 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"writing-mode", "writing-mode",
"horizontal-tb vertical-rl vertical-lr", "horizontal-tb vertical-rl vertical-lr",
engines="gecko servo-2013 servo-2020",
extra_gecko_values="sideways-rl sideways-lr", extra_gecko_values="sideways-rl sideways-lr",
extra_gecko_aliases="lr=horizontal-tb lr-tb=horizontal-tb \ gecko_aliases="lr=horizontal-tb lr-tb=horizontal-tb \
rl=horizontal-tb rl-tb=horizontal-tb \ rl=horizontal-tb rl-tb=horizontal-tb \
tb=vertical-rl tb-rl=vertical-rl", tb=vertical-rl tb-rl=vertical-rl",
servo_pref="layout.writing-mode.enabled", servo_2013_pref="layout.writing-mode.enabled",
animation_value_type="none", animation_value_type="none",
spec="https://drafts.csswg.org/css-writing-modes/#propdef-writing-mode", spec="https://drafts.csswg.org/css-writing-modes/#propdef-writing-mode",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
@ -34,6 +37,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"direction", "direction",
"ltr rtl", "ltr rtl",
engines="gecko servo-2013 servo-2020",
animation_value_type="none", animation_value_type="none",
spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction", spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction",
needs_conversion=True, needs_conversion=True,
@ -43,8 +47,8 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"text-orientation", "text-orientation",
"mixed upright sideways", "mixed upright sideways",
extra_gecko_aliases="sideways-right=sideways", engines="gecko",
products="gecko", gecko_aliases="sideways-right=sideways",
animation_value_type="none", animation_value_type="none",
spec="https://drafts.csswg.org/css-writing-modes/#propdef-text-orientation", spec="https://drafts.csswg.org/css-writing-modes/#propdef-text-orientation",
)} )}
@ -53,7 +57,8 @@ ${helpers.single_keyword(
// https://drafts.csswg.org/css-color/ // https://drafts.csswg.org/css-color/
${helpers.single_keyword( ${helpers.single_keyword(
"color-adjust", "color-adjust",
"economy exact", products="gecko", "economy exact",
engines="gecko",
gecko_enum_prefix="StyleColorAdjust", gecko_enum_prefix="StyleColorAdjust",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-color/#propdef-color-adjust", spec="https://drafts.csswg.org/css-color/#propdef-color-adjust",
@ -64,9 +69,10 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"image-rendering", "image-rendering",
"auto crisp-edges", "auto crisp-edges",
engines="gecko servo-2013",
extra_gecko_values="optimizespeed optimizequality", extra_gecko_values="optimizespeed optimizequality",
extra_servo_values="pixelated", extra_servo_2013_values="pixelated",
extra_gecko_aliases="-moz-crisp-edges=crisp-edges", gecko_aliases="-moz-crisp-edges=crisp-edges",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-images/#propdef-image-rendering", spec="https://drafts.csswg.org/css-images/#propdef-image-rendering",
)} )}
@ -74,7 +80,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"image-orientation", "image-orientation",
"none from-image", "none from-image",
products="gecko", engines="gecko",
gecko_enum_prefix="StyleImageOrientation", gecko_enum_prefix="StyleImageOrientation",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-images/#propdef-image-orientation", spec="https://drafts.csswg.org/css-images/#propdef-image-orientation",

View file

@ -14,7 +14,7 @@ ${helpers.single_keyword(
"dominant-baseline", "dominant-baseline",
"""auto ideographic alphabetic hanging mathematical central middle """auto ideographic alphabetic hanging mathematical central middle
text-after-edge text-before-edge""", text-after-edge text-before-edge""",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/css-inline-3/#propdef-dominant-baseline", spec="https://www.w3.org/TR/css-inline-3/#propdef-dominant-baseline",
)} )}
@ -22,7 +22,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"text-anchor", "text-anchor",
"start middle end", "start middle end",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG/text.html#TextAnchorProperty", spec="https://www.w3.org/TR/SVG/text.html#TextAnchorProperty",
)} )}
@ -31,7 +31,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"color-interpolation", "color-interpolation",
"srgb auto linearrgb", "srgb auto linearrgb",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty", spec="https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty",
)} )}
@ -39,7 +39,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"color-interpolation-filters", "color-interpolation-filters",
"linearrgb auto srgb", "linearrgb auto srgb",
products="gecko", engines="gecko",
gecko_constant_prefix="NS_STYLE_COLOR_INTERPOLATION", gecko_constant_prefix="NS_STYLE_COLOR_INTERPOLATION",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationFiltersProperty", spec="https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationFiltersProperty",
@ -49,7 +49,7 @@ ${helpers.predefined_type(
"fill", "fill",
"SVGPaint", "SVGPaint",
"crate::values::computed::SVGPaint::black()", "crate::values::computed::SVGPaint::black()",
products="gecko", engines="gecko",
animation_value_type="IntermediateSVGPaint", animation_value_type="IntermediateSVGPaint",
boxed=True, boxed=True,
spec="https://www.w3.org/TR/SVG2/painting.html#SpecifyingFillPaint", spec="https://www.w3.org/TR/SVG2/painting.html#SpecifyingFillPaint",
@ -59,7 +59,7 @@ ${helpers.predefined_type(
"fill-opacity", "fill-opacity",
"SVGOpacity", "SVGOpacity",
"Default::default()", "Default::default()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://svgwg.org/svg2-draft/painting.html#FillOpacity", spec="https://svgwg.org/svg2-draft/painting.html#FillOpacity",
)} )}
@ -68,8 +68,8 @@ ${helpers.predefined_type(
"fill-rule", "fill-rule",
"FillRule", "FillRule",
"Default::default()", "Default::default()",
engines="gecko",
needs_context=False, needs_context=False,
products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#FillRuleProperty", spec="https://www.w3.org/TR/SVG11/painting.html#FillRuleProperty",
)} )}
@ -77,7 +77,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"shape-rendering", "shape-rendering",
"auto optimizespeed crispedges geometricprecision", "auto optimizespeed crispedges geometricprecision",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#ShapeRenderingProperty", spec="https://www.w3.org/TR/SVG11/painting.html#ShapeRenderingProperty",
)} )}
@ -86,7 +86,7 @@ ${helpers.predefined_type(
"stroke", "stroke",
"SVGPaint", "SVGPaint",
"Default::default()", "Default::default()",
products="gecko", engines="gecko",
animation_value_type="IntermediateSVGPaint", animation_value_type="IntermediateSVGPaint",
boxed=True, boxed=True,
spec="https://www.w3.org/TR/SVG2/painting.html#SpecifyingStrokePaint", spec="https://www.w3.org/TR/SVG2/painting.html#SpecifyingStrokePaint",
@ -96,7 +96,7 @@ ${helpers.predefined_type(
"stroke-width", "stroke-width",
"SVGWidth", "SVGWidth",
"computed::SVGWidth::one()", "computed::SVGWidth::one()",
products="gecko", engines="gecko",
animation_value_type="crate::values::computed::SVGWidth", animation_value_type="crate::values::computed::SVGWidth",
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeWidth", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeWidth",
)} )}
@ -104,7 +104,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"stroke-linecap", "stroke-linecap",
"butt round square", "butt round square",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinecapProperty", spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinecapProperty",
)} )}
@ -112,7 +112,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"stroke-linejoin", "stroke-linejoin",
"miter round bevel", "miter round bevel",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinejoinProperty", spec="https://www.w3.org/TR/SVG11/painting.html#StrokeLinejoinProperty",
)} )}
@ -121,7 +121,7 @@ ${helpers.predefined_type(
"stroke-miterlimit", "stroke-miterlimit",
"NonNegativeNumber", "NonNegativeNumber",
"From::from(4.0)", "From::from(4.0)",
products="gecko", engines="gecko",
animation_value_type="crate::values::computed::NonNegativeNumber", animation_value_type="crate::values::computed::NonNegativeNumber",
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeMiterlimitProperty", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeMiterlimitProperty",
)} )}
@ -130,7 +130,7 @@ ${helpers.predefined_type(
"stroke-opacity", "stroke-opacity",
"SVGOpacity", "SVGOpacity",
"Default::default()", "Default::default()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://svgwg.org/svg2-draft/painting.html#StrokeOpacity", spec="https://svgwg.org/svg2-draft/painting.html#StrokeOpacity",
)} )}
@ -139,7 +139,7 @@ ${helpers.predefined_type(
"stroke-dasharray", "stroke-dasharray",
"SVGStrokeDashArray", "SVGStrokeDashArray",
"Default::default()", "Default::default()",
products="gecko", engines="gecko",
animation_value_type="crate::values::computed::SVGStrokeDashArray", animation_value_type="crate::values::computed::SVGStrokeDashArray",
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing",
)} )}
@ -148,7 +148,7 @@ ${helpers.predefined_type(
"stroke-dashoffset", "stroke-dashoffset",
"SVGLength", "SVGLength",
"computed::SVGLength::zero()", "computed::SVGLength::zero()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing", spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing",
)} )}
@ -158,8 +158,8 @@ ${helpers.predefined_type(
"clip-rule", "clip-rule",
"FillRule", "FillRule",
"Default::default()", "Default::default()",
engines="gecko",
needs_context=False, needs_context=False,
products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/masking.html#ClipRuleProperty", spec="https://www.w3.org/TR/SVG11/masking.html#ClipRuleProperty",
)} )}
@ -168,7 +168,7 @@ ${helpers.predefined_type(
"marker-start", "marker-start",
"url::UrlOrNone", "url::UrlOrNone",
"computed::url::UrlOrNone::none()", "computed::url::UrlOrNone::none()",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties", spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties",
)} )}
@ -177,7 +177,7 @@ ${helpers.predefined_type(
"marker-mid", "marker-mid",
"url::UrlOrNone", "url::UrlOrNone",
"computed::url::UrlOrNone::none()", "computed::url::UrlOrNone::none()",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties", spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties",
)} )}
@ -186,7 +186,7 @@ ${helpers.predefined_type(
"marker-end", "marker-end",
"url::UrlOrNone", "url::UrlOrNone",
"computed::url::UrlOrNone::none()", "computed::url::UrlOrNone::none()",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties", spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties",
)} )}
@ -195,7 +195,7 @@ ${helpers.predefined_type(
"paint-order", "paint-order",
"SVGPaintOrder", "SVGPaintOrder",
"computed::SVGPaintOrder::normal()", "computed::SVGPaintOrder::normal()",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder", spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder",
)} )}
@ -204,7 +204,7 @@ ${helpers.predefined_type(
"-moz-context-properties", "-moz-context-properties",
"MozContextProperties", "MozContextProperties",
"computed::MozContextProperties::default()", "computed::MozContextProperties::default()",
products="gecko", engines="gecko",
animation_value_type="none", animation_value_type="none",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties)",
)} )}

View file

@ -9,6 +9,7 @@
${helpers.single_keyword( ${helpers.single_keyword(
"border-collapse", "border-collapse",
"separate collapse", "separate collapse",
engines="gecko servo-2013",
gecko_enum_prefix="StyleBorderCollapse", gecko_enum_prefix="StyleBorderCollapse",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-border-collapse", spec="https://drafts.csswg.org/css-tables/#propdef-border-collapse",
@ -18,6 +19,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"empty-cells", "empty-cells",
"show hide", "show hide",
engines="gecko servo-2013",
gecko_constant_prefix="NS_STYLE_TABLE_EMPTY_CELLS", gecko_constant_prefix="NS_STYLE_TABLE_EMPTY_CELLS",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-empty-cells", spec="https://drafts.csswg.org/css-tables/#propdef-empty-cells",
@ -27,6 +29,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"caption-side", "caption-side",
"top bottom", "top bottom",
engines="gecko servo-2013",
extra_gecko_values="right left top-outside bottom-outside", extra_gecko_values="right left top-outside bottom-outside",
needs_conversion="True", needs_conversion="True",
animation_value_type="discrete", animation_value_type="discrete",
@ -38,6 +41,8 @@ ${helpers.predefined_type(
"border-spacing", "border-spacing",
"BorderSpacing", "BorderSpacing",
"computed::BorderSpacing::zero()", "computed::BorderSpacing::zero()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="BorderSpacing", animation_value_type="BorderSpacing",
boxed=True, boxed=True,
spec="https://drafts.csswg.org/css-tables/#propdef-border-spacing", spec="https://drafts.csswg.org/css-tables/#propdef-border-spacing",

View file

@ -10,6 +10,7 @@ ${helpers.predefined_type(
"color", "color",
"ColorPropertyValue", "ColorPropertyValue",
"::cssparser::RGBA::new(0, 0, 0, 255)", "::cssparser::RGBA::new(0, 0, 0, 255)",
engines="gecko servo-2013 servo-2020",
animation_value_type="AnimatedRGBA", animation_value_type="AnimatedRGBA",
ignored_when_colors_disabled="True", ignored_when_colors_disabled="True",
spec="https://drafts.csswg.org/css-color/#color", spec="https://drafts.csswg.org/css-color/#color",
@ -19,6 +20,8 @@ ${helpers.predefined_type(
"line-height", "line-height",
"LineHeight", "LineHeight",
"computed::LineHeight::normal()", "computed::LineHeight::normal()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="LineHeight", animation_value_type="LineHeight",
flags="GETCS_NEEDS_LAYOUT_FLUSH", flags="GETCS_NEEDS_LAYOUT_FLUSH",
spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height", spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height",
@ -31,6 +34,7 @@ ${helpers.predefined_type(
"text-transform", "text-transform",
"TextTransform", "TextTransform",
"computed::TextTransform::none()", "computed::TextTransform::none()",
engines="gecko servo-2013",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-text-transform", spec="https://drafts.csswg.org/css-text/#propdef-text-transform",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
@ -39,8 +43,8 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"hyphens", "hyphens",
"manual none auto", "manual none auto",
engines="gecko",
gecko_enum_prefix="StyleHyphens", gecko_enum_prefix="StyleHyphens",
products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
extra_prefixes="moz", extra_prefixes="moz",
spec="https://drafts.csswg.org/css-text/#propdef-hyphens", spec="https://drafts.csswg.org/css-text/#propdef-hyphens",
@ -50,9 +54,10 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-text-size-adjust", "-moz-text-size-adjust",
"auto none", "auto none",
engines="gecko",
gecko_constant_prefix="NS_STYLE_TEXT_SIZE_ADJUST", gecko_constant_prefix="NS_STYLE_TEXT_SIZE_ADJUST",
gecko_ffi_name="mTextSizeAdjust", gecko_ffi_name="mTextSizeAdjust",
products="gecko", animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-size-adjust/#adjustment-control", spec="https://drafts.csswg.org/css-size-adjust/#adjustment-control",
alias="-webkit-text-size-adjust", alias="-webkit-text-size-adjust",
)} )}
@ -61,6 +66,8 @@ ${helpers.predefined_type(
"text-indent", "text-indent",
"LengthPercentage", "LengthPercentage",
"computed::LengthPercentage::zero()", "computed::LengthPercentage::zero()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-text/#propdef-text-indent", spec="https://drafts.csswg.org/css-text/#propdef-text-indent",
allow_quirks="Yes", allow_quirks="Yes",
@ -73,6 +80,8 @@ ${helpers.predefined_type(
"overflow-wrap", "overflow-wrap",
"OverflowWrap", "OverflowWrap",
"computed::OverflowWrap::Normal", "computed::OverflowWrap::Normal",
engines="servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-overflow-wrap", spec="https://drafts.csswg.org/css-text/#propdef-overflow-wrap",
alias="word-wrap", alias="word-wrap",
@ -84,6 +93,8 @@ ${helpers.predefined_type(
"word-break", "word-break",
"WordBreak", "WordBreak",
"computed::WordBreak::Normal", "computed::WordBreak::Normal",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-word-break", spec="https://drafts.csswg.org/css-text/#propdef-word-break",
needs_context=False, needs_context=False,
@ -94,8 +105,10 @@ ${helpers.predefined_type(
<%helpers:single_keyword <%helpers:single_keyword
name="text-justify" name="text-justify"
values="auto none inter-word" values="auto none inter-word"
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
extra_gecko_values="inter-character" extra_gecko_values="inter-character"
extra_specified="${'distribute' if product == 'gecko' else ''}" extra_specified="${'distribute' if engine == 'gecko' else ''}"
gecko_enum_prefix="StyleTextJustify" gecko_enum_prefix="StyleTextJustify"
animation_value_type="discrete" animation_value_type="discrete"
gecko_pref="layout.css.text-justify.enabled" gecko_pref="layout.css.text-justify.enabled"
@ -103,7 +116,7 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-text/#propdef-text-justify" spec="https://drafts.csswg.org/css-text/#propdef-text-justify"
servo_restyle_damage="rebuild_and_reflow" servo_restyle_damage="rebuild_and_reflow"
> >
% if product == 'gecko': % if engine == 'gecko':
impl ToComputedValue for SpecifiedValue { impl ToComputedValue for SpecifiedValue {
type ComputedValue = computed_value::T; type ComputedValue = computed_value::T;
@ -133,7 +146,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"text-align-last", "text-align-last",
"auto start end left right center justify", "auto start end left right center justify",
products="gecko", engines="gecko",
gecko_constant_prefix="NS_STYLE_TEXT_ALIGN", gecko_constant_prefix="NS_STYLE_TEXT_ALIGN",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-text-align-last", spec="https://drafts.csswg.org/css-text/#propdef-text-align-last",
@ -144,6 +157,8 @@ ${helpers.predefined_type(
"text-align", "text-align",
"TextAlign", "TextAlign",
"computed::TextAlign::Start", "computed::TextAlign::Start",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-text-align", spec="https://drafts.csswg.org/css-text/#propdef-text-align",
servo_restyle_damage = "reflow", servo_restyle_damage = "reflow",
@ -153,6 +168,7 @@ ${helpers.predefined_type(
"letter-spacing", "letter-spacing",
"LetterSpacing", "LetterSpacing",
"computed::LetterSpacing::normal()", "computed::LetterSpacing::normal()",
engines="gecko servo-2013",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing", spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
@ -162,6 +178,7 @@ ${helpers.predefined_type(
"word-spacing", "word-spacing",
"WordSpacing", "WordSpacing",
"computed::WordSpacing::zero()", "computed::WordSpacing::zero()",
engines="gecko servo-2013",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-text/#propdef-word-spacing", spec="https://drafts.csswg.org/css-text/#propdef-word-spacing",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
@ -170,6 +187,8 @@ ${helpers.predefined_type(
<%helpers:single_keyword <%helpers:single_keyword
name="white-space" name="white-space"
values="normal pre nowrap pre-wrap pre-line" values="normal pre nowrap pre-wrap pre-line"
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
extra_gecko_values="break-spaces -moz-pre-space" extra_gecko_values="break-spaces -moz-pre-space"
gecko_enum_prefix="StyleWhiteSpace" gecko_enum_prefix="StyleWhiteSpace"
needs_conversion="True" needs_conversion="True"
@ -177,7 +196,7 @@ ${helpers.predefined_type(
spec="https://drafts.csswg.org/css-text/#propdef-white-space" spec="https://drafts.csswg.org/css-text/#propdef-white-space"
servo_restyle_damage="rebuild_and_reflow" servo_restyle_damage="rebuild_and_reflow"
> >
% if product != "gecko": % if engine == "servo-2013":
impl SpecifiedValue { impl SpecifiedValue {
pub fn allow_wrap(&self) -> bool { pub fn allow_wrap(&self) -> bool {
match *self { match *self {
@ -216,6 +235,7 @@ ${helpers.predefined_type(
"text-shadow", "text-shadow",
"SimpleShadow", "SimpleShadow",
None, None,
engines="gecko servo-2013",
vector=True, vector=True,
vector_animation_type="with_zero", vector_animation_type="with_zero",
animation_value_type="AnimatedTextShadowList", animation_value_type="AnimatedTextShadowList",
@ -228,8 +248,8 @@ ${helpers.predefined_type(
"text-emphasis-style", "text-emphasis-style",
"TextEmphasisStyle", "TextEmphasisStyle",
None, None,
engines="gecko",
initial_specified_value="SpecifiedValue::None", initial_specified_value="SpecifiedValue::None",
products="gecko",
boxed=True, boxed=True,
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-style", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-style",
@ -239,8 +259,8 @@ ${helpers.predefined_type(
"text-emphasis-position", "text-emphasis-position",
"TextEmphasisPosition", "TextEmphasisPosition",
"computed::TextEmphasisPosition::over_right()", "computed::TextEmphasisPosition::over_right()",
engines="gecko",
initial_specified_value="specified::TextEmphasisPosition::over_right()", initial_specified_value="specified::TextEmphasisPosition::over_right()",
products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-position", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-position",
)} )}
@ -249,8 +269,8 @@ ${helpers.predefined_type(
"text-emphasis-color", "text-emphasis-color",
"Color", "Color",
"computed_value::T::currentcolor()", "computed_value::T::currentcolor()",
engines="gecko",
initial_specified_value="specified::Color::currentcolor()", initial_specified_value="specified::Color::currentcolor()",
products="gecko",
animation_value_type="AnimatedColor", animation_value_type="AnimatedColor",
ignored_when_colors_disabled=True, ignored_when_colors_disabled=True,
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-color", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-color",
@ -260,7 +280,7 @@ ${helpers.predefined_type(
"-moz-tab-size", "-moz-tab-size",
"NonNegativeLengthOrNumber", "NonNegativeLengthOrNumber",
"generics::length::LengthOrNumber::Number(From::from(8.0))", "generics::length::LengthOrNumber::Number(From::from(8.0))",
products="gecko", engines="gecko",
animation_value_type="LengthOrNumber", animation_value_type="LengthOrNumber",
spec="https://drafts.csswg.org/css-text-3/#tab-size-property", spec="https://drafts.csswg.org/css-text-3/#tab-size-property",
)} )}
@ -269,7 +289,7 @@ ${helpers.predefined_type(
"line-break", "line-break",
"LineBreak", "LineBreak",
"computed::LineBreak::Auto", "computed::LineBreak::Auto",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text-3/#line-break-property", spec="https://drafts.csswg.org/css-text-3/#line-break-property",
needs_context=False, needs_context=False,
@ -281,7 +301,7 @@ ${helpers.predefined_type(
"-webkit-text-fill-color", "-webkit-text-fill-color",
"Color", "Color",
"computed_value::T::currentcolor()", "computed_value::T::currentcolor()",
products="gecko", engines="gecko",
animation_value_type="AnimatedColor", animation_value_type="AnimatedColor",
ignored_when_colors_disabled=True, ignored_when_colors_disabled=True,
spec="https://compat.spec.whatwg.org/#the-webkit-text-fill-color", spec="https://compat.spec.whatwg.org/#the-webkit-text-fill-color",
@ -292,7 +312,7 @@ ${helpers.predefined_type(
"Color", "Color",
"computed_value::T::currentcolor()", "computed_value::T::currentcolor()",
initial_specified_value="specified::Color::currentcolor()", initial_specified_value="specified::Color::currentcolor()",
products="gecko", engines="gecko",
animation_value_type="AnimatedColor", animation_value_type="AnimatedColor",
ignored_when_colors_disabled=True, ignored_when_colors_disabled=True,
spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-color", spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-color",
@ -302,9 +322,9 @@ ${helpers.predefined_type(
"-webkit-text-stroke-width", "-webkit-text-stroke-width",
"BorderSideWidth", "BorderSideWidth",
"crate::values::computed::NonNegativeLength::new(0.)", "crate::values::computed::NonNegativeLength::new(0.)",
engines="gecko",
initial_specified_value="specified::BorderSideWidth::zero()", initial_specified_value="specified::BorderSideWidth::zero()",
computed_type="crate::values::computed::NonNegativeLength", computed_type="crate::values::computed::NonNegativeLength",
products="gecko",
spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-width", spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-width",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
@ -314,7 +334,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"ruby-align", "ruby-align",
"space-around start center space-between", "space-around start center space-between",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-ruby/#ruby-align-property", spec="https://drafts.csswg.org/css-ruby/#ruby-align-property",
)} )}
@ -322,7 +342,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"ruby-position", "ruby-position",
"over under", "over under",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-ruby/#ruby-position-property", spec="https://drafts.csswg.org/css-ruby/#ruby-position-property",
)} )}
@ -333,7 +353,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"text-combine-upright", "text-combine-upright",
"none all", "none all",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-writing-modes-3/#text-combine-upright", spec="https://drafts.csswg.org/css-writing-modes-3/#text-combine-upright",
)} )}
@ -342,6 +362,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"text-rendering", "text-rendering",
"auto optimizespeed optimizelegibility geometricprecision", "auto optimizespeed optimizelegibility geometricprecision",
engines="gecko servo-2013",
gecko_enum_prefix="StyleTextRendering", gecko_enum_prefix="StyleTextRendering",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#TextRenderingProperty", spec="https://www.w3.org/TR/SVG11/painting.html#TextRenderingProperty",
@ -353,10 +374,10 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-control-character-visibility", "-moz-control-character-visibility",
"hidden visible", "hidden visible",
engines="gecko",
gecko_constant_prefix="NS_STYLE_CONTROL_CHARACTER_VISIBILITY", gecko_constant_prefix="NS_STYLE_CONTROL_CHARACTER_VISIBILITY",
animation_value_type="none", animation_value_type="none",
gecko_ffi_name="mControlCharacterVisibility", gecko_ffi_name="mControlCharacterVisibility",
products="gecko",
spec="Nonstandard", spec="Nonstandard",
)} )}
@ -365,7 +386,7 @@ ${helpers.predefined_type(
"text-underline-offset", "text-underline-offset",
"LengthOrAuto", "LengthOrAuto",
"computed::LengthOrAuto::auto()", "computed::LengthOrAuto::auto()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
gecko_pref="layout.css.text-underline-offset.enabled", gecko_pref="layout.css.text-underline-offset.enabled",
has_effect_on_gecko_scrollbars=False, has_effect_on_gecko_scrollbars=False,
@ -377,7 +398,7 @@ ${helpers.predefined_type(
"text-decoration-skip-ink", "text-decoration-skip-ink",
"TextDecorationSkipInk", "TextDecorationSkipInk",
"computed::TextDecorationSkipInk::Auto", "computed::TextDecorationSkipInk::Auto",
products="gecko", engines="gecko",
needs_context=False, needs_context=False,
animation_value_type="discrete", animation_value_type="discrete",
gecko_pref="layout.css.text-decoration-skip-ink.enabled", gecko_pref="layout.css.text-decoration-skip-ink.enabled",

View file

@ -10,6 +10,7 @@ ${helpers.predefined_type(
"cursor", "cursor",
"Cursor", "Cursor",
"computed::Cursor::auto()", "computed::Cursor::auto()",
engines="gecko servo-2013",
initial_specified_value="specified::Cursor::auto()", initial_specified_value="specified::Cursor::auto()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-ui/#cursor", spec="https://drafts.csswg.org/css-ui/#cursor",
@ -21,6 +22,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"pointer-events", "pointer-events",
"auto none", "auto none",
engines="gecko servo-2013",
animation_value_type="discrete", animation_value_type="discrete",
extra_gecko_values="visiblepainted visiblefill visiblestroke visible painted fill stroke all", extra_gecko_values="visiblepainted visiblefill visiblestroke visible painted fill stroke all",
spec="https://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty", spec="https://www.w3.org/TR/SVG11/interact.html#PointerEventsProperty",
@ -29,7 +31,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-user-input", "-moz-user-input",
"auto none", "auto none",
products="gecko", engines="gecko",
gecko_ffi_name="mUserInput", gecko_ffi_name="mUserInput",
gecko_enum_prefix="StyleUserInput", gecko_enum_prefix="StyleUserInput",
animation_value_type="discrete", animation_value_type="discrete",
@ -39,7 +41,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-user-modify", "-moz-user-modify",
"read-only read-write write-only", "read-only read-write write-only",
products="gecko", engines="gecko",
gecko_ffi_name="mUserModify", gecko_ffi_name="mUserModify",
gecko_enum_prefix="StyleUserModify", gecko_enum_prefix="StyleUserModify",
needs_conversion=True, needs_conversion=True,
@ -50,7 +52,8 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-user-focus", "-moz-user-focus",
"none ignore normal select-after select-before select-menu select-same select-all", "none ignore normal select-after select-before select-menu select-same select-all",
products="gecko", gecko_ffi_name="mUserFocus", engines="gecko",
gecko_ffi_name="mUserFocus",
gecko_enum_prefix="StyleUserFocus", gecko_enum_prefix="StyleUserFocus",
animation_value_type="discrete", animation_value_type="discrete",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-focus)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-user-focus)",
@ -60,17 +63,18 @@ ${helpers.predefined_type(
"caret-color", "caret-color",
"ColorOrAuto", "ColorOrAuto",
"generics::color::ColorOrAuto::Auto", "generics::color::ColorOrAuto::Auto",
engines="gecko",
spec="https://drafts.csswg.org/css-ui/#caret-color", spec="https://drafts.csswg.org/css-ui/#caret-color",
animation_value_type="AnimatedCaretColor", animation_value_type="AnimatedCaretColor",
boxed=True, boxed=True,
ignored_when_colors_disabled=True, ignored_when_colors_disabled=True,
products="gecko",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
"scrollbar-color", "scrollbar-color",
"ui::ScrollbarColor", "ui::ScrollbarColor",
"Default::default()", "Default::default()",
engines="gecko",
spec="https://drafts.csswg.org/css-scrollbars-1/#scrollbar-color", spec="https://drafts.csswg.org/css-scrollbars-1/#scrollbar-color",
gecko_pref="layout.css.scrollbar-color.enabled", gecko_pref="layout.css.scrollbar-color.enabled",
# Surprisingly, yes the computed value of scrollbar-color has no effect on # Surprisingly, yes the computed value of scrollbar-color has no effect on
@ -81,5 +85,4 @@ ${helpers.predefined_type(
boxed=True, boxed=True,
ignored_when_colors_disabled=True, ignored_when_colors_disabled=True,
enabled_in="chrome", enabled_in="chrome",
products="gecko",
)} )}

View file

@ -6,9 +6,15 @@
<% data.new_style_struct("List", inherited=True) %> <% data.new_style_struct("List", inherited=True) %>
${helpers.single_keyword("list-style-position", "outside inside", animation_value_type="discrete", ${helpers.single_keyword(
"list-style-position",
"outside inside",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-position", spec="https://drafts.csswg.org/css-lists/#propdef-list-style-position",
servo_restyle_damage="rebuild_and_reflow")} servo_restyle_damage="rebuild_and_reflow",
)}
// TODO(pcwalton): Implement the full set of counter styles per CSS-COUNTER-STYLES [1] 6.1: // TODO(pcwalton): Implement the full set of counter styles per CSS-COUNTER-STYLES [1] 6.1:
// //
@ -16,22 +22,26 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
// upper-roman // upper-roman
// //
// [1]: http://dev.w3.org/csswg/css-counter-styles/ // [1]: http://dev.w3.org/csswg/css-counter-styles/
% if product == "servo": % if engine in ["servo-2013", "servo-2020"]:
${helpers.single_keyword( ${helpers.single_keyword(
"list-style-type", "list-style-type",
"""disc none circle square decimal disclosure-open disclosure-closed lower-alpha upper-alpha """disc none circle square decimal disclosure-open disclosure-closed lower-alpha upper-alpha
arabic-indic bengali cambodian cjk-decimal devanagari gujarati gurmukhi kannada khmer lao arabic-indic bengali cambodian cjk-decimal devanagari gujarati gurmukhi kannada khmer lao
malayalam mongolian myanmar oriya persian telugu thai tibetan cjk-earthly-branch malayalam mongolian myanmar oriya persian telugu thai tibetan cjk-earthly-branch
cjk-heavenly-stem lower-greek hiragana hiragana-iroha katakana katakana-iroha""", cjk-heavenly-stem lower-greek hiragana hiragana-iroha katakana katakana-iroha""",
engines="servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type", spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
)} )}
% else: % endif
% if engine == "gecko":
${helpers.predefined_type( ${helpers.predefined_type(
"list-style-type", "list-style-type",
"ListStyleType", "ListStyleType",
"computed::ListStyleType::disc()", "computed::ListStyleType::disc()",
engines="gecko",
initial_specified_value="specified::ListStyleType::disc()", initial_specified_value="specified::ListStyleType::disc()",
animation_value_type="discrete", animation_value_type="discrete",
boxed=True, boxed=True,
@ -43,6 +53,7 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
${helpers.predefined_type( ${helpers.predefined_type(
"list-style-image", "list-style-image",
"url::ImageUrlOrNone", "url::ImageUrlOrNone",
engines="gecko servo-2013",
initial_value="computed::url::ImageUrlOrNone::none()", initial_value="computed::url::ImageUrlOrNone::none()",
initial_specified_value="specified::url::ImageUrlOrNone::none()", initial_specified_value="specified::url::ImageUrlOrNone::none()",
animation_value_type="discrete", animation_value_type="discrete",
@ -54,6 +65,7 @@ ${helpers.predefined_type(
"quotes", "quotes",
"Quotes", "Quotes",
"computed::Quotes::get_initial_value()", "computed::Quotes::get_initial_value()",
engines="gecko servo-2013",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-content/#propdef-quotes", spec="https://drafts.csswg.org/css-content/#propdef-quotes",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
@ -63,8 +75,8 @@ ${helpers.predefined_type(
"-moz-image-region", "-moz-image-region",
"ClipRectOrAuto", "ClipRectOrAuto",
"computed::ClipRectOrAuto::auto()", "computed::ClipRectOrAuto::auto()",
engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
products="gecko",
boxed=True, boxed=True,
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-image-region)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-image-region)",
)} )}
@ -73,8 +85,8 @@ ${helpers.predefined_type(
"-moz-list-reversed", "-moz-list-reversed",
"MozListReversed", "MozListReversed",
"computed::MozListReversed::False", "computed::MozListReversed::False",
engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
products="gecko",
enabled_in="ua", enabled_in="ua",
needs_context=False, needs_context=False,
spec="Internal implementation detail for <ol reversed>", spec="Internal implementation detail for <ol reversed>",

View file

@ -16,7 +16,9 @@
"margin-%s" % side[0], "margin-%s" % side[0],
"LengthPercentageOrAuto", "LengthPercentageOrAuto",
"computed::LengthPercentageOrAuto::zero()", "computed::LengthPercentageOrAuto::zero()",
alias=maybe_moz_logical_alias(product, side, "-moz-margin-%s"), engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
alias=maybe_moz_logical_alias(engine, side, "-moz-margin-%s"),
allow_quirks="No" if side[1] else "Yes", allow_quirks="No" if side[1] else "Yes",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
logical=side[1], logical=side[1],
@ -33,7 +35,7 @@
"scroll-margin-%s" % side[0], "scroll-margin-%s" % side[0],
"Length", "Length",
"computed::Length::zero()", "computed::Length::zero()",
products="gecko", engines="gecko",
gecko_pref="layout.css.scroll-snap-v1.enabled", gecko_pref="layout.css.scroll-snap-v1.enabled",
logical=side[1], logical=side[1],
logical_group="scroll-margin", logical_group="scroll-margin",

View file

@ -14,6 +14,7 @@ ${helpers.predefined_type(
"outline-color", "outline-color",
"Color", "Color",
"computed_value::T::currentcolor()", "computed_value::T::currentcolor()",
engines="gecko servo-2013",
initial_specified_value="specified::Color::currentcolor()", initial_specified_value="specified::Color::currentcolor()",
animation_value_type="AnimatedColor", animation_value_type="AnimatedColor",
ignored_when_colors_disabled=True, ignored_when_colors_disabled=True,
@ -24,6 +25,8 @@ ${helpers.predefined_type(
"outline-style", "outline-style",
"OutlineStyle", "OutlineStyle",
"computed::OutlineStyle::none()", "computed::OutlineStyle::none()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::OutlineStyle::none()", initial_specified_value="specified::OutlineStyle::none()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-ui/#propdef-outline-style", spec="https://drafts.csswg.org/css-ui/#propdef-outline-style",
@ -33,6 +36,8 @@ ${helpers.predefined_type(
"outline-width", "outline-width",
"BorderSideWidth", "BorderSideWidth",
"crate::values::computed::NonNegativeLength::new(3.)", "crate::values::computed::NonNegativeLength::new(3.)",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::BorderSideWidth::Medium", initial_specified_value="specified::BorderSideWidth::Medium",
computed_type="crate::values::computed::NonNegativeLength", computed_type="crate::values::computed::NonNegativeLength",
animation_value_type="NonNegativeLength", animation_value_type="NonNegativeLength",
@ -45,7 +50,7 @@ ${helpers.predefined_type(
"-moz-outline-radius-" + corner, "-moz-outline-radius-" + corner,
"BorderCornerRadius", "BorderCornerRadius",
"computed::BorderCornerRadius::zero()", "computed::BorderCornerRadius::zero()",
products="gecko", engines="gecko",
boxed=True, boxed=True,
animation_value_type="BorderCornerRadius", animation_value_type="BorderCornerRadius",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)",
@ -56,7 +61,7 @@ ${helpers.predefined_type(
"outline-offset", "outline-offset",
"Length", "Length",
"crate::values::computed::Length::new(0.)", "crate::values::computed::Length::new(0.)",
products="servo gecko", engines="gecko servo-2013",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-ui/#propdef-outline-offset", spec="https://drafts.csswg.org/css-ui/#propdef-outline-offset",
)} )}

View file

@ -16,7 +16,9 @@
"padding-%s" % side[0], "padding-%s" % side[0],
"NonNegativeLengthPercentage", "NonNegativeLengthPercentage",
"computed::NonNegativeLengthPercentage::zero()", "computed::NonNegativeLengthPercentage::zero()",
alias=maybe_moz_logical_alias(product, side, "-moz-padding-%s"), engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
alias=maybe_moz_logical_alias(engine, side, "-moz-padding-%s"),
animation_value_type="NonNegativeLengthPercentage", animation_value_type="NonNegativeLengthPercentage",
logical=side[1], logical=side[1],
logical_group="padding", logical_group="padding",
@ -32,7 +34,7 @@
"scroll-padding-%s" % side[0], "scroll-padding-%s" % side[0],
"NonNegativeLengthPercentageOrAuto", "NonNegativeLengthPercentageOrAuto",
"computed::NonNegativeLengthPercentageOrAuto::auto()", "computed::NonNegativeLengthPercentageOrAuto::auto()",
products="gecko", engines="gecko",
gecko_pref="layout.css.scroll-snap-v1.enabled", gecko_pref="layout.css.scroll-snap-v1.enabled",
logical=side[1], logical=side[1],
logical_group="scroll-padding", logical_group="scroll-padding",

View file

@ -14,6 +14,8 @@
side, side,
"LengthPercentageOrAuto", "LengthPercentageOrAuto",
"computed::LengthPercentageOrAuto::auto()", "computed::LengthPercentageOrAuto::auto()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side, spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side,
flags="GETCS_NEEDS_LAYOUT_FLUSH", flags="GETCS_NEEDS_LAYOUT_FLUSH",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
@ -28,6 +30,8 @@
"inset-%s" % side, "inset-%s" % side,
"LengthPercentageOrAuto", "LengthPercentageOrAuto",
"computed::LengthPercentageOrAuto::auto()", "computed::LengthPercentageOrAuto::auto()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
spec="https://drafts.csswg.org/css-logical-props/#propdef-inset-%s" % side, spec="https://drafts.csswg.org/css-logical-props/#propdef-inset-%s" % side,
flags="GETCS_NEEDS_LAYOUT_FLUSH", flags="GETCS_NEEDS_LAYOUT_FLUSH",
alias="offset-%s:layout.css.offset-logical-properties.enabled" % side, alias="offset-%s:layout.css.offset-logical-properties.enabled" % side,
@ -59,6 +63,8 @@ ${helpers.predefined_type(
"z-index", "z-index",
"ZIndex", "ZIndex",
"computed::ZIndex::auto()", "computed::ZIndex::auto()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
spec="https://www.w3.org/TR/CSS2/visuren.html#z-index", spec="https://www.w3.org/TR/CSS2/visuren.html#z-index",
flags="CREATES_STACKING_CONTEXT", flags="CREATES_STACKING_CONTEXT",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
@ -71,6 +77,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"flex-direction", "flex-direction",
"row row-reverse column column-reverse", "row row-reverse column column-reverse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-flexbox/#flex-direction-property", spec="https://drafts.csswg.org/css-flexbox/#flex-direction-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
@ -81,27 +88,31 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"flex-wrap", "flex-wrap",
"nowrap wrap wrap-reverse", "nowrap wrap wrap-reverse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-flexbox/#flex-wrap-property", spec="https://drafts.csswg.org/css-flexbox/#flex-wrap-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow", servo_restyle_damage = "reflow",
)} )}
% if product == "servo": % if engine == "servo-2013":
// FIXME: Update Servo to support the same Syntax as Gecko. // FIXME: Update Servo to support the same Syntax as Gecko.
${helpers.single_keyword( ${helpers.single_keyword(
"justify-content", "justify-content",
"flex-start stretch flex-end center space-between space-around", "flex-start stretch flex-end center space-between space-around",
engines="servo-2013",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-align/#propdef-justify-content", spec="https://drafts.csswg.org/css-align/#propdef-justify-content",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow", servo_restyle_damage = "reflow",
)} )}
% else: % endif
% if engine == "gecko":
${helpers.predefined_type( ${helpers.predefined_type(
"justify-content", "justify-content",
"JustifyContent", "JustifyContent",
"specified::JustifyContent(specified::ContentDistribution::normal())", "specified::JustifyContent(specified::ContentDistribution::normal())",
engines="gecko",
spec="https://drafts.csswg.org/css-align/#propdef-justify-content", spec="https://drafts.csswg.org/css-align/#propdef-justify-content",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
@ -109,11 +120,12 @@ ${helpers.single_keyword(
)} )}
% endif % endif
% if product == "servo": % if engine in ["servo-2013", "servo-2020"]:
// FIXME: Update Servo to support the same Syntax as Gecko. // FIXME: Update Servo to support the same Syntax as Gecko.
${helpers.single_keyword( ${helpers.single_keyword(
"align-content", "align-content",
"stretch flex-start flex-end center space-between space-around", "stretch flex-start flex-end center space-between space-around",
engines="servo-2013",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-align/#propdef-align-content", spec="https://drafts.csswg.org/css-align/#propdef-align-content",
animation_value_type="discrete", animation_value_type="discrete",
@ -123,16 +135,20 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"align-items", "align-items",
"stretch flex-start flex-end center baseline", "stretch flex-start flex-end center baseline",
engines="servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-flexbox/#align-items-property", spec="https://drafts.csswg.org/css-flexbox/#align-items-property",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage="reflow", servo_restyle_damage="reflow",
)} )}
% else: % endif
% if engine == "gecko":
${helpers.predefined_type( ${helpers.predefined_type(
"align-content", "align-content",
"AlignContent", "AlignContent",
"specified::AlignContent(specified::ContentDistribution::normal())", "specified::AlignContent(specified::ContentDistribution::normal())",
engines="gecko",
spec="https://drafts.csswg.org/css-align/#propdef-align-content", spec="https://drafts.csswg.org/css-align/#propdef-align-content",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
@ -143,6 +159,7 @@ ${helpers.single_keyword(
"align-items", "align-items",
"AlignItems", "AlignItems",
"specified::AlignItems::normal()", "specified::AlignItems::normal()",
engines="gecko",
spec="https://drafts.csswg.org/css-align/#propdef-align-items", spec="https://drafts.csswg.org/css-align/#propdef-align-items",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
@ -156,6 +173,7 @@ ${helpers.single_keyword(
"justify-items", "justify-items",
"JustifyItems", "JustifyItems",
"computed::JustifyItems::legacy()", "computed::JustifyItems::legacy()",
engines="gecko",
spec="https://drafts.csswg.org/css-align/#propdef-justify-items", spec="https://drafts.csswg.org/css-align/#propdef-justify-items",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
@ -169,6 +187,7 @@ ${helpers.predefined_type(
"flex-grow", "flex-grow",
"NonNegativeNumber", "NonNegativeNumber",
"From::from(0.0)", "From::from(0.0)",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-flexbox/#flex-grow-property", spec="https://drafts.csswg.org/css-flexbox/#flex-grow-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="NonNegativeNumber", animation_value_type="NonNegativeNumber",
@ -179,6 +198,7 @@ ${helpers.predefined_type(
"flex-shrink", "flex-shrink",
"NonNegativeNumber", "NonNegativeNumber",
"From::from(1.0)", "From::from(1.0)",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-flexbox/#flex-shrink-property", spec="https://drafts.csswg.org/css-flexbox/#flex-shrink-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="NonNegativeNumber", animation_value_type="NonNegativeNumber",
@ -186,21 +206,25 @@ ${helpers.predefined_type(
)} )}
// https://drafts.csswg.org/css-align/#align-self-property // https://drafts.csswg.org/css-align/#align-self-property
% if product == "servo": % if engine in ["servo-2013", "servo-2020"]:
// FIXME: Update Servo to support the same syntax as Gecko. // FIXME: Update Servo to support the same syntax as Gecko.
${helpers.single_keyword( ${helpers.single_keyword(
"align-self", "align-self",
"auto stretch flex-start flex-end center baseline", "auto stretch flex-start flex-end center baseline",
engines="servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-flexbox/#propdef-align-self", spec="https://drafts.csswg.org/css-flexbox/#propdef-align-self",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow", servo_restyle_damage = "reflow",
)} )}
% else: % endif
% if engine == "gecko":
${helpers.predefined_type( ${helpers.predefined_type(
"align-self", "align-self",
"AlignSelf", "AlignSelf",
"specified::AlignSelf(specified::SelfAlignment::auto())", "specified::AlignSelf(specified::SelfAlignment::auto())",
engines="gecko",
spec="https://drafts.csswg.org/css-align/#align-self-property", spec="https://drafts.csswg.org/css-align/#align-self-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
@ -210,6 +234,7 @@ ${helpers.predefined_type(
"justify-self", "justify-self",
"JustifySelf", "JustifySelf",
"specified::JustifySelf(specified::SelfAlignment::auto())", "specified::JustifySelf(specified::SelfAlignment::auto())",
engines="gecko",
spec="https://drafts.csswg.org/css-align/#justify-self-property", spec="https://drafts.csswg.org/css-align/#justify-self-property",
animation_value_type="discrete", animation_value_type="discrete",
)} )}
@ -223,6 +248,7 @@ ${helpers.predefined_type(
"order", "order",
"Integer", "Integer",
"0", "0",
engines="gecko servo-2013",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-flexbox/#order-property", spec="https://drafts.csswg.org/css-flexbox/#order-property",
@ -233,6 +259,7 @@ ${helpers.predefined_type(
"flex-basis", "flex-basis",
"FlexBasis", "FlexBasis",
"computed::FlexBasis::auto()", "computed::FlexBasis::auto()",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property", spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="FlexBasis", animation_value_type="FlexBasis",
@ -251,6 +278,8 @@ ${helpers.predefined_type(
size, size,
"Size", "Size",
"computed::Size::auto()", "computed::Size::auto()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
logical=logical, logical=logical,
logical_group="size", logical_group="size",
allow_quirks="No" if logical else "Yes", allow_quirks="No" if logical else "Yes",
@ -264,6 +293,8 @@ ${helpers.predefined_type(
"min-%s" % size, "min-%s" % size,
"Size", "Size",
"computed::Size::auto()", "computed::Size::auto()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
logical=logical, logical=logical,
logical_group="min-size", logical_group="min-size",
allow_quirks="No" if logical else "Yes", allow_quirks="No" if logical else "Yes",
@ -275,6 +306,8 @@ ${helpers.predefined_type(
"max-%s" % size, "max-%s" % size,
"MaxSize", "MaxSize",
"computed::MaxSize::none()", "computed::MaxSize::none()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
logical=logical, logical=logical,
logical_group="max-size", logical_group="max-size",
allow_quirks="No" if logical else "Yes", allow_quirks="No" if logical else "Yes",
@ -287,6 +320,8 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"box-sizing", "box-sizing",
"content-box border-box", "content-box border-box",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
extra_prefixes="moz:layout.css.prefixes.box-sizing webkit", extra_prefixes="moz:layout.css.prefixes.box-sizing webkit",
spec="https://drafts.csswg.org/css-ui/#propdef-box-sizing", spec="https://drafts.csswg.org/css-ui/#propdef-box-sizing",
gecko_enum_prefix="StyleBoxSizing", gecko_enum_prefix="StyleBoxSizing",
@ -298,7 +333,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"object-fit", "object-fit",
"fill contain cover none scale-down", "fill contain cover none scale-down",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-images/#propdef-object-fit", spec="https://drafts.csswg.org/css-images/#propdef-object-fit",
)} )}
@ -307,7 +342,7 @@ ${helpers.predefined_type(
"object-position", "object-position",
"Position", "Position",
"computed::Position::zero()", "computed::Position::zero()",
products="gecko", engines="gecko",
boxed=True, boxed=True,
spec="https://drafts.csswg.org/css-images-3/#the-object-position", spec="https://drafts.csswg.org/css-images-3/#the-object-position",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
@ -319,9 +354,9 @@ ${helpers.predefined_type(
"grid-%s-%s" % (kind, range), "grid-%s-%s" % (kind, range),
"GridLine", "GridLine",
"Default::default()", "Default::default()",
engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-%s-%s" % (kind, range), spec="https://drafts.csswg.org/css-grid/#propdef-grid-%s-%s" % (kind, range),
products="gecko",
)} )}
% endfor % endfor
@ -331,9 +366,9 @@ ${helpers.predefined_type(
"grid-auto-%ss" % kind, "grid-auto-%ss" % kind,
"TrackSize", "TrackSize",
"Default::default()", "Default::default()",
engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-%ss" % kind, spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-%ss" % kind,
products="gecko",
boxed=True, boxed=True,
)} )}
@ -341,7 +376,7 @@ ${helpers.predefined_type(
"grid-template-%ss" % kind, "grid-template-%ss" % kind,
"GridTemplateComponent", "GridTemplateComponent",
"specified::GenericGridTemplateComponent::None", "specified::GenericGridTemplateComponent::None",
products="gecko", engines="gecko",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-%ss" % kind, spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-%ss" % kind,
boxed=True, boxed=True,
flags="GETCS_NEEDS_LAYOUT_FLUSH", flags="GETCS_NEEDS_LAYOUT_FLUSH",
@ -354,7 +389,7 @@ ${helpers.predefined_type(
"grid-auto-flow", "grid-auto-flow",
"GridAutoFlow", "GridAutoFlow",
"computed::GridAutoFlow::row()", "computed::GridAutoFlow::row()",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-flow", spec="https://drafts.csswg.org/css-grid/#propdef-grid-auto-flow",
)} )}
@ -363,7 +398,7 @@ ${helpers.predefined_type(
"grid-template-areas", "grid-template-areas",
"GridTemplateAreas", "GridTemplateAreas",
"computed::GridTemplateAreas::none()", "computed::GridTemplateAreas::none()",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-areas", spec="https://drafts.csswg.org/css-grid/#propdef-grid-template-areas",
)} )}
@ -372,9 +407,10 @@ ${helpers.predefined_type(
"column-gap", "column-gap",
"length::NonNegativeLengthPercentageOrNormal", "length::NonNegativeLengthPercentageOrNormal",
"computed::length::NonNegativeLengthPercentageOrNormal::normal()", "computed::length::NonNegativeLengthPercentageOrNormal::normal()",
alias="grid-column-gap" if product == "gecko" else "", engines="gecko servo-2013",
alias="grid-column-gap" if engine == "gecko" else "",
extra_prefixes="moz", extra_prefixes="moz",
servo_pref="layout.columns.enabled", servo_2013_pref="layout.columns.enabled",
spec="https://drafts.csswg.org/css-align-3/#propdef-column-gap", spec="https://drafts.csswg.org/css-align-3/#propdef-column-gap",
animation_value_type="NonNegativeLengthPercentageOrNormal", animation_value_type="NonNegativeLengthPercentageOrNormal",
servo_restyle_damage="reflow", servo_restyle_damage="reflow",
@ -385,8 +421,8 @@ ${helpers.predefined_type(
"row-gap", "row-gap",
"length::NonNegativeLengthPercentageOrNormal", "length::NonNegativeLengthPercentageOrNormal",
"computed::length::NonNegativeLengthPercentageOrNormal::normal()", "computed::length::NonNegativeLengthPercentageOrNormal::normal()",
engines="gecko",
alias="grid-row-gap", alias="grid-row-gap",
products="gecko",
spec="https://drafts.csswg.org/css-align-3/#propdef-row-gap", spec="https://drafts.csswg.org/css-align-3/#propdef-row-gap",
animation_value_type="NonNegativeLengthPercentageOrNormal", animation_value_type="NonNegativeLengthPercentageOrNormal",
servo_restyle_damage="reflow", servo_restyle_damage="reflow",
@ -400,6 +436,7 @@ ${helpers.predefined_type(
"aspect-ratio", "aspect-ratio",
"Number", "Number",
"computed::Number::zero()", "computed::Number::zero()",
engines="gecko servo-2013",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="Internal, for now", spec="Internal, for now",
enabled_in="", enabled_in="",

View file

@ -9,7 +9,7 @@
${helpers.single_keyword( ${helpers.single_keyword(
"vector-effect", "vector-effect",
"none non-scaling-stroke", "none non-scaling-stroke",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVGTiny12/painting.html#VectorEffectProperty", spec="https://www.w3.org/TR/SVGTiny12/painting.html#VectorEffectProperty",
)} )}
@ -20,7 +20,7 @@ ${helpers.predefined_type(
"stop-color", "stop-color",
"Color", "Color",
"RGBA::new(0, 0, 0, 255).into()", "RGBA::new(0, 0, 0, 255).into()",
products="gecko", engines="gecko",
animation_value_type="AnimatedRGBA", animation_value_type="AnimatedRGBA",
spec="https://www.w3.org/TR/SVGTiny12/painting.html#StopColorProperty", spec="https://www.w3.org/TR/SVGTiny12/painting.html#StopColorProperty",
)} )}
@ -29,7 +29,7 @@ ${helpers.predefined_type(
"stop-opacity", "stop-opacity",
"Opacity", "Opacity",
"1.0", "1.0",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty", spec="https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty",
)} )}
@ -40,7 +40,7 @@ ${helpers.predefined_type(
"flood-color", "flood-color",
"Color", "Color",
"RGBA::new(0, 0, 0, 255).into()", "RGBA::new(0, 0, 0, 255).into()",
products="gecko", engines="gecko",
animation_value_type="AnimatedColor", animation_value_type="AnimatedColor",
spec="https://www.w3.org/TR/SVG/filters.html#FloodColorProperty", spec="https://www.w3.org/TR/SVG/filters.html#FloodColorProperty",
)} )}
@ -49,7 +49,7 @@ ${helpers.predefined_type(
"flood-opacity", "flood-opacity",
"Opacity", "Opacity",
"1.0", "1.0",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.fxtf.org/filter-effects/#FloodOpacityProperty", spec="https://drafts.fxtf.org/filter-effects/#FloodOpacityProperty",
)} )}
@ -58,7 +58,7 @@ ${helpers.predefined_type(
"lighting-color", "lighting-color",
"Color", "Color",
"RGBA::new(255, 255, 255, 255).into()", "RGBA::new(255, 255, 255, 255).into()",
products="gecko", engines="gecko",
animation_value_type="AnimatedColor", animation_value_type="AnimatedColor",
spec="https://www.w3.org/TR/SVG/filters.html#LightingColorProperty", spec="https://www.w3.org/TR/SVG/filters.html#LightingColorProperty",
)} )}
@ -68,7 +68,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"mask-type", "mask-type",
"luminance alpha", "luminance alpha",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-type", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-type",
)} )}
@ -77,7 +77,7 @@ ${helpers.predefined_type(
"clip-path", "clip-path",
"basic_shape::ClippingShape", "basic_shape::ClippingShape",
"generics::basic_shape::ShapeSource::None", "generics::basic_shape::ShapeSource::None",
products="gecko", engines="gecko",
animation_value_type="basic_shape::ClippingShape", animation_value_type="basic_shape::ClippingShape",
flags="CREATES_STACKING_CONTEXT", flags="CREATES_STACKING_CONTEXT",
spec="https://drafts.fxtf.org/css-masking/#propdef-clip-path", spec="https://drafts.fxtf.org/css-masking/#propdef-clip-path",
@ -86,9 +86,9 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"mask-mode", "mask-mode",
"match-source alpha luminance", "match-source alpha luminance",
engines="gecko",
gecko_enum_prefix="StyleMaskMode", gecko_enum_prefix="StyleMaskMode",
vector=True, vector=True,
products="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-mode", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-mode",
)} )}
@ -97,8 +97,8 @@ ${helpers.predefined_type(
"mask-repeat", "mask-repeat",
"BackgroundRepeat", "BackgroundRepeat",
"computed::BackgroundRepeat::repeat()", "computed::BackgroundRepeat::repeat()",
engines="gecko",
initial_specified_value="specified::BackgroundRepeat::repeat()", initial_specified_value="specified::BackgroundRepeat::repeat()",
products="gecko",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-repeat", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-repeat",
@ -110,7 +110,7 @@ ${helpers.predefined_type(
"mask-position-" + axis, "mask-position-" + axis,
"position::" + direction + "Position", "position::" + direction + "Position",
"computed::LengthPercentage::zero()", "computed::LengthPercentage::zero()",
products="gecko", engines="gecko",
extra_prefixes="webkit", extra_prefixes="webkit",
initial_specified_value="specified::PositionComponent::Center", initial_specified_value="specified::PositionComponent::Center",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-position", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-position",
@ -123,9 +123,9 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"mask-clip", "mask-clip",
"border-box content-box padding-box", "border-box content-box padding-box",
engines="gecko",
extra_gecko_values="fill-box stroke-box view-box no-clip", extra_gecko_values="fill-box stroke-box view-box no-clip",
vector=True, vector=True,
products="gecko",
extra_prefixes="webkit", extra_prefixes="webkit",
gecko_enum_prefix="StyleGeometryBox", gecko_enum_prefix="StyleGeometryBox",
gecko_inexhaustive=True, gecko_inexhaustive=True,
@ -136,9 +136,9 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"mask-origin", "mask-origin",
"border-box content-box padding-box", "border-box content-box padding-box",
engines="gecko",
extra_gecko_values="fill-box stroke-box view-box", extra_gecko_values="fill-box stroke-box view-box",
vector=True, vector=True,
products="gecko",
extra_prefixes="webkit", extra_prefixes="webkit",
gecko_enum_prefix="StyleGeometryBox", gecko_enum_prefix="StyleGeometryBox",
gecko_inexhaustive=True, gecko_inexhaustive=True,
@ -150,8 +150,8 @@ ${helpers.predefined_type(
"mask-size", "mask-size",
"background::BackgroundSize", "background::BackgroundSize",
"computed::BackgroundSize::auto()", "computed::BackgroundSize::auto()",
engines="gecko",
initial_specified_value="specified::BackgroundSize::auto()", initial_specified_value="specified::BackgroundSize::auto()",
products="gecko",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-size", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-size",
animation_value_type="MaskSizeList", animation_value_type="MaskSizeList",
@ -162,8 +162,8 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"mask-composite", "mask-composite",
"add subtract intersect exclude", "add subtract intersect exclude",
engines="gecko",
vector=True, vector=True,
products="gecko",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-composite", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-composite",
@ -172,12 +172,12 @@ ${helpers.single_keyword(
${helpers.predefined_type( ${helpers.predefined_type(
"mask-image", "mask-image",
"ImageLayer", "ImageLayer",
engines="gecko",
initial_value="computed::ImageLayer::none()", initial_value="computed::ImageLayer::none()",
initial_specified_value="specified::ImageLayer::none()", initial_specified_value="specified::ImageLayer::none()",
parse_method="parse_with_cors_anonymous", parse_method="parse_with_cors_anonymous",
spec="https://drafts.fxtf.org/css-masking/#propdef-mask-image", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-image",
vector=True, vector=True,
products="gecko",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete", animation_value_type="discrete",
flags="CREATES_STACKING_CONTEXT", flags="CREATES_STACKING_CONTEXT",
@ -187,7 +187,7 @@ ${helpers.predefined_type(
"x", "x",
"LengthPercentage", "LengthPercentage",
"computed::LengthPercentage::zero()", "computed::LengthPercentage::zero()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://svgwg.org/svg2-draft/geometry.html#X", spec="https://svgwg.org/svg2-draft/geometry.html#X",
)} )}
@ -196,7 +196,7 @@ ${helpers.predefined_type(
"y", "y",
"LengthPercentage", "LengthPercentage",
"computed::LengthPercentage::zero()", "computed::LengthPercentage::zero()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://svgwg.org/svg2-draft/geometry.html#Y", spec="https://svgwg.org/svg2-draft/geometry.html#Y",
)} )}
@ -205,7 +205,7 @@ ${helpers.predefined_type(
"cx", "cx",
"LengthPercentage", "LengthPercentage",
"computed::LengthPercentage::zero()", "computed::LengthPercentage::zero()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://svgwg.org/svg2-draft/geometry.html#CX", spec="https://svgwg.org/svg2-draft/geometry.html#CX",
)} )}
@ -214,7 +214,7 @@ ${helpers.predefined_type(
"cy", "cy",
"LengthPercentage", "LengthPercentage",
"computed::LengthPercentage::zero()", "computed::LengthPercentage::zero()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://svgwg.org/svg2-draft/geometry.html#CY", spec="https://svgwg.org/svg2-draft/geometry.html#CY",
)} )}
@ -223,7 +223,7 @@ ${helpers.predefined_type(
"rx", "rx",
"NonNegativeLengthPercentageOrAuto", "NonNegativeLengthPercentageOrAuto",
"computed::NonNegativeLengthPercentageOrAuto::auto()", "computed::NonNegativeLengthPercentageOrAuto::auto()",
products="gecko", engines="gecko",
animation_value_type="LengthPercentageOrAuto", animation_value_type="LengthPercentageOrAuto",
spec="https://svgwg.org/svg2-draft/geometry.html#RX", spec="https://svgwg.org/svg2-draft/geometry.html#RX",
)} )}
@ -232,7 +232,7 @@ ${helpers.predefined_type(
"ry", "ry",
"NonNegativeLengthPercentageOrAuto", "NonNegativeLengthPercentageOrAuto",
"computed::NonNegativeLengthPercentageOrAuto::auto()", "computed::NonNegativeLengthPercentageOrAuto::auto()",
products="gecko", engines="gecko",
animation_value_type="LengthPercentageOrAuto", animation_value_type="LengthPercentageOrAuto",
spec="https://svgwg.org/svg2-draft/geometry.html#RY", spec="https://svgwg.org/svg2-draft/geometry.html#RY",
)} )}
@ -241,7 +241,7 @@ ${helpers.predefined_type(
"r", "r",
"NonNegativeLengthPercentage", "NonNegativeLengthPercentage",
"computed::NonNegativeLengthPercentage::zero()", "computed::NonNegativeLengthPercentage::zero()",
products="gecko", engines="gecko",
animation_value_type="LengthPercentage", animation_value_type="LengthPercentage",
spec="https://svgwg.org/svg2-draft/geometry.html#R", spec="https://svgwg.org/svg2-draft/geometry.html#R",
)} )}

View file

@ -9,6 +9,7 @@
${helpers.single_keyword( ${helpers.single_keyword(
"table-layout", "table-layout",
"auto fixed", "auto fixed",
engines="gecko servo-2013",
gecko_ffi_name="mLayoutStrategy", gecko_ffi_name="mLayoutStrategy",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-table-layout", spec="https://drafts.csswg.org/css-tables/#propdef-table-layout",
@ -19,7 +20,7 @@ ${helpers.predefined_type(
"-x-span", "-x-span",
"XSpan", "XSpan",
"computed::XSpan(1)", "computed::XSpan(1)",
products="gecko", engines="gecko",
spec="Internal-only (for `<col span>` pres attr)", spec="Internal-only (for `<col span>` pres attr)",
animation_value_type="none", animation_value_type="none",
enabled_in="", enabled_in="",

View file

@ -11,6 +11,7 @@ ${helpers.predefined_type(
"text-overflow", "text-overflow",
"TextOverflow", "TextOverflow",
"computed::TextOverflow::get_initial_value()", "computed::TextOverflow::get_initial_value()",
engines="gecko servo-2013",
animation_value_type="discrete", animation_value_type="discrete",
boxed=True, boxed=True,
spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow", spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow",
@ -20,6 +21,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"unicode-bidi", "unicode-bidi",
"normal embed isolate bidi-override isolate-override plaintext", "normal embed isolate bidi-override isolate-override plaintext",
engines="gecko servo-2013",
animation_value_type="none", animation_value_type="none",
spec="https://drafts.csswg.org/css-writing-modes/#propdef-unicode-bidi", spec="https://drafts.csswg.org/css-writing-modes/#propdef-unicode-bidi",
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
@ -29,6 +31,8 @@ ${helpers.predefined_type(
"text-decoration-line", "text-decoration-line",
"TextDecorationLine", "TextDecorationLine",
"specified::TextDecorationLine::none()", "specified::TextDecorationLine::none()",
engines="gecko servo-2013 servo-2020",
servo_2020_pref="layout.2020.unimplemented",
initial_specified_value="specified::TextDecorationLine::none()", initial_specified_value="specified::TextDecorationLine::none()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line",
@ -38,7 +42,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"text-decoration-style", "text-decoration-style",
"solid double dotted dashed wavy -moz-none", "solid double dotted dashed wavy -moz-none",
products="gecko", engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-style", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-style",
)} )}
@ -47,8 +51,8 @@ ${helpers.predefined_type(
"text-decoration-color", "text-decoration-color",
"Color", "Color",
"computed_value::T::currentcolor()", "computed_value::T::currentcolor()",
engines="gecko",
initial_specified_value="specified::Color::currentcolor()", initial_specified_value="specified::Color::currentcolor()",
products="gecko",
animation_value_type="AnimatedColor", animation_value_type="AnimatedColor",
ignored_when_colors_disabled=True, ignored_when_colors_disabled=True,
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-color", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-color",
@ -58,9 +62,9 @@ ${helpers.predefined_type(
"initial-letter", "initial-letter",
"InitialLetter", "InitialLetter",
"computed::InitialLetter::normal()", "computed::InitialLetter::normal()",
engines="gecko",
initial_specified_value="specified::InitialLetter::normal()", initial_specified_value="specified::InitialLetter::normal()",
animation_value_type="discrete", animation_value_type="discrete",
products="gecko",
gecko_pref="layout.css.initial-letter.enabled", gecko_pref="layout.css.initial-letter.enabled",
spec="https://drafts.csswg.org/css-inline/#sizing-drop-initials", spec="https://drafts.csswg.org/css-inline/#sizing-drop-initials",
)} )}
@ -69,7 +73,7 @@ ${helpers.predefined_type(
"text-decoration-thickness", "text-decoration-thickness",
"LengthOrAuto", "LengthOrAuto",
"computed::LengthOrAuto::auto()", "computed::LengthOrAuto::auto()",
products="gecko", engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
gecko_pref="layout.css.text-decoration-thickness.enabled", gecko_pref="layout.css.text-decoration-thickness.enabled",
spec="https://drafts.csswg.org/css-text-decor-4/#text-decoration-width-property" spec="https://drafts.csswg.org/css-text-decor-4/#text-decoration-width-property"

View file

@ -14,7 +14,7 @@
${helpers.single_keyword( ${helpers.single_keyword(
"ime-mode", "ime-mode",
"auto normal active disabled inactive", "auto normal active disabled inactive",
products="gecko", engines="gecko",
gecko_ffi_name="mIMEMode", gecko_ffi_name="mIMEMode",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-ui/#input-method-editor", spec="https://drafts.csswg.org/css-ui/#input-method-editor",
@ -23,7 +23,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"scrollbar-width", "scrollbar-width",
"auto thin none", "auto thin none",
products="gecko", engines="gecko",
gecko_enum_prefix="StyleScrollbarWidth", gecko_enum_prefix="StyleScrollbarWidth",
animation_value_type="discrete", animation_value_type="discrete",
gecko_pref="layout.css.scrollbar-width.enabled", gecko_pref="layout.css.scrollbar-width.enabled",
@ -35,7 +35,7 @@ ${helpers.predefined_type(
"user-select", "user-select",
"UserSelect", "UserSelect",
"computed::UserSelect::Auto", "computed::UserSelect::Auto",
products="gecko", engines="gecko",
extra_prefixes="moz webkit", extra_prefixes="moz webkit",
animation_value_type="discrete", animation_value_type="discrete",
needs_context=False, needs_context=False,
@ -46,7 +46,7 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-window-dragging", "-moz-window-dragging",
"default drag no-drag", "default drag no-drag",
products="gecko", engines="gecko",
gecko_ffi_name="mWindowDragging", gecko_ffi_name="mWindowDragging",
gecko_enum_prefix="StyleWindowDragging", gecko_enum_prefix="StyleWindowDragging",
animation_value_type="discrete", animation_value_type="discrete",
@ -56,7 +56,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-window-shadow", "-moz-window-shadow",
"none default menu tooltip sheet", "none default menu tooltip sheet",
products="gecko", engines="gecko",
gecko_ffi_name="mWindowShadow", gecko_ffi_name="mWindowShadow",
gecko_constant_prefix="NS_STYLE_WINDOW_SHADOW", gecko_constant_prefix="NS_STYLE_WINDOW_SHADOW",
animation_value_type="discrete", animation_value_type="discrete",
@ -68,7 +68,7 @@ ${helpers.predefined_type(
"-moz-window-opacity", "-moz-window-opacity",
"Opacity", "Opacity",
"1.0", "1.0",
products="gecko", engines="gecko",
gecko_ffi_name="mWindowOpacity", gecko_ffi_name="mWindowOpacity",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="None (Nonstandard internal property)", spec="None (Nonstandard internal property)",
@ -79,7 +79,7 @@ ${helpers.predefined_type(
"-moz-window-transform", "-moz-window-transform",
"Transform", "Transform",
"generics::transform::Transform::none()", "generics::transform::Transform::none()",
products="gecko", engines="gecko",
flags="GETCS_NEEDS_LAYOUT_FLUSH", flags="GETCS_NEEDS_LAYOUT_FLUSH",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="None (Nonstandard internal property)", spec="None (Nonstandard internal property)",
@ -90,9 +90,9 @@ ${helpers.predefined_type(
"-moz-window-transform-origin", "-moz-window-transform-origin",
"TransformOrigin", "TransformOrigin",
"computed::TransformOrigin::initial_value()", "computed::TransformOrigin::initial_value()",
engines="gecko",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
gecko_ffi_name="mWindowTransformOrigin", gecko_ffi_name="mWindowTransformOrigin",
products="gecko",
boxed=True, boxed=True,
flags="GETCS_NEEDS_LAYOUT_FLUSH", flags="GETCS_NEEDS_LAYOUT_FLUSH",
spec="None (Nonstandard internal property)", spec="None (Nonstandard internal property)",
@ -104,7 +104,7 @@ ${helpers.predefined_type(
"-moz-force-broken-image-icon", "-moz-force-broken-image-icon",
"MozForceBrokenImageIcon", "MozForceBrokenImageIcon",
"computed::MozForceBrokenImageIcon::false_value()", "computed::MozForceBrokenImageIcon::false_value()",
engines="gecko",
animation_value_type="discrete", animation_value_type="discrete",
products="gecko",
spec="None (Nonstandard Firefox-only property)", spec="None (Nonstandard Firefox-only property)",
)} )}

View file

@ -11,7 +11,7 @@
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-box-align", "-moz-box-align",
"stretch start center baseline end", "stretch start center baseline end",
products="gecko", engines="gecko",
gecko_ffi_name="mBoxAlign", gecko_ffi_name="mBoxAlign",
gecko_enum_prefix="StyleBoxAlign", gecko_enum_prefix="StyleBoxAlign",
animation_value_type="discrete", animation_value_type="discrete",
@ -22,7 +22,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-box-direction", "-moz-box-direction",
"normal reverse", "normal reverse",
products="gecko", engines="gecko",
gecko_ffi_name="mBoxDirection", gecko_ffi_name="mBoxDirection",
gecko_enum_prefix="StyleBoxDirection", gecko_enum_prefix="StyleBoxDirection",
animation_value_type="discrete", animation_value_type="discrete",
@ -34,7 +34,7 @@ ${helpers.predefined_type(
"-moz-box-flex", "-moz-box-flex",
"NonNegativeNumber", "NonNegativeNumber",
"From::from(0.)", "From::from(0.)",
products="gecko", engines="gecko",
gecko_ffi_name="mBoxFlex", gecko_ffi_name="mBoxFlex",
animation_value_type="NonNegativeNumber", animation_value_type="NonNegativeNumber",
alias="-webkit-box-flex", alias="-webkit-box-flex",
@ -44,9 +44,9 @@ ${helpers.predefined_type(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-box-orient", "-moz-box-orient",
"horizontal vertical", "horizontal vertical",
products="gecko", engines="gecko",
gecko_ffi_name="mBoxOrient", gecko_ffi_name="mBoxOrient",
extra_gecko_aliases="inline-axis=horizontal block-axis=vertical", gecko_aliases="inline-axis=horizontal block-axis=vertical",
gecko_enum_prefix="StyleBoxOrient", gecko_enum_prefix="StyleBoxOrient",
animation_value_type="discrete", animation_value_type="discrete",
alias="-webkit-box-orient", alias="-webkit-box-orient",
@ -56,7 +56,8 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-box-pack", "-moz-box-pack",
"start center end justify", "start center end justify",
products="gecko", gecko_ffi_name="mBoxPack", engines="gecko",
gecko_ffi_name="mBoxPack",
gecko_enum_prefix="StyleBoxPack", gecko_enum_prefix="StyleBoxPack",
animation_value_type="discrete", animation_value_type="discrete",
alias="-webkit-box-pack", alias="-webkit-box-pack",
@ -66,7 +67,7 @@ ${helpers.single_keyword(
${helpers.single_keyword( ${helpers.single_keyword(
"-moz-stack-sizing", "-moz-stack-sizing",
"stretch-to-fit ignore ignore-horizontal ignore-vertical", "stretch-to-fit ignore ignore-horizontal ignore-vertical",
products="gecko", engines="gecko",
gecko_ffi_name="mStackSizing", gecko_ffi_name="mStackSizing",
gecko_enum_prefix="StyleStackSizing", gecko_enum_prefix="StyleStackSizing",
animation_value_type="discrete", animation_value_type="discrete",
@ -77,8 +78,8 @@ ${helpers.predefined_type(
"-moz-box-ordinal-group", "-moz-box-ordinal-group",
"Integer", "Integer",
"0", "0",
engines="gecko",
parse_method="parse_non_negative", parse_method="parse_non_negative",
products="gecko",
alias="-webkit-box-ordinal-group", alias="-webkit-box-ordinal-group",
gecko_ffi_name="mBoxOrdinal", gecko_ffi_name="mBoxOrdinal",
animation_value_type="discrete", animation_value_type="discrete",

View file

@ -3,38 +3,29 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc"> <title>Supported CSS properties in Servo</title>
<meta name="description" content="API documentation for the Rust `servo` crate."> <link rel="stylesheet" type="text/css" href="../normalize.css">
<meta name="keywords" content="rust, rustlang, rust-lang, servo">
<title>Supported CSS properties - servo - Rust</title>
<link rel="stylesheet" type="text/css" href="../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css"> <link rel="stylesheet" type="text/css" href="../light.css">
</head> </head>
<body class="rustdoc"> <body class="rustdoc">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<section id='main' class="content mod"> <section id='main' class="content mod">
<h1 class='fqn'><span class='in-band'>CSS properties currently supported in <a class='mod' href=''>Servo</a></span></h1> <h1 class='fqn'><span class='in-band'>CSS properties currently supported in Servo</span></h1>
<div id='properties' class='docblock'> % for kind, props in sorted(properties.items()):
<h2>${kind.capitalize()}</h2>
<table> <table>
<tr> <tr>
<th>Property</th> <th>Name</th>
<th>Flag</th> <th>Pref</th>
<th>Shorthand</th>
</tr> </tr>
% for prop in properties: % for name, data in sorted(props.items()):
<tr> <tr>
<td>${prop}</td> <td><code>${name}</code></td>
<td>${properties[prop]['flag']}</td> <td><code>${data['pref'] or ''}</code></td>
<td>${properties[prop]['shorthand']}</td>
</tr> </tr>
% endfor % endfor
</table> </table>
</div> % endfor
</section> </section>
</body> </body>
</html> </html>

View file

@ -167,7 +167,7 @@ pub mod shorthands {
for p in data.longhands: for p in data.longhands:
if p.name in ['direction', 'unicode-bidi']: if p.name in ['direction', 'unicode-bidi']:
continue; continue;
if not p.enabled_in_content() and not p.experimental(product): if not p.enabled_in_content() and not p.experimental(engine):
continue; continue;
if p.logical: if p.logical:
logical_longhands.append(p.name) logical_longhands.append(p.name)
@ -177,6 +177,7 @@ pub mod shorthands {
data.declare_shorthand( data.declare_shorthand(
"all", "all",
logical_longhands + other_longhands, logical_longhands + other_longhands,
engines="gecko servo-2013 servo-2020",
spec="https://drafts.csswg.org/css-cascade-3/#all-shorthand" spec="https://drafts.csswg.org/css-cascade-3/#all-shorthand"
) )
%> %>
@ -426,7 +427,7 @@ pub struct NonCustomPropertyId(usize);
pub const NON_CUSTOM_PROPERTY_ID_COUNT: usize = pub const NON_CUSTOM_PROPERTY_ID_COUNT: usize =
${len(data.longhands) + len(data.shorthands) + len(data.all_aliases())}; ${len(data.longhands) + len(data.shorthands) + len(data.all_aliases())};
% if product == "gecko": % if engine == "gecko":
#[allow(dead_code)] #[allow(dead_code)]
unsafe fn static_assert_nscsspropertyid() { unsafe fn static_assert_nscsspropertyid() {
% for i, property in enumerate(data.longhands + data.shorthands + data.all_aliases()): % for i, property in enumerate(data.longhands + data.shorthands + data.all_aliases()):
@ -492,20 +493,26 @@ impl NonCustomPropertyId {
fn enabled_for_all_content(self) -> bool { fn enabled_for_all_content(self) -> bool {
${static_non_custom_property_id_set( ${static_non_custom_property_id_set(
"EXPERIMENTAL", "EXPERIMENTAL",
lambda p: p.experimental(product) lambda p: p.experimental(engine)
)} )}
${static_non_custom_property_id_set( ${static_non_custom_property_id_set(
"ALWAYS_ENABLED", "ALWAYS_ENABLED",
lambda p: (not p.experimental(product)) and p.enabled_in_content() lambda p: (not p.experimental(engine)) and p.enabled_in_content()
)} )}
let passes_pref_check = || { let passes_pref_check = || {
% if product == "servo": % if engine == "gecko":
unsafe { structs::nsCSSProps_gPropertyEnabled[self.0] }
% else:
static PREF_NAME: [Option< &str>; ${len(data.longhands) + len(data.shorthands)}] = [ static PREF_NAME: [Option< &str>; ${len(data.longhands) + len(data.shorthands)}] = [
% for property in data.longhands + data.shorthands: % for property in data.longhands + data.shorthands:
% if property.servo_pref: <%
Some("${property.servo_pref}"), attrs = {"servo-2013": "servo_2013_pref", "servo-2020": "servo_2020_pref"}
pref = getattr(property, attrs[engine])
%>
% if pref:
Some("${pref}"),
% else: % else:
None, None,
% endif % endif
@ -517,8 +524,6 @@ impl NonCustomPropertyId {
}; };
prefs::pref_map().get(pref).as_bool().unwrap_or(false) prefs::pref_map().get(pref).as_bool().unwrap_or(false)
% else:
unsafe { structs::nsCSSProps_gPropertyEnabled[self.0] }
% endif % endif
}; };
@ -1242,7 +1247,7 @@ impl LonghandId {
/// processing these properties. /// processing these properties.
fn is_visited_dependent(&self) -> bool { fn is_visited_dependent(&self) -> bool {
matches!(*self, matches!(*self,
% if product == "gecko": % if engine == "gecko":
LonghandId::ColumnRuleColor | LonghandId::ColumnRuleColor |
LonghandId::TextEmphasisColor | LonghandId::TextEmphasisColor |
LonghandId::WebkitTextFillColor | LonghandId::WebkitTextFillColor |
@ -1252,13 +1257,15 @@ impl LonghandId {
LonghandId::Stroke | LonghandId::Stroke |
LonghandId::CaretColor | LonghandId::CaretColor |
% endif % endif
LonghandId::Color | % if engine in ["gecko", "servo-2013"]:
LonghandId::BackgroundColor | LonghandId::BackgroundColor |
LonghandId::BorderTopColor | LonghandId::BorderTopColor |
LonghandId::BorderRightColor | LonghandId::BorderRightColor |
LonghandId::BorderBottomColor | LonghandId::BorderBottomColor |
LonghandId::BorderLeftColor | LonghandId::BorderLeftColor |
LonghandId::OutlineColor LonghandId::OutlineColor |
% endif
LonghandId::Color
) )
} }
@ -1279,7 +1286,7 @@ impl LonghandId {
/// correct. /// correct.
fn is_early_property(&self) -> bool { fn is_early_property(&self) -> bool {
matches!(*self, matches!(*self,
% if product == 'gecko': % if engine == "gecko":
// Needed to properly compute the writing mode, to resolve logical // Needed to properly compute the writing mode, to resolve logical
// properties, and similar stuff. In this block instead of along // properties, and similar stuff. In this block instead of along
@ -1305,12 +1312,14 @@ impl LonghandId {
LonghandId::MozScriptLevel | LonghandId::MozScriptLevel |
% endif % endif
% if engine in ["gecko", "servo-2013"]:
// Needed to compute the first available font, in order to // Needed to compute the first available font, in order to
// compute font-relative units correctly. // compute font-relative units correctly.
LonghandId::FontSize | LonghandId::FontSize |
LonghandId::FontWeight | LonghandId::FontWeight |
LonghandId::FontStretch | LonghandId::FontStretch |
LonghandId::FontStyle | LonghandId::FontStyle |
% endif
LonghandId::FontFamily | LonghandId::FontFamily |
// Needed to properly compute the writing mode, to resolve logical // Needed to properly compute the writing mode, to resolve logical
@ -2151,7 +2160,7 @@ impl PropertyDeclaration {
/// Returns whether or not the property is set by a system font /// Returns whether or not the property is set by a system font
pub fn get_system(&self) -> Option<SystemFont> { pub fn get_system(&self) -> Option<SystemFont> {
match *self { match *self {
% if product == "gecko": % if engine == "gecko":
% for prop in SYSTEM_FONT_LONGHANDS: % for prop in SYSTEM_FONT_LONGHANDS:
PropertyDeclaration::${to_camel_case(prop)}(ref prop) => { PropertyDeclaration::${to_camel_case(prop)}(ref prop) => {
prop.get_system() prop.get_system()
@ -2355,7 +2364,8 @@ impl PropertyDeclaration {
} }
type SubpropertiesArray<T> = type SubpropertiesArray<T> =
[T; ${max(len(s.sub_properties) for s in data.shorthands_except_all())}]; [T; ${max(len(s.sub_properties) for s in data.shorthands_except_all()) \
if data.shorthands_except_all() else 0}];
type SubpropertiesVec<T> = ArrayVec<SubpropertiesArray<T>>; type SubpropertiesVec<T> = ArrayVec<SubpropertiesArray<T>>;
@ -3181,7 +3191,7 @@ impl ComputedValuesInner {
} }
} }
% if product == "gecko": % if engine == "gecko":
pub use crate::servo_arc::RawOffsetArc as BuilderArc; pub use crate::servo_arc::RawOffsetArc as BuilderArc;
/// Clone an arc, returning a regular arc /// Clone an arc, returning a regular arc
fn clone_arc<T: 'static>(x: &BuilderArc<T>) -> Arc<T> { fn clone_arc<T: 'static>(x: &BuilderArc<T>) -> Arc<T> {
@ -3494,7 +3504,7 @@ impl<'a> StyleBuilder<'a> {
} }
% endif % endif
% if not property.is_vector or property.simple_vector_bindings or product != "gecko": % if not property.is_vector or property.simple_vector_bindings or engine in ["servo-2013", "servo-2020"]:
/// Set the `${property.ident}` to the computed value `value`. /// Set the `${property.ident}` to the computed value `value`.
#[allow(non_snake_case)] #[allow(non_snake_case)]
pub fn set_${property.ident}( pub fn set_${property.ident}(
@ -3882,7 +3892,7 @@ macro_rules! longhand_properties_idents {
} }
} }
% if product == "servo": % if engine in ["servo-2013", "servo-2020"]:
% for effect_name in ["repaint", "reflow_out_of_flow", "reflow", "rebuild_and_reflow_inline", "rebuild_and_reflow"]: % for effect_name in ["repaint", "reflow_out_of_flow", "reflow", "rebuild_and_reflow_inline", "rebuild_and_reflow"]:
macro_rules! restyle_damage_${effect_name} { macro_rules! restyle_damage_${effect_name} {
($old: ident, $new: ident, $damage: ident, [ $($effect:expr),* ]) => ({ ($old: ident, $new: ident, $damage: ident, [ $($effect:expr),* ]) => ({

View file

@ -6,6 +6,7 @@
// TODO: other background-* properties // TODO: other background-* properties
<%helpers:shorthand name="background" <%helpers:shorthand name="background"
engines="gecko servo-2013"
sub_properties="background-color background-position-x background-position-y background-repeat sub_properties="background-color background-position-x background-position-y background-repeat
background-attachment background-image background-size background-origin background-attachment background-image background-size background-origin
background-clip" background-clip"
@ -193,6 +194,7 @@
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="background-position" <%helpers:shorthand name="background-position"
engines="gecko servo-2013"
flags="SHORTHAND_IN_GETCS" flags="SHORTHAND_IN_GETCS"
sub_properties="background-position-x background-position-y" sub_properties="background-position-x background-position-y"
spec="https://drafts.csswg.org/css-backgrounds-4/#the-background-position"> spec="https://drafts.csswg.org/css-backgrounds-4/#the-background-position">

View file

@ -5,19 +5,28 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<% from data import to_rust_ident, ALL_SIDES, PHYSICAL_SIDES, maybe_moz_logical_alias %> <% from data import to_rust_ident, ALL_SIDES, PHYSICAL_SIDES, maybe_moz_logical_alias %>
${helpers.four_sides_shorthand("border-color", "border-%s-color", "specified::Color::parse", ${helpers.four_sides_shorthand(
"border-color",
"border-%s-color",
"specified::Color::parse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-backgrounds/#border-color", spec="https://drafts.csswg.org/css-backgrounds/#border-color",
allow_quirks="Yes")} allow_quirks="Yes",
)}
${helpers.four_sides_shorthand( ${helpers.four_sides_shorthand(
"border-style", "border-style",
"border-%s-style", "border-%s-style",
"specified::BorderStyle::parse", "specified::BorderStyle::parse",
engines="gecko servo-2013",
needs_context=False, needs_context=False,
spec="https://drafts.csswg.org/css-backgrounds/#border-style", spec="https://drafts.csswg.org/css-backgrounds/#border-style",
)} )}
<%helpers:shorthand name="border-width" sub_properties="${ <%helpers:shorthand
name="border-width"
engines="gecko servo-2013"
sub_properties="${
' '.join('border-%s-width' % side ' '.join('border-%s-width' % side
for side in PHYSICAL_SIDES)}" for side in PHYSICAL_SIDES)}"
spec="https://drafts.csswg.org/css-backgrounds/#border-width"> spec="https://drafts.csswg.org/css-backgrounds/#border-width">
@ -101,11 +110,13 @@ pub fn parse_border<'i, 't>(
%> %>
<%helpers:shorthand <%helpers:shorthand
name="border-${side}" name="border-${side}"
engines="gecko servo-2013 servo-2020"
servo_2020_pref="layout.2020.unimplemented"
sub_properties="${' '.join( sub_properties="${' '.join(
'border-%s-%s' % (side, prop) 'border-%s-%s' % (side, prop)
for prop in ['color', 'style', 'width'] for prop in ['color', 'style', 'width']
)}" )}"
alias="${maybe_moz_logical_alias(product, (side, logical), '-moz-border-%s')}" alias="${maybe_moz_logical_alias(engine, (side, logical), '-moz-border-%s')}"
spec="${spec}"> spec="${spec}">
pub fn parse_value<'i, 't>( pub fn parse_value<'i, 't>(
@ -135,6 +146,7 @@ pub fn parse_border<'i, 't>(
% endfor % endfor
<%helpers:shorthand name="border" <%helpers:shorthand name="border"
engines="gecko servo-2013"
sub_properties="${' '.join('border-%s-%s' % (side, prop) sub_properties="${' '.join('border-%s-%s' % (side, prop)
for side in PHYSICAL_SIDES for side in PHYSICAL_SIDES
for prop in ['color', 'style', 'width'])} for prop in ['color', 'style', 'width'])}
@ -216,10 +228,16 @@ pub fn parse_border<'i, 't>(
} }
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="border-radius" sub_properties="${' '.join( <%helpers:shorthand
name="border-radius"
engines="gecko servo-2013"
sub_properties="${' '.join(
'border-%s-radius' % (corner) 'border-%s-radius' % (corner)
for corner in ['top-left', 'top-right', 'bottom-right', 'bottom-left'] for corner in ['top-left', 'top-right', 'bottom-right', 'bottom-left']
)}" extra_prefixes="webkit" spec="https://drafts.csswg.org/css-backgrounds/#border-radius"> )}"
extra_prefixes="webkit"
spec="https://drafts.csswg.org/css-backgrounds/#border-radius"
>
use crate::values::generics::rect::Rect; use crate::values::generics::rect::Rect;
use crate::values::generics::border::BorderCornerRadius; use crate::values::generics::border::BorderCornerRadius;
use crate::values::specified::border::BorderRadius; use crate::values::specified::border::BorderRadius;
@ -256,10 +274,14 @@ pub fn parse_border<'i, 't>(
} }
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="border-image" sub_properties="border-image-outset <%helpers:shorthand
name="border-image"
engines="gecko servo-2013"
sub_properties="border-image-outset
border-image-repeat border-image-slice border-image-source border-image-width" border-image-repeat border-image-slice border-image-source border-image-width"
extra_prefixes="moz:layout.css.prefixes.border-image webkit" extra_prefixes="moz:layout.css.prefixes.border-image webkit"
spec="https://drafts.csswg.org/css-backgrounds-3/#border-image"> spec="https://drafts.csswg.org/css-backgrounds-3/#border-image"
>
use crate::properties::longhands::{border_image_outset, border_image_repeat, border_image_slice}; use crate::properties::longhands::{border_image_outset, border_image_repeat, border_image_slice};
use crate::properties::longhands::{border_image_source, border_image_width}; use crate::properties::longhands::{border_image_source, border_image_width};
@ -362,6 +384,7 @@ pub fn parse_border<'i, 't>(
spec = "https://drafts.csswg.org/css-logical/#propdef-border-%s-%s" % (axis, prop) spec = "https://drafts.csswg.org/css-logical/#propdef-border-%s-%s" % (axis, prop)
%> %>
<%helpers:shorthand <%helpers:shorthand
engines="gecko servo-2013"
name="border-${axis}-${prop}" name="border-${axis}-${prop}"
sub_properties="${' '.join( sub_properties="${' '.join(
'border-%s-%s-%s' % (axis, side, prop) 'border-%s-%s-%s' % (axis, side, prop)
@ -407,6 +430,7 @@ pub fn parse_border<'i, 't>(
%> %>
<%helpers:shorthand <%helpers:shorthand
name="border-${axis}" name="border-${axis}"
engines="gecko servo-2013"
sub_properties="${' '.join( sub_properties="${' '.join(
'border-%s-%s-width' % (axis, side) 'border-%s-%s-width' % (axis, side)
for side in ['start', 'end'] for side in ['start', 'end']

View file

@ -9,6 +9,7 @@ ${helpers.two_properties_shorthand(
"overflow-x", "overflow-x",
"overflow-y", "overflow-y",
"specified::Overflow::parse", "specified::Overflow::parse",
engines="gecko servo-2013",
flags="SHORTHAND_IN_GETCS", flags="SHORTHAND_IN_GETCS",
needs_context=False, needs_context=False,
spec="https://drafts.csswg.org/css-overflow/#propdef-overflow", spec="https://drafts.csswg.org/css-overflow/#propdef-overflow",
@ -19,14 +20,15 @@ ${helpers.two_properties_shorthand(
"overflow-clip-box-block", "overflow-clip-box-block",
"overflow-clip-box-inline", "overflow-clip-box-inline",
"specified::OverflowClipBox::parse", "specified::OverflowClipBox::parse",
engines="gecko",
enabled_in="ua", enabled_in="ua",
needs_context=False, needs_context=False,
gecko_pref="layout.css.overflow-clip-box.enabled", gecko_pref="layout.css.overflow-clip-box.enabled",
spec="Internal, may be standardized in the future " spec="Internal, may be standardized in the future "
"(https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-clip-box)", "(https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-clip-box)",
products="gecko",
)} )}
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
macro_rules! try_parse_one { macro_rules! try_parse_one {
($context: expr, $input: expr, $var: ident, $prop_module: ident) => { ($context: expr, $input: expr, $var: ident, $prop_module: ident) => {
if $var.is_none() { if $var.is_none() {
@ -41,6 +43,7 @@ macro_rules! try_parse_one {
} }
<%helpers:shorthand name="transition" <%helpers:shorthand name="transition"
engines="gecko servo-2013"
extra_prefixes="moz:layout.css.prefixes.transitions webkit" extra_prefixes="moz:layout.css.prefixes.transitions webkit"
sub_properties="transition-property transition-duration sub_properties="transition-property transition-duration
transition-timing-function transition-timing-function
@ -186,6 +189,7 @@ macro_rules! try_parse_one {
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="animation" <%helpers:shorthand name="animation"
engines="gecko servo-2013"
extra_prefixes="moz:layout.css.prefixes.animations webkit" extra_prefixes="moz:layout.css.prefixes.animations webkit"
sub_properties="animation-name animation-duration sub_properties="animation-name animation-duration
animation-timing-function animation-delay animation-timing-function animation-delay
@ -308,15 +312,15 @@ ${helpers.two_properties_shorthand(
"overscroll-behavior-x", "overscroll-behavior-x",
"overscroll-behavior-y", "overscroll-behavior-y",
"specified::OverscrollBehavior::parse", "specified::OverscrollBehavior::parse",
engines="gecko",
needs_context=False, needs_context=False,
products="gecko",
gecko_pref="layout.css.overscroll-behavior.enabled", gecko_pref="layout.css.overscroll-behavior.enabled",
spec="https://wicg.github.io/overscroll-behavior/#overscroll-behavior-properties", spec="https://wicg.github.io/overscroll-behavior/#overscroll-behavior-properties",
)} )}
<%helpers:shorthand <%helpers:shorthand
engines="gecko"
name="page-break-before" name="page-break-before"
products="gecko"
flags="SHORTHAND_IN_GETCS IS_LEGACY_SHORTHAND" flags="SHORTHAND_IN_GETCS IS_LEGACY_SHORTHAND"
sub_properties="break-before" sub_properties="break-before"
spec="https://drafts.csswg.org/css2/page.html#propdef-page-break-before" spec="https://drafts.csswg.org/css2/page.html#propdef-page-break-before"
@ -339,8 +343,8 @@ ${helpers.two_properties_shorthand(
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand <%helpers:shorthand
engines="gecko"
name="page-break-after" name="page-break-after"
products="gecko"
flags="SHORTHAND_IN_GETCS IS_LEGACY_SHORTHAND" flags="SHORTHAND_IN_GETCS IS_LEGACY_SHORTHAND"
sub_properties="break-after" sub_properties="break-after"
spec="https://drafts.csswg.org/css2/page.html#propdef-page-break-after" spec="https://drafts.csswg.org/css2/page.html#propdef-page-break-after"

View file

@ -5,8 +5,9 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="columns" <%helpers:shorthand name="columns"
engines="gecko servo-2013"
sub_properties="column-width column-count" sub_properties="column-width column-count"
servo_pref="layout.columns.enabled", servo_2013_pref="layout.columns.enabled",
derive_serialize="True" derive_serialize="True"
extra_prefixes="moz" spec="https://drafts.csswg.org/css-multicol/#propdef-columns"> extra_prefixes="moz" spec="https://drafts.csswg.org/css-multicol/#propdef-columns">
use crate::properties::longhands::{column_count, column_width}; use crate::properties::longhands::{column_count, column_width};
@ -55,10 +56,14 @@
} }
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="column-rule" products="gecko" extra_prefixes="moz" <%helpers:shorthand
name="column-rule"
engines="gecko"
extra_prefixes="moz"
sub_properties="column-rule-width column-rule-style column-rule-color" sub_properties="column-rule-width column-rule-style column-rule-color"
derive_serialize="True" derive_serialize="True"
spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule"> spec="https://drafts.csswg.org/css-multicol/#propdef-column-rule"
>
use crate::properties::longhands::{column_rule_width, column_rule_style}; use crate::properties::longhands::{column_rule_width, column_rule_style};
use crate::properties::longhands::column_rule_color; use crate::properties::longhands::column_rule_color;

View file

@ -5,22 +5,33 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<% from data import SYSTEM_FONT_LONGHANDS %> <% from data import SYSTEM_FONT_LONGHANDS %>
<%helpers:shorthand name="font" <%helpers:shorthand
sub_properties="font-style font-variant-caps font-weight font-stretch name="font"
font-size line-height font-family engines="gecko servo-2013 servo-2020"
${'font-size-adjust' if product == 'gecko' else ''} servo_2020_pref="layout.2020.unimplemented"
${'font-kerning' if product == 'gecko' else ''} sub_properties="
${'font-optical-sizing' if product == 'gecko' else ''} font-style
${'font-variant-alternates' if product == 'gecko' else ''} font-variant-caps
${'font-variant-east-asian' if product == 'gecko' else ''} font-weight
${'font-variant-ligatures' if product == 'gecko' else ''} font-stretch
${'font-variant-numeric' if product == 'gecko' else ''} font-size
${'font-variant-position' if product == 'gecko' else ''} line-height
${'font-language-override' if product == 'gecko' else ''} font-family
${'font-feature-settings' if product == 'gecko' else ''} ${'font-size-adjust' if engine == 'gecko' else ''}
${'font-variation-settings' if product == 'gecko' else ''}" ${'font-kerning' if engine == 'gecko' else ''}
${'font-optical-sizing' if engine == 'gecko' else ''}
${'font-variant-alternates' if engine == 'gecko' else ''}
${'font-variant-east-asian' if engine == 'gecko' else ''}
${'font-variant-ligatures' if engine == 'gecko' else ''}
${'font-variant-numeric' if engine == 'gecko' else ''}
${'font-variant-position' if engine == 'gecko' else ''}
${'font-language-override' if engine == 'gecko' else ''}
${'font-feature-settings' if engine == 'gecko' else ''}
${'font-variation-settings' if engine == 'gecko' else ''}
"
derive_value_info="False" derive_value_info="False"
spec="https://drafts.csswg.org/css-fonts-3/#propdef-font"> spec="https://drafts.csswg.org/css-fonts-3/#propdef-font"
>
use crate::parser::Parse; use crate::parser::Parse;
use crate::properties::longhands::{font_family, font_style, font_weight, font_stretch}; use crate::properties::longhands::{font_family, font_style, font_weight, font_stretch};
use crate::properties::longhands::font_variant_caps; use crate::properties::longhands::font_variant_caps;
@ -37,7 +48,7 @@
variant_position feature_settings \ variant_position feature_settings \
variation_settings optical_sizing".split() variation_settings optical_sizing".split()
%> %>
% if product == "gecko": % if engine == "gecko":
% for prop in gecko_sub_properties: % for prop in gecko_sub_properties:
use crate::properties::longhands::font_${prop}; use crate::properties::longhands::font_${prop};
% endfor % endfor
@ -54,7 +65,7 @@
let mut weight = None; let mut weight = None;
let mut stretch = None; let mut stretch = None;
let size; let size;
% if product == "gecko": % if engine == "gecko":
if let Ok(sys) = input.try(SystemFont::parse) { if let Ok(sys) = input.try(SystemFont::parse) {
return Ok(expanded! { return Ok(expanded! {
% for name in SYSTEM_FONT_LONGHANDS: % for name in SYSTEM_FONT_LONGHANDS:
@ -135,7 +146,7 @@
font_size: size, font_size: size,
line_height: line_height.unwrap_or(LineHeight::normal()), line_height: line_height.unwrap_or(LineHeight::normal()),
font_family: family, font_family: family,
% if product == "gecko": % if engine == "gecko":
% for name in gecko_sub_properties: % for name in gecko_sub_properties:
font_${name}: font_${name}::get_initial_specified_value(), font_${name}: font_${name}::get_initial_specified_value(),
% endfor % endfor
@ -143,7 +154,7 @@
}) })
} }
% if product == "gecko": % if engine == "gecko":
enum CheckSystemResult { enum CheckSystemResult {
AllSystem(SystemFont), AllSystem(SystemFont),
SomeSystem, SomeSystem,
@ -153,7 +164,7 @@
impl<'a> ToCss for LonghandsToSerialize<'a> { impl<'a> ToCss for LonghandsToSerialize<'a> {
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write { fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write {
% if product == "gecko": % if engine == "gecko":
match self.check_system() { match self.check_system() {
CheckSystemResult::AllSystem(sys) => return sys.to_css(dest), CheckSystemResult::AllSystem(sys) => return sys.to_css(dest),
CheckSystemResult::SomeSystem => return Ok(()), CheckSystemResult::SomeSystem => return Ok(()),
@ -161,7 +172,7 @@
} }
% endif % endif
% if product == "gecko": % if engine == "gecko":
if let Some(v) = self.font_optical_sizing { if let Some(v) = self.font_optical_sizing {
if v != &font_optical_sizing::get_initial_specified_value() { if v != &font_optical_sizing::get_initial_specified_value() {
return Ok(()); return Ok(());
@ -222,7 +233,7 @@
} }
impl<'a> LonghandsToSerialize<'a> { impl<'a> LonghandsToSerialize<'a> {
% if product == "gecko": % if engine == "gecko":
/// Check if some or all members are system fonts /// Check if some or all members are system fonts
fn check_system(&self) -> CheckSystemResult { fn check_system(&self) -> CheckSystemResult {
let mut sys = None; let mut sys = None;
@ -285,18 +296,19 @@
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="font-variant" <%helpers:shorthand name="font-variant"
engines="gecko servo-2013"
flags="SHORTHAND_IN_GETCS" flags="SHORTHAND_IN_GETCS"
sub_properties="font-variant-caps sub_properties="font-variant-caps
${'font-variant-alternates' if product == 'gecko' else ''} ${'font-variant-alternates' if engine == 'gecko' else ''}
${'font-variant-east-asian' if product == 'gecko' else ''} ${'font-variant-east-asian' if engine == 'gecko' else ''}
${'font-variant-ligatures' if product == 'gecko' else ''} ${'font-variant-ligatures' if engine == 'gecko' else ''}
${'font-variant-numeric' if product == 'gecko' else ''} ${'font-variant-numeric' if engine == 'gecko' else ''}
${'font-variant-position' if product == 'gecko' else ''}" ${'font-variant-position' if engine == 'gecko' else ''}"
spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-variant"> spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-variant">
<% gecko_sub_properties = "alternates east_asian ligatures numeric position".split() %> <% gecko_sub_properties = "alternates east_asian ligatures numeric position".split() %>
<% <%
sub_properties = ["caps"] sub_properties = ["caps"]
if product == "gecko": if engine == "gecko":
sub_properties += gecko_sub_properties sub_properties += gecko_sub_properties
%> %>
@ -319,7 +331,7 @@
} else if input.try(|input| input.expect_ident_matching("none")).is_ok() { } else if input.try(|input| input.expect_ident_matching("none")).is_ok() {
// The 'none' value sets 'font-variant-ligatures' to 'none' and resets all other sub properties // The 'none' value sets 'font-variant-ligatures' to 'none' and resets all other sub properties
// to their initial value. // to their initial value.
% if product == "gecko": % if engine == "gecko":
ligatures = Some(FontVariantLigatures::none()); ligatures = Some(FontVariantLigatures::none());
% endif % endif
} else { } else {
@ -359,7 +371,7 @@
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write { fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write {
let has_none_ligatures = let has_none_ligatures =
% if product == "gecko": % if engine == "gecko":
self.font_variant_ligatures == &FontVariantLigatures::none(); self.font_variant_ligatures == &FontVariantLigatures::none();
% else: % else:
false; false;

View file

@ -4,9 +4,12 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="marker" products="gecko" <%helpers:shorthand
name="marker"
engines="gecko"
sub_properties="marker-start marker-end marker-mid" sub_properties="marker-start marker-end marker-mid"
spec="https://www.w3.org/TR/SVG2/painting.html#MarkerShorthand"> spec="https://www.w3.org/TR/SVG2/painting.html#MarkerShorthand"
>
use crate::values::specified::url::UrlOrNone; use crate::values::specified::url::UrlOrNone;
pub fn parse_value<'i, 't>( pub fn parse_value<'i, 't>(

View file

@ -4,10 +4,13 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="text-emphasis" products="gecko" <%helpers:shorthand
name="text-emphasis"
engines="gecko"
sub_properties="text-emphasis-style text-emphasis-color" sub_properties="text-emphasis-style text-emphasis-color"
derive_serialize="True" derive_serialize="True"
spec="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-property"> spec="https://drafts.csswg.org/css-text-decor-3/#text-emphasis-property"
>
use crate::properties::longhands::{text_emphasis_color, text_emphasis_style}; use crate::properties::longhands::{text_emphasis_color, text_emphasis_style};
pub fn parse_value<'i, 't>( pub fn parse_value<'i, 't>(
@ -46,9 +49,9 @@
// CSS Compatibility // CSS Compatibility
// https://compat.spec.whatwg.org/ // https://compat.spec.whatwg.org/
<%helpers:shorthand name="-webkit-text-stroke" <%helpers:shorthand name="-webkit-text-stroke"
engines="gecko"
sub_properties="-webkit-text-stroke-width sub_properties="-webkit-text-stroke-width
-webkit-text-stroke-color" -webkit-text-stroke-color"
products="gecko"
derive_serialize="True" derive_serialize="True"
spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke"> spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke">
use crate::properties::longhands::{_webkit_text_stroke_color, _webkit_text_stroke_width}; use crate::properties::longhands::{_webkit_text_stroke_color, _webkit_text_stroke_width};

View file

@ -5,6 +5,7 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="list-style" <%helpers:shorthand name="list-style"
engines="gecko servo-2013"
sub_properties="list-style-position list-style-image list-style-type" sub_properties="list-style-position list-style-image list-style-type"
derive_serialize="True" derive_serialize="True"
spec="https://drafts.csswg.org/css-lists/#propdef-list-style"> spec="https://drafts.csswg.org/css-lists/#propdef-list-style">
@ -61,11 +62,11 @@
let position = unwrap_or_initial!(list_style_position, position); let position = unwrap_or_initial!(list_style_position, position);
fn list_style_type_none() -> list_style_type::SpecifiedValue { fn list_style_type_none() -> list_style_type::SpecifiedValue {
% if product == "servo": % if engine == "gecko":
list_style_type::SpecifiedValue::None
% else:
use crate::values::generics::CounterStyleOrNone; use crate::values::generics::CounterStyleOrNone;
list_style_type::SpecifiedValue::CounterStyle(CounterStyleOrNone::None) list_style_type::SpecifiedValue::CounterStyle(CounterStyleOrNone::None)
% else:
list_style_type::SpecifiedValue::None
% endif % endif
} }

View file

@ -8,6 +8,7 @@ ${helpers.four_sides_shorthand(
"margin", "margin",
"margin-%s", "margin-%s",
"specified::LengthPercentageOrAuto::parse", "specified::LengthPercentageOrAuto::parse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-box/#propdef-margin", spec="https://drafts.csswg.org/css-box/#propdef-margin",
allowed_in_page_rule=True, allowed_in_page_rule=True,
allow_quirks="Yes", allow_quirks="Yes",
@ -18,6 +19,7 @@ ${helpers.two_properties_shorthand(
"margin-block-start", "margin-block-start",
"margin-block-end", "margin-block-end",
"specified::LengthPercentageOrAuto::parse", "specified::LengthPercentageOrAuto::parse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-logical/#propdef-margin-block" spec="https://drafts.csswg.org/css-logical/#propdef-margin-block"
)} )}
@ -26,6 +28,7 @@ ${helpers.two_properties_shorthand(
"margin-inline-start", "margin-inline-start",
"margin-inline-end", "margin-inline-end",
"specified::LengthPercentageOrAuto::parse", "specified::LengthPercentageOrAuto::parse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-logical/#propdef-margin-inline" spec="https://drafts.csswg.org/css-logical/#propdef-margin-inline"
)} )}
@ -33,8 +36,8 @@ ${helpers.four_sides_shorthand(
"scroll-margin", "scroll-margin",
"scroll-margin-%s", "scroll-margin-%s",
"specified::Length::parse", "specified::Length::parse",
engines="gecko",
spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin", spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin",
products="gecko",
gecko_pref="layout.css.scroll-snap-v1.enabled", gecko_pref="layout.css.scroll-snap-v1.enabled",
)} )}
@ -43,8 +46,8 @@ ${helpers.two_properties_shorthand(
"scroll-margin-block-start", "scroll-margin-block-start",
"scroll-margin-block-end", "scroll-margin-block-end",
"specified::Length::parse", "specified::Length::parse",
engines="gecko",
spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin-block", spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin-block",
products="gecko",
gecko_pref="layout.css.scroll-snap-v1.enabled", gecko_pref="layout.css.scroll-snap-v1.enabled",
)} )}
@ -53,7 +56,7 @@ ${helpers.two_properties_shorthand(
"scroll-margin-inline-start", "scroll-margin-inline-start",
"scroll-margin-inline-end", "scroll-margin-inline-end",
"specified::Length::parse", "specified::Length::parse",
engines="gecko",
spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin-inline", spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-margin-inline",
products="gecko",
gecko_pref="layout.css.scroll-snap-v1.enabled", gecko_pref="layout.css.scroll-snap-v1.enabled",
)} )}

View file

@ -5,6 +5,7 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="outline" <%helpers:shorthand name="outline"
engines="gecko servo-2013"
sub_properties="outline-color outline-style outline-width" sub_properties="outline-color outline-style outline-width"
derive_serialize="True" derive_serialize="True"
spec="https://drafts.csswg.org/css-ui/#propdef-outline"> spec="https://drafts.csswg.org/css-ui/#propdef-outline">
@ -58,10 +59,15 @@
</%helpers:shorthand> </%helpers:shorthand>
// The -moz-outline-radius shorthand is non-standard and not on a standards track. // The -moz-outline-radius shorthand is non-standard and not on a standards track.
<%helpers:shorthand name="-moz-outline-radius" sub_properties="${' '.join( <%helpers:shorthand
name="-moz-outline-radius"
engines="gecko"
sub_properties="${' '.join(
'-moz-outline-radius-%s' % corner '-moz-outline-radius-%s' % corner
for corner in ['topleft', 'topright', 'bottomright', 'bottomleft'] for corner in ['topleft', 'topright', 'bottomright', 'bottomleft']
)}" products="gecko" spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)"> )}"
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-outline-radius)"
>
use crate::values::generics::rect::Rect; use crate::values::generics::rect::Rect;
use crate::values::specified::border::BorderRadius; use crate::values::specified::border::BorderRadius;
use crate::parser::Parse; use crate::parser::Parse;

View file

@ -8,6 +8,7 @@ ${helpers.four_sides_shorthand(
"padding", "padding",
"padding-%s", "padding-%s",
"specified::NonNegativeLengthPercentage::parse", "specified::NonNegativeLengthPercentage::parse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-box-3/#propdef-padding", spec="https://drafts.csswg.org/css-box-3/#propdef-padding",
allow_quirks="Yes", allow_quirks="Yes",
)} )}
@ -17,6 +18,7 @@ ${helpers.two_properties_shorthand(
"padding-block-start", "padding-block-start",
"padding-block-end", "padding-block-end",
"specified::NonNegativeLengthPercentage::parse", "specified::NonNegativeLengthPercentage::parse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-logical/#propdef-padding-block" spec="https://drafts.csswg.org/css-logical/#propdef-padding-block"
)} )}
@ -25,6 +27,7 @@ ${helpers.two_properties_shorthand(
"padding-inline-start", "padding-inline-start",
"padding-inline-end", "padding-inline-end",
"specified::NonNegativeLengthPercentage::parse", "specified::NonNegativeLengthPercentage::parse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-logical/#propdef-padding-inline" spec="https://drafts.csswg.org/css-logical/#propdef-padding-inline"
)} )}
@ -32,7 +35,7 @@ ${helpers.four_sides_shorthand(
"scroll-padding", "scroll-padding",
"scroll-padding-%s", "scroll-padding-%s",
"specified::NonNegativeLengthPercentageOrAuto::parse", "specified::NonNegativeLengthPercentageOrAuto::parse",
products="gecko", engines="gecko",
gecko_pref="layout.css.scroll-snap-v1.enabled", gecko_pref="layout.css.scroll-snap-v1.enabled",
spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding" spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding"
)} )}
@ -42,7 +45,7 @@ ${helpers.two_properties_shorthand(
"scroll-padding-block-start", "scroll-padding-block-start",
"scroll-padding-block-end", "scroll-padding-block-end",
"specified::NonNegativeLengthPercentageOrAuto::parse", "specified::NonNegativeLengthPercentageOrAuto::parse",
products="gecko", engines="gecko",
gecko_pref="layout.css.scroll-snap-v1.enabled", gecko_pref="layout.css.scroll-snap-v1.enabled",
spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding-block" spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding-block"
)} )}
@ -52,7 +55,7 @@ ${helpers.two_properties_shorthand(
"scroll-padding-inline-start", "scroll-padding-inline-start",
"scroll-padding-inline-end", "scroll-padding-inline-end",
"specified::NonNegativeLengthPercentageOrAuto::parse", "specified::NonNegativeLengthPercentageOrAuto::parse",
products="gecko", engines="gecko",
gecko_pref="layout.css.scroll-snap-v1.enabled", gecko_pref="layout.css.scroll-snap-v1.enabled",
spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding-inline" spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding-inline"
)} )}

View file

@ -5,6 +5,7 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="flex-flow" <%helpers:shorthand name="flex-flow"
engines="gecko servo-2013"
sub_properties="flex-direction flex-wrap" sub_properties="flex-direction flex-wrap"
extra_prefixes="webkit" extra_prefixes="webkit"
derive_serialize="True" derive_serialize="True"
@ -44,6 +45,7 @@
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="flex" <%helpers:shorthand name="flex"
engines="gecko servo-2013"
sub_properties="flex-grow flex-shrink flex-basis" sub_properties="flex-grow flex-shrink flex-basis"
extra_prefixes="webkit" extra_prefixes="webkit"
derive_serialize="True" derive_serialize="True"
@ -108,9 +110,13 @@
} }
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="gap" alias="grid-gap" sub_properties="row-gap column-gap" <%helpers:shorthand
name="gap"
engines="gecko"
alias="grid-gap"
sub_properties="row-gap column-gap"
spec="https://drafts.csswg.org/css-align-3/#gap-shorthand" spec="https://drafts.csswg.org/css-align-3/#gap-shorthand"
products="gecko"> >
use crate::properties::longhands::{row_gap, column_gap}; use crate::properties::longhands::{row_gap, column_gap};
pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
@ -139,9 +145,12 @@
</%helpers:shorthand> </%helpers:shorthand>
% for kind in ["row", "column"]: % for kind in ["row", "column"]:
<%helpers:shorthand name="grid-${kind}" sub_properties="grid-${kind}-start grid-${kind}-end" <%helpers:shorthand
name="grid-${kind}"
sub_properties="grid-${kind}-start grid-${kind}-end"
engines="gecko",
spec="https://drafts.csswg.org/css-grid/#propdef-grid-${kind}" spec="https://drafts.csswg.org/css-grid/#propdef-grid-${kind}"
products="gecko"> >
use crate::values::specified::GridLine; use crate::values::specified::GridLine;
use crate::parser::Parse; use crate::parser::Parse;
use crate::Zero; use crate::Zero;
@ -181,10 +190,12 @@
</%helpers:shorthand> </%helpers:shorthand>
% endfor % endfor
<%helpers:shorthand name="grid-area" <%helpers:shorthand
name="grid-area"
engines="gecko"
sub_properties="grid-row-start grid-row-end grid-column-start grid-column-end" sub_properties="grid-row-start grid-row-end grid-column-start grid-column-end"
spec="https://drafts.csswg.org/css-grid/#propdef-grid-area" spec="https://drafts.csswg.org/css-grid/#propdef-grid-area"
products="gecko"> >
use crate::values::specified::GridLine; use crate::values::specified::GridLine;
use crate::parser::Parse; use crate::parser::Parse;
use crate::Zero; use crate::Zero;
@ -249,10 +260,12 @@
} }
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="grid-template" <%helpers:shorthand
name="grid-template"
engines="gecko"
sub_properties="grid-template-rows grid-template-columns grid-template-areas" sub_properties="grid-template-rows grid-template-columns grid-template-areas"
spec="https://drafts.csswg.org/css-grid/#propdef-grid-template" spec="https://drafts.csswg.org/css-grid/#propdef-grid-template"
products="gecko"> >
use crate::parser::Parse; use crate::parser::Parse;
use servo_arc::Arc; use servo_arc::Arc;
use crate::values::generics::grid::{TrackSize, TrackList, TrackListType}; use crate::values::generics::grid::{TrackSize, TrackList, TrackListType};
@ -476,11 +489,13 @@
} }
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="grid" <%helpers:shorthand
name="grid"
engines="gecko"
sub_properties="grid-template-rows grid-template-columns grid-template-areas sub_properties="grid-template-rows grid-template-columns grid-template-areas
grid-auto-rows grid-auto-columns grid-auto-flow" grid-auto-rows grid-auto-columns grid-auto-flow"
spec="https://drafts.csswg.org/css-grid/#propdef-grid" spec="https://drafts.csswg.org/css-grid/#propdef-grid"
products="gecko"> >
use crate::parser::Parse; use crate::parser::Parse;
use crate::properties::longhands::{grid_auto_columns, grid_auto_rows, grid_auto_flow}; use crate::properties::longhands::{grid_auto_columns, grid_auto_rows, grid_auto_flow};
use crate::values::generics::grid::{GridTemplateComponent, TrackListType}; use crate::values::generics::grid::{GridTemplateComponent, TrackListType};
@ -629,9 +644,12 @@
} }
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="place-content" sub_properties="align-content justify-content" <%helpers:shorthand
name="place-content"
engines="gecko"
sub_properties="align-content justify-content"
spec="https://drafts.csswg.org/css-align/#propdef-place-content" spec="https://drafts.csswg.org/css-align/#propdef-place-content"
products="gecko"> >
use crate::values::specified::align::{AlignContent, JustifyContent, ContentDistribution, AxisDirection}; use crate::values::specified::align::{AlignContent, JustifyContent, ContentDistribution, AxisDirection};
pub fn parse_value<'i, 't>( pub fn parse_value<'i, 't>(
@ -681,9 +699,12 @@
} }
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="place-self" sub_properties="align-self justify-self" <%helpers:shorthand
name="place-self"
engines="gecko"
sub_properties="align-self justify-self"
spec="https://drafts.csswg.org/css-align/#place-self-property" spec="https://drafts.csswg.org/css-align/#place-self-property"
products="gecko"> >
use crate::values::specified::align::{AlignSelf, JustifySelf, SelfAlignment, AxisDirection}; use crate::values::specified::align::{AlignSelf, JustifySelf, SelfAlignment, AxisDirection};
pub fn parse_value<'i, 't>( pub fn parse_value<'i, 't>(
@ -719,9 +740,12 @@
} }
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="place-items" sub_properties="align-items justify-items" <%helpers:shorthand
name="place-items"
engines="gecko"
sub_properties="align-items justify-items"
spec="https://drafts.csswg.org/css-align/#place-items-property" spec="https://drafts.csswg.org/css-align/#place-items-property"
products="gecko"> >
use crate::values::specified::align::{AlignItems, JustifyItems}; use crate::values::specified::align::{AlignItems, JustifyItems};
use crate::parser::Parse; use crate::parser::Parse;
@ -764,6 +788,7 @@ ${helpers.four_sides_shorthand(
"inset", "inset",
"%s", "%s",
"specified::LengthPercentageOrAuto::parse", "specified::LengthPercentageOrAuto::parse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-logical/#propdef-inset", spec="https://drafts.csswg.org/css-logical/#propdef-inset",
allow_quirks="No", allow_quirks="No",
)} )}
@ -773,6 +798,7 @@ ${helpers.two_properties_shorthand(
"inset-block-start", "inset-block-start",
"inset-block-end", "inset-block-end",
"specified::LengthPercentageOrAuto::parse", "specified::LengthPercentageOrAuto::parse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-logical/#propdef-inset-block" spec="https://drafts.csswg.org/css-logical/#propdef-inset-block"
)} )}
@ -781,5 +807,6 @@ ${helpers.two_properties_shorthand(
"inset-inline-start", "inset-inline-start",
"inset-inline-end", "inset-inline-end",
"specified::LengthPercentageOrAuto::parse", "specified::LengthPercentageOrAuto::parse",
engines="gecko servo-2013",
spec="https://drafts.csswg.org/css-logical/#propdef-inset-inline" spec="https://drafts.csswg.org/css-logical/#propdef-inset-inline"
)} )}

View file

@ -4,7 +4,7 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="mask" products="gecko" extra_prefixes="webkit" <%helpers:shorthand name="mask" engines="gecko" extra_prefixes="webkit"
flags="SHORTHAND_IN_GETCS" flags="SHORTHAND_IN_GETCS"
sub_properties="mask-mode mask-repeat mask-clip mask-origin mask-composite mask-position-x sub_properties="mask-mode mask-repeat mask-clip mask-origin mask-composite mask-position-x
mask-position-y mask-size mask-image" mask-position-y mask-size mask-image"
@ -25,7 +25,7 @@
mask_clip::single_value::SpecifiedValue::PaddingBox , mask_clip::single_value::SpecifiedValue::PaddingBox ,
mask_origin::single_value::SpecifiedValue::BorderBox => mask_origin::single_value::SpecifiedValue::BorderBox =>
mask_clip::single_value::SpecifiedValue::BorderBox, mask_clip::single_value::SpecifiedValue::BorderBox,
% if product == "gecko": % if engine == "gecko":
mask_origin::single_value::SpecifiedValue::FillBox => mask_origin::single_value::SpecifiedValue::FillBox =>
mask_clip::single_value::SpecifiedValue::FillBox , mask_clip::single_value::SpecifiedValue::FillBox ,
mask_origin::single_value::SpecifiedValue::StrokeBox => mask_origin::single_value::SpecifiedValue::StrokeBox =>
@ -195,7 +195,7 @@
} }
</%helpers:shorthand> </%helpers:shorthand>
<%helpers:shorthand name="mask-position" products="gecko" extra_prefixes="webkit" <%helpers:shorthand name="mask-position" engines="gecko" extra_prefixes="webkit"
flags="SHORTHAND_IN_GETCS" flags="SHORTHAND_IN_GETCS"
sub_properties="mask-position-x mask-position-y" sub_properties="mask-position-x mask-position-y"
spec="https://drafts.csswg.org/css-masks-4/#the-mask-position"> spec="https://drafts.csswg.org/css-masks-4/#the-mask-position">

View file

@ -5,23 +5,23 @@
<%namespace name="helpers" file="/helpers.mako.rs" /> <%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="text-decoration" <%helpers:shorthand name="text-decoration"
engines="gecko servo-2013"
flags="SHORTHAND_IN_GETCS" flags="SHORTHAND_IN_GETCS"
sub_properties="text-decoration-line sub_properties="text-decoration-line
${' text-decoration-style text-decoration-color' if product == 'gecko' else ''}" ${' text-decoration-style text-decoration-color' if engine == 'gecko' else ''}"
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration"> spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration">
% if product == "gecko": % if engine == "gecko":
use crate::values::specified; use crate::values::specified;
use crate::properties::longhands::{text_decoration_line, text_decoration_style, text_decoration_color}; use crate::properties::longhands::{text_decoration_style, text_decoration_color};
% else:
use crate::properties::longhands::text_decoration_line;
% endif % endif
use crate::properties::longhands::text_decoration_line;
pub fn parse_value<'i, 't>( pub fn parse_value<'i, 't>(
context: &ParserContext, context: &ParserContext,
input: &mut Parser<'i, 't>, input: &mut Parser<'i, 't>,
) -> Result<Longhands, ParseError<'i>> { ) -> Result<Longhands, ParseError<'i>> {
% if product == "gecko": % if engine == "gecko":
let (mut line, mut style, mut color, mut any) = (None, None, None, false); let (mut line, mut style, mut color, mut any) = (None, None, None, false);
% else: % else:
let (mut line, mut any) = (None, false); let (mut line, mut any) = (None, false);
@ -42,7 +42,7 @@
parse_component!(line, text_decoration_line); parse_component!(line, text_decoration_line);
% if product == "gecko": % if engine == "gecko":
parse_component!(style, text_decoration_style); parse_component!(style, text_decoration_style);
parse_component!(color, text_decoration_color); parse_component!(color, text_decoration_color);
% endif % endif
@ -57,7 +57,7 @@
Ok(expanded! { Ok(expanded! {
text_decoration_line: unwrap_or_initial!(text_decoration_line, line), text_decoration_line: unwrap_or_initial!(text_decoration_line, line),
% if product == "gecko": % if engine == "gecko":
text_decoration_style: unwrap_or_initial!(text_decoration_style, style), text_decoration_style: unwrap_or_initial!(text_decoration_style, style),
text_decoration_color: unwrap_or_initial!(text_decoration_color, color), text_decoration_color: unwrap_or_initial!(text_decoration_color, color),
% endif % endif
@ -68,7 +68,7 @@
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write { fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write {
self.text_decoration_line.to_css(dest)?; self.text_decoration_line.to_css(dest)?;
% if product == "gecko": % if engine == "gecko":
if *self.text_decoration_style != text_decoration_style::SpecifiedValue::Solid { if *self.text_decoration_style != text_decoration_style::SpecifiedValue::Solid {
dest.write_str(" ")?; dest.write_str(" ")?;
self.text_decoration_style.to_css(dest)?; self.text_decoration_style.to_css(dest)?;

View file

@ -243,7 +243,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
.add_flags(ComputedValueFlags::IS_IN_PSEUDO_ELEMENT_SUBTREE); .add_flags(ComputedValueFlags::IS_IN_PSEUDO_ELEMENT_SUBTREE);
} }
#[cfg(feature = "servo")] #[cfg(feature = "servo-layout-2013")]
{ {
if self.style.get_parent_column().is_multicol() { if self.style.get_parent_column().is_multicol() {
self.style.add_flags(ComputedValueFlags::CAN_BE_FRAGMENTED); self.style.add_flags(ComputedValueFlags::CAN_BE_FRAGMENTED);

View file

@ -172,17 +172,16 @@ impl TextDecorationsInEffect {
/// Computes the text-decorations in effect for a given style. /// Computes the text-decorations in effect for a given style.
#[cfg(feature = "servo")] #[cfg(feature = "servo")]
pub fn from_style(style: &StyleBuilder) -> Self { pub fn from_style(style: &StyleBuilder) -> Self {
use crate::values::computed::Display;
// Start with no declarations if this is an atomic inline-level box; // Start with no declarations if this is an atomic inline-level box;
// otherwise, start with the declarations in effect and add in the text // otherwise, start with the declarations in effect and add in the text
// decorations that this block specifies. // decorations that this block specifies.
let mut result = match style.get_box().clone_display() { let mut result = if style.get_box().clone_display().is_atomic_inline_level() {
Display::InlineBlock | Display::InlineTable => Self::default(), Self::default()
_ => style } else {
style
.get_parent_inherited_text() .get_parent_inherited_text()
.text_decorations_in_effect .text_decorations_in_effect
.clone(), .clone()
}; };
let line = style.get_text().clone_text_decoration_line(); let line = style.get_text().clone_text_decoration_line();

View file

@ -47,13 +47,20 @@ use style_traits::{CssWriter, ParseError, ToCss};
pub enum BorderStyle { pub enum BorderStyle {
Hidden, Hidden,
None, None,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Inset, Inset,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Groove, Groove,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Outset, Outset,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Ridge, Ridge,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Dotted, Dotted,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Dashed, Dashed,
Solid, Solid,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Double, Double,
} }

View file

@ -37,6 +37,19 @@ fn moz_box_display_values_enabled(context: &ParserContext) -> bool {
} }
} }
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
fn parse_unimplemented_in_servo_2020(_context: &ParserContext) -> bool {
true
}
#[cfg(feature = "servo-layout-2020")]
fn parse_unimplemented_in_servo_2020(_context: &ParserContext) -> bool {
servo_config::prefs::pref_map()
.get("layout.2020.unimplemented")
.as_bool()
.unwrap_or(false)
}
/// Defines an elements display type, which consists of /// Defines an elements display type, which consists of
/// the two basic qualities of how an element generates boxes /// the two basic qualities of how an element generates boxes
/// <https://drafts.csswg.org/css-display/#propdef-display> /// <https://drafts.csswg.org/css-display/#propdef-display>
@ -72,20 +85,34 @@ pub enum Display {
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
FlowRoot, FlowRoot,
Inline, Inline,
#[parse(condition = "parse_unimplemented_in_servo_2020")]
InlineBlock, InlineBlock,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
ListItem, ListItem,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Table, Table,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
InlineTable, InlineTable,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
TableRowGroup, TableRowGroup,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
TableColumn, TableColumn,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
TableColumnGroup, TableColumnGroup,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
TableHeaderGroup, TableHeaderGroup,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
TableFooterGroup, TableFooterGroup,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
TableRow, TableRow,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
TableCell, TableCell,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
TableCaption, TableCaption,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
#[parse(aliases = "-webkit-flex")] #[parse(aliases = "-webkit-flex")]
Flex, Flex,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
#[parse(aliases = "-webkit-inline-flex")] #[parse(aliases = "-webkit-inline-flex")]
InlineFlex, InlineFlex,
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
@ -150,12 +177,25 @@ impl Display {
Display::Inline Display::Inline
} }
/// <https://drafts.csswg.org/css2/visuren.html#x13>
#[cfg(feature = "servo")]
#[inline]
pub fn is_atomic_inline_level(&self) -> bool {
match *self {
Display::InlineBlock => true,
#[cfg(feature = "servo-layout-2013")]
Display::InlineFlex | Display::InlineTable => true,
_ => false,
}
}
/// Returns whether this "display" value is the display of a flex or /// Returns whether this "display" value is the display of a flex or
/// grid container. /// grid container.
/// ///
/// This is used to implement various style fixups. /// This is used to implement various style fixups.
pub fn is_item_container(&self) -> bool { pub fn is_item_container(&self) -> bool {
match *self { match *self {
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Display::Flex | Display::InlineFlex => true, Display::Flex | Display::InlineFlex => true,
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
Display::Grid | Display::InlineGrid => true, Display::Grid | Display::InlineGrid => true,
@ -204,7 +244,9 @@ impl Display {
pub fn equivalent_block_display(&self, _is_root_element: bool) -> Self { pub fn equivalent_block_display(&self, _is_root_element: bool) -> Self {
match *self { match *self {
// Values that have a corresponding block-outside version. // Values that have a corresponding block-outside version.
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Display::InlineTable => Display::Table, Display::InlineTable => Display::Table,
#[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
Display::InlineFlex => Display::Flex, Display::InlineFlex => Display::Flex,
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
@ -218,9 +260,9 @@ impl Display {
Display::Contents | Display::ListItem if _is_root_element => Display::Block, Display::Contents | Display::ListItem if _is_root_element => Display::Block,
// These are not changed by blockification. // These are not changed by blockification.
Display::None | Display::Block | Display::Flex | Display::ListItem | Display::Table => { Display::None | Display::Block => *self,
*self #[cfg(any(feature = "gecko", feature = "servo-layout-2013"))]
}, Display::Flex | Display::ListItem | Display::Table => *self,
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
Display::Contents | Display::FlowRoot | Display::Grid | Display::WebkitBox => *self, Display::Contents | Display::FlowRoot | Display::Grid | Display::WebkitBox => *self,

View file

@ -13,7 +13,6 @@ import json
import os import os
import os.path as path import os.path as path
import subprocess import subprocess
import sys
from shutil import copytree, rmtree, copy2 from shutil import copytree, rmtree, copy2
from mach.decorators import ( from mach.decorators import (
@ -237,7 +236,7 @@ class PostBuildCommands(CommandBase):
'params', nargs='...', 'params', nargs='...',
help="Command-line arguments to be passed through to cargo doc") help="Command-line arguments to be passed through to cargo doc")
@CommandBase.build_like_command_arguments @CommandBase.build_like_command_arguments
def doc(self, params, **kwargs): def doc(self, params, features, **kwargs):
env = os.environ.copy() env = os.environ.copy()
env["RUSTUP_TOOLCHAIN"] = self.toolchain() env["RUSTUP_TOOLCHAIN"] = self.toolchain()
rustc_path = check_output(["rustup" + BIN_SUFFIX, "which", "rustc"], env=env) rustc_path = check_output(["rustup" + BIN_SUFFIX, "which", "rustc"], env=env)
@ -265,7 +264,8 @@ class PostBuildCommands(CommandBase):
else: else:
copy2(full_name, destination) copy2(full_name, destination)
returncode = self.run_cargo_build_like_command("doc", params, **kwargs) features = features or []
returncode = self.run_cargo_build_like_command("doc", params, features=features, **kwargs)
if returncode: if returncode:
return returncode return returncode
@ -273,14 +273,6 @@ class PostBuildCommands(CommandBase):
for name in os.listdir(static): for name in os.listdir(static):
copy2(path.join(static, name), path.join(docs, name)) copy2(path.join(static, name), path.join(docs, name))
build = path.join(self.context.topdir, "components", "style", "properties", "build.py")
subprocess.check_call([sys.executable, build, "servo", "html"])
script = path.join(self.context.topdir, "components", "script")
subprocess.check_call(["cmake", "."], cwd=script)
subprocess.check_call(["cmake", "--build", ".", "--target", "supported-apis"], cwd=script)
copy2(path.join(script, "apis.html"), path.join(docs, "servo", "apis.html"))
@Command('browse-doc', @Command('browse-doc',
description='Generate documentation and open it in a web browser', description='Generate documentation and open it in a web browser',
category='post-build') category='post-build')

View file

@ -4,9 +4,8 @@
use serde_json::{self, Value}; use serde_json::{self, Value};
use std::env; use std::env;
use std::fs::{remove_file, File}; use std::fs::File;
use std::path::Path; use std::path::Path;
use std::process::Command;
#[test] #[test]
fn properties_list_json() { fn properties_list_json() {
@ -19,67 +18,10 @@ fn properties_list_json() {
.join("doc") .join("doc")
.join("servo") .join("servo")
.join("css-properties.json"); .join("css-properties.json");
if json.exists() {
remove_file(&json).unwrap()
}
let python = env::var("PYTHON").ok().unwrap_or_else(find_python);
let script = top
.join("components")
.join("style")
.join("properties")
.join("build.py");
let status = Command::new(python)
.arg(&script)
.arg("servo")
.arg("html")
.arg("regular")
.status()
.unwrap();
assert!(status.success(), "{:?}", status);
let properties: Value = serde_json::from_reader(File::open(json).unwrap()).unwrap(); let properties: Value = serde_json::from_reader(File::open(json).unwrap()).unwrap();
assert!(properties.as_object().unwrap().len() > 100); let longhands = properties["longhands"].as_object().unwrap();
assert!(properties.as_object().unwrap().contains_key("margin")); assert!(longhands.len() > 100);
assert!(properties.as_object().unwrap().contains_key("margin-top")); assert!(longhands.get("margin-top").is_some());
} assert!(properties["shorthands"].get("margin").is_some());
#[cfg(windows)]
fn find_python() -> String {
if Command::new("python2.7.exe")
.arg("--version")
.output()
.is_ok()
{
return "python2.7.exe".to_owned();
}
if Command::new("python27.exe")
.arg("--version")
.output()
.is_ok()
{
return "python27.exe".to_owned();
}
if Command::new("python.exe").arg("--version").output().is_ok() {
return "python.exe".to_owned();
}
panic!("Can't find python (tried python27.exe and python.exe)! Try fixing PATH or setting the PYTHON env var");
}
#[cfg(not(windows))]
fn find_python() -> String {
if Command::new("python2.7")
.arg("--version")
.output()
.unwrap()
.status
.success()
{
"python2.7"
} else {
"python"
}
.to_owned()
} }