Bug 231158 - Make RuleSetBuilder a class
Summary: Make RuleSetBuilder a class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antti Koivisto
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-04 01:41 PDT by Antti Koivisto
Modified: 2021-10-05 12:50 PDT (History)
3 users (show)

See Also:


Attachments
Patch (36.23 KB, patch)
2021-10-04 01:45 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch (36.08 KB, patch)
2021-10-04 01:51 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch (36.08 KB, patch)
2021-10-04 02:10 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch (36.20 KB, patch)
2021-10-04 06:19 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch (36.07 KB, patch)
2021-10-04 06:53 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch (36.12 KB, patch)
2021-10-04 07:45 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch (36.07 KB, patch)
2021-10-04 07:49 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch (36.07 KB, patch)
2021-10-04 07:52 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2021-10-04 01:41:33 PDT
improve encapsulation
Comment 1 Antti Koivisto 2021-10-04 01:45:02 PDT
Created attachment 440039 [details]
Patch
Comment 2 Antti Koivisto 2021-10-04 01:51:46 PDT
Created attachment 440041 [details]
Patch
Comment 3 Antti Koivisto 2021-10-04 02:10:31 PDT
Created attachment 440042 [details]
Patch
Comment 4 Antti Koivisto 2021-10-04 06:19:56 PDT
Created attachment 440055 [details]
Patch
Comment 5 Antti Koivisto 2021-10-04 06:53:50 PDT
Created attachment 440058 [details]
Patch
Comment 6 Antti Koivisto 2021-10-04 07:45:25 PDT
Created attachment 440060 [details]
Patch
Comment 7 Antti Koivisto 2021-10-04 07:49:18 PDT
Created attachment 440061 [details]
Patch
Comment 8 Antti Koivisto 2021-10-04 07:52:22 PDT
Created attachment 440062 [details]
Patch
Comment 9 EWS 2021-10-04 12:34:12 PDT
Committed r283508 (242476@main): <https://commits.webkit.org/242476@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 440062 [details].
Comment 10 Radar WebKit Bug Importer 2021-10-04 12:35:21 PDT
<rdar://problem/83849661>
Comment 11 Darin Adler 2021-10-04 13:21:11 PDT
Comment on attachment 440062 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=440062&action=review

Noticed one small stylistic thing.

> Source/WebCore/style/RuleSetBuilder.h:59
> +            Vector<size_t> affectedRulePositions { };
> +            RuleFeatureVector ruleFeatures { };

These braces aren’t needed.

> Source/WebCore/style/RuleSetBuilder.h:63
> +        Vector<DynamicContext> dynamicContextStack { };
> +
> +        Vector<RuleSet::DynamicMediaQueryRules> dynamicMediaQueryRules { };

These braces aren’t needed.

> Source/WebCore/style/RuleSetBuilder.h:75
> +    CascadeLayerName m_resolvedCascadeLayerName { };
> +    HashMap<CascadeLayerName, RuleSet::CascadeLayerIdentifier> m_cascadeLayerIdentifierMap { };

These braces aren’t needed.

> Source/WebCore/style/RuleSetBuilder.h:77
> +    Vector<RuleSet::ResolverMutatingRule> m_collectedResolverMutatingRules { };

These braces aren’t needed.
Comment 12 Antti Koivisto 2021-10-04 23:59:13 PDT
Comment on attachment 440062 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=440062&action=review

>> Source/WebCore/style/RuleSetBuilder.h:59
>> +        struct DynamicContext {
>> +            Ref<const MediaQuerySet> set;
>> +            Vector<size_t> affectedRulePositions { };
>> +            RuleFeatureVector ruleFeatures { };
> 
> These braces aren’t needed.

Some of the compilers in bots have failed in the past if all fields are not initialized explicitly when the struct is brace-initialized.
Comment 13 Darin Adler 2021-10-05 09:49:39 PDT
Comment on attachment 440062 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=440062&action=review

>>> Source/WebCore/style/RuleSetBuilder.h:59
>>> +            RuleFeatureVector ruleFeatures { };
>> 
>> These braces aren’t needed.
> 
> Some of the compilers in bots have failed in the past if all fields are not initialized explicitly when the struct is brace-initialized.

Does that really apply here or not?
Comment 14 Antti Koivisto 2021-10-05 11:44:15 PDT
> Does that really apply here or not?

Seems so, see https://bugs.webkit.org/show_bug.cgi?id=231236

(class members here don't need them)
Comment 15 Darin Adler 2021-10-05 12:50:12 PDT
(In reply to Antti Koivisto from comment #14)
> > Does that really apply here or not?
> 
> Seems so, see https://bugs.webkit.org/show_bug.cgi?id=231236
> 
> (class members here don't need them)

Thanks! I appreciate learning about this.