layout: Use an accurately-sized clipping rectangle for box-shadow display list item properties instead of MaxRect#44457
Merged
Conversation
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
yezhizhen
commented
Apr 23, 2026
| clip_rect = self.border_rect; | ||
| } | ||
| let common = builder.common_properties(clip_rect, &style); | ||
| // Note: According to CSS-BACKGROUNDS, box shadows render in *reverse* order (front to back). |
Member
Author
There was a problem hiding this comment.
I don't know what "NB:" is, so replaced with "Note:".
Member
There was a problem hiding this comment.
https://en.wikipedia.org/wiki/Nota_bene is often used in mathematics.
Member
Author
There was a problem hiding this comment.
I received my math education in English but never saw this word before🤣
mrobinson
requested changes
Apr 23, 2026
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Member
Author
|
Try run here |
mrobinson
approved these changes
Apr 23, 2026
box-shadow on Android/OHOS by replacing infinite clip rect in build_box_shadowbox-shadow display list item properties instead of MaxRect
box-shadow display list item properties instead of MaxRectbox-shadow display list item properties instead of MaxRect
Member
Author
|
This also seems to fix a bug on Desktop: After you zoom in 4 times, the box-shadow would completely disappear. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mobile phone runs OpenGL Embedded System. The precision is limited comparing to Desktop which runs full OpenGL. This caused a bug where box-shadow is not displayed on Android/OHOS. Instead of using an infinite clip rect, we compute a bounded one. This should save some GPU work as well.
Reference: How to gracefully handle highp/mediump switch for mobile Android browsers?
Testing: Desktop WPT unchanged. Manually tested on Android/Ohos. Now look same as Firefox/Chrome.
Fixes: #44431
Closes: servo/webrender#4879