Implement ConsumeShorthandGreedilyViaLonghandsAPI and API for shorthand...
Implement ConsumeShorthandGreedilyViaLonghandsAPI and API for shorthand property -webkit-text-emphasis. ConsumeShorthandGreedilyViaLonghandsAPI is a modified version of ConsumeShorthandGreedily of CSSPropertyParser. The difference between the two is that the new version expects component longhands to have API impl already as it will forward parsing logic to component longhands API via ParseLonghandViaAPI. ConsumeShorthandGreedily will be deprecated soon, when shorthand properties are ribbonised (i.e. have their own APIs). Until then, there is a slight code duplication between the two versions for the following reasons: 1. An alternative to code duplicate is to have the old ConsumeShorthandGreedily call the new ConsumeShorthandGreedilyViaLonghandsAPI. However, the new ConsumeShorthandGreedilyViaLonghandsAPI expects ALL component longhands to have APIs and will parse all longhands via their APIs. In order to parse shorthands, where some component longhands do not have APIs, the new ConsumeShorthandGreedilyViaLonghandsAPI will need to return to the old ConsumeShorthandGreedily which longhands have no APIs and thus are not parsed. The old ConsumeShorthandGreedily will then have to parse these longhands separately. Hence there's added code complexity with little code reduction. 2. All shorthand properties will have APIs soon, hence such code duplication is temporary only. This cl also implements API for shorthand property -webkit-text-emphasis as a use case of ConsumeShorthandGreedilyViaLonghandsAPI. Design doc for shorthand parsing: https://docs.google.com/document/d/1gF_3wAvO82iVNcyJ7z2YzT8sFa8JepkWmIgJ9NcT1Pc/edit Diff: https://gist.github.com/f9cff56b20f46225b6b90f033798eccf/revisions Bug: 668012 Change-Id: I1cf9295893bb113527b44c2935d296e2997164ac Reviewed-on: https://chromium-review.googlesource.com/564875Reviewed-by:meade_UTC10 <meade@chromium.org> Reviewed-by:
Darren Shen <shend@chromium.org> Commit-Queue: Jia Meng <jiameng@chromium.org> Cr-Commit-Position: refs/heads/master@{#485567}
Showing
Please register or sign in to comment