blob: 027dac85fe9ba8c6183259aea79c1baf5abd29de [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: "external",
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",
},
{
name: "VisitedLinkTextStrokeColor",
inherited: true,
field_template: "storage_only",
field_type_path: "platform/graphics/Color",
default_value: "Color()",
field_group: "rare-inherited",
},
{
name: "VisitedLinkTextFillColor",
inherited: true,
field_template: "storage_only",
field_type_path: "platform/graphics/Color",
default_value: "Color()",
field_group: "rare-inherited",
},
{
name: "VisitedLinkTextEmphasisColor",
inherited: true,
field_template: "storage_only",
field_type_path: "platform/graphics/Color",
default_value: "Color()",
field_group: "rare-inherited",
},
{
name: "VisitedLinkCaretColor",
inherited: true,
field_template: "storage_only",
field_type_path: "platform/graphics/Color",
default_value: "Color()",
field_group: "rare-inherited",
},
{
name: "CursorData",
inherited: true,
field_template: "storage_only",
field_type_path: "core/style/CursorList",
default_value: "nullptr",
wrapper_pointer_name: "Persistent",
field_group: "rare-inherited",
},
{
name: "EffectiveZoom",
inherited: true,
field_template: "storage_only",
type_name: "float",
default_value: "1.0f",
field_group: "rare-inherited",
},
{
name: "TextStrokeColorIsCurrentColor",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "true",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "TextFillColorIsCurrentColor",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "true",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "TextEmphasisColorIsCurrentColor",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "true",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "CaretColorIsCurrentColor",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "false",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "CaretColorIsAuto",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "true",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "VisitedLinkTextStrokeColorIsCurrentColor",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "true",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "VisitedLinkTextFillColorIsCurrentColor",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "true",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "VisitedLinkTextEmphasisColorIsCurrentColor",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "true",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "VisitedLinkCaretColorIsCurrentColor",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "false",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "VisitedLinkCaretColorIsAuto",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "true",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "TextEmphasisFill",
inherited: true,
field_template: "storage_only",
type_name: "TextEmphasisFill",
default_value: "kTextEmphasisFillFilled",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "TextEmphasisMark",
inherited: true,
field_template: "storage_only",
type_name: "TextEmphasisMark",
default_value: "kTextEmphasisMarkNone",
field_size: 3,
field_group: "rare-inherited",
},
{
name: "TextEmphasisPosition",
inherited: true,
field_template: "storage_only",
type_name: "TextEmphasisPosition",
default_value: "kTextEmphasisPositionOver",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "TextIndentLine",
inherited: true,
field_template: "storage_only",
type_name: "TextIndentLine",
default_value: "kTextIndentFirstLine",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "TextIndentType",
inherited: true,
field_template: "storage_only",
type_name: "TextIndentType",
default_value: "kTextIndentNormal",
field_size: 1,
field_group: "rare-inherited",
},
// Though will-change is not itself an inherited property, the intent
// expressed by 'will-change: contents' includes descendants.
{
name: "SubtreeWillChangeContents",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "false",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "SelfOrAncestorHasDirAutoAttribute",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "false",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "RespectImageOrientation",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "false",
field_size: 1,
field_group: "rare-inherited",
},
// Though position: sticky is not itself an inherited property, being a
// descendent of a sticky element changes some document lifecycle logic.
{
name: "SubtreeIsSticky",
inherited: true,
field_template: "storage_only",
type_name: "bool",
default_value: "false",
field_size: 1,
field_group: "rare-inherited",
},
{
name: "HyphenationLimitBefore",
inherited: true,
field_template: "storage_only",
type_name: "short",
default_value: "-1",
field_group: "rare-inherited",
},
{
name: "HyphenationLimitAfter",
inherited: true,
field_template: "storage_only",
type_name: "short",
default_value: "-1",
field_group: "rare-inherited",
},
{
name: "HyphenationLimitLines",
inherited: true,
field_template: "storage_only",
type_name: "short",
default_value: "-1",
field_group: "rare-inherited",
},
{
name: "TextEmphasisCustomMark",
inherited: true,
field_template: "storage_only",
field_type_path: "platform/wtf/text/AtomicString",
default_value: "AtomicString()",
field_group: "rare-inherited",
},
{
name: "AppliedTextDecorations",
inherited: true,
field_template: "storage_only",
field_type_path: "core/style/AppliedTextDecorationList",
default_value: "nullptr",
wrapper_pointer_name: "RefPtr",
field_group: "rare-inherited",
},
{
name: "Variables",
inherited: true,
field_template: "storage_only",
field_type_path: "core/style/StyleInheritedVariables",
default_value: "nullptr",
wrapper_pointer_name: "RefPtr",
field_group: "rare-inherited",
},
],
}