DescriptionGenerate mappings between CSSValueID and ComputedStyle enums.
To convert between CSSValueIDs and ComputedStyle enums, we currently
use handwritten switch statements. This patch generates, for every
'keyword' field in CSSProperties.json5, a pair of mapping functions
that convert between a CSSValueID and the corresponding enum of the
field. This makes it easier to add new CSS properties and reduces the
risk of typos in the handwritten mapping functions.
As we generate more CSS properties, we can remove more of the
handwritten switch statements. For special cases that we can't
generate (e.g. when the mapping is not bijective), we can overload/
specialize the mapping functions in C++.
The generated mappings file CSSValueMappings.h is at:
https://gist.github.com/anonymous/93e797f4e99c3e8aba829139f612abe0
The names for the mapping functions comes from:
https://codereview.chromium.org/2366243002/
BUG=665272
Review-Url: https://codereview.chromium.org/2702173002
Cr-Commit-Position: refs/heads/master@{#453643}
Committed: https://chromium.googlesource.com/chromium/src/+/5bf6de7534c19b51e66607786263b90deba99b26
Patch Set 1 #Patch Set 2 : Generate more things #Patch Set 3 : Do it properly #
Total comments: 1
Patch Set 4 : Forgot file #Patch Set 5 : Forgot case #
Dependent Patchsets: Messages
Total messages: 25 (19 generated)
|