RESOLVED FIXED 190303
Properly determine if css custom property values are computationally independent
https://bugs.webkit.org/show_bug.cgi?id=190303
Summary Properly determine if css custom property values are computationally independent
Justin Michaud
Reported 2018-10-04 22:52:46 PDT
Currently, in order to avoid computationally dependent initial values, a simple substring check is used. This should be replaced with something that can actually parse the value.
Attachments
Patch (25.27 KB, patch)
2018-10-04 23:12 PDT, Justin Michaud
no flags
Patch (24.78 KB, patch)
2018-10-05 11:13 PDT, Justin Michaud
no flags
Justin Michaud
Comment 1 2018-10-04 23:12:11 PDT
Justin Michaud
Comment 2 2018-10-04 23:13:33 PDT
I moved the serialization code because this change uncovered a bug in the way I was parsing initial values.
Antti Koivisto
Comment 3 2018-10-05 03:12:05 PDT
Comment on attachment 351657 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351657&action=review Looks generally fine, but one more round would be good. > Source/WebCore/css/CSSCalculationValue.cpp:282 > + void getDirectComputationalDependencies(HashSet<CSSPropertyID>& values) const final > + { > + auto dependencies = m_value->getDirectComputationalDependencies(); > + values.add(dependencies.begin(), dependencies.end()); > + } > + > + void getDirectRootComputationalDependencies(HashSet<CSSPropertyID>& values) const final > + { > + auto dependencies = m_value->getDirectRootComputationalDependencies(); > + values.add(dependencies.begin(), dependencies.end()); > + } Maybe all versions of these functions should take the HashSet as an argument? It would avoid moving values from one hash to another. > Source/WebCore/css/CSSCalculationValue.h:73 > + virtual void getDirectComputationalDependencies(HashSet<CSSPropertyID>&) const = 0; > + virtual void getDirectRootComputationalDependencies(HashSet<CSSPropertyID>&) const = 0; collect* instead of get* would be better names for these. > Source/WebCore/css/CSSCalculationValue.h:108 > + HashSet<CSSPropertyID> getDirectComputationalDependencies() const; > + HashSet<CSSPropertyID> getDirectRootComputationalDependencies() const; Here too. It signals they are not cheap accessors. > Source/WebCore/css/CSSCustomPropertyValue.cpp:51 > +Vector<CSSParserToken>& CSSCustomPropertyValue::tokens(const CSSRegisteredCustomPropertySet& registeredProperties, const RenderStyle& style) const > +{ > + m_tokensReturnValue.clear(); It appears m_tokensReturnValue is only needed so you can return a reference? It is not clear to me how that is better than just returning the vector as a value and it is certainly more bug prone. Move semantics should keep it cheap. An alternative is the pass the vector in as a reference parameter (and call this something like collectTokens). > Source/WebCore/css/CSSPrimitiveValue.cpp:1231 > + return HashSet<CSSPropertyID>({CSSPropertyFontSize}); I think you can just say return { CSSPropertyFontSize }; > Source/WebCore/css/CSSPrimitiveValue.cpp:1235 > + return HashSet<CSSPropertyID>(); return { }; > Source/WebCore/css/CSSPrimitiveValue.cpp:1246 > + return HashSet<CSSPropertyID>(); return { }; > Source/WebCore/css/CSSValue.cpp:124 > + return HashSet<CSSPropertyID>(); return { }; > Source/WebCore/css/CSSValue.cpp:131 > + return HashSet<CSSPropertyID>(); return { };
Justin Michaud
Comment 4 2018-10-05 11:13:38 PDT
WebKit Commit Bot
Comment 5 2018-10-06 06:57:23 PDT
Comment on attachment 351682 [details] Patch Clearing flags on attachment: 351682 Committed r236895: <https://trac.webkit.org/changeset/236895>
WebKit Commit Bot
Comment 6 2018-10-06 06:57:25 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 7 2018-10-06 06:58:30 PDT
Note You need to log in before you can comment on or make changes to this bug.