This is a sub-task of Project Ribbon.
TLDR: We should fast-track the completion of the CSS property API for CSSPropertyVariable (called CSSPropertyAPIVariable at time of writing). This will make Custom Properties easier to reason about & improve as a stand-alone feature.
So far Project Ribbon has progressed by breaking up large style engine methods one-at-a-time and moving their logic into CSSPropertyAPI & its subclasses. We should break this pattern and move logic relating to CSSPropertyAPIVariable into CSSPropertyVariable in advance of other properties.
Once we have all of the custom property logic together in one class, we can re-asses its design to see if we can improve its clarity and - more importantly - performance.
It may also be worthwhile to move logic pertaining to custom properties into CSSPropertyAPIVariable from methods that we do not plan to completely Ribbonize. This will require special-case calls to CSSPropertyAPIVariable where logic for other properties is in-line, but will make all the custom property logic easier to find & possibly re-design/refactor/optimize.
Comment 1 by rjwright@chromium.org
, Oct 31 2017