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

Issue 2187493004: Add a generated ComputedStyleBase class that ComputedStyle extends (Closed)

Created:
4 years, 4 months ago by sashab
Modified:
4 years, 3 months ago
Reviewers:
esprehn
CC:
blink-reviews, blink-reviews-css, blink-reviews-style_chromium.org, chromium-reviews, esprehn, glazkov+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@_make_visibility_enum_class_rebase
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a generated ComputedStyleBase class that ComputedStyle extends Add a generated ComputedStyleBase class that ComputedStyle extends from, as well as a generated ComputedStyleBaseConstants file that ComputedStyleConstants includes. Moved the 'visibility' field to be generated in ComputedStyleBase and it's type, the EVisibility enum, to be generated as well. This patch adds the 'keyword_only' field to CSSProperties.in, which is used to detect keyword-only properties that can be stored as bitfields, as well as enough generation code to generate enum bitfields. Other field types, as well as support for custom storage and methods, will be added in future patches. This is the beginning of an effort to move properties across to ComputedStyleBase and then, eventually, remove ComputedStyle and rename the base to ComputedStyle. Design doc: https://docs.google.com/document/d/1sWf_kCtVSokx8oDJZwTrUk2JNqrgTZDV0Z-jsy6tWxg/edit BUG=628043 Committed: https://crrev.com/8439075a9356236aa3f893f67f23faab867baccf Cr-Commit-Position: refs/heads/master@{#420508}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Rebase to use unsigned #

Patch Set 3 : Added TODOs for future fixes #

Patch Set 4 : Rebase #

Patch Set 5 : Rebase #

Patch Set 6 : Renamed BaseComputedStyle to ComputedStyleBase #

Patch Set 7 : Rebase onto fast path patches #

Total comments: 2

Patch Set 8 : Moved enum back to ComputedStyleBase and removed TODO #

Patch Set 9 : Updated ComputedStyle.cpp to use new size check method #

Patch Set 10 : Small fix to SameSizeAs check -- used inheritance instead of manual vtable sizing #

Patch Set 11 : Fixed typo; ComputedStyleBase instead of BaseComputedStyle #

Patch Set 12 : Rebase #

Patch Set 13 : Moved RefCounted<> down to ComputedStyle to fix memory leak #

Patch Set 14 : Re-ordered inheritance to match initializers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+317 lines, -31 lines) Patch
M third_party/WebKit/Source/build/scripts/css_properties.py View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/build/scripts/make_computed_style_base.py View 1 2 3 4 5 6 1 chunk +88 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl View 1 2 3 4 5 1 chunk +15 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +116 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl View 1 2 3 4 5 6 7 1 chunk +22 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +15 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSProperties.in View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +16 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 8 chunks +21 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 10 chunks +20 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyleConstants.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -4 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 90 (69 generated)
sashab
Hey Renee! Please take a look at this patch I wrote to start generating computedstyle. ...
4 years, 4 months ago (2016-07-27 03:23:19 UTC) #5
sashab
4 years, 4 months ago (2016-07-27 03:24:29 UTC) #6
sashab
esprehn FYI (you'll be reviewing this after Renee :) ), added TODOs to the generated ...
4 years, 4 months ago (2016-08-02 06:58:00 UTC) #15
sashab
4 years, 4 months ago (2016-08-11 08:09:08 UTC) #33
sashab
I am now aware that BaseComputedStyle has been used in Animations and so forth... Maybe ...
4 years, 4 months ago (2016-08-11 08:10:01 UTC) #34
esprehn
I think we usually out the base in the other side btw. It's FooBase not ...
4 years, 4 months ago (2016-08-11 08:39:52 UTC) #35
esprehn
I think we usually out the base in the other side btw. It's FooBase not ...
4 years, 4 months ago (2016-08-11 08:39:54 UTC) #36
sashab
Done! Please review. Also see WIP follow-up patch if you're interested which moves the isInherited ...
4 years, 3 months ago (2016-09-07 01:54:34 UTC) #46
ojan
https://codereview.chromium.org/2187493004/diff/120001/third_party/WebKit/Source/core/css/CSSProperties.in File third_party/WebKit/Source/core/css/CSSProperties.in (right): https://codereview.chromium.org/2187493004/diff/120001/third_party/WebKit/Source/core/css/CSSProperties.in#newcode38 third_party/WebKit/Source/core/css/CSSProperties.in:38: // CSSValueKeywords.in and use this list instead. <3
4 years, 3 months ago (2016-09-07 03:46:10 UTC) #47
esprehn
lgtm. This is how I feel about this patch: http://i.imgur.com/H5KUTKM.gif https://codereview.chromium.org/2187493004/diff/120001/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl File third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl (right): https://codereview.chromium.org/2187493004/diff/120001/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl#newcode9 ...
4 years, 3 months ago (2016-09-08 22:32:52 UTC) #48
sashab
LOL @ gif. Also re the enum: it only has 1 use, here: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/style/ComputedStyle.cpp?rcl=1473362324&l=309 and ...
4 years, 3 months ago (2016-09-08 23:25:12 UTC) #49
sashab
On 2016/09/08 at 23:25:12, sashab wrote: > LOL @ gif. > > Also re the ...
4 years, 3 months ago (2016-09-09 01:26:51 UTC) #50
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/2187493004/140001
4 years, 3 months ago (2016-09-09 01:27:23 UTC) #53
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_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-generic_chromium_compile_only_ng/builds/197237)
4 years, 3 months ago (2016-09-09 02:15:05 UTC) #55
sashab
On 2016/09/09 at 02:15:05, commit-bot wrote: > Try jobs failed on following builders: > chromeos_amd64-generic_chromium_compile_only_ng ...
4 years, 3 months ago (2016-09-09 09:11:19 UTC) #56
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/2187493004/200001
4 years, 3 months ago (2016-09-20 05:49:47 UTC) #71
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/229125)
4 years, 3 months ago (2016-09-20 08:20:29 UTC) #73
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/2187493004/260001
4 years, 3 months ago (2016-09-22 23:47:34 UTC) #86
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 3 months ago (2016-09-22 23:53:49 UTC) #87
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/8439075a9356236aa3f893f67f23faab867baccf Cr-Commit-Position: refs/heads/master@{#420508}
4 years, 3 months ago (2016-09-22 23:56:53 UTC) #89
sashab
4 years, 3 months ago (2016-09-23 00:10:23 UTC) #90
Message was sent while issue was closed.
Fyi esprehn; there was a memory leak caused by ComputedStyleBase not having a
virtual destructor and inheriting from RefCounted<>.
RefCounted<ComputedStyleBase> was calling ~ComputedStyleBase which doesn't call
~ComputedStyle. The LSAN bot caught this and I fixed it by leaving RefCounted<>
as a parent of ComputedStyle.

When we're all done with ComputedStyleBase I'll move RefCounted<> to the new
ComputedStyle :)

Powered by Google App Engine
This is Rietveld 408576698