Implement ParseLonghandViaAPI and move CountKeywordOnlyPropertyUsage to CSSPropertyParserHelpers

Desktop / Chromium - Jia [] - 9 July 2017 20:49 EDT

This cl contains the following changes
- Implemented ParseLonghandViaAPI in CSSPropertyParserHelpers.- This function will be used by Consume2Values, Consume4Values and ConsumeShorthandGreedily. These shorthand parsing functions all need to forward parsing ops to component longhands.
- At the moment, these functions call CSSPropertyParser's ParseSingleValue. However, as we will later move these shorthand parsing functions to CSSPropertyParserHelpers, we should not continue to call CSSPropertyParser.- Therefore, this cl adds ParseLonghandViaAPI, which contains similar logic to CSSPropertyParser's ParseSingleValue, with the exception that this new method only works on longhands that have API impl.

- Moved CountKeywordOnlyPropertyUsage from CSSPropertyParser to CSSPropertyParserHelps.
- This function is used by ParseLonghandViaAPI.

Note, the next cl will have an impl of ConsumeShorthandVia4LonghandsAPI that will use ParseLonghandViaAPI.

Bug: 668012 Change-Id: Ia9211f9eb5d70124536f5ef0e7d44eeafefa69e2 Reviewed-on: Commit-Queue: Jia Meng

065f9c7 Implement ParseLonghandViaAPI and move CountKeywordOnlyPropertyUsage to CSSPropertyParserHelpers.
.../Source/core/css/parser/CSSPropertyParser.cpp | 81 ++------------------
.../core/css/parser/CSSPropertyParserHelpers.cpp | 88 ++++++++++++++++++++++
.../core/css/parser/CSSPropertyParserHelpers.h | 10 +++
3 files changed, 106 insertions(+), 73 deletions(-)


  • Share