Repository navigation
Commit 3c058a2
Paint iOS box shadows below child content
A `boxShadow` drew over the view's children when the view had no border
layer. Each shadow layer copied `_borderLayer.zPosition`, and a view
whose border Core Animation draws (no border, or a uniform border on a
clipping view) has no border layer, so the shadow got z-position 0.
Children also have z-position 0 and the shadow layers are added after
them, so the shadow painted on top: an inset shadow over every child,
and an outset shadow over a child that overflows the view.
CSS paints inset shadows above the element's background and all box
shadows below its border and content
(https://drafts.csswg.org/css-backgrounds-3/#shadow-layers). Give the
shadow layers a fixed z-position between the background layers and the
border layer. Outset shadows then sit above the background, but they
are masked to the outside of the border box.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>1 parent 94aee19 commit 3c058a2
2 files changed
Lines changed: 26 additions & 1 deletion
File tree
- packages/react-native/React
- Fabric/Mounting/ComponentViews/View
- Tests/Mounting
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1480 | 1480 | | |
1481 | 1481 | | |
1482 | 1482 | | |
1483 | | - | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
1484 | 1487 | | |
1485 | 1488 | | |
1486 | 1489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
411 | 433 | | |
0 commit comments