Bug 207567

Summary: :host() pseudo-selector reported as :host in CSSStyleRule
Product: WebKit Reporter: jlo
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Minor CC: allan.jensen, callis, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jbedard, koivisto, macpherson, menard, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 13   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 148695    
Attachments:
Description Flags
Minimal reproduction case
none
patch none

Description jlo 2020-02-11 11:05:32 PST
Created attachment 390393 [details]
Minimal reproduction case

Any |:host(selector)| rules in a stylesheet are incorrectly reported as plain |:host| pseudo-selectors when accessed through CSSStyleRule.prototype.cssText or CSSStyleRule.prototype.selectorText.

See the attached test case. In Chrome and FireFox the <pre> is populated with |:host(.hidden) { display: none; }|, using Safari (Mobile and Desktop) the output is |:host { display: none; }|.
Comment 1 Radar WebKit Bug Importer 2020-02-11 15:07:18 PST
<rdar://problem/59365547>
Comment 2 Antti Koivisto 2020-08-26 08:59:39 PDT
https://github.com/WebKit/webkit/blob/master/Source/WebCore/css/CSSSelector.cpp#L670  is missing the code to build the argument string
Comment 3 Antti Koivisto 2020-08-27 09:19:35 PDT
Created attachment 407411 [details]
patch
Comment 4 EWS 2020-08-27 10:28:09 PDT
Committed r266245: <https://trac.webkit.org/changeset/266245>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407411 [details].
Comment 5 jlo 2020-12-01 08:31:23 PST
I see the fix for this has been merged for quite some time, but the issue is still occurring on the latest Safari releases. Has the fix been included in a Safari release yet?
Comment 6 Jonathan Bedard 2020-12-01 09:30:50 PST
Looks like this missed the branch cut-off (which was r266022) and never got cherry-picked to the release branch.
Comment 7 jlo 2020-12-01 09:35:24 PST
Okay, thanks for the update. Does this mean it should make it into the next release (14.1)?
Comment 8 MC 2021-05-24 09:39:30 PDT
(In reply to Jonathan Bedard from comment #6)
> Looks like this missed the branch cut-off (which was r266022) and never got
> cherry-picked to the release branch.

Hello. We have projects that depend on this bug fix getting pushed in safari. Can this fix please be included in the next release soon??

Thanks
Comment 9 Antti Koivisto 2021-05-25 01:59:50 PDT
The fix was in macOS 11.3/iOS 14.5