Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Issue 2692803002: Clean up type handling in make_computed_style_base.py. (Closed)

Created:
3 years, 10 months ago by shend
Modified:
3 years, 10 months ago
Reviewers:
meade_UTC10
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Clean up type handling in make_computed_style_base.py. Currently, the way we specify the types of fields in ComputedStyleBase is confusing and inconsistent. This makes it difficult to extend the generator to support non-enum types like ints and platform types. This patch renames: - storage_type -> type_name (not really storage related) - storage_type_path -> field_type_path (not really storage related) - field_family -> field_role (family is vague, role is better IMO) - keyword_only -> field_template (field_template generalises keyword_only to more than just enums). so that, as of this patch: - Every field picks a 'template' which for now can only be 'keyword', but can be 'primitive' or 'external' when we support those later. This affects what the generated API for that field looks like. - Every field has a 'type_name', which is the actual C++ type used in the generated code. For 'keyword' fields, this is the enum name. For 'primitive', it'll be int/bool etc. Previously, 'storage_type' was same as 'type_name', which means templates could not tell whether the field is a enum or something else. This patch does not change behaviour. BUG=628043 Review-Url: https://codereview.chromium.org/2692803002 Cr-Commit-Position: refs/heads/master@{#451534} Committed: https://chromium.googlesource.com/chromium/src/+/e3c137153d7e9995c53612e071d3afe094de39e2

Patch Set 1 #

Patch Set 2 : Use primitive #

Patch Set 3 : Cleaner CL #

Patch Set 4 : Better names? #

Patch Set 5 : Clearer CL #

Patch Set 6 : Don't change behaviour #

Total comments: 6

Patch Set 7 : Rebase #

Patch Set 8 : Rebase #

Total comments: 2

Patch Set 9 : Address comments #

Patch Set 10 : primitive -> flag #

Patch Set 11 : Rebase #

Patch Set 12 : Update comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -80 lines) Patch
M third_party/WebKit/Source/build/scripts/make_computed_style_base.py View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +36 lines, -29 lines 0 comments Download
M third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl View 1 2 3 4 5 6 7 8 2 chunks +19 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSProperties.json5 View 1 2 3 4 5 6 7 8 9 10 27 chunks +42 lines, -43 lines 0 comments Download

Messages

Total messages: 40 (26 generated)
shend
Hi Naina, PTAL. Let me know what you think of the names.
3 years, 10 months ago (2017-02-13 04:49:43 UTC) #6
shend
-nainar since she's not familiar with this code. Eddy PTAL :)
3 years, 10 months ago (2017-02-13 05:26:58 UTC) #8
meade_UTC10
https://codereview.chromium.org/2692803002/diff/100001/third_party/WebKit/Source/build/scripts/make_computed_style_base.py File third_party/WebKit/Source/build/scripts/make_computed_style_base.py (right): https://codereview.chromium.org/2692803002/diff/100001/third_party/WebKit/Source/build/scripts/make_computed_style_base.py#newcode40 third_party/WebKit/Source/build/scripts/make_computed_style_base.py:40: # Affects how the field is generated (keyword, primitive, ...
3 years, 10 months ago (2017-02-13 06:46:24 UTC) #10
shend
On 2017/02/13 at 06:46:24, meade wrote: > https://codereview.chromium.org/2692803002/diff/100001/third_party/WebKit/Source/build/scripts/make_computed_style_base.py > File third_party/WebKit/Source/build/scripts/make_computed_style_base.py (right): > > https://codereview.chromium.org/2692803002/diff/100001/third_party/WebKit/Source/build/scripts/make_computed_style_base.py#newcode40 ...
3 years, 10 months ago (2017-02-13 07:15:42 UTC) #12
meade_UTC10
Re template vs field_template, it'd be better to make them consistent imo - field.field_template is ...
3 years, 10 months ago (2017-02-16 00:56:29 UTC) #14
meade_UTC10
lgtm Please fix the comments comment :)
3 years, 10 months ago (2017-02-16 00:56:45 UTC) #15
shend
On 2017/02/16 at 00:56:45, meade wrote: > lgtm > > Please fix the comments comment ...
3 years, 10 months ago (2017-02-16 00:57:30 UTC) #16
shend
On 2017/02/16 at 00:56:29, meade wrote: > Re template vs field_template, it'd be better to ...
3 years, 10 months ago (2017-02-16 01:01:30 UTC) #17
shend
Addressed comments https://codereview.chromium.org/2692803002/diff/100001/third_party/WebKit/Source/build/scripts/make_computed_style_base.py File third_party/WebKit/Source/build/scripts/make_computed_style_base.py (right): https://codereview.chromium.org/2692803002/diff/100001/third_party/WebKit/Source/build/scripts/make_computed_style_base.py#newcode40 third_party/WebKit/Source/build/scripts/make_computed_style_base.py:40: # Affects how the field is generated ...
3 years, 10 months ago (2017-02-16 02:48:58 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2692803002/200001
3 years, 10 months ago (2017-02-16 21:56:48 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2692803002/220001
3 years, 10 months ago (2017-02-17 01:56:35 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) chromium_presubmit on ...
3 years, 10 months ago (2017-02-17 03:59:39 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2692803002/220001
3 years, 10 months ago (2017-02-19 22:29:13 UTC) #37
commit-bot: I haz the power
3 years, 10 months ago (2017-02-20 00:07:24 UTC) #40
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/e3c137153d7e9995c53612e071d3...

Powered by Google App Engine
This is Rietveld 408576698