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

Issue 2919343002: Remove template parameter on ComputedStyleBase. (Closed)

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

Description

Remove template parameter on ComputedStyleBase. In a previous patch, we made ComputedStyleBase a template class. This allowed ComputedStyle to pass itself as a template parameter so that ComputedStyleBase can access methods on ComputedStyle. However, this meant that all the ComputedStyleBase code were in a single header file. Whenever it calls a non-inlined function declared without CORE_EXPORT, it would cause a linker error. This is because ComputedStyleBase functions were being inlined in different translation units that did not have the necessary symbols. Whilst we could make an explicit instantiation of ComputedStyleBase with ComputedStyle, it is much easier to go back to the original .h/cpp split. To make this work, we forward declare ComputedStyle in ComputedStyleBase.h. Whenever we call methods on ComputedStyle, we do that in ComputedStyleBase.cpp. We also have to make diffing functions static functions that took two ComputedStyles instead of an "other" ComputedStyleBase. This patch does not change behaviour. Diff of generated files: https://gist.github.com/darrnshn/18645fc5c36cc74e00f2724be2079f0a/revisions BUG=628043 Review-Url: https://codereview.chromium.org/2919343002 Cr-Commit-Position: refs/heads/master@{#477580} Committed: https://chromium.googlesource.com/chromium/src/+/93dba2909d46c4ec7dbb94fe666480a7486b7f39

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Nit #

Patch Set 4 : Add file #

Patch Set 5 : Rebase #

Patch Set 6 : Move ctor #

Patch Set 7 : Fix forward decl #

Patch Set 8 : Rebase #

Total comments: 2

Patch Set 9 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+132 lines, -83 lines) Patch
M third_party/WebKit/Source/build/scripts/make_computed_style_base.py View 2 chunks +11 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl View 1 2 3 1 chunk +78 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl View 1 2 3 4 5 6 5 chunks +9 lines, -52 lines 0 comments Download
M third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/build/scripts/templates/fields/group.tmpl View 1 2 3 4 5 2 chunks +12 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/ComputedStyleDiffFunctions.json5 View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/style/ComputedStyle.cpp View 1 2 3 4 5 6 7 8 9 chunks +11 lines, -13 lines 0 comments Download

Messages

Total messages: 53 (42 generated)
shend
Hi Naina, PTAL
3 years, 6 months ago (2017-06-05 07:33:14 UTC) #3
shend
On 2017/06/05 at 07:33:14, shend wrote: > Hi Naina, PTAL Pretend the bots pass :P ...
3 years, 6 months ago (2017-06-05 08:02:45 UTC) #14
nainar
shend@, Where is the cpp.tmpl file?
3 years, 6 months ago (2017-06-05 16:44:20 UTC) #15
shend
On 2017/06/05 at 16:44:20, nainar wrote: > Where is the cpp.tmpl file? Oops, sorry forgot ...
3 years, 6 months ago (2017-06-05 22:15:36 UTC) #17
nainar
lgtm. Why are the bots breaking? :P
3 years, 6 months ago (2017-06-05 22:37:02 UTC) #21
shend
On 2017/06/05 at 22:37:02, nainar wrote: > lgtm. > > Why are the bots breaking? ...
3 years, 6 months ago (2017-06-05 22:44:10 UTC) #22
shend
Hi Alan, PTAL
3 years, 6 months ago (2017-06-05 22:59:41 UTC) #24
alancutter (OOO until 2018)
lgtm after comment. https://codereview.chromium.org/2919343002/diff/140001/third_party/WebKit/Source/core/css/ComputedStyleDiffFunctions.json5 File third_party/WebKit/Source/core/css/ComputedStyleDiffFunctions.json5 (right): https://codereview.chromium.org/2919343002/diff/140001/third_party/WebKit/Source/core/css/ComputedStyleDiffFunctions.json5#newcode141 third_party/WebKit/Source/core/css/ComputedStyleDiffFunctions.json5:141: predicate: "TextShadowDataEquivalent(b)", "b" is a bit ...
3 years, 6 months ago (2017-06-07 05:16:05 UTC) #42
shend
https://codereview.chromium.org/2919343002/diff/140001/third_party/WebKit/Source/core/css/ComputedStyleDiffFunctions.json5 File third_party/WebKit/Source/core/css/ComputedStyleDiffFunctions.json5 (right): https://codereview.chromium.org/2919343002/diff/140001/third_party/WebKit/Source/core/css/ComputedStyleDiffFunctions.json5#newcode141 third_party/WebKit/Source/core/css/ComputedStyleDiffFunctions.json5:141: predicate: "TextShadowDataEquivalent(b)", On 2017/06/07 at 05:16:04, alancutter wrote: > ...
3 years, 6 months ago (2017-06-07 05:56:35 UTC) #45
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/2919343002/160001
3 years, 6 months ago (2017-06-07 08:16:00 UTC) #50
commit-bot: I haz the power
3 years, 6 months ago (2017-06-07 08:21:23 UTC) #53
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/93dba2909d46c4ec7dbb94fe6664...

Powered by Google App Engine
This is Rietveld 408576698