Summary: | Style::Scope should use CheckedPtr | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Antti Koivisto <koivisto> | ||||||
Component: | CSS | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | annulen, benjamin, cdumez, cmarcelo, ews-watchlist, gyuyoung.kim, Hironori.Fujii, rniwa, ryuan.choi, sam, sergio, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=226369 | ||||||||
Attachments: |
|
Description
Antti Koivisto
2021-06-02 03:41:23 PDT
Created attachment 430332 [details]
patch
Created attachment 430333 [details]
patch
Committed r278355 (238387@main): <https://commits.webkit.org/238387@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430333 [details]. Comment on attachment 430333 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=430333&action=review > Source/WebCore/style/StyleScope.cpp:671 > + resolverScopes.add(makeRef(*resolver), Vector<CheckedPtr<Scope>> { }).iterator->value.append(&scope); You add an empty vector, and append a single Scope. Does this vector always have only a single Scope? If so, why is ResolverScopes's ValueType using Vector<CheckedPtr<Scope>>? Comment on attachment 430333 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=430333&action=review >> Source/WebCore/style/StyleScope.cpp:671 >> + resolverScopes.add(makeRef(*resolver), Vector<CheckedPtr<Scope>> { }).iterator->value.append(&scope); > > You add an empty vector, and append a single Scope. > Does this vector always have only a single Scope? > If so, why is ResolverScopes's ValueType using Vector<CheckedPtr<Scope>>? We're in a loop so we may add more scope than one to the Vector. (Note that add() is a no-op if the key already exists) It would be nice to have a single-argument version of add (or ensure) where the value is default constructed. (In reply to Antti Koivisto from comment #7) > It would be nice to have a single-argument version of add (or ensure) where > the value is default constructed. Maybe we can just add the default argument value to it... |