Bug 218256

Summary: REGRESSION (r258321): CSS rules using :first-of-type are applied to any/all siblings in a group under certain circumstances
Product: WebKit Reporter: Eben Packwood <ebenpackwood>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, koivisto, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac   
OS: macOS 10.15   
Attachments:
Description Flags
Minimal working example
none
patch
none
patch none

Description Eben Packwood 2020-10-27 13:23:30 PDT
Created attachment 412456 [details]
Minimal working example

In the attached example, when using Safari 14 or Safari Technology Preview, moving the mouse over the different elements of the page will result in the CSS rule `table td:first-of-type {color: red;}` being applied to potentially any arbitrary sibling in a group.

Only the first `td` in each group should be colored red, but mousing over and out of the other `td` elements results in these element also being colored red. This also occurs with various other properties.
Comment 1 Radar WebKit Bug Importer 2020-10-27 20:12:27 PDT
<rdar://problem/70749584>
Comment 2 Antti Koivisto 2020-10-28 01:34:22 PDT
style sharing bug perhaps?
Comment 3 Antti Koivisto 2020-10-28 01:36:19 PDT
A decent theory is that the animation code is losing the bits that prevent style sharing.
Comment 4 Antti Koivisto 2020-10-28 02:24:30 PDT
Yeah, disabling style sharing makes the bug go away.
Comment 5 Antti Koivisto 2021-01-11 08:24:41 PST
Created attachment 417380 [details]
patch
Comment 6 Antti Koivisto 2021-01-11 09:09:34 PST
Created attachment 417386 [details]
patch
Comment 7 EWS 2021-01-11 10:12:25 PST
Committed r271367: <https://trac.webkit.org/changeset/271367>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417386 [details].