WebUI: Add a new preprocess_if_expr rule to preprocess only <if expr>s
preprocess_grit takes the same path as preprocess="true" for a grd file
entry. This includes inlining <include>s, which is no longer supported
(see styleguide at [1]). Add a new preprocess_if_expr rule, which is
copied from preprocess_grit, with the following modifications:
(1) Runs only the preprocessing of <if expr>s ("Conditional Elements")
    and not the rest of the preprocess="true" HTML inlining path
(2) Depends on fewer pieces of grit, by no longer using the full DoInline
    method and inlining/simplifying some logic for parsing defines.
This new rule shares the same inputs as preprocess_grit. In followup
CLs, users of preprocess_grit can be migrated by simply importing the
new rule and replacing all usages of preprocess_grit with
preprocess_if_expr. Once all usages have been migrated, preprocess_grit
will be deleted.
[1] https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/web/web.md#Preprocessing
Change-Id: Iccb00ea036b336a2ad16cb74e75fbfe0264c751b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2557262
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: 
dpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831117}
Showing
Please register or sign in to comment