Bug 187808

Summary: CSS rule not applied for non-button elements with -webkit-appearance set to 'button'
Product: WebKit Reporter: Yogesh Mangaj <yogesh.mangaj>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: bfulgham, simon.fraser, yogesh.mangaj, zcorpan
Priority: P2    
Version: Safari 11   
Hardware: Mac   
OS: macOS 10.13   
URL: https://next.plnkr.co/edit/wYsCEVvT3eJgSRre?preview
Attachments:
Description Flags
Screenshot across multiple webkit based browser vs Firefox gecko none

Description Yogesh Mangaj 2018-07-19 09:28:25 PDT
Created attachment 345351 [details]
Screenshot across multiple webkit based browser vs Firefox gecko

CSS rule that changes background is not being applied for on a non-button element.

To reproduce, use the following example (available at https://next.plnkr.co/edit/wYsCEVvT3eJgSRre?preview) -
HTML:
```
<div class="btn" type="submit">Hello world</div>
<button class="btn" type="submit">Hello world</div>
```

CSS:
```
[type="submit"].btn {
  background-color: red;
}

[type="submit"] {
     -webkit-appearance: button;
}
```

The div.btn does not have a red background, expected that it should have a red background.
Comment 1 Simon Pieters (:zcorpan) 2019-01-23 12:27:30 PST
background-color only disables appearance on actual buttons, not divs. I think this is reasonable/by design. If you want the 'none' appearance on a div, don't set it to 'button'.
Comment 2 Brent Fulgham 2022-07-15 13:32:48 PDT
We believe the current behavior is correct. If standards have been changed recently, please REOPEN this bug with relevant details.