| Summary: | REGRESSION(r276882): Style not invalidated correctly for media queries in shadow trees that share style | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Antti Koivisto <koivisto> | ||||||||
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | eric.carlson, ews-watchlist, glenn, jer.noble, philipj, rniwa, 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=226530 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Antti Koivisto
2021-05-28 02:16:01 PDT
Created attachment 429997 [details]
patch
Created attachment 430197 [details]
patch
Comment on attachment 430197 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=430197&action=review > Source/WebCore/style/StyleScope.cpp:684 > + auto resolverScopes = collectResolverScopes(); > + for (auto& resolverAndScopes : resolverScopes) { > + auto& resolver = resolverAndScopes.key.get(); > + auto& scopes = resolverAndScopes.value; I think you can write this: for (auto& [resolver, scopes] : collectResolverScopes()) { (though you will then have to call .get() on the resolver below). > Source/WebCore/style/StyleScope.cpp:691 > + for (auto& scope : scopes) { As these scopes are WeakPtrs, what is guaranteeing they are alive? Do they really have to be WeakPtrs? Given how short lived this Vector is, could they Ref<>s? Should you be null checking them? > As these scopes are WeakPtrs, what is guaranteeing they are alive? Do they
> really have to be WeakPtrs? Given how short lived this Vector is, could they
> Ref<>s? Should you be null checking them?
Logically they are guaranteed to be non-null. I'm just using WeakPtrs defensively here.
(In reply to Antti Koivisto from comment #5) > > As these scopes are WeakPtrs, what is guaranteeing they are alive? Do they > > really have to be WeakPtrs? Given how short lived this Vector is, could they > > Ref<>s? Should you be null checking them? > > Logically they are guaranteed to be non-null. I'm just using WeakPtrs > defensively here. I guess we can't use Refs as they are not reference counted. It's going to take me some time (if ever) to become comfortable with defensive use of WeakPtr :(. (In reply to Sam Weinig from comment #6) > (In reply to Antti Koivisto from comment #5) > > > As these scopes are WeakPtrs, what is guaranteeing they are alive? Do they > > > really have to be WeakPtrs? Given how short lived this Vector is, could they > > > Ref<>s? Should you be null checking them? > > > > Logically they are guaranteed to be non-null. I'm just using WeakPtrs > > defensively here. > > I guess we can't use Refs as they are not reference counted. It's going to > take me some time (if ever) to become comfortable with defensive use of > WeakPtr :(. I'm adding CheckedPtr for this exact use case: https://bugs.webkit.org/show_bug.cgi?id=226158 Created attachment 430328 [details]
patch
Committed r278346 (238378@main): <https://commits.webkit.org/238378@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430328 [details]. |