blob: 177c5e0238bb1d8fcdc51578aea87c7316f1ca96 [file] [log] [blame]
{
// This file specifies fields in ComputedStyle that we would like to
// generate, but are not CSS properties.
parameters: {
// If the field has_custom_compare_and_copy, then it does not appear in
// ComputedStyle::operator== and ComputedStyle::CopyNonInheritedFromCached.
has_custom_compare_and_copy: {
default: false,
},
// The rest is the same as CSSProperties.json5, but the only relevant ones in
// this file are:
// name, field_template, field_type_path, default_value, type_name, keyword,
// inherited
},
data: [
{
name: "IsLink",
field_template: "monotonic_flag",
default_value: "false",
has_custom_compare_and_copy: true,
},
{
name: "BorderLeftColorIsCurrentColor",
field_template: "primitive",
default_value: "true",
type_name: "bool",
field_group: "surround",
},
{
name: "BorderRightColorIsCurrentColor",
field_template: "primitive",
default_value: "true",
type_name: "bool",
field_group: "surround",
},
{
name: "BorderTopColorIsCurrentColor",
field_template: "primitive",
default_value: "true",
type_name: "bool",
field_group: "surround",
},
{
name: "BorderBottomColorIsCurrentColor",
field_template: "primitive",
default_value: "true",
type_name: "bool",
field_group: "surround",
},
{
name: "OriginalDisplay",
field_template: "keyword",
default_value: "inline",
type_name: "EDisplay",
keywords: [
"inline", "block", "list-item", "inline-block", "table", "inline-table", "table-row-group", "table-header-group",
"table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "-webkit-box",
"-webkit-inline-box", "flex", "inline-flex", "grid", "inline-grid", "contents", "flow-root", "none",
],
},
{
name: "InsideLink",
field_template: "keyword",
default_value: "not-inside-link",
keywords: ["not-inside-link", "inside-unvisited-link", "inside-visited-link"],
inherited: true,
has_custom_compare_and_copy: true,
},
// Style can not be shared.
{
name: "Unique",
field_template: "monotonic_flag",
default_value: "false",
has_custom_compare_and_copy: true,
},
// Whether this style is affected by these pseudo-classes.
{
name: "AffectedByFocus",
field_template: "monotonic_flag",
default_value: "false",
has_custom_compare_and_copy: true,
},
{
name: "AffectedByFocusWithin",
field_template: "monotonic_flag",
default_value: "false",
has_custom_compare_and_copy: true,
},
{
name: "AffectedByHover",
field_template: "monotonic_flag",
default_value: "false",
has_custom_compare_and_copy: true,
},
{
name: "AffectedByActive",
field_template: "monotonic_flag",
default_value: "false",
has_custom_compare_and_copy: true,
},
{
name: "AffectedByDrag",
field_template: "monotonic_flag",
default_value: "false",
has_custom_compare_and_copy: true,
},
// A non-inherited property references a variable or @apply is used
{
name: "HasVariableReferenceFromNonInheritedProperty",
field_template: "monotonic_flag",
default_value: "false",
has_custom_compare_and_copy: true,
},
// Explicitly inherits a non-inherited property
{
name: "HasExplicitlyInheritedProperties",
field_template: "monotonic_flag",
default_value: "false",
has_custom_compare_and_copy: true,
},
// These are set if we used viewport or rem units when resolving a length.
// TODO(shend): HasViewportUnits should be a monotonic_flag.
{
name: "HasViewportUnits",
field_template: "primitive",
default_value: "false",
type_name: "bool",
has_custom_compare_and_copy: true,
},
{
name: "HasRemUnits",
field_template: "monotonic_flag",
default_value: "false",
has_custom_compare_and_copy: true,
},
// These properties only have generated storage, and their methods are handwritten in ComputedStyle.
// TODO(shend): Remove these fields and delete the 'storage_only' template.
{
name: "EmptyState",
field_template: "storage_only",
field_size: 1,
default_value: "false",
type_name: "bool",
has_custom_compare_and_copy: true,
},
{
name: "StyleType",
field_template: "storage_only",
field_size: 6,
default_value: "0",
type_name: "PseudoId",
has_custom_compare_and_copy: true,
},
{
name: "PseudoBits",
field_template: "storage_only",
field_size: 8,
default_value: "kPseudoIdNone",
type_name: "PseudoId",
has_custom_compare_and_copy: true,
},
// True if 'underline solid' is the only text decoration on this element.
{
name: "HasSimpleUnderline",
field_template: "storage_only",
field_size: 1,
default_value: "false",
type_name: "bool",
inherited: true,
has_custom_compare_and_copy: true,
},
// TODO(shend): vertical align is actually a CSS property, but since we don't support union fields
// which can be either a keyword or Length, this is specified in this file for now. Remove this
// once we can support union fields.
{
name: "VerticalAlign",
field_template: "storage_only",
field_size: 4,
default_value: "EVerticalAlign::kBaseline",
type_name: "EVerticalAlign",
},
{
name: "VerticalAlignLength",
field_template: "storage_only",
default_value: "Length()",
field_type_path: "platform/Length",
field_group: "box",
},
{
name: "border-image",
field_template: "storage_only",
field_type_path: "core/style/NinePieceImage",
field_group: "surround",
default_value: "NinePieceImage()",
},
{
name: "Background",
field_template: "storage_only",
field_type_path: "core/style/FillLayer",
default_value: "FillLayer(kBackgroundFillLayer, true)",
field_group: "background",
},
{
name: "BackgroundColor",
field_template: "storage_only",
field_type_path: "core/css/StyleColor",
default_value: "Color::kTransparent",
field_group: "background",
},
{
name: "TextDecoration",
field_template: "storage_only",
type_name: "TextDecoration",
field_size: 4,
default_value: "TextDecoration::kNone",
field_group: "visual",
},
{
name: "HasAutoClip",
field_template: "storage_only",
type_name: "bool",
field_size: 1,
default_value: "true",
field_group: "visual",
},
{
name: "HasAutoZIndex",
field_template: "storage_only",
type_name: "bool",
field_size: 1,
field_group: "box",
default_value: "true",
},
{
name: "font",
field_template: "storage_only",
field_type_path: "platform/fonts/Font",
field_group: "inherited",
inherited: true,
default_value: "Font()",
},
{
name: "color",
inherited: true,
field_template: "storage_only",
field_type_path: "platform/graphics/Color",
field_group: "inherited",
default_value: "Color::kBlack",
},
{
name: "VisitedLinkColor",
inherited: true,
field_template: "external",
field_type_path: "platform/graphics/Color",
field_group: "inherited",
default_value: "Color::kBlack",
},
{
name: "TextAutosizingMultiplier",
inherited: true,
field_template: "storage_only",
type_name: "float",
field_group: "inherited",
default_value: "1.0",
},
],
}