Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Unified Diff: third_party/WebKit/Source/core/css/CSSProperties.json5

Issue 2904483003: Replace "field_type_path" with "include_paths" in CSSProperties.json5. (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSProperties.json5
diff --git a/third_party/WebKit/Source/core/css/CSSProperties.json5 b/third_party/WebKit/Source/core/css/CSSProperties.json5
index e06e3ddda923b8afdb142156471868a393eb6a47..72826706c9c3646eac365abcab5cfda3ebe49744 100644
--- a/third_party/WebKit/Source/core/css/CSSProperties.json5
+++ b/third_party/WebKit/Source/core/css/CSSProperties.json5
@@ -84,6 +84,8 @@
field_template: {
valid_values: [
// Field is stored as an enum and has a initial/getter/setter/resetter.
+ // If include_paths is empty, we would also generate the corresponding
+ // enum definition in ComputedStyleConstants.h.
"keyword",
// Field stores a primitive value like int/bool. The type is specified by
// type_name. The interface has a initial/getter/setter/resetter.
@@ -91,7 +93,7 @@
// Field is stored as a bool, whose default value is false
// and can only be set to true. Has a initial/getter/setter.
"monotonic_flag",
- // Field has type specified at field_type_path and has a getter/setter.
+ // Field has type specified at type_name and has a getter/setter.
// Also has a setter taking an rvalue reference. Cannot be packed.
"external",
// Only the storage is generated. The interface is handwritten.
@@ -99,14 +101,13 @@
],
},
- // - field_type_path: "path/to/Type"
- // For properties that have generated field storage in ComputedStyle,
- // this optional argument will override the field's generated type with
- // an external one specified at the given path. The type must be defined
- // in a header file at that path, and have the same name as the file.
- // Currently, only enum types are supported, and the enum's only values
- // must be CamelCase values of the keywords of the property.
- field_type_path: {
+ // - include_paths: ["path/to/file1.h", "path/to/file2.h"]
+ // List of files containing the definitions of types in 'type_name'. Each of
+ // these files will appear as a #include in ComputedStyleBase.h. For
+ // example, if the type_name is 'Vector<String>', include_paths should be
+ // ["platform/wtf/Vector.h", "platform/wtf/text/WTFString.h"]
+ include_paths: {
+ default: [],
},
// Name of the pointer type that wraps this field (e.g. RefPtr).
@@ -367,12 +368,13 @@
{
name: "direction",
custom_value: true,
- field_type_path: "platform/text/TextDirection",
+ type_name: "TextDirection",
inherited: true,
default_value: "ltr",
field_template: "keyword",
keywords: ["ltr", "rtl"],
priority: "High",
+ include_paths: ["platform/text/TextDirection.h"],
},
{
name: "font-family",
@@ -536,13 +538,13 @@
{
name: "writing-mode",
custom_value: true,
- field_type_path: "platform/text/WritingMode",
inherited: true,
default_value: "horizontal-tb",
field_template: "keyword",
keywords: ["horizontal-tb", "vertical-rl", "vertical-lr"],
priority: "High",
type_name: "WritingMode",
+ include_paths: ["platform/text/WritingMode.h"],
},
{
name: "-webkit-writing-mode",
@@ -668,10 +670,11 @@
name: "border-bottom-color",
custom_all: true,
interpolable: true,
+ type_name: "Color",
field_template: "storage_only",
- field_type_path: "platform/graphics/Color",
default_value: "0",
field_group: "surround",
+ include_paths: ["platform/graphics/Color.h"],
},
{
name: "border-bottom-left-radius",
@@ -680,7 +683,8 @@
converter: "ConvertRadius",
interpolable: true,
field_template: "external",
- field_type_path: "platform/LengthSize",
+ include_paths: ["platform/LengthSize.h"],
+ type_name: "LengthSize",
field_group: "surround",
default_value: "LengthSize(Length(0, kFixed), Length(0, kFixed))",
},
@@ -691,7 +695,8 @@
converter: "ConvertRadius",
interpolable: true,
field_template: "external",
- field_type_path: "platform/LengthSize",
+ include_paths: ["platform/LengthSize.h"],
+ type_name: "LengthSize",
field_group: "surround",
default_value: "LengthSize(Length(0, kFixed), Length(0, kFixed))",
},
@@ -713,7 +718,8 @@
keywords: ["thin", "medium", "thick"],
typedom_types: ["Length"],
field_template: "storage_only",
- field_type_path: "platform/LayoutUnit",
+ include_paths: ["platform/LayoutUnit.h"],
+ type_name: "LayoutUnit",
default_value: "LayoutUnit(3)",
field_group: "surround",
},
@@ -762,7 +768,8 @@
custom_all: true,
interpolable: true,
field_template: "storage_only",
- field_type_path: "platform/graphics/Color",
+ include_paths: ["platform/graphics/Color.h"],
+ type_name: "Color",
default_value: "0",
field_group: "surround",
},
@@ -784,7 +791,8 @@
keywords: ["thin", "medium", "thick"],
typedom_types: ["Length"],
field_template: "storage_only",
- field_type_path: "platform/LayoutUnit",
+ include_paths: ["platform/LayoutUnit.h"],
+ type_name: "LayoutUnit",
default_value: "LayoutUnit(3)",
field_group: "surround",
},
@@ -793,7 +801,8 @@
custom_all: true,
interpolable: true,
field_template: "storage_only",
- field_type_path: "platform/graphics/Color",
+ include_paths: ["platform/graphics/Color.h"],
+ type_name: "Color",
default_value: "0",
field_group: "surround",
},
@@ -815,7 +824,8 @@
keywords: ["thin", "medium", "thick"],
typedom_types: ["Length"],
field_template: "storage_only",
- field_type_path: "platform/LayoutUnit",
+ include_paths: ["platform/LayoutUnit.h"],
+ type_name: "LayoutUnit",
default_value: "LayoutUnit(3)",
field_group: "surround",
},
@@ -824,7 +834,8 @@
custom_all: true,
interpolable: true,
field_template: "storage_only",
- field_type_path: "platform/graphics/Color",
+ include_paths: ["platform/graphics/Color.h"],
+ type_name: "Color",
default_value: "0",
field_group: "surround",
},
@@ -835,7 +846,8 @@
converter: "ConvertRadius",
interpolable: true,
field_template: "external",
- field_type_path: "platform/LengthSize",
+ include_paths: ["platform/LengthSize.h"],
+ type_name: "LengthSize",
field_group: "surround",
default_value: "LengthSize(Length(0, kFixed), Length(0, kFixed))",
},
@@ -846,7 +858,8 @@
converter: "ConvertRadius",
interpolable: true,
field_template: "external",
- field_type_path: "platform/LengthSize",
+ include_paths: ["platform/LengthSize.h"],
+ type_name: "LengthSize",
field_group: "surround",
default_value: "LengthSize(Length(0, kFixed), Length(0, kFixed))",
},
@@ -869,7 +882,8 @@
supports_percentage: true,
typedom_types: ["Length"],
field_template: "storage_only",
- field_type_path: "platform/LayoutUnit",
+ include_paths: ["platform/LayoutUnit.h"],
+ type_name: "LayoutUnit",
default_value: "LayoutUnit(3)",
field_group: "surround",
},
@@ -883,7 +897,8 @@
supports_percentage: true,
typedom_types: ["Length"],
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length()",
},
@@ -950,7 +965,8 @@
inherited: true,
interpolable: true,
field_template: "storage_only",
- field_type_path: "platform/graphics/Color",
+ type_name: "Color",
+ include_paths: ["platform/graphics/Color.h"],
default_value: "Color()",
field_group: "rare-inherited",
},
@@ -968,7 +984,8 @@
custom_all: true,
interpolable: true,
field_template: "storage_only",
- field_type_path: "platform/LengthBox",
+ include_paths: ["platform/LengthBox.h"],
+ type_name: "LengthBox",
default_value: "LengthBox()",
field_group: "visual",
},
@@ -1252,7 +1269,8 @@
supports_percentage: true,
typedom_types: ["Length"],
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "box",
default_value: "Length()",
},
@@ -1318,7 +1336,8 @@
supports_percentage: true,
typedom_types: ["Length"],
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length()",
},
@@ -1348,7 +1367,8 @@
inherited: true,
interpolable: true,
field_template: "storage_only",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
default_value: "Length(-100.0, kPercent)",
field_group: "inherited",
},
@@ -1402,7 +1422,8 @@
converter: "ConvertQuirkyLength",
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length(kFixed)",
},
@@ -1413,7 +1434,8 @@
converter: "ConvertQuirkyLength",
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length(kFixed)",
},
@@ -1424,7 +1446,8 @@
converter: "ConvertQuirkyLength",
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length(kFixed)",
},
@@ -1435,7 +1458,8 @@
converter: "ConvertQuirkyLength",
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length(kFixed)",
},
@@ -1485,7 +1509,8 @@
is_descriptor: true,
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "box",
default_value: "Length(kMaxSizeNone)",
},
@@ -1495,7 +1520,8 @@
is_descriptor: true,
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "box",
default_value: "Length(kMaxSizeNone)",
},
@@ -1506,7 +1532,8 @@
is_descriptor: true,
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "box",
default_value: "Length()",
},
@@ -1517,7 +1544,8 @@
is_descriptor: true,
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "box",
default_value: "Length()",
},
@@ -1663,7 +1691,8 @@
converter: "ConvertLength",
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length(kFixed)",
},
@@ -1674,7 +1703,8 @@
converter: "ConvertLength",
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length(kFixed)",
},
@@ -1685,7 +1715,8 @@
converter: "ConvertLength",
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length(kFixed)",
},
@@ -1696,7 +1727,8 @@
converter: "ConvertLength",
interpolable: true,
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length(kFixed)",
},
@@ -1746,7 +1778,8 @@
converter: "ConvertQuotes",
inherited: true,
field_template: "storage_only",
- field_type_path: "core/style/QuotesData",
+ type_name: "QuotesData",
+ include_paths: ["core/style/QuotesData.h"],
default_value: "nullptr",
wrapper_pointer_name: "RefPtr",
field_group: "rare-inherited",
@@ -1765,7 +1798,8 @@
supports_percentage: true,
typedom_types: ["Length"],
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length()",
},
@@ -1967,7 +2001,8 @@
converter: "ConvertLengthOrTabSpaces",
inherited: true,
getter: "GetTabSize",
- field_type_path: "platform/text/TabSize",
+ type_name: "TabSize",
+ include_paths: ["platform/text/TabSize.h"],
field_template: "external",
default_value: "TabSize(8)",
field_group: "rare-inherited",
@@ -2057,7 +2092,8 @@
inherited: true,
interpolable: true,
field_template: "storage_only",
- field_type_path: "platform/Length",
+ type_name: "Length",
+ include_paths: ["platform/Length.h"],
default_value: "Length(kFixed)",
field_group: "rare-inherited",
},
@@ -2067,7 +2103,8 @@
runtime_flag: "CSS3Text",
getter: "GetTextJustify",
field_template: "storage_only",
- field_type_path: "platform/text/TextJustify",
+ type_name: "TextJustify",
+ include_paths: ["platform/text/TextJustify.h"],
type_name: "TextJustify",
default_value: "kTextJustifyAuto",
field_size: 2,
@@ -2083,7 +2120,8 @@
inherited: true,
interpolable: true,
field_template: "storage_only",
- field_type_path: "core/style/ShadowList",
+ type_name: "ShadowList",
+ include_paths: ["core/style/ShadowList.h"],
wrapper_pointer_name: "RefPtr",
default_value: "nullptr",
field_group: "rare-inherited",
@@ -2096,7 +2134,8 @@
inherited: true,
getter: "GetTextSizeAdjust",
field_template: "storage_only",
- field_type_path: "core/style/TextSizeAdjust",
+ type_name: "TextSizeAdjust",
+ include_paths: ["core/style/TextSizeAdjust.h"],
default_value: "TextSizeAdjust::AdjustAuto()",
field_group: "rare-inherited",
},
@@ -2130,7 +2169,8 @@
supports_percentage: true,
typedom_types: ["Length"],
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "surround",
default_value: "Length()",
},
@@ -2195,7 +2235,7 @@
},
{
name: "unicode-bidi",
- field_type_path: "platform/text/UnicodeBidi",
+ include_paths: ["platform/text/UnicodeBidi.h"],
default_value: "normal",
field_template: "keyword",
keywords: [
@@ -2384,7 +2424,8 @@
converter: "ConvertString<CSSValueNone>",
inherited: true,
field_template: "storage_only",
- field_type_path: "platform/wtf/text/AtomicString",
+ type_name: "AtomicString",
+ include_paths: ["platform/wtf/text/AtomicString.h"],
default_value: "g_null_atom",
field_group: "rare-inherited",
},
@@ -2394,7 +2435,8 @@
inherited: true,
name_for_methods: "HyphenationString",
field_template: "storage_only",
- field_type_path: "platform/wtf/text/AtomicString",
+ type_name: "AtomicString",
+ include_paths: ["platform/wtf/text/AtomicString.h"],
default_value: "AtomicString()",
field_group: "rare-inherited",
},
@@ -2550,7 +2592,8 @@
converter: "ConvertColor",
inherited: true,
field_template: "storage_only",
- field_type_path: "platform/graphics/Color",
+ type_name: "Color",
+ include_paths: ["platform/graphics/Color.h"],
default_value: "LayoutTheme::TapHighlightColor()",
field_group: "rare-inherited",
},
@@ -2567,7 +2610,8 @@
custom_all: true,
inherited: true,
field_template: "storage_only",
- field_type_path: "platform/graphics/Color",
+ type_name: "Color",
+ include_paths: ["platform/graphics/Color.h"],
default_value: "Color()",
field_group: "rare-inherited",
},
@@ -2590,7 +2634,8 @@
custom_all: true,
inherited: true,
field_template: "storage_only",
- field_type_path: "platform/graphics/Color",
+ type_name: "Color",
+ include_paths: ["platform/graphics/Color.h"],
default_value: "Color()",
field_group: "rare-inherited",
},
@@ -2611,7 +2656,8 @@
inherited: true,
interpolable: true,
field_template: "storage_only",
- field_type_path: "platform/graphics/Color",
+ type_name: "Color",
+ include_paths: ["platform/graphics/Color.h"],
default_value: "Color()",
field_group: "rare-inherited",
},
@@ -2693,7 +2739,8 @@
supports_percentage: true,
typedom_types: ["Length"],
field_template: "external",
- field_type_path: "platform/Length",
+ include_paths: ["platform/Length.h"],
+ type_name: "Length",
field_group: "box",
default_value: "Length()"
},

Powered by Google App Engine
This is Rietveld 408576698