New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 763306 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Dec 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 545324



Sign in to add a comment

Move Initial*() methods from ComputedStyle into CSSPropertyAPIs

Project Member Reported by meade@chromium.org, Sep 8 2017

Issue description

In https://chromium-review.googlesource.com/c/648536/, we added a #include for ComputedStyle to 222 CSSPropertyAPI classes. This increases compilation time.

There's not really any reason the initial values need to be on ComputedStyle. If we move them to the CSSPropertyAPI subclasses, it would make more intuitive sense in the context of Project Ribbon, and would allow us to remove the #include for ComputedStyle (and thus speed up compilation again).
 

Comment 1 by meade@chromium.org, Sep 8 2017

I have a CL (https://chromium-review.googlesource.com/c/chromium/src/+/656643) which removes the include for a subset of APIs, but it would better if we didn't need it in the first place.


Comment 2 by meade@chromium.org, Sep 8 2017

Blocking: 545324

Comment 3 by meade@chromium.org, Sep 8 2017

Further context: https://cs.chromium.org/chromium/src/out/Debug/gen/blink/core/css/properties/CSSPropertyAPIContain.h?l=44

ComputedStyle::InitialContain() returns an enum value kContainsNone.

Comment 4 by msten...@opera.com, Sep 8 2017

Thanks for working on this!

Comment 5 by meade@chromium.org, Sep 8 2017

Labels: Update-Quarterly
No problem! Thanks for alerting us to the build slowness we caused!

Comment 6 by meade@chromium.org, Sep 11 2017

Cc: nainar@chromium.org

Comment 7 by nainar@chromium.org, Sep 11 2017

Cc: shend@chromium.org
I think this makes sense. Both from a ribbon perspective and a compile time perspective.

Comment 8 by shend@chromium.org, Sep 11 2017

Just a heads up, this might conflict with the stuff that Minh-Duc's doing with multiple fields per property. If you have a property that's represented by two fields in ComputedStyle, the initial method in CSSPropertyAPI could only be used to initialize one of the fields (unless you return a struct representing both fields or something). I've named the 'default_value' of a field on purpose to indicate that this is different to the 'initial value' of a property.

I think there's an important issue which we need to resolve: should we ever have more than one field per property? If so, how do we interface between ComputedStyle, which works with fields, and the rest of the style engine, which works with properties?
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0c0df22d7a07c0d5f22de3647ef61302f268ae03

commit 0c0df22d7a07c0d5f22de3647ef61302f268ae03
Author: Eddy Mead <meade@chromium.org>
Date: Wed Oct 18 06:11:28 2017

Move field_alias expansion up into css_properties.py

This allows us to remove some duplicate code, and prepares the way
for generating ComputedStyle's Initial* functions elsewhere.

This ended up reducing the number of includes in each APO subclass
header. Gist diff:
https://gist.github.com/wilddamon/5bfa127e71e9c7993104bbfa602b3f97/revisions

Bug:  763306 
Change-Id: Icaacee6abe218b73a460311eb1ffcbff5c81d4c5
Reviewed-on: https://chromium-review.googlesource.com/716442
Commit-Queue: meade_UTC10 <meade@chromium.org>
Reviewed-by: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509698}
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/core/css/css_properties.py
[add] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/core/css/field_alias_expander.py
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/core/css/make_cssom_types.py
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/core/css/make_style_shorthands.py
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_api_base.py
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_api_headers.py
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSPropertyAPISubclass.h.tmpl
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/keyword_utils.py
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/make_css_value_id_mappings.py
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/make_style_builder.py
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/scripts.gni
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/build/scripts/templates/CSSValueIDMappingsGenerated.h.tmpl
[modify] https://crrev.com/0c0df22d7a07c0d5f22de3647ef61302f268ae03/third_party/WebKit/Source/core/BUILD.gn

Labels: Hotlist-CodeHealth
Project Member

Comment 11 by bugdroid1@chromium.org, Nov 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/38209505572f4385932a09eb9615682fdc96ae3c

commit 38209505572f4385932a09eb9615682fdc96ae3c
Author: Eddy Mead <meade@chromium.org>
Date: Fri Nov 10 02:27:39 2017

Move initial functions into a new file ComputedStyleInitialFunctions

This may allow us to speed up compilation by removing includes of
ComputedStyle in some places.

Gist diff:
https://gist.github.com/wilddamon/56eb08d2493db7d67bed9c7fa728ed1f/revisions
ComputedStyleBase by itself:
https://www.diffchecker.com/lR5pzim1
StyleBuilderFunctions by itself
https://www.diffchecker.com/B3XLnnLr

Bug:  763306 
Change-Id: Ie302c6a3aab4a75cc8fe9385b2dea8c053b22f2a
Reviewed-on: https://chromium-review.googlesource.com/714896
Commit-Queue: meade_UTC10 <meade@chromium.org>
Reviewed-by: Bugs Nash <bugsnash@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515426}
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/core/css/css_properties.py
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSPropertySubclass.h.tmpl
[add] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/core/style/make_computed_style_initial_values.py
[add] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/core/style/templates/ComputedStyleInitialValues.h.tmpl
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/templates/fields/external.tmpl
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/templates/fields/keyword.tmpl
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/templates/fields/pointer.tmpl
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/build/scripts/templates/fields/primitive.tmpl
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/animation/CSSTextIndentInterpolationType.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/css/CSSProperties.json5
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/css/ComputedStyleExtraFields.json5
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/LayoutBox.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/LayoutImage.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/LayoutReplaced.h
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/LayoutRubyText.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/LayoutTheme.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/line/InlineBox.h
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/38209505572f4385932a09eb9615682fdc96ae3c/third_party/WebKit/Source/core/style/ComputedStyle.h

Comment 12 by meade@chromium.org, Nov 21 2017

Owner: ----
Status: Available (was: Assigned)
I think this is an ok solution for now. I'm unassigning myself from this until we can think of a solution given the functions all return different types.
Labels: -Update-Quarterly
Project Member

Comment 14 by sheriffbot@chromium.org, Dec 6

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: -bugsnash@chromium.org
Status: Fixed (was: Untriaged)

Sign in to add a comment