Skip to content

Clamp rect origin point and size after scaling#4879

Closed
BudiArb wants to merge 1 commit into
servo:0.68from
BudiArb:0.68
Closed

Clamp rect origin point and size after scaling#4879
BudiArb wants to merge 1 commit into
servo:0.68from
BudiArb:0.68

Conversation

@BudiArb

@BudiArb BudiArb commented Jan 27, 2026

Copy link
Copy Markdown

Clamp rect origin point and size after scaling to prevent overflowing of f32 numbers

Signed-off-by: Budiman Arbenta <arbenta6@gmail.com>

@yezhizhen yezhizhen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emm, I wonder if such change should be made in upstream instead?
cc @mrobinson

@mrobinson mrobinson force-pushed the 0.68 branch 2 times, most recently from bfd0b6b to 8c1bfc3 Compare January 28, 2026 10:33
@mrobinson

Copy link
Copy Markdown
Member

Yes, let's try to get this upstream first, as it is not really related to Servo.

pull Bot pushed a commit to Haofei/servo that referenced this pull request Apr 23, 2026
…isplay list item properties instead of `MaxRect` (servo#44457)

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?](https://discourse.threejs.org/t/how-to-gracefully-handle-highp-mediump-switch-for-mobile-android-browsers/77335)


Testing: Desktop WPT
[unchanged](https://github.com/servo/servo/actions/runs/24825758325).
Manually tested on Android/Ohos. Now look same as Firefox/Chrome.

| Before | After |
| -------- | -------- |
|
![Screenshot_20260423_154114.jpg](https://github.com/user-attachments/assets/b1c970c8-a30c-4fb8-acbc-c97fa9cc03f9)
|
![screenshot_20260423_154059_1776930134.jpg](https://github.com/user-attachments/assets/432a29c4-0c5c-4ff2-83eb-81db55e76f64)
|


Fixes: servo#44431
Closes: servo/webrender#4879

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants