Commit 85ba7c59 authored by timloh@chromium.org's avatar timloh@chromium.org

Merge CSSPropertyNames.in and SVGCSSPropertyNames.in with CSSProperties.in

This patch is part 2 of merging the CSS .in files. Having a single .in
file for listing CSS properties makes it both easier to add new properties
and add new property flags.

BUG=396992
TBR=pfeldman

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=180034

Review URL: https://codereview.chromium.org/415613002

git-svn-id: svn://svn.chromium.org/blink/trunk@180151 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a5f22313
<!DOCTYPE html>
<div id="test">This test passes if it does not crash.</div>
<script>
test.style.webkitAnimationName = "anim";
if (window.testRunner)
testRunner.dumpAsText();
</script>
...@@ -9,6 +9,7 @@ from name_utilities import lower_first ...@@ -9,6 +9,7 @@ from name_utilities import lower_first
class CSSProperties(in_generator.Writer): class CSSProperties(in_generator.Writer):
defaults = { defaults = {
'alias_for': None,
'longhands': '', 'longhands': '',
'font': False, 'font': False,
'svg': False, 'svg': False,
...@@ -43,10 +44,18 @@ class CSSProperties(in_generator.Writer): ...@@ -43,10 +44,18 @@ class CSSProperties(in_generator.Writer):
properties = self.in_file.name_dictionaries properties = self.in_file.name_dictionaries
for property in properties: self._aliases = {property['name']: property['alias_for'] for property in properties if property['alias_for']}
properties = [property for property in properties if not property['alias_for']]
assert len(properties) <= 1024, 'There are more than 1024 CSS Properties, you need to update CSSProperty.h/StylePropertyMetadata m_propertyID accordingly.'
# We currently assign 0 to CSSPropertyInvalid
self._first_enum_value = 1
for offset, property in enumerate(properties):
property['property_id'] = css_name_to_enum(property['name']) property['property_id'] = css_name_to_enum(property['name'])
property['upper_camel_name'] = camelcase_css_name(property['name']) property['upper_camel_name'] = camelcase_css_name(property['name'])
property['lower_camel_name'] = lower_first(property['upper_camel_name']) property['lower_camel_name'] = lower_first(property['upper_camel_name'])
property['enum_value'] = self._first_enum_value + offset
property['is_internal'] = property['name'].startswith('-internal-')
self._properties_list = properties self._properties_list = properties
self._properties = {property['property_id']: property for property in properties} self._properties = {property['property_id']: property for property in properties}
......
#!/usr/bin/env python #!/usr/bin/env python
import os.path
import re
import subprocess import subprocess
import sys import sys
from in_file import InFile import css_properties
import in_generator import in_generator
import license import license
...@@ -178,71 +176,47 @@ bool isInternalProperty(CSSPropertyID id) ...@@ -178,71 +176,47 @@ bool isInternalProperty(CSSPropertyID id)
""" """
class CSSPropertiesWriter(in_generator.Writer): class CSSPropertyNamesWriter(css_properties.CSSProperties):
class_name = "CSSPropertyNames" class_name = "CSSPropertyNames"
defaults = {
'alias_for': None,
'is_internal': False,
}
def __init__(self, file_paths): def __init__(self, in_file_path):
in_generator.Writer.__init__(self, file_paths) super(CSSPropertyNamesWriter, self).__init__(in_file_path)
self._outputs = {(self.class_name + ".h"): self.generate_header, self._outputs = {(self.class_name + ".h"): self.generate_header,
(self.class_name + ".cpp"): self.generate_implementation, (self.class_name + ".cpp"): self.generate_implementation,
} }
self._aliases = filter(lambda property: property['alias_for'], self.in_file.name_dictionaries)
for offset, property in enumerate(self._aliases):
# Aliases use the enum_name that they are an alias for.
property['enum_name'] = self._enum_name_from_property_name(property['alias_for'])
# Aliases do not get an enum_value.
self._properties = filter(lambda property: not property['alias_for'], self.in_file.name_dictionaries)
if len(self._properties) > 1024:
print "ERROR : There is more than 1024 CSS Properties, you need to update CSSProperty.h/StylePropertyMetadata m_propertyID accordingly."
exit(1)
self._first_property_id = 1 # We start after CSSPropertyInvalid.
property_id = self._first_property_id
for offset, property in enumerate(self._properties):
property['enum_name'] = self._enum_name_from_property_name(property['name'])
property['enum_value'] = self._first_property_id + offset
if property['name'].startswith('-internal-'):
property['is_internal'] = True
def _enum_name_from_property_name(self, property_name):
return "CSSProperty" + re.sub(r'(^[^-])|-(.)', lambda match: (match.group(1) or match.group(2)).upper(), property_name)
def _enum_declaration(self, property): def _enum_declaration(self, property):
return " %(enum_name)s = %(enum_value)s," % property return " %(property_id)s = %(enum_value)s," % property
def generate_header(self): def generate_header(self):
return HEADER_TEMPLATE % { return HEADER_TEMPLATE % {
'license': license.license_for_generated_cpp(), 'license': license.license_for_generated_cpp(),
'class_name': self.class_name, 'class_name': self.class_name,
'property_enums': "\n".join(map(self._enum_declaration, self._properties)), 'property_enums': "\n".join(map(self._enum_declaration, self._properties_list)),
'first_property_id': self._first_property_id, 'first_property_id': self._first_enum_value,
'properties_count': len(self._properties), 'properties_count': len(self._properties),
'last_property_id': self._first_property_id + len(self._properties) - 1, 'last_property_id': self._first_enum_value + len(self._properties) - 1,
'max_name_length': reduce(max, map(len, map(lambda property: property['name'], self._properties))), 'max_name_length': max(map(len, self._properties)),
} }
def _case_properties(self, property):
return "case %(enum_name)s:" % property
def generate_implementation(self): def generate_implementation(self):
property_offsets = [] property_offsets = []
current_offset = 0 current_offset = 0
for property in self._properties: for property in self._properties_list:
property_offsets.append(current_offset) property_offsets.append(current_offset)
current_offset += len(property["name"]) + 1 current_offset += len(property["name"]) + 1
css_name_and_enum_pairs = [(property['name'], property_id) for property_id, property in self._properties.items()]
for name, aliased_name in self._aliases.items():
css_name_and_enum_pairs.append((name, css_properties.css_name_to_enum(aliased_name)))
gperf_input = GPERF_TEMPLATE % { gperf_input = GPERF_TEMPLATE % {
'license': license.license_for_generated_cpp(), 'license': license.license_for_generated_cpp(),
'class_name': self.class_name, 'class_name': self.class_name,
'property_name_strings': '\n'.join(map(lambda property: ' "%(name)s\\0"' % property, self._properties)), 'property_name_strings': '\n'.join(map(lambda property: ' "%(name)s\\0"' % property, self._properties_list)),
'property_name_offsets': '\n'.join(map(lambda offset: ' %d,' % offset, property_offsets)), 'property_name_offsets': '\n'.join(map(lambda offset: ' %d,' % offset, property_offsets)),
'property_to_enum_map': '\n'.join(map(lambda property: '%(name)s, %(enum_name)s' % property, self._properties + self._aliases)), 'property_to_enum_map': '\n'.join(map(lambda property: '%s, %s' % property, css_name_and_enum_pairs)),
'internal_properties': '\n'.join(map(self._case_properties, filter(lambda property: property['is_internal'], self._properties))), 'internal_properties': '\n'.join("case %s:" % property_id for property_id, property in self._properties.items() if property['is_internal']),
} }
# FIXME: If we could depend on Python 2.7, we would use subprocess.check_output # FIXME: If we could depend on Python 2.7, we would use subprocess.check_output
gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n']
...@@ -253,4 +227,4 @@ class CSSPropertiesWriter(in_generator.Writer): ...@@ -253,4 +227,4 @@ class CSSPropertiesWriter(in_generator.Writer):
if __name__ == "__main__": if __name__ == "__main__":
in_generator.Maker(CSSPropertiesWriter).main(sys.argv) in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv)
...@@ -589,12 +589,8 @@ group("make_core_generated") { ...@@ -589,12 +589,8 @@ group("make_core_generated") {
} }
# "CSSPropertyNames" in make_core_generated from GYP. # "CSSPropertyNames" in make_core_generated from GYP.
process_in_files("make_core_generated_css_property_names") { css_properties("make_core_generated_css_property_names") {
script = "../build/scripts/make_css_property_names.py" script = "../build/scripts/make_css_property_names.py"
in_files = [
"css/CSSPropertyNames.in",
"css/SVGCSSPropertyNames.in",
]
outputs = [ outputs = [
"$blink_core_output_dir/CSSPropertyNames.cpp", "$blink_core_output_dir/CSSPropertyNames.cpp",
"$blink_core_output_dir/CSSPropertyNames.h", "$blink_core_output_dir/CSSPropertyNames.h",
......
...@@ -205,16 +205,9 @@ ...@@ -205,16 +205,9 @@
}, },
{ {
'action_name': 'CSSPropertyNames', 'action_name': 'CSSPropertyNames',
'variables': {
'in_files': [
'css/CSSPropertyNames.in',
'css/SVGCSSPropertyNames.in',
],
},
'inputs': [ 'inputs': [
'<@(scripts_for_in_files)', '<@(css_properties_files)',
'../build/scripts/make_css_property_names.py', '../build/scripts/make_css_property_names.py',
'<@(in_files)'
], ],
'outputs': [ 'outputs': [
'<(blink_core_output_dir)/CSSPropertyNames.cpp', '<(blink_core_output_dir)/CSSPropertyNames.cpp',
...@@ -223,7 +216,7 @@ ...@@ -223,7 +216,7 @@
'action': [ 'action': [
'python', 'python',
'../build/scripts/make_css_property_names.py', '../build/scripts/make_css_property_names.py',
'<@(in_files)', 'css/CSSProperties.in',
'--output_dir', '--output_dir',
'<(blink_core_output_dir)', '<(blink_core_output_dir)',
'--gperf', '<(gperf_exe)', '--gperf', '<(gperf_exe)',
......
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
// are described below with example usage // are described below with example usage
// - alias_for=other-property
// Properties specifying alias_for do not get their own enum and instead map
// directly onto the CSSPropertyID they alias. Currently this means that the
// UseCounter will not pick up on these (crbug.com/304855)
// - longhands=property;other-property // - longhands=property;other-property
// The property is a shorthand for several other properties. // The property is a shorthand for several other properties.
...@@ -60,6 +66,7 @@ ...@@ -60,6 +66,7 @@
// High Priority and all other font properties. // High Priority and all other font properties.
// Other properties can depend upon high priority properties (e.g. font-size / ems) // Other properties can depend upon high priority properties (e.g. font-size / ems)
color custom_all color custom_all
direction custom_value
// FIXME: This is a mess due to crbug.com/353932. Shorthands shouldn't have // FIXME: This is a mess due to crbug.com/353932. Shorthands shouldn't have
// any StyleBuilder handling! // any StyleBuilder handling!
font custom_all, longhands=font-family;font-size;font-style;font-variant;font-weight;font-stretch;line-height font custom_all, longhands=font-family;font-size;font-style;font-variant;font-weight;font-stretch;line-height
...@@ -75,8 +82,10 @@ font-weight font, type_name=FontWeight, name_for_methods=Weight, converter=conve ...@@ -75,8 +82,10 @@ font-weight font, type_name=FontWeight, name_for_methods=Weight, converter=conve
-webkit-font-smoothing font, type_name=FontSmoothingMode -webkit-font-smoothing font, type_name=FontSmoothingMode
-webkit-locale custom_value -webkit-locale custom_value
-webkit-text-orientation custom_value -webkit-text-orientation custom_value
-webkit-writing-mode custom_value
text-rendering font, type_name=TextRenderingMode text-rendering font, type_name=TextRenderingMode
zoom custom_all zoom custom_all
line-height getter=specifiedLineHeight, custom_value
align-content align-content
align-items custom_all align-items custom_all
...@@ -134,7 +143,6 @@ content custom_all ...@@ -134,7 +143,6 @@ content custom_all
counter-increment custom_all counter-increment custom_all
counter-reset custom_all counter-reset custom_all
cursor custom_all cursor custom_all
direction custom_value
display display
dominant-baseline svg dominant-baseline svg
empty-cells type_name=EEmptyCell empty-cells type_name=EEmptyCell
...@@ -171,7 +179,6 @@ justify-self custom_all ...@@ -171,7 +179,6 @@ justify-self custom_all
left initial=initialOffset, converter=convertLengthOrAuto left initial=initialOffset, converter=convertLengthOrAuto
letter-spacing initial=initialLetterWordSpacing, converter=convertSpacing letter-spacing initial=initialLetterWordSpacing, converter=convertSpacing
lighting-color svg, converter=convertSVGColor lighting-color svg, converter=convertSVGColor
line-height getter=specifiedLineHeight, custom_value
list-style-image custom_value list-style-image custom_value
list-style-position list-style-position
list-style-type list-style-type
...@@ -356,7 +363,6 @@ word-wrap name_for_methods=OverflowWrap ...@@ -356,7 +363,6 @@ word-wrap name_for_methods=OverflowWrap
-webkit-user-drag -webkit-user-drag
-webkit-user-modify -webkit-user-modify
-webkit-user-select -webkit-user-select
-webkit-writing-mode custom_value
white-space white-space
widows type_name=short, custom_all widows type_name=short, custom_all
width initial=initialSize, converter=convertLengthSizing width initial=initialSize, converter=convertLengthSizing
...@@ -481,3 +487,36 @@ transition longhands=transition-property;transition-duration;transition-timing-f ...@@ -481,3 +487,36 @@ transition longhands=transition-property;transition-duration;transition-timing-f
-webkit-text-stroke longhands=-webkit-text-stroke-width;-webkit-text-stroke-color -webkit-text-stroke longhands=-webkit-text-stroke-width;-webkit-text-stroke-color
-webkit-transform-origin longhands=-webkit-transform-origin-x;-webkit-transform-origin-y;-webkit-transform-origin-z -webkit-transform-origin longhands=-webkit-transform-origin-x;-webkit-transform-origin-y;-webkit-transform-origin-z
-webkit-transition longhands=-webkit-transition-property;-webkit-transition-duration;-webkit-transition-timing-function;-webkit-transition-delay -webkit-transition longhands=-webkit-transition-property;-webkit-transition-duration;-webkit-transition-timing-function;-webkit-transition-delay
// Aliases; these map to the same CSSPropertyID
-epub-caption-side alias_for=caption-side
-epub-text-combine alias_for=-webkit-text-combine
-epub-text-emphasis alias_for=-webkit-text-emphasis
-epub-text-emphasis-color alias_for=-webkit-text-emphasis-color
-epub-text-emphasis-style alias_for=-webkit-text-emphasis-style
-epub-text-orientation alias_for=-webkit-text-orientation
-epub-text-transform alias_for=text-transform
-epub-word-break alias_for=word-break
-epub-writing-mode alias_for=-webkit-writing-mode
-webkit-align-content alias_for=align-content
-webkit-align-items alias_for=align-items
-webkit-align-self alias_for=align-self
-webkit-border-bottom-left-radius alias_for=border-bottom-left-radius
-webkit-border-bottom-right-radius alias_for=border-bottom-right-radius
-webkit-border-top-left-radius alias_for=border-top-left-radius
-webkit-border-top-right-radius alias_for=border-top-right-radius
-webkit-box-sizing alias_for=box-sizing
-webkit-flex alias_for=flex
-webkit-flex-basis alias_for=flex-basis
-webkit-flex-direction alias_for=flex-direction
-webkit-flex-flow alias_for=flex-flow
-webkit-flex-grow alias_for=flex-grow
-webkit-flex-shrink alias_for=flex-shrink
-webkit-flex-wrap alias_for=flex-wrap
-webkit-justify-content alias_for=justify-content
-webkit-opacity alias_for=opacity
-webkit-order alias_for=order
-webkit-shape-image-threshold alias_for=shape-image-threshold
-webkit-shape-margin alias_for=shape-margin
-webkit-shape-outside alias_for=shape-outside
...@@ -92,7 +92,7 @@ private: ...@@ -92,7 +92,7 @@ private:
inline CSSPropertyID prefixingVariantForPropertyId(CSSPropertyID propId) inline CSSPropertyID prefixingVariantForPropertyId(CSSPropertyID propId)
{ {
if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && (propId >= CSSPropertyWebkitAnimation && propId <= CSSPropertyAnimationTimingFunction)) if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled())
return propId; return propId;
CSSPropertyID propertyId = CSSPropertyInvalid; CSSPropertyID propertyId = CSSPropertyInvalid;
......
//
// CSS property names
//
// Some properties are used internally, but are not part of CSS. They are used to get
// HTML4 compatibility in the rendering engine.
//
// Microsoft extensions are documented here:
// http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp
//
// high-priority properties (those on which other properties can depend) must
// be listed first
color
direction
font
font-family
font-kerning
font-size
font-stretch
font-style
font-variant
font-variant-ligatures
font-weight
text-rendering
-webkit-font-feature-settings
-webkit-font-smoothing
-webkit-locale
-webkit-text-orientation
-epub-text-orientation alias_for=-webkit-text-orientation
-webkit-writing-mode
-epub-writing-mode alias_for=-webkit-writing-mode
zoom
// line height needs to be right after the above high-priority properties
line-height
// The remaining properties are listed in some order
background
background-attachment
background-blend-mode
background-clip
background-color
background-image
background-origin
background-position
background-position-x
background-position-y
background-repeat
background-repeat-x
background-repeat-y
background-size
border
border-bottom
border-bottom-color
border-bottom-left-radius
-webkit-border-bottom-left-radius alias_for=border-bottom-left-radius
border-bottom-right-radius
-webkit-border-bottom-right-radius alias_for=border-bottom-right-radius
border-bottom-style
border-bottom-width
border-collapse
border-color
border-image
border-image-outset
border-image-repeat
border-image-slice
border-image-source
border-image-width
border-left
border-left-color
border-left-style
border-left-width
border-radius
border-right
border-right-color
border-right-style
border-right-width
border-spacing
border-style
border-top
border-top-color
border-top-left-radius
-webkit-border-top-left-radius alias_for=border-top-left-radius
border-top-right-radius
-webkit-border-top-right-radius alias_for=border-top-right-radius
border-top-style
border-top-width
border-width
bottom
box-shadow
box-sizing
// -webkit-box-sizing worked in Safari 4 and earlier.
-webkit-box-sizing alias_for=box-sizing
caption-side
-epub-caption-side alias_for=caption-side
clear
clip
-webkit-clip-path
content
counter-increment
counter-reset
cursor
empty-cells
float
height
image-rendering
isolation
justify-items
justify-self
left
letter-spacing
list-style
list-style-image
list-style-position
list-style-type
margin
margin-bottom
margin-left
margin-right
margin-top
mask-source-type
max-height
max-width
min-height
min-width
mix-blend-mode
opacity
// Honor -webkit-opacity as a synonym for opacity. This was the only syntax that worked in Safari 1.1,
// and may be in use on some websites and widgets.
-webkit-opacity alias_for=opacity
orphans
outline
outline-color
outline-offset
outline-style
outline-width
object-fit
object-position
overflow
overflow-wrap
overflow-x
overflow-y
padding
padding-bottom
padding-left
padding-right
padding-top
page
page-break-after
page-break-before
page-break-inside
pointer-events
position
quotes
resize
right
scroll-behavior
size
src
speak
table-layout
tab-size
text-align
text-align-last
text-decoration
text-decoration-line
text-decoration-style
text-decoration-color
text-indent
text-justify
text-overflow
text-shadow
text-transform
-epub-text-transform alias_for=text-transform
text-underline-position
top
touch-action
touch-action-delay
display
-webkit-animation
-webkit-animation-delay
-webkit-animation-direction
-webkit-animation-duration
-webkit-animation-fill-mode
-webkit-animation-iteration-count
-webkit-animation-name
-webkit-animation-play-state
-webkit-animation-timing-function
animation
animation-delay
animation-direction
animation-duration
animation-fill-mode
animation-iteration-count
animation-name
animation-play-state
animation-timing-function
-webkit-transition
-webkit-transition-delay
-webkit-transition-duration
-webkit-transition-property
-webkit-transition-timing-function
transition
transition-delay
transition-duration
transition-property
transition-timing-function
unicode-bidi
unicode-range
vertical-align
visibility
white-space
widows
width
will-change
word-break
-epub-word-break alias_for=word-break
word-spacing
word-wrap
z-index
-webkit-appearance
-webkit-aspect-ratio
backface-visibility
-webkit-backface-visibility
-webkit-background-clip
-webkit-background-composite
-webkit-background-origin
// -webkit-background-size differs from background-size only in the interpretation of
// a single value: -webkit-background-size: l; is equivalent to background-size: l l;
// whereas background-size: l; is equivalent to background-size: l auto;
-webkit-background-size
-webkit-border-after
-webkit-border-after-color
-webkit-border-after-style
-webkit-border-after-width
-webkit-border-before
-webkit-border-before-color
-webkit-border-before-style
-webkit-border-before-width
-webkit-border-end
-webkit-border-end-color
-webkit-border-end-style
-webkit-border-end-width
-webkit-border-fit
-webkit-border-horizontal-spacing
-webkit-border-image
// -webkit-border-radius differs from border-radius only in the interpretation of
// a value consisting of two lengths: "-webkit-border-radius: l1 l2;" is equivalent
// to "border-radius: l1 / l2;"
-webkit-border-radius
-webkit-border-start
-webkit-border-start-color
-webkit-border-start-style
-webkit-border-start-width
-webkit-border-vertical-spacing
-webkit-box-align
-webkit-box-direction
-webkit-box-flex
-webkit-box-flex-group
-webkit-box-lines
-webkit-box-ordinal-group
-webkit-box-orient
-webkit-box-pack
-webkit-box-reflect
-webkit-box-shadow
-internal-callback
-webkit-column-break-after
-webkit-column-break-before
-webkit-column-break-inside
-webkit-column-count
column-fill
-webkit-column-gap
-webkit-column-rule
-webkit-column-rule-color
-webkit-column-rule-style
-webkit-column-rule-width
-webkit-column-span
-webkit-column-width
-webkit-columns
-webkit-box-decoration-break
-webkit-filter
align-content
-webkit-align-content alias_for=align-content
align-items
-webkit-align-items alias_for=align-items
align-self
-webkit-align-self alias_for=align-self
flex
-webkit-flex alias_for=flex
flex-basis
-webkit-flex-basis alias_for=flex-basis
flex-direction
-webkit-flex-direction alias_for=flex-direction
flex-flow
-webkit-flex-flow alias_for=flex-flow
flex-grow
-webkit-flex-grow alias_for=flex-grow
flex-shrink
-webkit-flex-shrink alias_for=flex-shrink
flex-wrap
-webkit-flex-wrap alias_for=flex-wrap
justify-content
-webkit-justify-content alias_for=justify-content
-webkit-font-size-delta
grid-auto-columns
grid-auto-flow
grid-auto-rows
grid-area
grid-column
grid-column-end
grid-column-start
grid
grid-template
grid-template-columns
grid-template-rows
grid-row
grid-row-end
grid-row-start
grid-template-areas
-webkit-highlight
-webkit-hyphenate-character
-webkit-line-box-contain
-webkit-line-break
-webkit-line-clamp
-webkit-logical-width
-webkit-logical-height
-webkit-margin-after-collapse
-webkit-margin-before-collapse
-webkit-margin-bottom-collapse
-webkit-margin-top-collapse
-webkit-margin-collapse
-webkit-margin-after
-webkit-margin-before
-webkit-margin-end
-webkit-margin-start
-webkit-mask
-webkit-mask-box-image
-webkit-mask-box-image-outset
-webkit-mask-box-image-repeat
-webkit-mask-box-image-slice
-webkit-mask-box-image-source
-webkit-mask-box-image-width
-webkit-mask-clip
-webkit-mask-composite
-webkit-mask-image
-webkit-mask-origin
-webkit-mask-position
-webkit-mask-position-x
-webkit-mask-position-y
-webkit-mask-repeat
-webkit-mask-repeat-x
-webkit-mask-repeat-y
-webkit-mask-size
-webkit-max-logical-width
-webkit-max-logical-height
-webkit-min-logical-width
-webkit-min-logical-height
order
-webkit-order alias_for=order
-webkit-padding-after
-webkit-padding-before
-webkit-padding-end
-webkit-padding-start
perspective
-webkit-perspective
perspective-origin
-webkit-perspective-origin
-webkit-perspective-origin-x
-webkit-perspective-origin-y
-webkit-print-color-adjust
-webkit-rtl-ordering
-webkit-ruby-position
-webkit-text-combine
-epub-text-combine alias_for=-webkit-text-combine
-webkit-text-decorations-in-effect
-webkit-text-emphasis
-epub-text-emphasis alias_for=-webkit-text-emphasis
-webkit-text-emphasis-color
-epub-text-emphasis-color alias_for=-webkit-text-emphasis-color
-webkit-text-emphasis-position
-webkit-text-emphasis-style
-epub-text-emphasis-style alias_for=-webkit-text-emphasis-style
-webkit-text-fill-color
-webkit-text-security
-webkit-text-stroke
-webkit-text-stroke-color
-webkit-text-stroke-width
transform
-webkit-transform
transform-origin
-webkit-transform-origin
-webkit-transform-origin-x
-webkit-transform-origin-y
-webkit-transform-origin-z
transform-style
-webkit-transform-style
-webkit-user-drag
-webkit-user-modify
-webkit-user-select
-webkit-shape-outside alias_for=shape-outside
-webkit-shape-margin alias_for=shape-margin
-webkit-shape-image-threshold alias_for=shape-image-threshold
shape-outside
shape-margin
shape-image-threshold
max-zoom
min-zoom
orientation
user-zoom
-webkit-tap-highlight-color
-webkit-app-region
all
// Internal properties.
-internal-marquee-direction
-internal-marquee-increment
-internal-marquee-repetition
-internal-marquee-speed
-internal-marquee-style
//
// SVG CSS property names
//
// SVG style props
buffered-rendering
clip-path
clip-rule
mask
// opacity
enable-background
filter
flood-color
flood-opacity
lighting-color
stop-color
stop-opacity
// pointer-events
color-interpolation
color-interpolation-filters
color-rendering
fill
fill-opacity
fill-rule
//font-size-adjust
//image-rendering
marker
marker-end
marker-mid
marker-start
mask-type
shape-rendering
stroke
stroke-dasharray
stroke-dashoffset
stroke-linecap
stroke-linejoin
stroke-miterlimit
stroke-opacity
stroke-width
// text-rendering
alignment-baseline
baseline-shift
dominant-baseline
glyph-orientation-horizontal
glyph-orientation-vertical
text-anchor
vector-effect
writing-mode
paint-order
...@@ -1291,8 +1291,8 @@ template<> CSSPropertyID StyleResolver::lastCSSPropertyId<StyleResolver::HighPri ...@@ -1291,8 +1291,8 @@ template<> CSSPropertyID StyleResolver::lastCSSPropertyId<StyleResolver::HighPri
// lastCSSPropertyId<LowPriorityProperties>. // lastCSSPropertyId<LowPriorityProperties>.
template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::LowPriorityProperties>() template<> CSSPropertyID StyleResolver::firstCSSPropertyId<StyleResolver::LowPriorityProperties>()
{ {
COMPILE_ASSERT(CSSPropertyBackground == CSSPropertyLineHeight + 1, CSS_background_is_first_low_priority_property); COMPILE_ASSERT(CSSPropertyAlignContent == CSSPropertyLineHeight + 1, CSS_background_is_first_low_priority_property);
return CSSPropertyBackground; return CSSPropertyAlignContent;
} }
// This method returns the last CSSPropertyId of low priority properties. // This method returns the last CSSPropertyId of low priority properties.
......
...@@ -157,8 +157,6 @@ action("supported_css_properties") { ...@@ -157,8 +157,6 @@ action("supported_css_properties") {
script = "scripts/generate_supported_css.py" script = "scripts/generate_supported_css.py"
inputs = [ inputs = [
"../core/css/CSSPropertyNames.in",
"../core/css/SVGCSSPropertyNames.in",
"../core/css/CSSProperties.in", "../core/css/CSSProperties.in",
] ]
......
...@@ -237,8 +237,6 @@ ...@@ -237,8 +237,6 @@
# The python script in action below. # The python script in action below.
'scripts/generate_supported_css.py', 'scripts/generate_supported_css.py',
# Input files for the script. # Input files for the script.
'../core/css/CSSPropertyNames.in',
'../core/css/SVGCSSPropertyNames.in',
'../core/css/CSSProperties.in', '../core/css/CSSProperties.in',
], ],
'outputs': [ 'outputs': [
......
...@@ -34,49 +34,22 @@ except ImportError: ...@@ -34,49 +34,22 @@ except ImportError:
import sys import sys
cssProperties = {}
def properties_from_file(file_name):
def filterCommentsAndEmptyLines(lines): properties = []
result = [] with open(file_name, "r") as f:
for line in lines: for line in f:
if len(line.strip()) > 0 and line[:2] != "//": line = line.strip()
result.append(line.strip()) if not line or line.startswith("//") or "alias_for" in line:
return result continue
name = line.partition(" ")[0]
entry = {"name": name}
def fillPropertiesFromFile(fileName): longhands = line.partition("longhands=")[2].partition(",")[0]
with open(fileName, "r") as f: if longhands:
lines = f.readlines() entry["longhands"] = longhands.split(";")
lines = filterCommentsAndEmptyLines(lines) properties.append(entry)
for line in lines: return properties
if not "alias_for" in line:
cssProperties[line] = [] properties = properties_from_file(sys.argv[1])
with open(sys.argv[2], "w") as f:
f.write("WebInspector.CSSMetadata.initializeWithSupportedProperties(%s);" % json.dumps(properties))
def fillCSSShorthandsFromFile(fileName):
with open(fileName, "r") as f:
lines = f.readlines()
lines = filterCommentsAndEmptyLines(lines)
for line in lines:
# Format for shorthands is:
# <property-name>[ longhands=<longhand 1>;<longhand 2>;<longhand 3>]
shorthand = line.partition(" ")[0]
longhands = line.partition("longhands=")[2].partition(",")[0]
if longhands:
cssProperties[shorthand] = longhands.split(";")
fillPropertiesFromFile(sys.argv[1])
fillPropertiesFromFile(sys.argv[2])
fillCSSShorthandsFromFile(sys.argv[3])
# Reformat from map into list.
reformat = []
for name, longhands in cssProperties.items():
entry = {"name": name}
if len(longhands) > 0:
entry["longhands"] = longhands
reformat.append(entry)
with open(sys.argv[4], "w") as f:
f.write("WebInspector.CSSMetadata.initializeWithSupportedProperties(%s);" % json.dumps(reformat))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment