Bug 240455

Summary: "box-shadow" does not work on native form controls
Product: WebKit Reporter: Chijin <tlock.chijin>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Critical CC: 2843035794, ahmad.saleem792, akeerthi, ap, bfulgham, cdumez, ntim, simon.fraser, webkit-bug-importer, wenson_hsieh, zalan
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari 15   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=240638
https://bugs.webkit.org/show_bug.cgi?id=240706
Attachments:
Description Flags
webkit screenshot
none
chrome screenshot
none
firefox screenshot none

Description Chijin 2022-05-16 07:04:25 PDT
Created attachment 459420 [details]
webkit screenshot

reprodiciable example: https://codepen.io/chijinz/pen/vYdgpdY

code:
```
<html>
<head>
<style>
</style>
<script>
function jsfuzzer() {
document.getElementById("htmlvar00004").style["box-shadow"] = "red 1px 73px"
}
</script>
</head>
<body onload=jsfuzzer()>
<textarea id="htmlvar00004" >aaa</textarea>
</body>
</html>

```

version: all webkit products (including Safari)

description:

The textarea element does not have shadow even though the "box-shadow" is set. Chrome and Firefox work fine with it.
Comment 1 Chijin 2022-05-16 07:06:41 PDT
Created attachment 459421 [details]
chrome screenshot
Comment 2 Chijin 2022-05-16 07:06:55 PDT
Created attachment 459422 [details]
firefox screenshot
Comment 3 Radar WebKit Bug Importer 2022-05-16 09:39:38 PDT
<rdar://problem/93351344>
Comment 4 Tim Nguyen (:ntim) 2022-05-16 11:23:34 PDT
Seems intentional: https://webkit-search.igalia.com/webkit/rev/7bebd4483c6744ddf9823572d42d2e34dc9d0bd9/Source/WebCore/rendering/RenderTheme.cpp#174

though I think this behavior should be changed.
Comment 5 Chijin 2022-05-16 18:19:11 PDT
(In reply to Tim Nguyen (:ntim) from comment #4)
> Seems intentional:
> https://webkit-search.igalia.com/webkit/rev/
> 7bebd4483c6744ddf9823572d42d2e34dc9d0bd9/Source/WebCore/rendering/
> RenderTheme.cpp#174
> 
> though I think this behavior should be changed.

Thanks. Could you backtrace the reason for doing this? Is it for the security concern or just wrong implementation?
Comment 6 Tim Nguyen (:ntim) 2022-05-16 21:25:36 PDT
(In reply to Chijin from comment #5)
> (In reply to Tim Nguyen (:ntim) from comment #4)
> > Seems intentional:
> > https://webkit-search.igalia.com/webkit/rev/
> > 7bebd4483c6744ddf9823572d42d2e34dc9d0bd9/Source/WebCore/rendering/
> > RenderTheme.cpp#174
> > 
> > though I think this behavior should be changed.
> 
> Thanks. Could you backtrace the reason for doing this? Is it for the
> security concern or just wrong implementation?

Probably some old UI guideline saying native controls shouldn't get shadows. Anyway, this should be fixed to be in-line with other browsers.
Comment 7 Aditya Keerthi 2022-05-19 15:31:43 PDT
*** Bug 240635 has been marked as a duplicate of this bug. ***
Comment 8 Fujii Hironori 2022-06-29 21:29:13 PDT
*** Bug 242162 has been marked as a duplicate of this bug. ***